Session 1
1.1 Propositional Logic
Related reading: Stein et al. p. 147–154 or Rosen p. 4–6 and 23–24
We introduce propositional logic, aka. zeroth order logic. This is the simplest system of logic, with expressions using variables and the operators and, or, and not.
The starting point is the problem of determining whether two pieces of source code (C/Java) are equivalent.
This video continues where the previous one left.
New mathematical symbols:
- for ‘or’
- for ‘and’
- for ‘not’
The four logic operators (and), (or), (xor), and (not) can be defined using truth tables.
Exercise 1.1 Consider (the integers modulo 2). Fill in the addition and multiplication tables below:
Compare these two tables to the truth tables for logic operators (, , , ) in the video above. What is the relationship between the set of truth values and ? Can any of the logic operators be mapped to addition or multiplication?
Exercise 1.2 Let and stand for predicates (constants) that are always false or always true respectively. Simplify the following:
Exercise 1.3 There are two distributive laws. One was proved above. The other is this:
Prove that this law is also true, using truth tables.
1.2 Implication and equivalence
Related reading: Stein et al. p. 155-159 or Rosen p. 6+ and 9+
Definition 1 The logic operator (implication) is defined by the following truth table:
We read as implies .
Exercise 1.4 Show that the expression is equivalent to .
Definition 2 (Equivalence) Given two predicates and . The notation
means the same as
and we say that is equivalent to .
Exercise 1.5 Fill in the truth table for :
Exercise 1.6 Give examples in plain English or Scandinavian where
- «if» appears to mean «if and only if» (or where you think it would for many people).
- where «if» would not mean «if and only if».
1.3 Direct Proof
Related reading: Stein et al. p. 179–180 or Rosen p. 63–64
Principle 2 (Modus Ponens) From and , we can conclude .
Exercise 1.7 Consider the following argument
- If you are clever, then you will solve this exercise.
- You are clever.
- Therefore you will solve this exercise.
Rewrite the argument in symbolic form, and decide whether it is a valid argument.
Exercise 1.8 Rewrite the following argument in symbolic form, and decide whether or not it is a valid argument.
- If it is Wednesday, then we have fish for dinner.
- It is Wednesday.
- We have fish for dinner.
Exercise 1.9 Rewrite the following argument in symbolic form, and decide whether or not it is a valid argument.
- If it is Wednesday, then we have fish for dinner.
- We have fish for dinner.
- It is Wednesday.
Exercise 1.10 Rewrite the following argument in symbolic form, and decide whether or not it is a valid argument.
- If you fail mathematics, then you will not get your engineering degree.
- You do not get your engineering degree.
- Therefore you did not fail the mathematics module.
Exercise 1.11 Rewrite the following argument in symbolic form, and decide whether or not it is a valid argument.
- If you fail mathematics, then you will not get your engineering degree.
- You fail mathematics
- Therefore you do not get your engineering degree.