A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

21
A little Boolean Logic A little Boolean Logic

Transcript of A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Page 1: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

A little Boolean LogicA little Boolean Logic

Page 2: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

IF loving you is wrongIF loving you is wrongTHEN I don’t want to be rightTHEN I don’t want to be right

Page 3: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

IF-THEN StatementsIF-THEN Statements

If, Then, Else (a.k.a. Otherwise)If, Then, Else (a.k.a. Otherwise)

What is your procedure?What is your procedure?

In excel this is written as :In excel this is written as :

IF(Condition, True Value, False Value) IF(Condition, True Value, False Value)

Page 4: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Sample Problem 1Sample Problem 1

If a driver is going over 65 mph a speeding If a driver is going over 65 mph a speeding ticket should be issued.ticket should be issued.

Page 5: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Sample Problem 1Sample Problem 1

Yes

Speed > 65

No

Issue Ticket No Ticket

Page 6: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Sample Problem 1Sample Problem 1

Speed Caught Traveling Action To Be Taken

65 Issue Ticket

55 No Ticket

Speed Caught Traveling Action To Be Taken

65 =IF(A11<65,"No Ticket","Issue Ticket")

55 =IF(A12<65,"No Ticket","Issue Ticket")

Page 7: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Nested IF-THEN StatementsNested IF-THEN Statements

What if you have a second condition?What if you have a second condition?

IF(Cond, True ,IF(Cond, True, False))IF(Cond, True ,IF(Cond, True, False))

Page 8: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Sample Problem 2Sample Problem 2

If a driver is going over 65 mph or under If a driver is going over 65 mph or under 45 mph a speeding ticket should be 45 mph a speeding ticket should be issued.issued.

Page 9: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Sample Problem 2Sample Problem 2

Yes

Speed < 40

No

Issue TicketSpeed > 65

Yes No

Issue Ticket No Ticket

Page 10: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Nested IF-THEN StatementsNested IF-THEN Statements

Speed

65 Ticket

14 Ticket

55 No Ticket

Speed

65 =IF(A11>64,"Ticket",IF(A11<40,"Ticket","No Ticket"))

14 =IF(A12>64,"Ticket",IF(A12<40,"Ticket","No Ticket"))

55 =IF(A13>64,"Ticket",IF(A13<40,"Ticket","No Ticket"))

Page 11: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Using FormulasUsing Formulas1. Highlight the cell you want to write a formula for.

2. Click into the formula bar and type the operation you wish to perform

3. Remember you must always start a formula with an =

Page 12: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Formula NotationsFormula Notations

* = multiplication* = multiplication

^ = raise to the power of^ = raise to the power of

/ = divide by/ = divide by

+/- = addition/subtraction+/- = addition/subtraction

( ) = parenthesis very important for order ( ) = parenthesis very important for order of operationof operation

Page 13: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

FunctionsFunctions

Excel has tons of built in functions to perform Excel has tons of built in functions to perform everything from rounding to advanced statistical everything from rounding to advanced statistical tests.tests.

Page 14: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Let’s kick it up a notch!Let’s kick it up a notch!

1A

2B

2A

1B

Page 15: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

DirectionsDirections

Break the problem into steps and verbalize Break the problem into steps and verbalize what you want to do with your partner.what you want to do with your partner.

Draw a flow chart that outlines your Draw a flow chart that outlines your solutionsolution

Add columns to your spread sheet and Add columns to your spread sheet and perform to perform the necessary perform to perform the necessary calculations in stagescalculations in stages

Page 16: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Data TableData Table

Traffic Lane

Max Length of Light

Minimum Length of

Light

Time for car to clear intersection

# Of Cars

Time Needed

Time Given

(s)# Of Cars Leftover

Lane 1A

Lane 1B

Lane 2A

Lane 2B

Page 17: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Bam! Bam! Bam!Bam! Bam! Bam!

1A

1B1B

2

3

3

Page 18: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

TipsTips

Break the problem into steps and verbalize Break the problem into steps and verbalize what you want to do with your partner.what you want to do with your partner.

Draw a flow chart that outlines your Draw a flow chart that outlines your solutionsolution

Add columns to your spread sheet and Add columns to your spread sheet and perform to perform the necessary perform to perform the necessary calculations in stagescalculations in stages

Page 19: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

ReflectionReflection

How did you attack this problem?How did you attack this problem?

What helped you in solving the problem?What helped you in solving the problem?

Where did you get lost or stuck?Where did you get lost or stuck?

Page 20: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

What was this activity about?What was this activity about?

Page 21: A little Boolean Logic. IF loving you is wrong THEN I dont want to be right.

Problem SolvingProblem Solving

Step 1: What am I trying to find? Step 2: What information do I know?

Step 3: What equation will I use?

Step 4a: Do I need to solvefor any other information?

Step 4b: Pick equations to solve formissing variables. Will this work?

Step 5: Plug in all the informationand crunch the numbers

Step 6: Display your answer andask does this answer make sense?

If No

If Yes