⚙️ Logical Operators

AND, OR, and NOT — the tools that connect logical statements

← Back to Logic

🔗 Combining Statements

Just as arithmetic has operators like + and × to combine numbers, logic has logical operators to combine statements. The three fundamental operators are:

  • AND — conjunction (symbol: )
  • OR — disjunction (symbol: )
  • NOT — negation (symbol: ¬)

We'll use two statements throughout this lesson:
p = "It is raining."  |  q = "I have an umbrella."

🤝 AND (Conjunction)  p ∧ q

A conjunction is true only when both statements are true. If even one is false, the whole conjunction is false.

Example

p ∧ q: "It is raining AND I have an umbrella."

Both must be true at the same time for this to be true.

"I like pizza and I like ice cream." — True only if you like both.

pqp ∧ q (AND)
TTT
TFF
FTF
FFF

💡 Memory Tip

AND is like a strict teacher — both students must raise their hand, or the answer is no!

🔀 OR (Disjunction)  p ∨ q

A disjunction is true when at least one statement is true. It is only false when both are false.

Example

p ∨ q: "It is raining OR I have an umbrella."

This is true even if only one of those things is true.

"You can have cake OR pie." — In logic, you could have both (inclusive OR).

pqp ∨ q (OR)
TTT
TFT
FTT
FFF

Inclusive OR vs. Exclusive OR (XOR):
Logic's OR is inclusive — it allows both to be true. Everyday English sometimes uses exclusive or ("you can have coffee or tea" often implies not both). In logic, OR always means "at least one."

💡 Memory Tip

OR is like a lenient teacher — even one student raising their hand is enough!

🔁 NOT (Negation)  ¬p

You already saw negation in the previous lesson! NOT simply flips a statement's truth value.

Example

¬p: "It is not raining."

¬q: "I do not have an umbrella."

p¬p (NOT p)
TF
FT

🔢 Combining Operators

You can nest operators together to create complex logical expressions — just like using parentheses in math.

Example: ¬p ∧ q

"It is not raining and I have an umbrella."

pq¬p¬p ∧ q
TTFF
TFFF
FTTT
FFTF

Example: ¬(p ∨ q) — De Morgan's Law

The negation of "p OR q" equals "NOT p AND NOT q" — one of De Morgan's famous laws:

¬(p ∨ q) ≡ ¬p ∧ ¬q

"It is NOT the case that it's raining or I have an umbrella" = "It's not raining AND I don't have an umbrella."

¬(p ∧ q) ≡ ¬p ∨ ¬q

"It is NOT the case that it's BOTH raining AND I have an umbrella" = "It's not raining OR I don't have an umbrella."

✏️ Practice — Click to Reveal Answers

Let p = "The light is on." (True) and q = "The door is open." (False).

1. What is the truth value of p ∧ q?

FALSE. AND requires both to be true. Since q is false, p ∧ q is false.

2. What is the truth value of p ∨ q?

TRUE. OR only needs at least one true. Since p is true, p ∨ q is true.

3. What is the truth value of ¬p ∨ ¬q?

TRUE. ¬p = F, ¬q = T. F ∨ T = TRUE.

4. What is the truth value of ¬(p ∧ q)?

p ∧ q = F (from question 1). So ¬(p ∧ q) = TRUE.
By De Morgan: ¬(p ∧ q) = ¬p ∨ ¬q = F ∨ T = TRUE ✓

5. Write a real-world sentence for: ¬p ∧ q

"The light is NOT on AND the door is open."
Truth value: ¬p = F, so F ∧ F = FALSE.

🎯 Key Takeaways

  • AND (∧) — true only when both statements are true.
  • OR (∨) — true when at least one statement is true.
  • NOT (¬) — flips the truth value of a statement.
  • Operators can be combined with parentheses — evaluate inner parentheses first.
  • De Morgan's Laws: ¬(p ∨ q) ≡ ¬p ∧ ¬q  and  ¬(p ∧ q) ≡ ¬p ∨ ¬q