Discrete Math & Fixed points CS 350 — Fall 2018 gilray.org/classes/fall2018/cs350/
𝐴={1,2,3}
𝐴×𝐴= {(1,1),(1,2),(1,3), (2,1),(2,2),(2,3), (3,1),(3,2),(3,3)}
ℕ×ℕ= {(0,0),(0,1),(0,2),(0,3),⋯ (1,0),(1,1),(1,2),(1,3),⋯ (2,0),(2,1),(2,2),(3,3),⋯ (3,0),(3,1),(3,2),(3,3), ⋱ ⋮
𝑅⊆ℕ×ℕ
∃𝑥∈𝐴.Even(𝑥) ∀𝑥∈𝐴.Even(𝑥) 𝐴={1,2,3} Even(𝑥) = Δ 𝑥≡0(mod2) Propositions are statements that are True or False. E.g., 𝐴={1,2,3} Predicates are functions that yield True or False. E.g., Even(𝑥) = Δ 𝑥≡0(mod2) Quantifiers lift a proposition over elements to a proposition over sets. E.g. ∃𝑥∈𝐴.Even(𝑥) ∀𝑥∈𝐴.Even(𝑥)
Applies to sets as well: De Morgan’s Laws 𝑎∨𝑏⟺¬(¬𝑎∧¬𝑏) 𝑎∧𝑏⟺¬(¬𝑎∨¬𝑏) Applies to sets as well: 𝐴∩𝐵⟺ ( 𝐴 ∪ 𝐵 )
Or, using set-builder notation: 𝑅={(0,1),(1,2),(2,3),(3,4),…} Or, using set-builder notation: 𝑅={(𝑛,𝑛+1)|𝑛∈ℕ}
Or, as a graph: 1 2 3 4 5
|𝐴|=3 |𝐴×𝐴|=|𝐴|×|𝐴|=9 |𝒫(𝐴)|=| 2 𝐴 |= 2 |𝐴| =8
Counting Problems
𝒫(𝐴)= 2 𝐴 = {Ø,{1},{2},{3}, {1,2},{1,3},{2,3},{1,2,3}}
𝒫(𝐴)= 2 𝐴 = “Hasse” diagram {1,2,3} {1,2} {1,3} {2,3} {1} {2} {3} Ø
(⊆)⊆𝒫(𝐴)×𝒫(𝐴)
𝑥𝑅𝑦⟹𝑦𝑅𝑥 𝑥𝑅𝑦∧𝑦𝑅𝑥⟹𝑥=𝑦 𝑥𝑅𝑦∧𝑦𝑅𝑧⟹𝑥𝑅𝑧 ∀𝑥.𝑥𝑅𝑥 Reflexivity of R: Symmetry of R: 𝑥𝑅𝑦⟹𝑦𝑅𝑥 Antisymmetry of R: 𝑥𝑅𝑦∧𝑦𝑅𝑥⟹𝑥=𝑦 Transitivity of R: 𝑥𝑅𝑦∧𝑦𝑅𝑧⟹𝑥𝑅𝑧
⊑ ⊑ (ℝ,≤) (𝒫(ℕ),⊆) ∀𝑥,𝑦.𝑥𝑅𝑦∨𝑦𝑅𝑥 Partial orders are reflexive, antisymmetric, and transitive. If , then the order is total. If it is not antisymmetric, then it’s a preorder. If it is irreflexive, then it is a strict partial order. A set S and a partial order ( ) form a poset (S, ) together—a partially ordered set. For example: or A equivalence relation is reflexive, symmetric, and transitive—has equivalence classes. What does it’s graph look like? ∀𝑥,𝑦.𝑥𝑅𝑦∨𝑦𝑅𝑥 ⊑ ⊑ (ℝ,≤) (𝒫(ℕ),⊆)
A join , also called a least upper bound, is the unique element of a poset no less than than x and y, but strictly less than all other elements no less than either x or y. A meet , also called a greatest lower bound, is the unique element of a poset no greater than than x and y, but strictly greater than all other elements no greater than either x or y. A lattice is a partially ordered set such that, for all x and y, both a meet and a join exist for x and y. (𝑥⊔𝑦) 𝑥⊑(𝑥⊔𝑦)∧𝑦⊑(𝑥⊔𝑦)∧∀𝑧.(𝑥⊑𝑧∧𝑦⊑𝑧∧𝑧⊑(𝑥⊔𝑦)⟹𝑧=(𝑥⊔𝑦) (𝑥⊓𝑦) 𝑥⊒(𝑥⊓𝑦)∧𝑦⊒(𝑥⊓𝑦)∧∀𝑧.(𝑥⊒𝑧∧𝑦⊒𝑧∧𝑧⊒(𝑥⊓𝑦)⟹𝑧=(𝑥⊓𝑦)
(1.0m, 100kg) (0.5m, 100kg) (1.0m, 50kg) (1.0m, 10kg) (0.5m, 50kg) (0.5m, 10kg)
∀𝑥.∃𝑦.(𝑥,𝑦)∈𝐹 ∀𝑦.∃𝑥.(𝑥,𝑦)∈𝐹 ∀𝑥,𝑦.𝐹(𝑥)=𝐹(𝑦)⟹𝑥=𝑦 F is a function: ∀𝑥,𝑦,𝑧.(𝑥,𝑦)∈𝐹∧(𝑥,𝑧)∈𝐹⟹𝑦=𝑧 F is a total function: ∀𝑥.∃𝑦.(𝑥,𝑦)∈𝐹 F is injective/1-1: ∀𝑥,𝑦.𝐹(𝑥)=𝐹(𝑦)⟹𝑥=𝑦 F is surjective/onto: ∀𝑦.∃𝑥.(𝑥,𝑦)∈𝐹
sets, then they must have the same cardinality. 𝐹:ℕ→ℙ 𝐹(𝑛)=𝑛+1 1 2 3 4 5 6 7 8 9 10 11 If a bijective function (injective, surjective) exists between two finite sets, then they must have the same cardinality.
n f(n) 0 .0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 1 .1 0 0 1 0 0 0 0 1 1 0 1 0 1 0 0 0 1 1 0 … 2 .1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 … 3 .1 1 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 … 4 .0 0 1 0 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 … 5 .1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 1 1 0 1 … 6 .0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 7 .1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 … 8 .1 1 0 0 1 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 …
n f(n) 0 .0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 1 .1 0 0 1 0 0 0 0 1 1 0 1 0 1 0 0 0 1 1 0 … 2 .1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 … 3 .1 1 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 … 4 .0 0 1 0 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 … 5 .1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 1 1 0 1 … 6 .0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 7 .1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 … 8 .1 1 0 0 1 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 … d .0 0 1 0 1 0 0 1 0 …
n f(n) 0 .0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 1 .1 0 0 1 0 0 0 0 1 1 0 1 0 1 0 0 0 1 1 0 … 2 .1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 … 3 .1 1 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 … 4 .0 0 1 0 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 … 5 .1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 1 1 0 1 … 6 .0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 … 7 .1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 … 8 .1 1 0 0 1 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 … d .0 0 1 0 1 0 0 1 0 … d’ cannot exist as it must disagree at the d’th digit! d’ .1 1 0 1 0 1 1 0 1 …
Cantor’s Diagonalization Proof
Fixed-point algorithms
What are fixed points (a.k.a. fixpoints)?
f(x) = x2 (1,1) (0,0)
{𝑥|(𝑥,𝑥)∈𝐹} or {𝑥|𝐹(𝑥)=𝑥}
Babylonian method for computing . 2