If...Then

If...then is a way of thinking that allows us to make decisions based on Logic.

It can help us make decisions in mathematics, computer science and everyday life.

Here we explore the basics of using if...then logic, as well as how to use "and", "or" and "not".

Using If...Then

The basic structure of an if...then statement is simple:

Example: If it is raining, then I will take an umbrella.

In that example, the condition (it is raining) triggers the decision (take an umbrella).

There are two parts:

And Or Not

We can combine conditions together using andor and not.

It works like this:

And

We can use and when both conditions have to be true for the statement to be true.

Example: If it is raining and windy, then I will wear a raincoat.

If it is only raining or only windy then we don't make the decision. But if it is both rainy and windy we want that coat!

Example: If I am hungry and I have enough money, then I will buy lunch.

If we aren't hungry or don't have money we won't be buying lunch!

Or

Or is used when either condition (or both!) trigger the decision.

or then

Example: If it is raining or snowing, then I will take an umbrella.

In that example, either condition (it is raining or it is snowing) can be true for the decision to be true. A mix of rain and snow also works.

We can also have many conditions!

Example: If it is raining or snowing or cloudy, then I will take an umbrella.

The result (take an umbrella) will happen if any of those conditions are true.

Not

We can also make the decision when a condition is not met:

Example: If it is not sunny, then I will take an umbrella.

Numbers

Numbers are often part of the decision:

Example: If you have 8 items or less, then you can use this checkout.

Example: If the time is 8:00 and it is a weekday, then you should be out the door heading for the bus stop.

Example: If you are not in the top 20%, then you must do extra study.

 

Conditional

If...then is also called a conditional argument

Conclusion

If...then, and, or and not are powerful ways to make logical decisions.

By understanding the basics of this logic you can make better decisions in your everyday life.