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
- Build a truth table and read an implication correctly
- Simplify formulas and test equivalence with the laws of logic
- Write and negate statements with for all and there exists
Lessons
- 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
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
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
- A truth tableEasy
- How many rows are true?Medium
- Satisfying assignmentsHard
- Converse, inverse and contrapositiveEasy
- Tautology or not?Medium
- Are two formulas equivalent?Hard
- For all, there existsEasy
- Every number divisible by kMedium
- Nested quantifiers on a tableHard