Discrete Mathematics - Relations and Functions

47,936 views

Published on

Relations, relation composition, converse relation, reflexivity, symmetry, transitivity. Functions, function composition, one-to-one, onto, bijective functions, inverse function, pigeonhole principle, recursive functions.

Published in: Education, Technology
5 Comments
11 Likes
Statistics
Notes
No Downloads
Views
Total views
47,936
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
1,030
Comments
5
Likes
11
Embeds 0
No embeds

No notes for slide

Discrete Mathematics - Relations and Functions

  1. 1. Discrete Mathematics Relations and Functions H. Turgut Uyar Ay¸seg¨ul Gen¸cata Yayımlı Emre Harmancı 2001-2016
  2. 2. License c 2001-2016 T. Uyar, A. Yayımlı, E. Harmancı You are free to: Share – copy and redistribute the material in any medium or format Adapt – remix, transform, and build upon the material Under the following terms: Attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. NonCommercial – You may not use the material for commercial purposes. ShareAlike – If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. For more information: https://creativecommons.org/licenses/by-nc-sa/4.0/ Read the full license: https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
  3. 3. Topics 1 Relations Introduction Relation Properties Equivalence Relations 2 Functions Introduction Pigeonhole Principle Recursion
  4. 4. Topics 1 Relations Introduction Relation Properties Equivalence Relations 2 Functions Introduction Pigeonhole Principle Recursion
  5. 5. Relation Definition relation: α ⊆ A × B × C × · · · × N tuple: element of relation binary relation: α ⊆ A × B aαb : (a, b) ∈ α
  6. 6. Relation Definition relation: α ⊆ A × B × C × · · · × N tuple: element of relation binary relation: α ⊆ A × B aαb : (a, b) ∈ α
  7. 7. Relation Example A = {a1, a2, a3, a4}, B = {b1, b2, b3} α = {(a1, b1), (a1, b3), (a2, b2), (a2, b3), (a3, b1), (a3, b3), (a4, b1)} b1 b2 b3 a1 1 0 1 a2 0 1 1 a3 1 0 1 a4 1 0 0 Mα = 1 0 1 0 1 1 1 0 1 1 0 0
  8. 8. Relation Example A = {a1, a2, a3, a4}, B = {b1, b2, b3} α = {(a1, b1), (a1, b3), (a2, b2), (a2, b3), (a3, b1), (a3, b3), (a4, b1)} b1 b2 b3 a1 1 0 1 a2 0 1 1 a3 1 0 1 a4 1 0 0 Mα = 1 0 1 0 1 1 1 0 1 1 0 0
  9. 9. Relation Composition Definition relation composition: α ⊆ A × B, β ⊆ B × C αβ = {(a, c) | a ∈ A, c ∈ C, ∃b ∈ B [aαb ∧ bβc]} example
  10. 10. Relation Composition Mαβ = Mα × Mβ using logical operations: 1 : T 0 : F · : ∧ + : ∨ example Mα = 1 0 0 0 0 1 0 1 1 0 1 0 1 0 1 Mβ = 1 1 0 0 0 0 1 1 0 1 1 0 Mαβ = 1 1 0 0 0 1 1 0 0 1 1 1 0 0 1 1 1 1 1 0
  11. 11. Relation Composition Mαβ = Mα × Mβ using logical operations: 1 : T 0 : F · : ∧ + : ∨ example Mα = 1 0 0 0 0 1 0 1 1 0 1 0 1 0 1 Mβ = 1 1 0 0 0 0 1 1 0 1 1 0 Mαβ = 1 1 0 0 0 1 1 0 0 1 1 1 0 0 1 1 1 1 1 0
  12. 12. Relation Composition Associativity (αβ)γ = α(βγ). (a, d) ∈ (αβ)γ ⇔ ∃c [(a, c) ∈ αβ ∧ (c, d) ∈ γ] ⇔ ∃c [∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ∧ (c, d) ∈ γ] ⇔ ∃b [(a, b) ∈ α ∧ ∃c [(b, c) ∈ β ∧ (c, d) ∈ γ]] ⇔ ∃b [(a, b) ∈ α ∧ (b, d) ∈ βγ] ⇔ (a, d) ∈ α(βγ)
  13. 13. Relation Composition Associativity (αβ)γ = α(βγ). (a, d) ∈ (αβ)γ ⇔ ∃c [(a, c) ∈ αβ ∧ (c, d) ∈ γ] ⇔ ∃c [∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ∧ (c, d) ∈ γ] ⇔ ∃b [(a, b) ∈ α ∧ ∃c [(b, c) ∈ β ∧ (c, d) ∈ γ]] ⇔ ∃b [(a, b) ∈ α ∧ (b, d) ∈ βγ] ⇔ (a, d) ∈ α(βγ)
  14. 14. Relation Composition Associativity (αβ)γ = α(βγ). (a, d) ∈ (αβ)γ ⇔ ∃c [(a, c) ∈ αβ ∧ (c, d) ∈ γ] ⇔ ∃c [∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ∧ (c, d) ∈ γ] ⇔ ∃b [(a, b) ∈ α ∧ ∃c [(b, c) ∈ β ∧ (c, d) ∈ γ]] ⇔ ∃b [(a, b) ∈ α ∧ (b, d) ∈ βγ] ⇔ (a, d) ∈ α(βγ)
  15. 15. Relation Composition Associativity (αβ)γ = α(βγ). (a, d) ∈ (αβ)γ ⇔ ∃c [(a, c) ∈ αβ ∧ (c, d) ∈ γ] ⇔ ∃c [∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ∧ (c, d) ∈ γ] ⇔ ∃b [(a, b) ∈ α ∧ ∃c [(b, c) ∈ β ∧ (c, d) ∈ γ]] ⇔ ∃b [(a, b) ∈ α ∧ (b, d) ∈ βγ] ⇔ (a, d) ∈ α(βγ)
  16. 16. Relation Composition Associativity (αβ)γ = α(βγ). (a, d) ∈ (αβ)γ ⇔ ∃c [(a, c) ∈ αβ ∧ (c, d) ∈ γ] ⇔ ∃c [∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ∧ (c, d) ∈ γ] ⇔ ∃b [(a, b) ∈ α ∧ ∃c [(b, c) ∈ β ∧ (c, d) ∈ γ]] ⇔ ∃b [(a, b) ∈ α ∧ (b, d) ∈ βγ] ⇔ (a, d) ∈ α(βγ)
  17. 17. Relation Composition Associativity (αβ)γ = α(βγ). (a, d) ∈ (αβ)γ ⇔ ∃c [(a, c) ∈ αβ ∧ (c, d) ∈ γ] ⇔ ∃c [∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ∧ (c, d) ∈ γ] ⇔ ∃b [(a, b) ∈ α ∧ ∃c [(b, c) ∈ β ∧ (c, d) ∈ γ]] ⇔ ∃b [(a, b) ∈ α ∧ (b, d) ∈ βγ] ⇔ (a, d) ∈ α(βγ)
  18. 18. Relation Composition Associativity (αβ)γ = α(βγ). (a, d) ∈ (αβ)γ ⇔ ∃c [(a, c) ∈ αβ ∧ (c, d) ∈ γ] ⇔ ∃c [∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ∧ (c, d) ∈ γ] ⇔ ∃b [(a, b) ∈ α ∧ ∃c [(b, c) ∈ β ∧ (c, d) ∈ γ]] ⇔ ∃b [(a, b) ∈ α ∧ (b, d) ∈ βγ] ⇔ (a, d) ∈ α(βγ)
  19. 19. Relation Composition Theorems α(β ∪ γ) = αβ ∪ αγ. (a, c) ∈ α(β ∪ γ) ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ (β ∪ γ)] ⇔ ∃b [(a, b) ∈ α ∧ ((b, c) ∈ β ∨ (b, c) ∈ γ)] ⇔ ∃b [((a, b) ∈ α ∧ (b, c) ∈ β) ∨ ((a, b) ∈ α ∧ (b, c) ∈ γ)] ⇔ (a, c) ∈ αβ ∨ (a, c) ∈ αγ ⇔ (a, c) ∈ αβ ∪ αγ
  20. 20. Relation Composition Theorems α(β ∪ γ) = αβ ∪ αγ. (a, c) ∈ α(β ∪ γ) ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ (β ∪ γ)] ⇔ ∃b [(a, b) ∈ α ∧ ((b, c) ∈ β ∨ (b, c) ∈ γ)] ⇔ ∃b [((a, b) ∈ α ∧ (b, c) ∈ β) ∨ ((a, b) ∈ α ∧ (b, c) ∈ γ)] ⇔ (a, c) ∈ αβ ∨ (a, c) ∈ αγ ⇔ (a, c) ∈ αβ ∪ αγ
  21. 21. Relation Composition Theorems α(β ∪ γ) = αβ ∪ αγ. (a, c) ∈ α(β ∪ γ) ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ (β ∪ γ)] ⇔ ∃b [(a, b) ∈ α ∧ ((b, c) ∈ β ∨ (b, c) ∈ γ)] ⇔ ∃b [((a, b) ∈ α ∧ (b, c) ∈ β) ∨ ((a, b) ∈ α ∧ (b, c) ∈ γ)] ⇔ (a, c) ∈ αβ ∨ (a, c) ∈ αγ ⇔ (a, c) ∈ αβ ∪ αγ
  22. 22. Relation Composition Theorems α(β ∪ γ) = αβ ∪ αγ. (a, c) ∈ α(β ∪ γ) ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ (β ∪ γ)] ⇔ ∃b [(a, b) ∈ α ∧ ((b, c) ∈ β ∨ (b, c) ∈ γ)] ⇔ ∃b [((a, b) ∈ α ∧ (b, c) ∈ β) ∨ ((a, b) ∈ α ∧ (b, c) ∈ γ)] ⇔ (a, c) ∈ αβ ∨ (a, c) ∈ αγ ⇔ (a, c) ∈ αβ ∪ αγ
  23. 23. Relation Composition Theorems α(β ∪ γ) = αβ ∪ αγ. (a, c) ∈ α(β ∪ γ) ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ (β ∪ γ)] ⇔ ∃b [(a, b) ∈ α ∧ ((b, c) ∈ β ∨ (b, c) ∈ γ)] ⇔ ∃b [((a, b) ∈ α ∧ (b, c) ∈ β) ∨ ((a, b) ∈ α ∧ (b, c) ∈ γ)] ⇔ (a, c) ∈ αβ ∨ (a, c) ∈ αγ ⇔ (a, c) ∈ αβ ∪ αγ
  24. 24. Relation Composition Theorems α(β ∪ γ) = αβ ∪ αγ. (a, c) ∈ α(β ∪ γ) ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ (β ∪ γ)] ⇔ ∃b [(a, b) ∈ α ∧ ((b, c) ∈ β ∨ (b, c) ∈ γ)] ⇔ ∃b [((a, b) ∈ α ∧ (b, c) ∈ β) ∨ ((a, b) ∈ α ∧ (b, c) ∈ γ)] ⇔ (a, c) ∈ αβ ∨ (a, c) ∈ αγ ⇔ (a, c) ∈ αβ ∪ αγ
  25. 25. Relation Composition Theorems α(β ∪ γ) = αβ ∪ αγ. (a, c) ∈ α(β ∪ γ) ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ (β ∪ γ)] ⇔ ∃b [(a, b) ∈ α ∧ ((b, c) ∈ β ∨ (b, c) ∈ γ)] ⇔ ∃b [((a, b) ∈ α ∧ (b, c) ∈ β) ∨ ((a, b) ∈ α ∧ (b, c) ∈ γ)] ⇔ (a, c) ∈ αβ ∨ (a, c) ∈ αγ ⇔ (a, c) ∈ αβ ∪ αγ
  26. 26. Converse Relation Definition α−1 = {(b, a) | (a, b) ∈ α} Mα−1 = MT α
  27. 27. Converse Relation Theorems (α−1)−1 = α (α ∪ β)−1 = α−1 ∪ β−1 (α ∩ β)−1 = α−1 ∩ β−1 α−1 = α−1 (α − β)−1 = α−1 − β−1
  28. 28. Converse Relation Theorems α−1 = α−1. (b, a) ∈ α−1 ⇔ (a, b) ∈ α ⇔ (a, b) /∈ α ⇔ (b, a) /∈ α−1 ⇔ (b, a) ∈ α−1
  29. 29. Converse Relation Theorems α−1 = α−1. (b, a) ∈ α−1 ⇔ (a, b) ∈ α ⇔ (a, b) /∈ α ⇔ (b, a) /∈ α−1 ⇔ (b, a) ∈ α−1
  30. 30. Converse Relation Theorems α−1 = α−1. (b, a) ∈ α−1 ⇔ (a, b) ∈ α ⇔ (a, b) /∈ α ⇔ (b, a) /∈ α−1 ⇔ (b, a) ∈ α−1
  31. 31. Converse Relation Theorems α−1 = α−1. (b, a) ∈ α−1 ⇔ (a, b) ∈ α ⇔ (a, b) /∈ α ⇔ (b, a) /∈ α−1 ⇔ (b, a) ∈ α−1
  32. 32. Converse Relation Theorems α−1 = α−1. (b, a) ∈ α−1 ⇔ (a, b) ∈ α ⇔ (a, b) /∈ α ⇔ (b, a) /∈ α−1 ⇔ (b, a) ∈ α−1
  33. 33. Converse Relation Theorems α−1 = α−1. (b, a) ∈ α−1 ⇔ (a, b) ∈ α ⇔ (a, b) /∈ α ⇔ (b, a) /∈ α−1 ⇔ (b, a) ∈ α−1
  34. 34. Converse Relation Theorems (α ∩ β)−1 = α−1 ∩ β−1. (b, a) ∈ (α ∩ β)−1 ⇔ (a, b) ∈ (α ∩ β) ⇔ (a, b) ∈ α ∧ (a, b) ∈ β ⇔ (b, a) ∈ α−1 ∧ (b, a) ∈ β−1 ⇔ (b, a) ∈ α−1 ∩ β−1
  35. 35. Converse Relation Theorems (α ∩ β)−1 = α−1 ∩ β−1. (b, a) ∈ (α ∩ β)−1 ⇔ (a, b) ∈ (α ∩ β) ⇔ (a, b) ∈ α ∧ (a, b) ∈ β ⇔ (b, a) ∈ α−1 ∧ (b, a) ∈ β−1 ⇔ (b, a) ∈ α−1 ∩ β−1
  36. 36. Converse Relation Theorems (α ∩ β)−1 = α−1 ∩ β−1. (b, a) ∈ (α ∩ β)−1 ⇔ (a, b) ∈ (α ∩ β) ⇔ (a, b) ∈ α ∧ (a, b) ∈ β ⇔ (b, a) ∈ α−1 ∧ (b, a) ∈ β−1 ⇔ (b, a) ∈ α−1 ∩ β−1
  37. 37. Converse Relation Theorems (α ∩ β)−1 = α−1 ∩ β−1. (b, a) ∈ (α ∩ β)−1 ⇔ (a, b) ∈ (α ∩ β) ⇔ (a, b) ∈ α ∧ (a, b) ∈ β ⇔ (b, a) ∈ α−1 ∧ (b, a) ∈ β−1 ⇔ (b, a) ∈ α−1 ∩ β−1
  38. 38. Converse Relation Theorems (α ∩ β)−1 = α−1 ∩ β−1. (b, a) ∈ (α ∩ β)−1 ⇔ (a, b) ∈ (α ∩ β) ⇔ (a, b) ∈ α ∧ (a, b) ∈ β ⇔ (b, a) ∈ α−1 ∧ (b, a) ∈ β−1 ⇔ (b, a) ∈ α−1 ∩ β−1
  39. 39. Converse Relation Theorems (α ∩ β)−1 = α−1 ∩ β−1. (b, a) ∈ (α ∩ β)−1 ⇔ (a, b) ∈ (α ∩ β) ⇔ (a, b) ∈ α ∧ (a, b) ∈ β ⇔ (b, a) ∈ α−1 ∧ (b, a) ∈ β−1 ⇔ (b, a) ∈ α−1 ∩ β−1
  40. 40. Converse Relation Theorems (α − β)−1 = α−1 − β−1. (α − β)−1 = (α ∩ β)−1 = α−1 ∩ β −1 = α−1 ∩ β−1 = α−1 − β−1
  41. 41. Converse Relation Theorems (α − β)−1 = α−1 − β−1. (α − β)−1 = (α ∩ β)−1 = α−1 ∩ β −1 = α−1 ∩ β−1 = α−1 − β−1
  42. 42. Converse Relation Theorems (α − β)−1 = α−1 − β−1. (α − β)−1 = (α ∩ β)−1 = α−1 ∩ β −1 = α−1 ∩ β−1 = α−1 − β−1
  43. 43. Converse Relation Theorems (α − β)−1 = α−1 − β−1. (α − β)−1 = (α ∩ β)−1 = α−1 ∩ β −1 = α−1 ∩ β−1 = α−1 − β−1
  44. 44. Converse Relation Theorems (α − β)−1 = α−1 − β−1. (α − β)−1 = (α ∩ β)−1 = α−1 ∩ β −1 = α−1 ∩ β−1 = α−1 − β−1
  45. 45. Relation Composition Converse Theorem (αβ)−1 = β−1α−1 Proof. (c, a) ∈ (αβ)−1 ⇔ (a, c) ∈ αβ ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ⇔ ∃b [(b, a) ∈ α−1 ∧ (c, b) ∈ β−1 ] ⇔ (c, a) ∈ β−1 α−1
  46. 46. Relation Composition Converse Theorem (αβ)−1 = β−1α−1 Proof. (c, a) ∈ (αβ)−1 ⇔ (a, c) ∈ αβ ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ⇔ ∃b [(b, a) ∈ α−1 ∧ (c, b) ∈ β−1 ] ⇔ (c, a) ∈ β−1 α−1
  47. 47. Relation Composition Converse Theorem (αβ)−1 = β−1α−1 Proof. (c, a) ∈ (αβ)−1 ⇔ (a, c) ∈ αβ ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ⇔ ∃b [(b, a) ∈ α−1 ∧ (c, b) ∈ β−1 ] ⇔ (c, a) ∈ β−1 α−1
  48. 48. Relation Composition Converse Theorem (αβ)−1 = β−1α−1 Proof. (c, a) ∈ (αβ)−1 ⇔ (a, c) ∈ αβ ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ⇔ ∃b [(b, a) ∈ α−1 ∧ (c, b) ∈ β−1 ] ⇔ (c, a) ∈ β−1 α−1
  49. 49. Relation Composition Converse Theorem (αβ)−1 = β−1α−1 Proof. (c, a) ∈ (αβ)−1 ⇔ (a, c) ∈ αβ ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ⇔ ∃b [(b, a) ∈ α−1 ∧ (c, b) ∈ β−1 ] ⇔ (c, a) ∈ β−1 α−1
  50. 50. Relation Composition Converse Theorem (αβ)−1 = β−1α−1 Proof. (c, a) ∈ (αβ)−1 ⇔ (a, c) ∈ αβ ⇔ ∃b [(a, b) ∈ α ∧ (b, c) ∈ β] ⇔ ∃b [(b, a) ∈ α−1 ∧ (c, b) ∈ β−1 ] ⇔ (c, a) ∈ β−1 α−1
  51. 51. Topics 1 Relations Introduction Relation Properties Equivalence Relations 2 Functions Introduction Pigeonhole Principle Recursion
  52. 52. Relation Properties α ⊆ A × A αn: αα · · · α identity relation: E = {(a, a) | a ∈ A} reflexivity symmetry transitivity
  53. 53. Relation Properties α ⊆ A × A αn: αα · · · α identity relation: E = {(a, a) | a ∈ A} reflexivity symmetry transitivity
  54. 54. Reflexivity reflexive α ⊆ A × A ∀a ∈ A [aαa] E ⊆ α nonreflexive: ∃a ∈ A [¬(aαa)] irreflexive: ∀a ∈ A [¬(aαa)]
  55. 55. Reflexivity reflexive α ⊆ A × A ∀a ∈ A [aαa] E ⊆ α nonreflexive: ∃a ∈ A [¬(aαa)] irreflexive: ∀a ∈ A [¬(aαa)]
  56. 56. Reflexivity reflexive α ⊆ A × A ∀a ∈ A [aαa] E ⊆ α nonreflexive: ∃a ∈ A [¬(aαa)] irreflexive: ∀a ∈ A [¬(aαa)]
  57. 57. Reflexivity reflexive α ⊆ A × A ∀a ∈ A [aαa] E ⊆ α nonreflexive: ∃a ∈ A [¬(aαa)] irreflexive: ∀a ∈ A [¬(aαa)]
  58. 58. Reflexivity Examples R1 ⊆ {1, 2} × {1, 2} R1 = {(1, 1), (1, 2), (2, 2)} R1 is reflexive R2 ⊆ {1, 2, 3} × {1, 2, 3} R2 = {(1, 1), (1, 2), (2, 2)} R2 is nonreflexive
  59. 59. Reflexivity Examples R1 ⊆ {1, 2} × {1, 2} R1 = {(1, 1), (1, 2), (2, 2)} R1 is reflexive R2 ⊆ {1, 2, 3} × {1, 2, 3} R2 = {(1, 1), (1, 2), (2, 2)} R2 is nonreflexive
  60. 60. Reflexivity Examples R ⊆ {1, 2, 3} × {1, 2, 3} R = {(1, 2), (2, 1), (2, 3)} R is irreflexive
  61. 61. Reflexivity Examples R ⊆ Z × Z R = {(a, b) | ab ≥ 0} R is reflexive
  62. 62. Symmetry symmetric α ⊆ A × A ∀a, b ∈ A [(a = b) ∨ (aαb ∧ bαa) ∨ (¬(aαb) ∧ ¬(bαa))] ∀a, b ∈ A [(a = b) ∨ (aαb ↔ bαa)] α−1 = α asymmetric: ∃a, b ∈ A [(a = b) ∧ ((aαb ∧ ¬(bαa)) ∨ (¬(aαb) ∧ bαa))]
  63. 63. Symmetry symmetric α ⊆ A × A ∀a, b ∈ A [(a = b) ∨ (aαb ∧ bαa) ∨ (¬(aαb) ∧ ¬(bαa))] ∀a, b ∈ A [(a = b) ∨ (aαb ↔ bαa)] α−1 = α asymmetric: ∃a, b ∈ A [(a = b) ∧ ((aαb ∧ ¬(bαa)) ∨ (¬(aαb) ∧ bαa))]
  64. 64. Symmetry symmetric α ⊆ A × A ∀a, b ∈ A [(a = b) ∨ (aαb ∧ bαa) ∨ (¬(aαb) ∧ ¬(bαa))] ∀a, b ∈ A [(a = b) ∨ (aαb ↔ bαa)] α−1 = α asymmetric: ∃a, b ∈ A [(a = b) ∧ ((aαb ∧ ¬(bαa)) ∨ (¬(aαb) ∧ bαa))]
  65. 65. Symmetry symmetric α ⊆ A × A ∀a, b ∈ A [(a = b) ∨ (aαb ∧ bαa) ∨ (¬(aαb) ∧ ¬(bαa))] ∀a, b ∈ A [(a = b) ∨ (aαb ↔ bαa)] α−1 = α asymmetric: ∃a, b ∈ A [(a = b) ∧ ((aαb ∧ ¬(bαa)) ∨ (¬(aαb) ∧ bαa))]
  66. 66. Antisymmetry antisymmetric: ∀a, b ∈ A [(a = b) ∨ (aαb → ¬(bαa))] ⇔ ∀a, b ∈ A [(a = b) ∨ ¬(aαb) ∨ ¬(bαa)] ⇔ ∀a, b ∈ A [¬(aαb ∧ bαa) ∨ (a = b)] ⇔ ∀a, b ∈ A [(aαb ∧ bαa) → (a = b)]
  67. 67. Antisymmetry antisymmetric: ∀a, b ∈ A [(a = b) ∨ (aαb → ¬(bαa))] ⇔ ∀a, b ∈ A [(a = b) ∨ ¬(aαb) ∨ ¬(bαa)] ⇔ ∀a, b ∈ A [¬(aαb ∧ bαa) ∨ (a = b)] ⇔ ∀a, b ∈ A [(aαb ∧ bαa) → (a = b)]
  68. 68. Antisymmetry antisymmetric: ∀a, b ∈ A [(a = b) ∨ (aαb → ¬(bαa))] ⇔ ∀a, b ∈ A [(a = b) ∨ ¬(aαb) ∨ ¬(bαa)] ⇔ ∀a, b ∈ A [¬(aαb ∧ bαa) ∨ (a = b)] ⇔ ∀a, b ∈ A [(aαb ∧ bαa) → (a = b)]
  69. 69. Antisymmetry antisymmetric: ∀a, b ∈ A [(a = b) ∨ (aαb → ¬(bαa))] ⇔ ∀a, b ∈ A [(a = b) ∨ ¬(aαb) ∨ ¬(bαa)] ⇔ ∀a, b ∈ A [¬(aαb ∧ bαa) ∨ (a = b)] ⇔ ∀a, b ∈ A [(aαb ∧ bαa) → (a = b)]
  70. 70. Symmetry Examples R ⊆ {1, 2, 3} × {1, 2, 3} R = {(1, 2), (2, 1), (2, 3)} R is asymmetric
  71. 71. Symmetry Examples R ⊆ Z × Z R = {(a, b) | ab ≥ 0} R is symmetric
  72. 72. Symmetry Examples R ⊆ {1, 2, 3} × {1, 2, 3} R = {(1, 1), (2, 2)} R is symmetric and antisymmetric
  73. 73. Transitivity transitive α ⊆ A × A ∀a, b, c ∈ A [(aαb ∧ bαc) → (aαc)] α2 ⊆ α nontransitive: ∃a, b, c ∈ A [(aαb ∧ bαc) ∧ ¬(aαc)] antitransitive: ∀a, b, c ∈ A [(aαb ∧ bαc) → ¬(aαc)]
  74. 74. Transitivity transitive α ⊆ A × A ∀a, b, c ∈ A [(aαb ∧ bαc) → (aαc)] α2 ⊆ α nontransitive: ∃a, b, c ∈ A [(aαb ∧ bαc) ∧ ¬(aαc)] antitransitive: ∀a, b, c ∈ A [(aαb ∧ bαc) → ¬(aαc)]
  75. 75. Transitivity transitive α ⊆ A × A ∀a, b, c ∈ A [(aαb ∧ bαc) → (aαc)] α2 ⊆ α nontransitive: ∃a, b, c ∈ A [(aαb ∧ bαc) ∧ ¬(aαc)] antitransitive: ∀a, b, c ∈ A [(aαb ∧ bαc) → ¬(aαc)]
  76. 76. Transitivity transitive α ⊆ A × A ∀a, b, c ∈ A [(aαb ∧ bαc) → (aαc)] α2 ⊆ α nontransitive: ∃a, b, c ∈ A [(aαb ∧ bαc) ∧ ¬(aαc)] antitransitive: ∀a, b, c ∈ A [(aαb ∧ bαc) → ¬(aαc)]
  77. 77. Transitivity Examples R ⊆ {1, 2, 3} × {1, 2, 3} R = {(1, 2), (2, 1), (2, 3)} R is antitransitive
  78. 78. Transitivity Examples R ⊆ Z × Z R = {(a, b) | ab ≥ 0} R is nontransitive
  79. 79. Converse Relation Properties Theorem Reflexivity, symmetry and transitivity are preserved in the converse relation.
  80. 80. Closures reflexive closure: rα = α ∪ E symmetric closure: sα = α ∪ α−1 transitive closure: tα = i=1,2,3,... αi = α ∪ α2 ∪ α3 ∪ · · ·
  81. 81. Closures reflexive closure: rα = α ∪ E symmetric closure: sα = α ∪ α−1 transitive closure: tα = i=1,2,3,... αi = α ∪ α2 ∪ α3 ∪ · · ·
  82. 82. Closures reflexive closure: rα = α ∪ E symmetric closure: sα = α ∪ α−1 transitive closure: tα = i=1,2,3,... αi = α ∪ α2 ∪ α3 ∪ · · ·
  83. 83. Special Relations predecessor - successor R ⊆ Z × Z R = {(a, b) | a − b = 1} irreflexive antisymmetric antitransitive
  84. 84. Special Relations adjacency R ⊆ Z × Z R = {(a, b) | |a − b| = 1} irreflexive symmetric antitransitive
  85. 85. Special Relations strict order R ⊆ Z × Z R = {(a, b) | a < b} irreflexive antisymmetric transitive
  86. 86. Special Relations partial order R ⊆ Z × Z R = {(a, b) | a ≤ b} reflexive antisymmetric transitive
  87. 87. Special Relations preorder R ⊆ Z × Z R = {(a, b) | |a| ≤ |b|} reflexive asymmetric transitive
  88. 88. Special Relations limited difference R ⊆ Z × Z, m ∈ Z+ R = {(a, b) | |a − b| ≤ m} reflexive symmetric nontransitive
  89. 89. Special Relations comparability R ⊆ U × U R = {(a, b) | (a ⊆ b) ∨ (b ⊆ a)} reflexive symmetric nontransitive
  90. 90. Special Relations siblings? irreflexive symmetric transitive can a relation be symmetric, transitive and irreflexive?
  91. 91. Special Relations siblings? irreflexive symmetric transitive can a relation be symmetric, transitive and irreflexive?
  92. 92. Topics 1 Relations Introduction Relation Properties Equivalence Relations 2 Functions Introduction Pigeonhole Principle Recursion
  93. 93. Compatibility Relations Definition compatibility relation: γ reflexive symmetric when drawing, lines instead of arrows matrix representation as a triangle matrix αα−1 is a compatibility relation
  94. 94. Compatibility Relations Definition compatibility relation: γ reflexive symmetric when drawing, lines instead of arrows matrix representation as a triangle matrix αα−1 is a compatibility relation
  95. 95. Compatibility Relations Definition compatibility relation: γ reflexive symmetric when drawing, lines instead of arrows matrix representation as a triangle matrix αα−1 is a compatibility relation
  96. 96. Compatibility Relation Example A = {a1, a2, a3, a4} R = {(a1, a1), (a2, a2), (a3, a3), (a4, a4), (a1, a2), (a2, a1), (a2, a4), (a4, a2), (a3, a4), (a4, a3)} 1 1 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 0 1 1
  97. 97. Compatibility Relation Example A = {a1, a2, a3, a4} R = {(a1, a1), (a2, a2), (a3, a3), (a4, a4), (a1, a2), (a2, a1), (a2, a4), (a4, a2), (a3, a4), (a4, a3)} 1 1 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 0 1 1
  98. 98. Compatibility Relation Example P: persons, L: languages P = {p1, p2, p3, p4, p5, p6} L = {l1, l2, l3, l4, l5} α ⊆ P × L Mα = 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 1 0 1 1 0 0 0 0 1 0 0 1 1 0 0 Mα−1 = 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1 0 0 0
  99. 99. Compatibility Relation Example P: persons, L: languages P = {p1, p2, p3, p4, p5, p6} L = {l1, l2, l3, l4, l5} α ⊆ P × L Mα = 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 1 0 1 1 0 0 0 0 1 0 0 1 1 0 0 Mα−1 = 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1 0 0 0
  100. 100. Compatibility Relation Example αα−1 ⊆ P × P Mαα−1 = 1 1 0 1 0 1 1 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 0 1 1 1 1 0 1
  101. 101. Compatibility Block Definition compatibility block: C ⊆ A ∀a, b [a ∈ C ∧ b ∈ C → aγb] maximal compatibility block: not a subset of another compatibility block an element can be a member of more than one MCB complete cover: Cγ set of all MCBs
  102. 102. Compatibility Block Definition compatibility block: C ⊆ A ∀a, b [a ∈ C ∧ b ∈ C → aγb] maximal compatibility block: not a subset of another compatibility block an element can be a member of more than one MCB complete cover: Cγ set of all MCBs
  103. 103. Compatibility Block Definition compatibility block: C ⊆ A ∀a, b [a ∈ C ∧ b ∈ C → aγb] maximal compatibility block: not a subset of another compatibility block an element can be a member of more than one MCB complete cover: Cγ set of all MCBs
  104. 104. Compatibility Block Example C1 = {p4, p6} C2 = {p2, p4, p6} C3 = {p1, p2, p4, p6} (MCB) Cγ = {{p1, p2, p4, p6}, {p3, p4, p6}, {p4, p5}}
  105. 105. Compatibility Block Example C1 = {p4, p6} C2 = {p2, p4, p6} C3 = {p1, p2, p4, p6} (MCB) Cγ = {{p1, p2, p4, p6}, {p3, p4, p6}, {p4, p5}}
  106. 106. Compatibility Block Example C1 = {p4, p6} C2 = {p2, p4, p6} C3 = {p1, p2, p4, p6} (MCB) Cγ = {{p1, p2, p4, p6}, {p3, p4, p6}, {p4, p5}}
  107. 107. Equivalence Relations Definition equivalence relation: reflexive symmetric transitive equivalence classes (partitions) every element is a member of exactly one equivalence class complete cover: C
  108. 108. Equivalence Relations Definition equivalence relation: reflexive symmetric transitive equivalence classes (partitions) every element is a member of exactly one equivalence class complete cover: C
  109. 109. Equivalence Relation Example R ⊆ Z × Z R = {(a, b) | ∃m ∈ Z [a − b = 5m]} R partitions Z into 5 equivalence classes
  110. 110. References Required Reading: Grimaldi Chapter 5: Relations and Functions 5.1. Cartesian Products and Relations Chapter 7: Relations: The Second Time Around 7.1. Relations Revisited: Properties of Relations 7.4. Equivalence Relations and Partitions
  111. 111. Topics 1 Relations Introduction Relation Properties Equivalence Relations 2 Functions Introduction Pigeonhole Principle Recursion
  112. 112. Functions Definition function: f : X → Y ∀x ∈ X ∀y1, y2 ∈ Y [(x, y1), (x, y2) ∈ f → y1 = y2] X: domain, Y : codomain (or range) y = f (x) : (x, y) ∈ f y: image of x under f f : X → Y , X ⊆ X subset image: f (X ) = {f (x) | x ∈ X }
  113. 113. Functions Definition function: f : X → Y ∀x ∈ X ∀y1, y2 ∈ Y [(x, y1), (x, y2) ∈ f → y1 = y2] X: domain, Y : codomain (or range) y = f (x) : (x, y) ∈ f y: image of x under f f : X → Y , X ⊆ X subset image: f (X ) = {f (x) | x ∈ X }
  114. 114. Functions Definition function: f : X → Y ∀x ∈ X ∀y1, y2 ∈ Y [(x, y1), (x, y2) ∈ f → y1 = y2] X: domain, Y : codomain (or range) y = f (x) : (x, y) ∈ f y: image of x under f f : X → Y , X ⊆ X subset image: f (X ) = {f (x) | x ∈ X }
  115. 115. Subset Image Examples f : R → R f (x) = x2 f (Z) = {0, 1, 4, 9, 16, . . . } f ({−2, 1}) = {1, 4}
  116. 116. Subset Image Examples f : R → R f (x) = x2 f (Z) = {0, 1, 4, 9, 16, . . . } f ({−2, 1}) = {1, 4}
  117. 117. One-to-One Functions Definition f : X → Y is one-to-one (or injective): ∀x1, x2 ∈ X [f (x1) = f (x2) → x1 = x2]
  118. 118. One-to-One Function Examples one-to-one f : R → R f (x) = 3x + 7 f (x1) = f (x2) ⇒ 3x1 + 7 = 3x2 + 7 ⇒ 3x1 = 3x2 ⇒ x1 = x2 not one-to-one g : Z → Z g(x) = x4 − x g(0) = 04 − 0 = 0 g(1) = 14 − 1 = 0
  119. 119. One-to-One Function Examples one-to-one f : R → R f (x) = 3x + 7 f (x1) = f (x2) ⇒ 3x1 + 7 = 3x2 + 7 ⇒ 3x1 = 3x2 ⇒ x1 = x2 not one-to-one g : Z → Z g(x) = x4 − x g(0) = 04 − 0 = 0 g(1) = 14 − 1 = 0
  120. 120. One-to-One Function Examples one-to-one f : R → R f (x) = 3x + 7 f (x1) = f (x2) ⇒ 3x1 + 7 = 3x2 + 7 ⇒ 3x1 = 3x2 ⇒ x1 = x2 not one-to-one g : Z → Z g(x) = x4 − x g(0) = 04 − 0 = 0 g(1) = 14 − 1 = 0
  121. 121. One-to-One Function Examples one-to-one f : R → R f (x) = 3x + 7 f (x1) = f (x2) ⇒ 3x1 + 7 = 3x2 + 7 ⇒ 3x1 = 3x2 ⇒ x1 = x2 not one-to-one g : Z → Z g(x) = x4 − x g(0) = 04 − 0 = 0 g(1) = 14 − 1 = 0
  122. 122. One-to-One Function Examples one-to-one f : R → R f (x) = 3x + 7 f (x1) = f (x2) ⇒ 3x1 + 7 = 3x2 + 7 ⇒ 3x1 = 3x2 ⇒ x1 = x2 not one-to-one g : Z → Z g(x) = x4 − x g(0) = 04 − 0 = 0 g(1) = 14 − 1 = 0
  123. 123. One-to-One Function Examples one-to-one f : R → R f (x) = 3x + 7 f (x1) = f (x2) ⇒ 3x1 + 7 = 3x2 + 7 ⇒ 3x1 = 3x2 ⇒ x1 = x2 not one-to-one g : Z → Z g(x) = x4 − x g(0) = 04 − 0 = 0 g(1) = 14 − 1 = 0
  124. 124. One-to-One Function Examples one-to-one f : R → R f (x) = 3x + 7 f (x1) = f (x2) ⇒ 3x1 + 7 = 3x2 + 7 ⇒ 3x1 = 3x2 ⇒ x1 = x2 not one-to-one g : Z → Z g(x) = x4 − x g(0) = 04 − 0 = 0 g(1) = 14 − 1 = 0
  125. 125. One-to-One Function Examples one-to-one f : R → R f (x) = 3x + 7 f (x1) = f (x2) ⇒ 3x1 + 7 = 3x2 + 7 ⇒ 3x1 = 3x2 ⇒ x1 = x2 not one-to-one g : Z → Z g(x) = x4 − x g(0) = 04 − 0 = 0 g(1) = 14 − 1 = 0
  126. 126. Onto Functions Definition f : X → Y is onto (or surjective): ∀y ∈ Y ∃x ∈ X [f (x) = y] f (X) = Y
  127. 127. Onto Function Examples onto f : R → R f (x) = x3 not onto f : Z → Z f (x) = 3x + 1
  128. 128. Onto Function Examples onto f : R → R f (x) = x3 not onto f : Z → Z f (x) = 3x + 1
  129. 129. Bijective Functions Definition f : X → Y is bijective: f is one-to-one and onto
  130. 130. Function Composition Definition f : X → Y , g : Y → Z g ◦ f : X → Z (g ◦ f )(x) = g(f (x)) not commutative associative: f ◦ (g ◦ h) = (f ◦ g) ◦ h
  131. 131. Function Composition Definition f : X → Y , g : Y → Z g ◦ f : X → Z (g ◦ f )(x) = g(f (x)) not commutative associative: f ◦ (g ◦ h) = (f ◦ g) ◦ h
  132. 132. Composition Commutativity Example f : R → R f (x) = x2 g : R → R g(x) = x + 5 g ◦ f : R → R (g ◦ f )(x) = x2 + 5 f ◦ g : R → R (f ◦ g)(x) = (x + 5)2
  133. 133. Composition Commutativity Example f : R → R f (x) = x2 g : R → R g(x) = x + 5 g ◦ f : R → R (g ◦ f )(x) = x2 + 5 f ◦ g : R → R (f ◦ g)(x) = (x + 5)2
  134. 134. Composition Commutativity Example f : R → R f (x) = x2 g : R → R g(x) = x + 5 g ◦ f : R → R (g ◦ f )(x) = x2 + 5 f ◦ g : R → R (f ◦ g)(x) = (x + 5)2
  135. 135. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is one-to-one ∧ g is one-to-one ⇒ g ◦ f is one-to-one Proof. (g ◦ f )(x1) = (g ◦ f )(x2) ⇒ g(f (x1)) = g(f (x2)) ⇒ f (x1) = f (x2) ⇒ x1 = x2
  136. 136. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is one-to-one ∧ g is one-to-one ⇒ g ◦ f is one-to-one Proof. (g ◦ f )(x1) = (g ◦ f )(x2) ⇒ g(f (x1)) = g(f (x2)) ⇒ f (x1) = f (x2) ⇒ x1 = x2
  137. 137. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is one-to-one ∧ g is one-to-one ⇒ g ◦ f is one-to-one Proof. (g ◦ f )(x1) = (g ◦ f )(x2) ⇒ g(f (x1)) = g(f (x2)) ⇒ f (x1) = f (x2) ⇒ x1 = x2
  138. 138. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is one-to-one ∧ g is one-to-one ⇒ g ◦ f is one-to-one Proof. (g ◦ f )(x1) = (g ◦ f )(x2) ⇒ g(f (x1)) = g(f (x2)) ⇒ f (x1) = f (x2) ⇒ x1 = x2
  139. 139. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is one-to-one ∧ g is one-to-one ⇒ g ◦ f is one-to-one Proof. (g ◦ f )(x1) = (g ◦ f )(x2) ⇒ g(f (x1)) = g(f (x2)) ⇒ f (x1) = f (x2) ⇒ x1 = x2
  140. 140. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is onto ∧ g is onto ⇒ g ◦ f is onto Proof. ∀z ∈ Z ∃y ∈ Y g(y) = z ∀y ∈ Y ∃x ∈ X f (x) = y ⇒ ∀z ∈ Z ∃x ∈ X g(f (x)) = z
  141. 141. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is onto ∧ g is onto ⇒ g ◦ f is onto Proof. ∀z ∈ Z ∃y ∈ Y g(y) = z ∀y ∈ Y ∃x ∈ X f (x) = y ⇒ ∀z ∈ Z ∃x ∈ X g(f (x)) = z
  142. 142. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is onto ∧ g is onto ⇒ g ◦ f is onto Proof. ∀z ∈ Z ∃y ∈ Y g(y) = z ∀y ∈ Y ∃x ∈ X f (x) = y ⇒ ∀z ∈ Z ∃x ∈ X g(f (x)) = z
  143. 143. Composite Function Theorems Theorem f : X → Y , g : Y → Z f is onto ∧ g is onto ⇒ g ◦ f is onto Proof. ∀z ∈ Z ∃y ∈ Y g(y) = z ∀y ∈ Y ∃x ∈ X f (x) = y ⇒ ∀z ∈ Z ∃x ∈ X g(f (x)) = z
  144. 144. Identity Function Definition identity function: 1X 1X : X → X 1X (x) = x
  145. 145. Inverse Function Definition f : X → Y is invertible: ∃f −1 : Y → X [f −1 ◦ f = 1X ∧ f ◦ f −1 = 1Y ] f −1: inverse of function f
  146. 146. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  147. 147. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  148. 148. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  149. 149. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  150. 150. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  151. 151. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  152. 152. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  153. 153. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  154. 154. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  155. 155. Inverse Function Examples f : R → R f (x) = 2x + 5 f −1 : R → R f −1(x) = x−5 2 (f −1 ◦ f )(x) = f −1(f (x)) = f −1(2x + 5) = (2x+5)−5 2 = 2x 2 = x (f ◦ f −1)(x) = f (f −1(x)) = f (x−5 2 ) = 2x−5 2 + 5 = (x − 5) + 5 = x
  156. 156. Inverse Function Theorem If a function is invertible, its inverse is unique. Proof. f : X → Y g, h : Y → X g ◦ f = 1X ∧ f ◦ g = 1Y h ◦ f = 1X ∧ f ◦ h = 1Y h = h ◦ 1Y = h ◦ (f ◦ g) = (h ◦ f ) ◦ g = 1X ◦ g = g
  157. 157. Inverse Function Theorem If a function is invertible, its inverse is unique. Proof. f : X → Y g, h : Y → X g ◦ f = 1X ∧ f ◦ g = 1Y h ◦ f = 1X ∧ f ◦ h = 1Y h = h ◦ 1Y = h ◦ (f ◦ g) = (h ◦ f ) ◦ g = 1X ◦ g = g
  158. 158. Inverse Function Theorem If a function is invertible, its inverse is unique. Proof. f : X → Y g, h : Y → X g ◦ f = 1X ∧ f ◦ g = 1Y h ◦ f = 1X ∧ f ◦ h = 1Y h = h ◦ 1Y = h ◦ (f ◦ g) = (h ◦ f ) ◦ g = 1X ◦ g = g
  159. 159. Inverse Function Theorem If a function is invertible, its inverse is unique. Proof. f : X → Y g, h : Y → X g ◦ f = 1X ∧ f ◦ g = 1Y h ◦ f = 1X ∧ f ◦ h = 1Y h = h ◦ 1Y = h ◦ (f ◦ g) = (h ◦ f ) ◦ g = 1X ◦ g = g
  160. 160. Inverse Function Theorem If a function is invertible, its inverse is unique. Proof. f : X → Y g, h : Y → X g ◦ f = 1X ∧ f ◦ g = 1Y h ◦ f = 1X ∧ f ◦ h = 1Y h = h ◦ 1Y = h ◦ (f ◦ g) = (h ◦ f ) ◦ g = 1X ◦ g = g
  161. 161. Inverse Function Theorem If a function is invertible, its inverse is unique. Proof. f : X → Y g, h : Y → X g ◦ f = 1X ∧ f ◦ g = 1Y h ◦ f = 1X ∧ f ◦ h = 1Y h = h ◦ 1Y = h ◦ (f ◦ g) = (h ◦ f ) ◦ g = 1X ◦ g = g
  162. 162. Inverse Function Theorem If a function is invertible, its inverse is unique. Proof. f : X → Y g, h : Y → X g ◦ f = 1X ∧ f ◦ g = 1Y h ◦ f = 1X ∧ f ◦ h = 1Y h = h ◦ 1Y = h ◦ (f ◦ g) = (h ◦ f ) ◦ g = 1X ◦ g = g
  163. 163. Inverse Function Theorem If a function is invertible, its inverse is unique. Proof. f : X → Y g, h : Y → X g ◦ f = 1X ∧ f ◦ g = 1Y h ◦ f = 1X ∧ f ◦ h = 1Y h = h ◦ 1Y = h ◦ (f ◦ g) = (h ◦ f ) ◦ g = 1X ◦ g = g
  164. 164. Invertible Function Theorem A function is invertible if and only if it is one-to-one and onto.
  165. 165. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  166. 166. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  167. 167. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  168. 168. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  169. 169. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  170. 170. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  171. 171. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  172. 172. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  173. 173. Invertible Function If invertible then one-to-one. f : X → Y f (x1) = f (x2) ⇒ f −1 (f (x1)) = f −1 (f (x2)) ⇒ (f −1 ◦ f )(x1) = (f −1 ◦ f )(x2) ⇒ 1X (x1) = 1X (x2) ⇒ x1 = x2 If invertible then onto. f : X → Y y = 1Y (y) = (f ◦ f −1 )(y) = f (f −1 (y))
  174. 174. Invertible Function If bijective then invertible. f : X → Y f is onto ⇒ ∀y ∈ Y ∃x ∈ X f (x) = y let g : Y → X be defined by x = g(y) is it possible that g(y) = x1 = x2 = g(y) ? this would mean: f (x1) = y = f (x2) but f is one-to-one
  175. 175. Invertible Function If bijective then invertible. f : X → Y f is onto ⇒ ∀y ∈ Y ∃x ∈ X f (x) = y let g : Y → X be defined by x = g(y) is it possible that g(y) = x1 = x2 = g(y) ? this would mean: f (x1) = y = f (x2) but f is one-to-one
  176. 176. Invertible Function If bijective then invertible. f : X → Y f is onto ⇒ ∀y ∈ Y ∃x ∈ X f (x) = y let g : Y → X be defined by x = g(y) is it possible that g(y) = x1 = x2 = g(y) ? this would mean: f (x1) = y = f (x2) but f is one-to-one
  177. 177. Topics 1 Relations Introduction Relation Properties Equivalence Relations 2 Functions Introduction Pigeonhole Principle Recursion
  178. 178. Pigeonhole Principle Definition pigeonhole principle (Dirichlet drawers): If m pigeons go into n holes and m > n, then at least one hole contains more than one pigeon. f : X → Y |X| > |Y | ⇒ f is not one-to-one ∃x1, x2 ∈ X [x1 = x2 ∧ f (x1) = f (x2)]
  179. 179. Pigeonhole Principle Definition pigeonhole principle (Dirichlet drawers): If m pigeons go into n holes and m > n, then at least one hole contains more than one pigeon. f : X → Y |X| > |Y | ⇒ f is not one-to-one ∃x1, x2 ∈ X [x1 = x2 ∧ f (x1) = f (x2)]
  180. 180. Pigeonhole Principle Examples Among 367 people, at least two have the same birthday. In an exam where the grades are integers between 0 and 100, how many students have to take the exam to make sure that at least two students will have the same grade?
  181. 181. Pigeonhole Principle Examples Among 367 people, at least two have the same birthday. In an exam where the grades are integers between 0 and 100, how many students have to take the exam to make sure that at least two students will have the same grade?
  182. 182. Generalized Pigeonhole Principle Definition generalized pigeonhole principle: If m objects are distributed to n drawers, then at least one of the drawers contains m/n objects. example Among 100 people, at least 100/12 = 9 were born in the same month.
  183. 183. Generalized Pigeonhole Principle Definition generalized pigeonhole principle: If m objects are distributed to n drawers, then at least one of the drawers contains m/n objects. example Among 100 people, at least 100/12 = 9 were born in the same month.
  184. 184. Pigeonhole Principle Example Theorem S = {1, 2, 3, . . . , 9}, T ⊂ S, |T| = 6 ∃s1, s2 ∈ T [s1 + s2 = 10]
  185. 185. Pigeonhole Principle Example Theorem S ⊆ Z+, ∀a ∈ S [a ≤ 14], |S| = 6 T = P(S) − ∅ X = {ΣA | A ∈ T}, ΣA : sum of the elements in A |X| < |T| Proof Attempt holes: 1 ≤ ΣA ≤ 9 + · · · + 14 = 69 pigeons: 26 − 1 = 63 Proof. consider T − S holes: 1 ≤ sA ≤ 10 + · · · + 14 = 60 pigeons: 26 − 2 = 62
  186. 186. Pigeonhole Principle Example Theorem S ⊆ Z+, ∀a ∈ S [a ≤ 14], |S| = 6 T = P(S) − ∅ X = {ΣA | A ∈ T}, ΣA : sum of the elements in A |X| < |T| Proof Attempt holes: 1 ≤ ΣA ≤ 9 + · · · + 14 = 69 pigeons: 26 − 1 = 63 Proof. consider T − S holes: 1 ≤ sA ≤ 10 + · · · + 14 = 60 pigeons: 26 − 2 = 62
  187. 187. Pigeonhole Principle Example Theorem S ⊆ Z+, ∀a ∈ S [a ≤ 14], |S| = 6 T = P(S) − ∅ X = {ΣA | A ∈ T}, ΣA : sum of the elements in A |X| < |T| Proof Attempt holes: 1 ≤ ΣA ≤ 9 + · · · + 14 = 69 pigeons: 26 − 1 = 63 Proof. consider T − S holes: 1 ≤ sA ≤ 10 + · · · + 14 = 60 pigeons: 26 − 2 = 62
  188. 188. Pigeonhole Principle Example Theorem S ⊆ Z+, ∀a ∈ S [a ≤ 14], |S| = 6 T = P(S) − ∅ X = {ΣA | A ∈ T}, ΣA : sum of the elements in A |X| < |T| Proof Attempt holes: 1 ≤ ΣA ≤ 9 + · · · + 14 = 69 pigeons: 26 − 1 = 63 Proof. consider T − S holes: 1 ≤ sA ≤ 10 + · · · + 14 = 60 pigeons: 26 − 2 = 62
  189. 189. Pigeonhole Principle Example Theorem S = {1, 2, 3, . . . , 200}, T ⊂ S, |T| = 101 ∃s1, s2 ∈ T [s2|s1] first, show that: ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] then, use this to prove the main theorem
  190. 190. Pigeonhole Principle Example Theorem S = {1, 2, 3, . . . , 200}, T ⊂ S, |T| = 101 ∃s1, s2 ∈ T [s2|s1] first, show that: ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] then, use this to prove the main theorem
  191. 191. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  192. 192. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  193. 193. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  194. 194. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  195. 195. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  196. 196. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  197. 197. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  198. 198. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  199. 199. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  200. 200. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  201. 201. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  202. 202. Pigeonhole Principle Example Theorem ∀n ∃!p [n = 2r p ∧ r ∈ N ∧ ∃t ∈ Z [p = 2t + 1]] Proof of existence. n = 1: r = 0, p = 1 n ≤ k: assume n = 2r p n = k + 1: n = 2 : r = 1, p = 1 n prime (n > 2) : r = 0, p = n ¬(n prime) : n = n1n2 n = 2r1 p1 · 2r2 p2 n = 2r1+r2 · p1p2 Proof of uniqueness. if not unique: n = 2r1 p1 = 2r2 p2 ⇒ 2r1−r2 p1 = p2 ⇒ 2|p2
  203. 203. Pigeonhole Principle Example Theorem S = {1, 2, 3, . . . , 200}, T ⊂ S, |T| = 101 ∃s1, s2 ∈ T [s2|s1] Proof. P = {p | p ∈ S, ∃i ∈ Z [p = 2i + 1]}, |P| = 100 f : S → P, r ∈ N, s = 2r p → f (s) = p |T| = 101 ⇒ at least two elements have the same image in P: f (s1) = f (s2) ⇒ 2r1 p = 2r2 p s1 s2 = 2r1 p 2r2 p = 2r1−r2
  204. 204. Pigeonhole Principle Example Theorem S = {1, 2, 3, . . . , 200}, T ⊂ S, |T| = 101 ∃s1, s2 ∈ T [s2|s1] Proof. P = {p | p ∈ S, ∃i ∈ Z [p = 2i + 1]}, |P| = 100 f : S → P, r ∈ N, s = 2r p → f (s) = p |T| = 101 ⇒ at least two elements have the same image in P: f (s1) = f (s2) ⇒ 2r1 p = 2r2 p s1 s2 = 2r1 p 2r2 p = 2r1−r2
  205. 205. Pigeonhole Principle Example Theorem S = {1, 2, 3, . . . , 200}, T ⊂ S, |T| = 101 ∃s1, s2 ∈ T [s2|s1] Proof. P = {p | p ∈ S, ∃i ∈ Z [p = 2i + 1]}, |P| = 100 f : S → P, r ∈ N, s = 2r p → f (s) = p |T| = 101 ⇒ at least two elements have the same image in P: f (s1) = f (s2) ⇒ 2r1 p = 2r2 p s1 s2 = 2r1 p 2r2 p = 2r1−r2
  206. 206. Pigeonhole Principle Example Theorem S = {1, 2, 3, . . . , 200}, T ⊂ S, |T| = 101 ∃s1, s2 ∈ T [s2|s1] Proof. P = {p | p ∈ S, ∃i ∈ Z [p = 2i + 1]}, |P| = 100 f : S → P, r ∈ N, s = 2r p → f (s) = p |T| = 101 ⇒ at least two elements have the same image in P: f (s1) = f (s2) ⇒ 2r1 p = 2r2 p s1 s2 = 2r1 p 2r2 p = 2r1−r2
  207. 207. Topics 1 Relations Introduction Relation Properties Equivalence Relations 2 Functions Introduction Pigeonhole Principle Recursion
  208. 208. Recursive Functions Definition recursive function: a function defined in terms of itself f (n) = h(f (m)) inductively defined function: a recursive function where the size is reduced at every step f (n) = k if n = 0 h(f (n − 1)) if n > 0
  209. 209. Recursion Examples f 91(n) = n − 10 if n > 100 f 91(f 91(n + 11)) if n ≤ 100 n! = 1 if n = 0 n · (n − 1)! if n > 0
  210. 210. Recursion Examples f 91(n) = n − 10 if n > 100 f 91(f 91(n + 11)) if n ≤ 100 n! = 1 if n = 0 n · (n − 1)! if n > 0
  211. 211. Greatest Common Divisor gcd(a, b) = b if b | a gcd(b, a mod b) if b a gcd(333, 84) = gcd(84, 333 mod 84) = gcd(84, 81) = gcd(81, 84 mod 81) = gcd(81, 3) = 3
  212. 212. Greatest Common Divisor gcd(a, b) = b if b | a gcd(b, a mod b) if b a gcd(333, 84) = gcd(84, 333 mod 84) = gcd(84, 81) = gcd(81, 84 mod 81) = gcd(81, 3) = 3
  213. 213. Fibonacci Sequence Fn = fib(n) =    1 if n = 1 1 if n = 2 fib(n − 2) + fib(n − 1) if n > 2 F1 F2 F3 F4 F5 F6 F7 F8 . . . 1 1 2 3 5 8 13 21 . . .
  214. 214. Fibonacci Sequence Theorem n i=1 Fi 2 = Fn · Fn+1 Proof. n = 2 : 2 i=1 Fi 2 = F1 2 + F2 2 = 1 + 1 = 1 · 2 = F2 · F3 n = k : k i=1 Fi 2 = Fk · Fk+1 n = k + 1 : k+1 i=1 Fi 2 = k i=1 Fi 2 + Fk+1 2 = Fk · Fk+1 + Fk+1 2 = Fk+1 · (Fk + Fk+1) = Fk+1 · Fk+2
  215. 215. Fibonacci Sequence Theorem n i=1 Fi 2 = Fn · Fn+1 Proof. n = 2 : 2 i=1 Fi 2 = F1 2 + F2 2 = 1 + 1 = 1 · 2 = F2 · F3 n = k : k i=1 Fi 2 = Fk · Fk+1 n = k + 1 : k+1 i=1 Fi 2 = k i=1 Fi 2 + Fk+1 2 = Fk · Fk+1 + Fk+1 2 = Fk+1 · (Fk + Fk+1) = Fk+1 · Fk+2
  216. 216. Fibonacci Sequence Theorem n i=1 Fi 2 = Fn · Fn+1 Proof. n = 2 : 2 i=1 Fi 2 = F1 2 + F2 2 = 1 + 1 = 1 · 2 = F2 · F3 n = k : k i=1 Fi 2 = Fk · Fk+1 n = k + 1 : k+1 i=1 Fi 2 = k i=1 Fi 2 + Fk+1 2 = Fk · Fk+1 + Fk+1 2 = Fk+1 · (Fk + Fk+1) = Fk+1 · Fk+2
  217. 217. Fibonacci Sequence Theorem n i=1 Fi 2 = Fn · Fn+1 Proof. n = 2 : 2 i=1 Fi 2 = F1 2 + F2 2 = 1 + 1 = 1 · 2 = F2 · F3 n = k : k i=1 Fi 2 = Fk · Fk+1 n = k + 1 : k+1 i=1 Fi 2 = k i=1 Fi 2 + Fk+1 2 = Fk · Fk+1 + Fk+1 2 = Fk+1 · (Fk + Fk+1) = Fk+1 · Fk+2
  218. 218. Fibonacci Sequence Theorem n i=1 Fi 2 = Fn · Fn+1 Proof. n = 2 : 2 i=1 Fi 2 = F1 2 + F2 2 = 1 + 1 = 1 · 2 = F2 · F3 n = k : k i=1 Fi 2 = Fk · Fk+1 n = k + 1 : k+1 i=1 Fi 2 = k i=1 Fi 2 + Fk+1 2 = Fk · Fk+1 + Fk+1 2 = Fk+1 · (Fk + Fk+1) = Fk+1 · Fk+2
  219. 219. Fibonacci Sequence Theorem n i=1 Fi 2 = Fn · Fn+1 Proof. n = 2 : 2 i=1 Fi 2 = F1 2 + F2 2 = 1 + 1 = 1 · 2 = F2 · F3 n = k : k i=1 Fi 2 = Fk · Fk+1 n = k + 1 : k+1 i=1 Fi 2 = k i=1 Fi 2 + Fk+1 2 = Fk · Fk+1 + Fk+1 2 = Fk+1 · (Fk + Fk+1) = Fk+1 · Fk+2
  220. 220. Fibonacci Sequence Theorem n i=1 Fi 2 = Fn · Fn+1 Proof. n = 2 : 2 i=1 Fi 2 = F1 2 + F2 2 = 1 + 1 = 1 · 2 = F2 · F3 n = k : k i=1 Fi 2 = Fk · Fk+1 n = k + 1 : k+1 i=1 Fi 2 = k i=1 Fi 2 + Fk+1 2 = Fk · Fk+1 + Fk+1 2 = Fk+1 · (Fk + Fk+1) = Fk+1 · Fk+2
  221. 221. Ackermann Function ack(x, y) =    y + 1 if x = 0 ack(x − 1, 1) if y = 0 ack(x − 1, ack(x, y − 1)) if x > 0 ∧ y > 0
  222. 222. References Required Reading: Grimaldi Chapter 5: Relations and Functions 5.2. Functions: Plain and One-to-One 5.3. Onto Functions: Stirling Numbers of the Second Kind 5.5. The Pigeonhole Principle 5.6. Function Composition and Inverse Functions

×