← Back to course
Code Crew G3 / Week 09 / Monday
1/6
Week 09 Β· Boolean Logic

Monday

// True, false, AND/OR

Monday: Meet the Idea

Rocket rushes into the lab. "Can I have a cookie?" he asks.

Raven smiles. "Yes, if you finished homework and brushed your teeth."

Rocket counts on his fingers. "Homework is done. My teeth are not brushed yet."

"What do you notice about the rule?" Raven asks. Nova hovers close. "Look at the little word in the middle," she hints. Let's help them decide.

ROCKET asks: 'Can I have a cookie?' RAVEN says: 'IF you finished homework AND brushed teeth.' Both must be TRUE. That's an AND. If either one is FALSE, no cookie.

Big Idea
AND β†’ both true
OR β†’ at least one true
NOT β†’ flips true ↔ false

Quick Try

TRUE or FALSE? Circle one for each.

A cat has wings. T / F
Three is bigger than two. T / F
NOT (3 > 2) β†’ T / F

TRUE and FALSE Only

A Boolean is a value that can only be TRUE or FALSE. There is no maybe.

A question like Is it raining? has a Boolean answer.

BOOLEAN CHECK
  • Read the question.
  • Tap your answer.
Which question has a TRUE or FALSE answer?
Homework done is TRUE. Teeth brushed is TRUE. What is homework AND teeth?
It is sunny is FALSE. It is warm is TRUE. What is sunny OR warm?
What is NOT FALSE?
StatementTrue or false?
A Boolean can be TRUE or FALSE.?
A Boolean can be maybe.?
TRUE AND FALSE is FALSE.?
TRUE OR FALSE is FALSE.?
NOT TRUE is FALSE.?
WHY THIS EXERCISEThese three rules are all you need to work out any Boolean.
Cats have four legs AND fish can swim. TRUE or FALSE?
Snow is hot OR grass can be green. TRUE or FALSE?
NOT (the Sun is a star). TRUE or FALSE?
Rule: play_outside = sunny AND warm. It is sunny but cold. What is play_outside: true or false?
WHY THIS EXERCISEAND is only TRUE when every part is TRUE.
Try it
Say three sentences to a grown-up. Make some true and some false.
They answer only TRUE or FALSE.
Then join two with AND. Is the new sentence still true?

Quick Check

Homework is true. Teeth brushed is false. Homework AND teeth brushed is ____.
Homework is true. Teeth brushed is false. Homework OR teeth brushed is ____.
NOT true is ____.