discrete mathematics mathematical reasoning basic
play

Discrete Mathematics & Mathematical Reasoning Basic Structures: - PowerPoint PPT Presentation

Discrete Mathematics & Mathematical Reasoning Basic Structures: Sets, Functions, Relations, Sequences and Sums Colin Stirling Informatics Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 1 / 38 Sets A set is an


  1. A proper mathematical definition of set is complicated (Russell’s paradox) The set of cats is not a cat (is not a member of itself) The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 38

  2. A proper mathematical definition of set is complicated (Russell’s paradox) The set of cats is not a cat (is not a member of itself) The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = { x | x �∈ x } (using naive comprehension) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 38

  3. A proper mathematical definition of set is complicated (Russell’s paradox) The set of cats is not a cat (is not a member of itself) The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = { x | x �∈ x } (using naive comprehension) Question: is S a member of itself ( S ∈ S ) ? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 38

  4. A proper mathematical definition of set is complicated (Russell’s paradox) The set of cats is not a cat (is not a member of itself) The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = { x | x �∈ x } (using naive comprehension) Question: is S a member of itself ( S ∈ S ) ? S ∈ S provided that S �∈ S ; S �∈ S provided that S ∈ S Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 38

  5. A proper mathematical definition of set is complicated (Russell’s paradox) The set of cats is not a cat (is not a member of itself) The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = { x | x �∈ x } (using naive comprehension) Question: is S a member of itself ( S ∈ S ) ? S ∈ S provided that S �∈ S ; S �∈ S provided that S ∈ S There cannot be such a set S Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 38

  6. A proper mathematical definition of set is complicated (Russell’s paradox) The set of cats is not a cat (is not a member of itself) The set of non-cats (all things that are not cats) is a member of itself Let S be the set of all sets which are not members of themselves S = { x | x �∈ x } (using naive comprehension) Question: is S a member of itself ( S ∈ S ) ? S ∈ S provided that S �∈ S ; S �∈ S provided that S ∈ S There cannot be such a set S Modern formulations (such as Zermelo-Fraenkel set theory) restrict comprehension. (However, it is impossible to prove in ZF that ZF is consistent unless ZF is inconsistent.) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 7 / 38

  7. Functions Assume A and B are non-empty sets Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 38

  8. Functions Assume A and B are non-empty sets f is a function from A to B if f assigns to each element of A a unique element of B Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 38

  9. Functions Assume A and B are non-empty sets f is a function from A to B if f assigns to each element of A a unique element of B Write f ( a ) = b if f assigns b to a Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 38

  10. Functions Assume A and B are non-empty sets f is a function from A to B if f assigns to each element of A a unique element of B Write f ( a ) = b if f assigns b to a f : A → B if f is a function from A to B Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 38

  11. Functions Assume A and B are non-empty sets f is a function from A to B if f assigns to each element of A a unique element of B Write f ( a ) = b if f assigns b to a f : A → B if f is a function from A to B If f : A → B , A is the domain and B is codomain (range) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 8 / 38

  12. Examples f : DMMR_Students → Percentages Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 38

  13. Examples f : DMMR_Students → Percentages ι A : A → A where ι A ( a ) = a identity Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 38

  14. Examples f : DMMR_Students → Percentages ι A : A → A where ι A ( a ) = a identity ⌊ x ⌋ : R → Z : floor largest integer less than or equal to x Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 38

  15. Examples f : DMMR_Students → Percentages ι A : A → A where ι A ( a ) = a identity ⌊ x ⌋ : R → Z : floor largest integer less than or equal to x what are ⌊ 1 2 ⌋ ⌊− 6 . 1 ⌋ Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 38

  16. Examples f : DMMR_Students → Percentages ι A : A → A where ι A ( a ) = a identity ⌊ x ⌋ : R → Z : floor largest integer less than or equal to x what are ⌊ 1 2 ⌋ ⌊− 6 . 1 ⌋ ⌈ x ⌉ : R → Z : ceiling smallest integer greater than or equal to x Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 38

  17. Examples f : DMMR_Students → Percentages ι A : A → A where ι A ( a ) = a identity ⌊ x ⌋ : R → Z : floor largest integer less than or equal to x what are ⌊ 1 2 ⌋ ⌊− 6 . 1 ⌋ ⌈ x ⌉ : R → Z : ceiling smallest integer greater than or equal to x what are ⌈ 1 2 ⌉ ⌈− 6 . 1 ⌉ Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 38

  18. Examples f : DMMR_Students → Percentages ι A : A → A where ι A ( a ) = a identity ⌊ x ⌋ : R → Z : floor largest integer less than or equal to x what are ⌊ 1 2 ⌋ ⌊− 6 . 1 ⌋ ⌈ x ⌉ : R → Z : ceiling smallest integer greater than or equal to x what are ⌈ 1 2 ⌉ ⌈− 6 . 1 ⌉ ! : N → N Factorial 0 ! = 1 n ! = 1 · 2 · · · · · ( n − 1 ) · n for n > 0 Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 9 / 38

  19. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  20. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  21. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  22. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Is the function √· : Z + → R + injective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  23. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Is the function √· : Z + → R + injective? YES Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  24. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Is the function √· : Z + → R + injective? YES Is the squaring function · 2 : Z → Z injective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  25. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Is the function √· : Z + → R + injective? YES Is the squaring function · 2 : Z → Z injective? NO Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  26. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Is the function √· : Z + → R + injective? YES Is the squaring function · 2 : Z → Z injective? NO Is the function | · | : R → R injective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  27. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Is the function √· : Z + → R + injective? YES Is the squaring function · 2 : Z → Z injective? NO Is the function | · | : R → R injective? NO Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  28. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Is the function √· : Z + → R + injective? YES Is the squaring function · 2 : Z → Z injective? NO Is the function | · | : R → R injective? NO Assume m > 1. Is mod m : Z → { 0 , . . . , m − 1 } injective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  29. One-to-one or injective functions Definition f : A → B is injective iff ∀ a , c ∈ A (if f ( a ) = f ( c ) then a = c ) Is the identity function ι A : A → A injective? YES Is the function √· : Z + → R + injective? YES Is the squaring function · 2 : Z → Z injective? NO Is the function | · | : R → R injective? NO Assume m > 1. Is mod m : Z → { 0 , . . . , m − 1 } injective? NO Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 10 / 38

  30. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  31. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  32. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  33. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Is the function √· : Z + → R + surjective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  34. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Is the function √· : Z + → R + surjective? NO Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  35. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Is the function √· : Z + → R + surjective? NO Is the function · 2 : Z → Z surjective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  36. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Is the function √· : Z + → R + surjective? NO Is the function · 2 : Z → Z surjective? NO Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  37. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Is the function √· : Z + → R + surjective? NO Is the function · 2 : Z → Z surjective? NO Is the function | · | : R → R surjective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  38. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Is the function √· : Z + → R + surjective? NO Is the function · 2 : Z → Z surjective? NO Is the function | · | : R → R surjective? NO Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  39. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Is the function √· : Z + → R + surjective? NO Is the function · 2 : Z → Z surjective? NO Is the function | · | : R → R surjective? NO Assume m > 1. Is mod m : Z → { 0 , . . . , m − 1 } surjective? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  40. Onto or surjective functions Definition f : A → B is surjective iff ∀ b ∈ B ∃ a ∈ A ( f ( a ) = b ) Is the identity function ι A : A → A surjective? YES Is the function √· : Z + → R + surjective? NO Is the function · 2 : Z → Z surjective? NO Is the function | · | : R → R surjective? NO Assume m > 1. Is mod m : Z → { 0 , . . . , m − 1 } surjective? YES Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 11 / 38

  41. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  42. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Is the identity function ι A : A → A a bijection? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  43. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Is the identity function ι A : A → A a bijection? YES Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  44. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Is the identity function ι A : A → A a bijection? YES Is the function √· : R + → R + a bijection? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  45. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Is the identity function ι A : A → A a bijection? YES Is the function √· : R + → R + a bijection? YES Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  46. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Is the identity function ι A : A → A a bijection? YES Is the function √· : R + → R + a bijection? YES Is the function · 2 : R → R a bijection? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  47. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Is the identity function ι A : A → A a bijection? YES Is the function √· : R + → R + a bijection? YES Is the function · 2 : R → R a bijection? NO Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  48. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Is the identity function ι A : A → A a bijection? YES Is the function √· : R + → R + a bijection? YES Is the function · 2 : R → R a bijection? NO Is the function | · | : R → R a bijection? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  49. One-to-one correspondence or bijection Definition f : A → B is a bijection iff it is both injective and surjective Is the identity function ι A : A → A a bijection? YES Is the function √· : R + → R + a bijection? YES Is the function · 2 : R → R a bijection? NO Is the function | · | : R → R a bijection? NO Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 12 / 38

  50. Function composition Definition Let f : B → C and g : A → B . The composition function f ◦ g : A → C is ( f ◦ g )( a ) = f ( g ( a )) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 13 / 38

  51. Results about function composition Theorem The composition of two functions is a function Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 14 / 38

  52. Results about function composition Theorem The composition of two functions is a function Theorem The composition of two injective functions is an injective function Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 14 / 38

  53. Results about function composition Theorem The composition of two functions is a function Theorem The composition of two injective functions is an injective function Theorem The composition of two surjective functions is a surjective function Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 14 / 38

  54. Results about function composition Theorem The composition of two functions is a function Theorem The composition of two injective functions is an injective function Theorem The composition of two surjective functions is a surjective function Corollary The composition of two bijections is a bijection Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 14 / 38

  55. Inverse function Definition If f : A → B is a bijection, then the inverse of f , written f − 1 : B → A is f − 1 ( b ) = a iff f ( a ) = b Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 15 / 38

  56. Inverse function Definition If f : A → B is a bijection, then the inverse of f , written f − 1 : B → A is f − 1 ( b ) = a iff f ( a ) = b f –1 ( b ) a = f –1 ( b ) b = f ( a ) f ( a ) f –1 A B f 1 Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 15 / 38

  57. Inverse function Definition If f : A → B is a bijection, then the inverse of f , written f − 1 : B → A is f − 1 ( b ) = a iff f ( a ) = b f –1 ( b ) a = f –1 ( b ) b = f ( a ) f ( a ) f –1 A B f 1 What is the inverse of ι A : A → A ? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 15 / 38

  58. Inverse function Definition If f : A → B is a bijection, then the inverse of f , written f − 1 : B → A is f − 1 ( b ) = a iff f ( a ) = b f –1 ( b ) a = f –1 ( b ) b = f ( a ) f ( a ) f –1 A B f 1 What is the inverse of ι A : A → A ? What is the inverse of √· : R + → R + ? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 15 / 38

  59. Inverse function Definition If f : A → B is a bijection, then the inverse of f , written f − 1 : B → A is f − 1 ( b ) = a iff f ( a ) = b f –1 ( b ) a = f –1 ( b ) b = f ( a ) f ( a ) f –1 A B f 1 What is the inverse of ι A : A → A ? What is the inverse of √· : R + → R + ? What is f − 1 ◦ f ? and f ◦ f − 1 ? Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 15 / 38

  60. Relations Definition A binary relation R on sets A and B is a subset R ⊆ A × B Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 16 / 38

  61. Relations Definition A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples ( a , b ) with a ∈ A and b ∈ B Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 16 / 38

  62. Relations Definition A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples ( a , b ) with a ∈ A and b ∈ B Often we write a R b for ( a , b ) ∈ R Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 16 / 38

  63. Relations Definition A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples ( a , b ) with a ∈ A and b ∈ B Often we write a R b for ( a , b ) ∈ R A function f is a restricted relation where ∀ a ∈ A ∃ b ∈ B ((( a , b ) ∈ f ) ∧ ∀ c ∈ B (( a , c ) ∈ f → c = b )) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 16 / 38

  64. Relations Definition A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples ( a , b ) with a ∈ A and b ∈ B Often we write a R b for ( a , b ) ∈ R A function f is a restricted relation where ∀ a ∈ A ∃ b ∈ B ((( a , b ) ∈ f ) ∧ ∀ c ∈ B (( a , c ) ∈ f → c = b )) R is a relation on A if B = A (so, R ⊆ A × A ) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 16 / 38

  65. Relations Definition A binary relation R on sets A and B is a subset R ⊆ A × B R is a set of tuples ( a , b ) with a ∈ A and b ∈ B Often we write a R b for ( a , b ) ∈ R A function f is a restricted relation where ∀ a ∈ A ∃ b ∈ B ((( a , b ) ∈ f ) ∧ ∀ c ∈ B (( a , c ) ∈ f → c = b )) R is a relation on A if B = A (so, R ⊆ A × A ) Colin Stirling (Informatics) Discrete Mathematics (Chaps 2 & 9) Today 16 / 38

Recommend


More recommend