Discrete Mathematics
Lesson 1 of 3 10 min +70 XP

Logic & Truth Tables

Reason precisely about true and false.

What you'll learn

  • Define a proposition
  • Build truth tables for AND, OR, NOT
  • Recognize implication
The bouncer's checklist

A club bouncer lets you in only if you're on the list AND over 18 — both must be true. Logic and truth tables map out exactly when combinations of true/false conditions come out true, the bedrock of every circuit and computer decision.

Statements that are true or false

A proposition is a statement that is either true or false — never both. We combine propositions with connectives: conjunction (p ∧ q, 'and'), disjunction (p ∨ q, 'or'), and negation (¬p, 'not'). A truth table lists every combination of inputs and the resulting output.

p ∧ q is true ONLY when both p and q are true.
p ∨ q is true when AT LEAST ONE is true.
Implication surprises people

p → q ('if p then q') is false only when p is true and q is false. A false premise makes the whole implication vacuously true.

Simulation · Logic gate explorer
AND
0
0,00
0,10
1,00
1,11

Tap the inputs and switch gates — every computer is built from these.

Toggle the two inputs and switch between AND, OR, XOR, and NAND — the same truth tables that build every circuit.

Lab · Complete the table
  1. Set the gate to AND and try all four input pairs.
  2. Note for which pair the output is 1.
  3. Repeat for OR and compare.

What you should see: AND outputs 1 only for (1,1); OR outputs 1 for every pair except (0,0). These are the ∧ and ∨ truth tables.

Knowledge Check

+18 XP / correct

1. When is p ∧ q true?

2. The implication p → q is false only when…