Logic

Propositions and truth tables, logical equivalence and the laws of logic, and predicates with quantifiers: the exact language for conditions and claims.

About 5 hours of study

Learning objectives

Lessons

  1. 1

    Propositions and truth tables

    Statements that are true or false, the connectives not, and, or, xor, implies and if-and-only-if, and truth tables that list every case.

  2. 2

    Logical equivalence

    Tautologies and contradictions, when two formulas mean the same, the laws of logic (De Morgan's and more), and the contrapositive, converse and inverse.

  3. 3

    Predicates and quantifiers

    Statements with variables, 'for all' and 'there exists', Python's all() and any(), negating a quantifier, and why the order of nested quantifiers matters.

Module practice

Module quiz

1. How many rows does a truth table with 3 letters have?
2. An implication p → q is false only when...
3. What does De Morgan's law say about not (p or q)?
4. Which statement is equivalent to p → q?
5. What is the negation of 'some student failed'?
6. Over the integers, which of these is true?

Proof and induction ›