AmbifulWorksheets
Cheat sheet
CBSE · Class 7 · Computational Thinking and AI

Logic: If–Then, AND, OR, NOT

Logic decides whether statements are True or False. AND, OR and NOT combine them, and Venn diagrams count groups that overlap.

Key ideas

Remember

ANDTrue only if both are True
ORFalse only if both are False
NOTNOT True = False; NOT False = True
At least one groupA + B − both
Neithertotal − (A + B − both)
Example30 children, 18 like tea, 12 like milk, 5 both → 25 like one, 5 neither

Watch out

Worked example

(a) Rule: if it is a Saturday or a Sunday, the library opens at 10 a.m.; on other days it opens before 10 a.m.
Thursday: opens at 10 a.m.
Tuesday: opens at 8 a.m.
Friday: opens at 9 a.m.
Saturday: opens at 10 a.m.
Sunday: opens at 10 a.m.
Which day breaks the rule?
(b) P is False and Q is True. Is "NOT P OR NOT Q" True or False?

Working: (a) Thursday is a weekday but opens at 10; (b) put P = False, Q = True and work out the brackets first

Answer: (a) Thursday; (b) True