functions

Functions Aritra Hazra Department of Computer Science and - PowerPoint PPT Presentation

Functions Aritra Hazra Department of Computer Science and Engineering, Indian Institute of Technology Kharagpur, Paschim Medinipur, West Bengal, India - 721302. Email: aritrah@cse.iitkgp.ac.in Autumn 2020 Aritra Hazra (CSE, IITKGP) CS21001 :


  1. Properties of Functions Number of Functions: Let A = { a 1 , . . . , a m } ( |A| = m ) and B = { b 1 , . . . , b n } ( |B| = n ). f : A β†’ B is described as, { ( a 1 , x 1 ) , ( a 2 , x 2 ) , . . . , ( a m , x m ) } . So, Total Count = n m = |B| |A| (by rule-of-product). Image of Subset: If f : A β†’ B and A β€² βŠ† A , then f ( A β€² ) = { b ∈ B | b = f ( a ) } (for some a ∈ A β€² ), and f ( A β€² ) is called the image of A β€² under f . Restriction: If f : A β†’ B and A β€² βŠ† A , then f | A β€² : A β€² β†’ B is called the restriction of f to A β€² if f | A β€² ( a ) = f ( a ) for all a ∈ A β€² . Extension: Let A β€² βŠ† A and f : A β€² β†’ B . If g : A β†’ B and g ( a ) = f ( a ) for all a ∈ A β€² , then g is called an extension of f to A . Let f : A β†’ B , with A 1 , A 2 βŠ† A . Then, (i) If A 1 βŠ‚ A 2 β‡’ f ( A 1 ) βŠ† f ( A 2 ), (ii) f ( A 1 βˆͺ A 2 ) = f ( A 1 ) βˆͺ f ( A 2 ), and (iii) f ( A 1 ∩ A 2 ) βŠ† f ( A 1 ) ∩ f ( A 2 ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 3 / 17

  2. Properties of Functions Number of Functions: Let A = { a 1 , . . . , a m } ( |A| = m ) and B = { b 1 , . . . , b n } ( |B| = n ). f : A β†’ B is described as, { ( a 1 , x 1 ) , ( a 2 , x 2 ) , . . . , ( a m , x m ) } . So, Total Count = n m = |B| |A| (by rule-of-product). Image of Subset: If f : A β†’ B and A β€² βŠ† A , then f ( A β€² ) = { b ∈ B | b = f ( a ) } (for some a ∈ A β€² ), and f ( A β€² ) is called the image of A β€² under f . Restriction: If f : A β†’ B and A β€² βŠ† A , then f | A β€² : A β€² β†’ B is called the restriction of f to A β€² if f | A β€² ( a ) = f ( a ) for all a ∈ A β€² . Extension: Let A β€² βŠ† A and f : A β€² β†’ B . If g : A β†’ B and g ( a ) = f ( a ) for all a ∈ A β€² , then g is called an extension of f to A . Let f : A β†’ B , with A 1 , A 2 βŠ† A . Then, (i) If A 1 βŠ‚ A 2 β‡’ f ( A 1 ) βŠ† f ( A 2 ), (ii) f ( A 1 βˆͺ A 2 ) = f ( A 1 ) βˆͺ f ( A 2 ), and (iii) f ( A 1 ∩ A 2 ) βŠ† f ( A 1 ) ∩ f ( A 2 ). Proof: (ii) For each b ∈ B , b ∈ f ( A 1 ∩ A 2 ) β‡’ b = f ( a ), for some a ∈ ( A 1 ∩ A 2 ) β‡’ [ b = f ( a ) for some a ∈ A 1 ] ∧ [ b = f ( a ) for some a ∈ A 2 ] β‡’ b ∈ f ( A 1 ) ∧ b ∈ f ( A 2 ) β‡’ b ∈ f ( A 1 ) ∩ f ( A 2 ), implying the result. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 3 / 17

  3. Properties of Functions Number of Functions: Let A = { a 1 , . . . , a m } ( |A| = m ) and B = { b 1 , . . . , b n } ( |B| = n ). f : A β†’ B is described as, { ( a 1 , x 1 ) , ( a 2 , x 2 ) , . . . , ( a m , x m ) } . So, Total Count = n m = |B| |A| (by rule-of-product). Image of Subset: If f : A β†’ B and A β€² βŠ† A , then f ( A β€² ) = { b ∈ B | b = f ( a ) } (for some a ∈ A β€² ), and f ( A β€² ) is called the image of A β€² under f . Restriction: If f : A β†’ B and A β€² βŠ† A , then f | A β€² : A β€² β†’ B is called the restriction of f to A β€² if f | A β€² ( a ) = f ( a ) for all a ∈ A β€² . Extension: Let A β€² βŠ† A and f : A β€² β†’ B . If g : A β†’ B and g ( a ) = f ( a ) for all a ∈ A β€² , then g is called an extension of f to A . Let f : A β†’ B , with A 1 , A 2 βŠ† A . Then, (i) If A 1 βŠ‚ A 2 β‡’ f ( A 1 ) βŠ† f ( A 2 ), (ii) f ( A 1 βˆͺ A 2 ) = f ( A 1 ) βˆͺ f ( A 2 ), and (iii) f ( A 1 ∩ A 2 ) βŠ† f ( A 1 ) ∩ f ( A 2 ). Proof: (ii) For each b ∈ B , b ∈ f ( A 1 ∩ A 2 ) β‡’ b = f ( a ), for some a ∈ ( A 1 ∩ A 2 ) β‡’ [ b = f ( a ) for some a ∈ A 1 ] ∧ [ b = f ( a ) for some a ∈ A 2 ] β‡’ b ∈ f ( A 1 ) ∧ b ∈ f ( A 2 ) β‡’ b ∈ f ( A 1 ) ∩ f ( A 2 ), implying the result. (i) and (ii) Left for You as an Exercise! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 3 / 17

  4. One-to-One or Injective Functions One-to-one (Injective) Function: f : A β†’ B is a one-to-one (or injective) function, if each element in B appears at most once as image of an element of A . For arbitrary sets A , B , f : A β†’ B is one-to-one if and only if βˆ€ a 1 , a 2 ∈ A , f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 4 / 17

  5. One-to-One or Injective Functions One-to-one (Injective) Function: f : A β†’ B is a one-to-one (or injective) function, if each element in B appears at most once as image of an element of A . For arbitrary sets A , B , f : A β†’ B is one-to-one if and only if βˆ€ a 1 , a 2 ∈ A , f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 . If f : A β†’ B is one-to-one with A , B finite, then |A| ≀ |B| . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 4 / 17

  6. One-to-One or Injective Functions One-to-one (Injective) Function: f : A β†’ B is a one-to-one (or injective) function, if each element in B appears at most once as image of an element of A . For arbitrary sets A , B , f : A β†’ B is one-to-one if and only if βˆ€ a 1 , a 2 ∈ A , f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 . If f : A β†’ B is one-to-one with A , B finite, then |A| ≀ |B| . Examples: (i) f : R β†’ R where f ( x ) = 2 x + 1 , βˆ€ x ∈ R is one-to-one; because for all x 1 , x 2 ∈ R , we have f ( x 1 ) = f ( x 2 ) β‡’ 2 x 1 + 1 = 2 x 2 + 1 β‡’ x 1 = x 2 . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 4 / 17

  7. One-to-One or Injective Functions One-to-one (Injective) Function: f : A β†’ B is a one-to-one (or injective) function, if each element in B appears at most once as image of an element of A . For arbitrary sets A , B , f : A β†’ B is one-to-one if and only if βˆ€ a 1 , a 2 ∈ A , f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 . If f : A β†’ B is one-to-one with A , B finite, then |A| ≀ |B| . Examples: (i) f : R β†’ R where f ( x ) = 2 x + 1 , βˆ€ x ∈ R is one-to-one; because for all x 1 , x 2 ∈ R , we have f ( x 1 ) = f ( x 2 ) β‡’ 2 x 1 + 1 = 2 x 2 + 1 β‡’ x 1 = x 2 . (ii) g : R β†’ R where g ( x ) = x 2 + x , βˆ€ x ∈ R is NOT one-to-one; because g ( βˆ’ 1) = 0 and g (0) = 0. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 4 / 17

  8. One-to-One or Injective Functions One-to-one (Injective) Function: f : A β†’ B is a one-to-one (or injective) function, if each element in B appears at most once as image of an element of A . For arbitrary sets A , B , f : A β†’ B is one-to-one if and only if βˆ€ a 1 , a 2 ∈ A , f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 . If f : A β†’ B is one-to-one with A , B finite, then |A| ≀ |B| . Examples: (i) f : R β†’ R where f ( x ) = 2 x + 1 , βˆ€ x ∈ R is one-to-one; because for all x 1 , x 2 ∈ R , we have f ( x 1 ) = f ( x 2 ) β‡’ 2 x 1 + 1 = 2 x 2 + 1 β‡’ x 1 = x 2 . (ii) g : R β†’ R where g ( x ) = x 2 + x , βˆ€ x ∈ R is NOT one-to-one; because g ( βˆ’ 1) = 0 and g (0) = 0. Number of Injective Functions: Let A = { a 1 , . . . , a m } ( |A| = m ) and B = { b 1 , . . . , b n } ( |B| = n ) ( m ≀ n ). f : A β†’ B is described as, { ( a 1 , x 1 ) , ( a 2 , x 2 ) , . . . , ( a m , x m ) } . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 4 / 17

  9. One-to-One or Injective Functions One-to-one (Injective) Function: f : A β†’ B is a one-to-one (or injective) function, if each element in B appears at most once as image of an element of A . For arbitrary sets A , B , f : A β†’ B is one-to-one if and only if βˆ€ a 1 , a 2 ∈ A , f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 . If f : A β†’ B is one-to-one with A , B finite, then |A| ≀ |B| . Examples: (i) f : R β†’ R where f ( x ) = 2 x + 1 , βˆ€ x ∈ R is one-to-one; because for all x 1 , x 2 ∈ R , we have f ( x 1 ) = f ( x 2 ) β‡’ 2 x 1 + 1 = 2 x 2 + 1 β‡’ x 1 = x 2 . (ii) g : R β†’ R where g ( x ) = x 2 + x , βˆ€ x ∈ R is NOT one-to-one; because g ( βˆ’ 1) = 0 and g (0) = 0. Number of Injective Functions: Let A = { a 1 , . . . , a m } ( |A| = m ) and B = { b 1 , . . . , b n } ( |B| = n ) ( m ≀ n ). f : A β†’ B is described as, { ( a 1 , x 1 ) , ( a 2 , x 2 ) , . . . , ( a m , x m ) } . n ! So, Total Count = n ( n βˆ’ 1) Β· Β· Β· ( n βˆ’ m + 1) = ( n βˆ’ m )! = P ( |B| , |A| ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 4 / 17

  10. One-to-One or Injective Functions One-to-one (Injective) Function: f : A β†’ B is a one-to-one (or injective) function, if each element in B appears at most once as image of an element of A . For arbitrary sets A , B , f : A β†’ B is one-to-one if and only if βˆ€ a 1 , a 2 ∈ A , f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 . If f : A β†’ B is one-to-one with A , B finite, then |A| ≀ |B| . Examples: (i) f : R β†’ R where f ( x ) = 2 x + 1 , βˆ€ x ∈ R is one-to-one; because for all x 1 , x 2 ∈ R , we have f ( x 1 ) = f ( x 2 ) β‡’ 2 x 1 + 1 = 2 x 2 + 1 β‡’ x 1 = x 2 . (ii) g : R β†’ R where g ( x ) = x 2 + x , βˆ€ x ∈ R is NOT one-to-one; because g ( βˆ’ 1) = 0 and g (0) = 0. Number of Injective Functions: Let A = { a 1 , . . . , a m } ( |A| = m ) and B = { b 1 , . . . , b n } ( |B| = n ) ( m ≀ n ). f : A β†’ B is described as, { ( a 1 , x 1 ) , ( a 2 , x 2 ) , . . . , ( a m , x m ) } . n ! So, Total Count = n ( n βˆ’ 1) Β· Β· Β· ( n βˆ’ m + 1) = ( n βˆ’ m )! = P ( |B| , |A| ). f : A β†’ B , with A 1 , A 2 βŠ† A . Then, f ( A 1 ∩ A 2 ) = f ( A 1 ) ∩ f ( A 2 ), if f is one-to-one. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 4 / 17

  11. Onto or Surjective Functions Onto (Surjective) Function: f : A β†’ B is a onto (or surjective) function, if f ( A ) = B , i.e. for all b ∈ B there is at least one a ∈ A with f ( a ) = b . For arbitrary sets A , B , f : A β†’ B is onto if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 5 / 17

  12. Onto or Surjective Functions Onto (Surjective) Function: f : A β†’ B is a onto (or surjective) function, if f ( A ) = B , i.e. for all b ∈ B there is at least one a ∈ A with f ( a ) = b . For arbitrary sets A , B , f : A β†’ B is onto if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b . If f : A β†’ B is onto with A , B finite, then |A| β‰₯ |B| . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 5 / 17

  13. Onto or Surjective Functions Onto (Surjective) Function: f : A β†’ B is a onto (or surjective) function, if f ( A ) = B , i.e. for all b ∈ B there is at least one a ∈ A with f ( a ) = b . For arbitrary sets A , B , f : A β†’ B is onto if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b . If f : A β†’ B is onto with A , B finite, then |A| β‰₯ |B| . Examples: (i) f : R β†’ R where f ( x ) = x 3 + 1 , βˆ€ x ∈ R is onto; √ y βˆ’ 1. because for each y = x 3 + 1 ∈ R , there is an x = 3 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 5 / 17

  14. Onto or Surjective Functions Onto (Surjective) Function: f : A β†’ B is a onto (or surjective) function, if f ( A ) = B , i.e. for all b ∈ B there is at least one a ∈ A with f ( a ) = b . For arbitrary sets A , B , f : A β†’ B is onto if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b . If f : A β†’ B is onto with A , B finite, then |A| β‰₯ |B| . Examples: (i) f : R β†’ R where f ( x ) = x 3 + 1 , βˆ€ x ∈ R is onto; √ y βˆ’ 1. because for each y = x 3 + 1 ∈ R , there is an x = 3 (ii) f : R β†’ R where f ( x ) = x 2 , βˆ€ x ∈ R is NOT onto; because for an y = βˆ’ 4 ∈ R , we get x = √ y = 2 i or βˆ’ 2 i �∈ R . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 5 / 17

  15. Onto or Surjective Functions Onto (Surjective) Function: f : A β†’ B is a onto (or surjective) function, if f ( A ) = B , i.e. for all b ∈ B there is at least one a ∈ A with f ( a ) = b . For arbitrary sets A , B , f : A β†’ B is onto if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b . If f : A β†’ B is onto with A , B finite, then |A| β‰₯ |B| . Examples: (i) f : R β†’ R where f ( x ) = x 3 + 1 , βˆ€ x ∈ R is onto; √ y βˆ’ 1. because for each y = x 3 + 1 ∈ R , there is an x = 3 (ii) f : R β†’ R where f ( x ) = x 2 , βˆ€ x ∈ R is NOT onto; because for an y = βˆ’ 4 ∈ R , we get x = √ y = 2 i or βˆ’ 2 i �∈ R . Number of Onto Functions: Counting is non-trivial and will be addressed later! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 5 / 17

  16. Onto or Surjective Functions Onto (Surjective) Function: f : A β†’ B is a onto (or surjective) function, if f ( A ) = B , i.e. for all b ∈ B there is at least one a ∈ A with f ( a ) = b . For arbitrary sets A , B , f : A β†’ B is onto if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b . If f : A β†’ B is onto with A , B finite, then |A| β‰₯ |B| . Examples: (i) f : R β†’ R where f ( x ) = x 3 + 1 , βˆ€ x ∈ R is onto; √ y βˆ’ 1. because for each y = x 3 + 1 ∈ R , there is an x = 3 (ii) f : R β†’ R where f ( x ) = x 2 , βˆ€ x ∈ R is NOT onto; because for an y = βˆ’ 4 ∈ R , we get x = √ y = 2 i or βˆ’ 2 i �∈ R . Number of Onto Functions: Counting is non-trivial and will be addressed later! One-to-one & Onto (Bijective) Function: f : A β†’ B is bijective if it is both one-to-one (injective) and onto (surjective). For arbitrary sets A , B , f : A β†’ B is bijective if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b and βˆ€ a β€² ( οΏ½ = a ) ∈ A , f ( a β€² ) οΏ½ = b . If f : A β†’ B is bijective with A , B finite, then |A| = |B| . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 5 / 17

  17. Onto or Surjective Functions Onto (Surjective) Function: f : A β†’ B is a onto (or surjective) function, if f ( A ) = B , i.e. for all b ∈ B there is at least one a ∈ A with f ( a ) = b . Oneβˆ’toβˆ’one and Onto For arbitrary sets A , B , f : A β†’ B is onto if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b . If f : A β†’ B is onto with A , B finite, then |A| β‰₯ |B| . Examples: (i) f : R β†’ R where f ( x ) = x 3 + 1 , βˆ€ x ∈ R is onto; Oneβˆ’toβˆ’one, √ y βˆ’ 1. because for each y = x 3 + 1 ∈ R , there is an x = but not Onto 3 (ii) f : R β†’ R where f ( x ) = x 2 , βˆ€ x ∈ R is NOT onto; because for an y = βˆ’ 4 ∈ R , we get x = √ y = 2 i or βˆ’ 2 i �∈ R . Onto, but not Oneβˆ’toβˆ’one Number of Onto Functions: Counting is non-trivial and will be addressed later! One-to-one & Onto (Bijective) Function: f : A β†’ B is bijective if it is both one-to-one (injective) and onto (surjective). Neither Oneβˆ’toβˆ’one, nor Onto For arbitrary sets A , B , f : A β†’ B is bijective if and only if βˆ€ b ∈ B , βˆƒ a ∈ A , so that f ( a ) = b and βˆ€ a β€² ( οΏ½ = a ) ∈ A , f ( a β€² ) οΏ½ = b . If f : A β†’ B is bijective with A , B finite, then |A| = |B| . Not a Function (but a Relation) Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 5 / 17

  18. (Binary) Operations and Properties Definition Binary Operation: For non-empty sets, A , B , any function f : A Γ— A β†’ B is called a binary operation on A . If B βŠ† A then the binary operation is closed on (Count: |B| |A| 2 ) A (also A is closed under f ). Unary Operation: A function g : A β†’ A is called unary (or monary) operation on A . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 6 / 17

  19. (Binary) Operations and Properties Definition Binary Operation: For non-empty sets, A , B , any function f : A Γ— A β†’ B is called a binary operation on A . If B βŠ† A then the binary operation is closed on (Count: |B| |A| 2 ) A (also A is closed under f ). Unary Operation: A function g : A β†’ A is called unary (or monary) operation on A . Properties: Let f : A Γ— A β†’ B is a binary operation. Commutativity: If βˆ€ ( x , y ) ∈ A Γ— A , f ( x , y ) = f ( y , x ) then f is commutative. Associativity: If f is closed and βˆ€ x , y , z ∈ A , f ( f ( x , y ) , z ) = f ( x , f ( y , z )), then f is associative. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 6 / 17

  20. (Binary) Operations and Properties Definition Binary Operation: For non-empty sets, A , B , any function f : A Γ— A β†’ B is called a binary operation on A . If B βŠ† A then the binary operation is closed on (Count: |B| |A| 2 ) A (also A is closed under f ). Unary Operation: A function g : A β†’ A is called unary (or monary) operation on A . Properties: Let f : A Γ— A β†’ B is a binary operation. Commutativity: If βˆ€ ( x , y ) ∈ A Γ— A , f ( x , y ) = f ( y , x ) then f is commutative. Associativity: If f is closed and βˆ€ x , y , z ∈ A , f ( f ( x , y ) , z ) = f ( x , f ( y , z )), then f is associative. Example g : Z + Γ— Z + β†’ Z defined as g ( x , y ) = x βˆ’ y , is a binary operation on Z which is 1 NOT closed as g (1 , 2) = βˆ’ 1 �∈ Z + , though 1 , 2 ∈ Z + . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 6 / 17

  21. (Binary) Operations and Properties Definition Binary Operation: For non-empty sets, A , B , any function f : A Γ— A β†’ B is called a binary operation on A . If B βŠ† A then the binary operation is closed on (Count: |B| |A| 2 ) A (also A is closed under f ). Unary Operation: A function g : A β†’ A is called unary (or monary) operation on A . Properties: Let f : A Γ— A β†’ B is a binary operation. Commutativity: If βˆ€ ( x , y ) ∈ A Γ— A , f ( x , y ) = f ( y , x ) then f is commutative. Associativity: If f is closed and βˆ€ x , y , z ∈ A , f ( f ( x , y ) , z ) = f ( x , f ( y , z )), then f is associative. Example g : Z + Γ— Z + β†’ Z defined as g ( x , y ) = x βˆ’ y , is a binary operation on Z which is 1 NOT closed as g (1 , 2) = βˆ’ 1 �∈ Z + , though 1 , 2 ∈ Z + . h : R + β†’ R + defined as h ( x ) = 1 x is an unary operation on R + . 2 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 6 / 17

  22. (Binary) Operations and Properties Definition Binary Operation: For non-empty sets, A , B , any function f : A Γ— A β†’ B is called a binary operation on A . If B βŠ† A then the binary operation is closed on (Count: |B| |A| 2 ) A (also A is closed under f ). Unary Operation: A function g : A β†’ A is called unary (or monary) operation on A . Properties: Let f : A Γ— A β†’ B is a binary operation. Commutativity: If βˆ€ ( x , y ) ∈ A Γ— A , f ( x , y ) = f ( y , x ) then f is commutative. Associativity: If f is closed and βˆ€ x , y , z ∈ A , f ( f ( x , y ) , z ) = f ( x , f ( y , z )), then f is associative. Example g : Z + Γ— Z + β†’ Z defined as g ( x , y ) = x βˆ’ y , is a binary operation on Z which is 1 NOT closed as g (1 , 2) = βˆ’ 1 �∈ Z + , though 1 , 2 ∈ Z + . h : R + β†’ R + defined as h ( x ) = 1 x is an unary operation on R + . 2 f : Z Γ— Z β†’ Z defined as f ( x , y ) = x βˆ’ y , is a closed binary operation on Z which 3 is neither commutative nor associative. (Why?) Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 6 / 17

  23. (Binary) Operations and Properties Definition Binary Operation: For non-empty sets, A , B , any function f : A Γ— A β†’ B is called a binary operation on A . If B βŠ† A then the binary operation is closed on (Count: |B| |A| 2 ) A (also A is closed under f ). Unary Operation: A function g : A β†’ A is called unary (or monary) operation on A . Properties: Let f : A Γ— A β†’ B is a binary operation. Commutativity: If βˆ€ ( x , y ) ∈ A Γ— A , f ( x , y ) = f ( y , x ) then f is commutative. Associativity: If f is closed and βˆ€ x , y , z ∈ A , f ( f ( x , y ) , z ) = f ( x , f ( y , z )), then f is associative. Example g : Z + Γ— Z + β†’ Z defined as g ( x , y ) = x βˆ’ y , is a binary operation on Z which is 1 NOT closed as g (1 , 2) = βˆ’ 1 �∈ Z + , though 1 , 2 ∈ Z + . h : R + β†’ R + defined as h ( x ) = 1 x is an unary operation on R + . 2 f : Z Γ— Z β†’ Z defined as f ( x , y ) = x βˆ’ y , is a closed binary operation on Z which 3 is neither commutative nor associative. (Why?) f : Z Γ— Z β†’ Z defined as f ( a , b ) = a + b βˆ’ ab is both commutative and associative. 4 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 6 / 17

  24. More Properties of Binary Operation Properties: Let f : A Γ— A β†’ B is a binary operation. Identity: x ∈ A is an identity (or identity element) for f if f ( a , x ) = f ( x , a ) = a , βˆ€ a ∈ A . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 7 / 17

  25. More Properties of Binary Operation Properties: Let f : A Γ— A β†’ B is a binary operation. Identity: x ∈ A is an identity (or identity element) for f if f ( a , x ) = f ( x , a ) = a , βˆ€ a ∈ A . Property: If f has an identity, then that identity is unique . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 7 / 17

  26. More Properties of Binary Operation Properties: Let f : A Γ— A β†’ B is a binary operation. Identity: x ∈ A is an identity (or identity element) for f if f ( a , x ) = f ( x , a ) = a , βˆ€ a ∈ A . Property: If f has an identity, then that identity is unique . ( Proof: Let two identities, x 1 , x 2 ∈ A . Then, by definition f ( x 1 , x 2 ) = x 1 = f ( x 2 , x 1 ) = x 2 , leading to contradiction!) Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 7 / 17

  27. More Properties of Binary Operation Properties: Let f : A Γ— A β†’ B is a binary operation. Identity: x ∈ A is an identity (or identity element) for f if f ( a , x ) = f ( x , a ) = a , βˆ€ a ∈ A . Property: If f has an identity, then that identity is unique . ( Proof: Let two identities, x 1 , x 2 ∈ A . Then, by definition f ( x 1 , x 2 ) = x 1 = f ( x 2 , x 1 ) = x 2 , leading to contradiction!) Example: f : Z Γ— Z β†’ Z defined as f ( a , b ) = a + b βˆ’ ab has 0 as the unique identity, because f ( a , 0) = a + 0 + a . 0 = a = 0 + a + 0 . a = f (0 , a ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 7 / 17

  28. More Properties of Binary Operation Properties: Let f : A Γ— A β†’ B is a binary operation. Identity: x ∈ A is an identity (or identity element) for f if f ( a , x ) = f ( x , a ) = a , βˆ€ a ∈ A . Property: If f has an identity, then that identity is unique . ( Proof: Let two identities, x 1 , x 2 ∈ A . Then, by definition f ( x 1 , x 2 ) = x 1 = f ( x 2 , x 1 ) = x 2 , leading to contradiction!) Example: f : Z Γ— Z β†’ Z defined as f ( a , b ) = a + b βˆ’ ab has 0 as the unique identity, because f ( a , 0) = a + 0 + a . 0 = a = 0 + a + 0 . a = f (0 , a ). Projection: For sets A , B , if C βŠ† A Γ— B , then – (i) Ο€ A : C β†’ A defined by Ο€ A ( a , b ) = a , is called the projection on the first coordinate. (ii) Ο€ B : C β†’ B defined by Ο€ B ( a , b ) = b , is called the projection on the second coordinate. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 7 / 17

  29. More Properties of Binary Operation Properties: Let f : A Γ— A β†’ B is a binary operation. Identity: x ∈ A is an identity (or identity element) for f if f ( a , x ) = f ( x , a ) = a , βˆ€ a ∈ A . Property: If f has an identity, then that identity is unique . ( Proof: Let two identities, x 1 , x 2 ∈ A . Then, by definition f ( x 1 , x 2 ) = x 1 = f ( x 2 , x 1 ) = x 2 , leading to contradiction!) Example: f : Z Γ— Z β†’ Z defined as f ( a , b ) = a + b βˆ’ ab has 0 as the unique identity, because f ( a , 0) = a + 0 + a . 0 = a = 0 + a + 0 . a = f (0 , a ). Projection: For sets A , B , if C βŠ† A Γ— B , then – (i) Ο€ A : C β†’ A defined by Ο€ A ( a , b ) = a , is called the projection on the first coordinate. (ii) Ο€ B : C β†’ B defined by Ο€ B ( a , b ) = b , is called the projection on the second coordinate. Property: If C = A Γ— B , then Ο€ A and Ο€ B both are onto functions. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 7 / 17

  30. More Properties of Binary Operation Properties: Let f : A Γ— A β†’ B is a binary operation. Identity: x ∈ A is an identity (or identity element) for f if f ( a , x ) = f ( x , a ) = a , βˆ€ a ∈ A . Property: If f has an identity, then that identity is unique . ( Proof: Let two identities, x 1 , x 2 ∈ A . Then, by definition f ( x 1 , x 2 ) = x 1 = f ( x 2 , x 1 ) = x 2 , leading to contradiction!) Example: f : Z Γ— Z β†’ Z defined as f ( a , b ) = a + b βˆ’ ab has 0 as the unique identity, because f ( a , 0) = a + 0 + a . 0 = a = 0 + a + 0 . a = f (0 , a ). Projection: For sets A , B , if C βŠ† A Γ— B , then – (i) Ο€ A : C β†’ A defined by Ο€ A ( a , b ) = a , is called the projection on the first coordinate. (ii) Ο€ B : C β†’ B defined by Ο€ B ( a , b ) = b , is called the projection on the second coordinate. Property: If C = A Γ— B , then Ο€ A and Ο€ B both are onto functions. Example: Let A = B = R and C βŠ† A Γ— B where C = { ( x , y ) | y = x 2 , x , y ∈ R } representing the Euclidean plane that contains points on the parabola y = x 2 . Here, Ο€ A (3 , 9) = 3 and Ο€ B (3 , 9) = 9. Note that, Ο€ A ( C ) = R and hence Ο€ A is onto (and one-to-one as well). Whereas, Ο€ B ( C ) = [0 , + ∞ ] βŠ‚ R and hence Ο€ B is NOT onto (nor it is one-to-one as Ο€ B (2 , 4) = 4 = Ο€ B ( βˆ’ 2 , 4)). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 7 / 17

  31. Equal, Identity and Composite Functions Identity Function: The function, 1 A : A β†’ A defined by 1 A ( a ) = a ( βˆ€ a ∈ A ), is called the identity function for A . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 8 / 17

  32. Equal, Identity and Composite Functions Identity Function: The function, 1 A : A β†’ A defined by 1 A ( a ) = a ( βˆ€ a ∈ A ), is called the identity function for A . Equal Functions: Two functions f , g : A β†’ B are said to be equal (denoted as f = g ) if f ( a ) = g ( a ) , βˆ€ a ∈ A . Note : Domain and Codomain of f , g must also be the same! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 8 / 17

  33. Equal, Identity and Composite Functions Identity Function: The function, 1 A : A β†’ A defined by 1 A ( a ) = a ( βˆ€ a ∈ A ), is called the identity function for A . Equal Functions: Two functions f , g : A β†’ B are said to be equal (denoted as f = g ) if f ( a ) = g ( a ) , βˆ€ a ∈ A . Note : Domain and Codomain of f , g must also be the same! οΏ½ x , if x ∈ Z Example: f , g : R β†’ Z are defined as, f ( x ) = and ⌊ x βŒ‹ + 1 , if x ∈ R βˆ’ Z g ( x ) = ⌈ x βŒ‰ , then f ( x ) = g ( x ) for every x ∈ R (Why?). So, f = g . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 8 / 17

  34. Equal, Identity and Composite Functions Identity Function: The function, 1 A : A β†’ A defined by 1 A ( a ) = a ( βˆ€ a ∈ A ), is called the identity function for A . Equal Functions: Two functions f , g : A β†’ B are said to be equal (denoted as f = g ) if f ( a ) = g ( a ) , βˆ€ a ∈ A . Note : Domain and Codomain of f , g must also be the same! οΏ½ x , if x ∈ Z Example: f , g : R β†’ Z are defined as, f ( x ) = and ⌊ x βŒ‹ + 1 , if x ∈ R βˆ’ Z g ( x ) = ⌈ x βŒ‰ , then f ( x ) = g ( x ) for every x ∈ R (Why?). So, f = g . Composite Function: If f : A β†’ B and g : B β†’ C , we define the composite function, g β—¦ f : A β†’ C by ( g β—¦ f )( a ) = g ( f ( a )) , βˆ€ a ∈ A . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 8 / 17

  35. Equal, Identity and Composite Functions Identity Function: The function, 1 A : A β†’ A defined by 1 A ( a ) = a ( βˆ€ a ∈ A ), is called the identity function for A . Equal Functions: Two functions f , g : A β†’ B are said to be equal (denoted as f = g ) if f ( a ) = g ( a ) , βˆ€ a ∈ A . Note : Domain and Codomain of f , g must also be the same! οΏ½ x , if x ∈ Z Example: f , g : R β†’ Z are defined as, f ( x ) = and ⌊ x βŒ‹ + 1 , if x ∈ R βˆ’ Z g ( x ) = ⌈ x βŒ‰ , then f ( x ) = g ( x ) for every x ∈ R (Why?). So, f = g . Composite Function: If f : A β†’ B and g : B β†’ C , we define the composite function, g β—¦ f : A β†’ C by ( g β—¦ f )( a ) = g ( f ( a )) , βˆ€ a ∈ A . Range of f βŠ† Domain of g – sufficient for Function Composition! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 8 / 17

  36. Equal, Identity and Composite Functions Identity Function: The function, 1 A : A β†’ A defined by 1 A ( a ) = a ( βˆ€ a ∈ A ), is called the identity function for A . Equal Functions: Two functions f , g : A β†’ B are said to be equal (denoted as f = g ) if f ( a ) = g ( a ) , βˆ€ a ∈ A . Note : Domain and Codomain of f , g must also be the same! οΏ½ x , if x ∈ Z Example: f , g : R β†’ Z are defined as, f ( x ) = and ⌊ x βŒ‹ + 1 , if x ∈ R βˆ’ Z g ( x ) = ⌈ x βŒ‰ , then f ( x ) = g ( x ) for every x ∈ R (Why?). So, f = g . Composite Function: If f : A β†’ B and g : B β†’ C , we define the composite function, g β—¦ f : A β†’ C by ( g β—¦ f )( a ) = g ( f ( a )) , βˆ€ a ∈ A . Range of f βŠ† Domain of g – sufficient for Function Composition! For two identity functions 1 A : A β†’ A and 1 B : B β†’ B , f β—¦ 1 A = f = 1 B β—¦ f . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 8 / 17

  37. Equal, Identity and Composite Functions Identity Function: The function, 1 A : A β†’ A defined by 1 A ( a ) = a ( βˆ€ a ∈ A ), is called the identity function for A . Equal Functions: Two functions f , g : A β†’ B are said to be equal (denoted as f = g ) if f ( a ) = g ( a ) , βˆ€ a ∈ A . Note : Domain and Codomain of f , g must also be the same! οΏ½ x , if x ∈ Z Example: f , g : R β†’ Z are defined as, f ( x ) = and ⌊ x βŒ‹ + 1 , if x ∈ R βˆ’ Z g ( x ) = ⌈ x βŒ‰ , then f ( x ) = g ( x ) for every x ∈ R (Why?). So, f = g . Composite Function: If f : A β†’ B and g : B β†’ C , we define the composite function, g β—¦ f : A β†’ C by ( g β—¦ f )( a ) = g ( f ( a )) , βˆ€ a ∈ A . Range of f βŠ† Domain of g – sufficient for Function Composition! For two identity functions 1 A : A β†’ A and 1 B : B β†’ B , f β—¦ 1 A = f = 1 B β—¦ f . Example: Let f , g : R β†’ R defined as, f ( x ) = x 2 and g ( x ) = x + 1. Then, ( f β—¦ g )( x ) = x 2 + 2 x + 1 and ( g β—¦ f )( x ) = x 2 + 1. So, ( f β—¦ g )( x ) οΏ½ = ( g β—¦ f )( x ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 8 / 17

  38. Equal, Identity and Composite Functions Identity Function: The function, 1 A : A β†’ A defined by 1 A ( a ) = a ( βˆ€ a ∈ A ), is called the identity function for A . Equal Functions: Two functions f , g : A β†’ B are said to be equal (denoted as f = g ) if f ( a ) = g ( a ) , βˆ€ a ∈ A . Note : Domain and Codomain of f , g must also be the same! οΏ½ x , if x ∈ Z Example: f , g : R β†’ Z are defined as, f ( x ) = and ⌊ x βŒ‹ + 1 , if x ∈ R βˆ’ Z g ( x ) = ⌈ x βŒ‰ , then f ( x ) = g ( x ) for every x ∈ R (Why?). So, f = g . Composite Function: If f : A β†’ B and g : B β†’ C , we define the composite function, g β—¦ f : A β†’ C by ( g β—¦ f )( a ) = g ( f ( a )) , βˆ€ a ∈ A . Range of f βŠ† Domain of g – sufficient for Function Composition! For two identity functions 1 A : A β†’ A and 1 B : B β†’ B , f β—¦ 1 A = f = 1 B β—¦ f . Example: Let f , g : R β†’ R defined as, f ( x ) = x 2 and g ( x ) = x + 1. Then, ( f β—¦ g )( x ) = x 2 + 2 x + 1 and ( g β—¦ f )( x ) = x 2 + 1. So, ( f β—¦ g )( x ) οΏ½ = ( g β—¦ f )( x ). Commutativity of Function Compositions: Does NOT Hold! Function Composition is NOT Commutative, that is, we shall NOT always have f β—¦ g ( x ) οΏ½ = g β—¦ f ( x ) for any two functions, f , g : A β†’ A (and x ∈ A ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 8 / 17

  39. Composite Function Properties Associativity of Function Compositions If f : A β†’ B , g : B β†’ C and h : C β†’ D , then ( h β—¦ g ) β—¦ f = h β—¦ ( g β—¦ f ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 9 / 17

  40. Composite Function Properties Associativity of Function Compositions If f : A β†’ B , g : B β†’ C and h : C β†’ D , then ( h β—¦ g ) β—¦ f = h β—¦ ( g β—¦ f ). (h o g) o f Proof: For every x ∈ A , we can show, h o g A B C D ( h β—¦ g β—¦ f )( x ) = ( h β—¦ g ) β—¦ f ( x ) = ( h β—¦ g )( f ( x )) g f h g o f = h ( g ( f ( x ))) = h ( g β—¦ f ( x )) = h β—¦ ( g β—¦ f )( x ). h o (g o f) Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 9 / 17

  41. Composite Function Properties Associativity of Function Compositions If f : A β†’ B , g : B β†’ C and h : C β†’ D , then ( h β—¦ g ) β—¦ f = h β—¦ ( g β—¦ f ). (h o g) o f Proof: For every x ∈ A , we can show, h o g A B C D ( h β—¦ g β—¦ f )( x ) = ( h β—¦ g ) β—¦ f ( x ) = ( h β—¦ g )( f ( x )) g f h g o f = h ( g ( f ( x ))) = h ( g β—¦ f ( x )) = h β—¦ ( g β—¦ f )( x ). h o (g o f) Recursive Compositions of Functions Let f : A β†’ A . Then, f 1 = f , and for n ∈ Z + , f n +1 = f β—¦ ( f n ) = ( f n ) β—¦ f . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 9 / 17

  42. Composite Function Properties Associativity of Function Compositions If f : A β†’ B , g : B β†’ C and h : C β†’ D , then ( h β—¦ g ) β—¦ f = h β—¦ ( g β—¦ f ). (h o g) o f Proof: For every x ∈ A , we can show, h o g A B C D ( h β—¦ g β—¦ f )( x ) = ( h β—¦ g ) β—¦ f ( x ) = ( h β—¦ g )( f ( x )) g f h g o f = h ( g ( f ( x ))) = h ( g β—¦ f ( x )) = h β—¦ ( g β—¦ f )( x ). h o (g o f) Recursive Compositions of Functions Let f : A β†’ A . Then, f 1 = f , and for n ∈ Z + , f n +1 = f β—¦ ( f n ) = ( f n ) β—¦ f . Bijective Nature of Function Compositions If f : A β†’ B and g : B β†’ C both are one-to-one , then g β—¦ f : A β†’ C is one-to-one. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 9 / 17

  43. Composite Function Properties Associativity of Function Compositions If f : A β†’ B , g : B β†’ C and h : C β†’ D , then ( h β—¦ g ) β—¦ f = h β—¦ ( g β—¦ f ). (h o g) o f Proof: For every x ∈ A , we can show, h o g A B C D ( h β—¦ g β—¦ f )( x ) = ( h β—¦ g ) β—¦ f ( x ) = ( h β—¦ g )( f ( x )) g f h g o f = h ( g ( f ( x ))) = h ( g β—¦ f ( x )) = h β—¦ ( g β—¦ f )( x ). h o (g o f) Recursive Compositions of Functions Let f : A β†’ A . Then, f 1 = f , and for n ∈ Z + , f n +1 = f β—¦ ( f n ) = ( f n ) β—¦ f . Bijective Nature of Function Compositions If f : A β†’ B and g : B β†’ C both are one-to-one , then g β—¦ f : A β†’ C is one-to-one. Proof: Let a 1 , a 2 ∈ A . ( g β—¦ f )( a 1 ) = ( g β—¦ f )( a 2 ) β‡’ g ( f ( a 1 )) = g ( f ( a 2 )) β‡’ f ( a 1 ) = f ( a 2 ) (as g is one-to-one). Again, f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 (as f is one-to-one). Hence, g β—¦ f is one-to-one. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 9 / 17

  44. Composite Function Properties Associativity of Function Compositions If f : A β†’ B , g : B β†’ C and h : C β†’ D , then ( h β—¦ g ) β—¦ f = h β—¦ ( g β—¦ f ). (h o g) o f Proof: For every x ∈ A , we can show, h o g A B C D ( h β—¦ g β—¦ f )( x ) = ( h β—¦ g ) β—¦ f ( x ) = ( h β—¦ g )( f ( x )) g f h g o f = h ( g ( f ( x ))) = h ( g β—¦ f ( x )) = h β—¦ ( g β—¦ f )( x ). h o (g o f) Recursive Compositions of Functions Let f : A β†’ A . Then, f 1 = f , and for n ∈ Z + , f n +1 = f β—¦ ( f n ) = ( f n ) β—¦ f . Bijective Nature of Function Compositions If f : A β†’ B and g : B β†’ C both are one-to-one , then g β—¦ f : A β†’ C is one-to-one. Proof: Let a 1 , a 2 ∈ A . ( g β—¦ f )( a 1 ) = ( g β—¦ f )( a 2 ) β‡’ g ( f ( a 1 )) = g ( f ( a 2 )) β‡’ f ( a 1 ) = f ( a 2 ) (as g is one-to-one). Again, f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 (as f is one-to-one). Hence, g β—¦ f is one-to-one. If f : A β†’ B and g : B β†’ C both are onto, then g β—¦ f : A β†’ C is onto. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 9 / 17

  45. Composite Function Properties Associativity of Function Compositions If f : A β†’ B , g : B β†’ C and h : C β†’ D , then ( h β—¦ g ) β—¦ f = h β—¦ ( g β—¦ f ). (h o g) o f Proof: For every x ∈ A , we can show, h o g A B C D ( h β—¦ g β—¦ f )( x ) = ( h β—¦ g ) β—¦ f ( x ) = ( h β—¦ g )( f ( x )) g f h g o f = h ( g ( f ( x ))) = h ( g β—¦ f ( x )) = h β—¦ ( g β—¦ f )( x ). h o (g o f) Recursive Compositions of Functions Let f : A β†’ A . Then, f 1 = f , and for n ∈ Z + , f n +1 = f β—¦ ( f n ) = ( f n ) β—¦ f . Bijective Nature of Function Compositions If f : A β†’ B and g : B β†’ C both are one-to-one , then g β—¦ f : A β†’ C is one-to-one. Proof: Let a 1 , a 2 ∈ A . ( g β—¦ f )( a 1 ) = ( g β—¦ f )( a 2 ) β‡’ g ( f ( a 1 )) = g ( f ( a 2 )) β‡’ f ( a 1 ) = f ( a 2 ) (as g is one-to-one). Again, f ( a 1 ) = f ( a 2 ) β‡’ a 1 = a 2 (as f is one-to-one). Hence, g β—¦ f is one-to-one. If f : A β†’ B and g : B β†’ C both are onto, then g β—¦ f : A β†’ C is onto. Proof: For any z ∈ C , βˆƒ y ∈ B (as g is onto) and y ∈ B , βˆƒ x ∈ A (as f is onto). So, z = g ( y ) = g ( f ( x )) = ( g β—¦ f )( x ) and Range of ( g β—¦ f ) = C = Codomain of ( g β—¦ f ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 9 / 17

  46. Composite Function Properties Bijective Nature of Function Compositions Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a one-to-one (injective) function. Then, f is one-to-one (however, g need NOT be one-to-one). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 10 / 17

  47. Composite Function Properties Bijective Nature of Function Compositions Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a one-to-one (injective) function. Then, f is one-to-one (however, g need NOT be one-to-one). Explanation: f is one-to-one (Proof): Assuming f is NOT one-to-one, implies βˆƒ x 1 , x 2 ∈ A such that f ( x 1 ) = f ( x 2 ). So, g β—¦ f ( x 1 ) = g β—¦ f ( x 2 ), contradicting g β—¦ f is injective! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 10 / 17

  48. Composite Function Properties Bijective Nature of Function Compositions Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a one-to-one (injective) function. Then, f is one-to-one (however, g need NOT be one-to-one). Explanation: f is one-to-one (Proof): Assuming f is NOT one-to-one, implies βˆƒ x 1 , x 2 ∈ A such that f ( x 1 ) = f ( x 2 ). So, g β—¦ f ( x 1 ) = g β—¦ f ( x 2 ), contradicting g β—¦ f is injective! g is not one-to-one (Example): f , g : R β†’ R are defined as, f ( x ) = e x and g ( x ) = x 2 ( x ∈ R ). Here, g β—¦ f : R β†’ R is defined as, g β—¦ f ( x ) = e 2 x . So, ( g β—¦ f ) is one-to-one, but g is NOT (note that, f is one-to-one as proven)! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 10 / 17

  49. Composite Function Properties Bijective Nature of Function Compositions Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a one-to-one (injective) function. Then, f is one-to-one (however, g need NOT be one-to-one). Explanation: f is one-to-one (Proof): Assuming f is NOT one-to-one, implies βˆƒ x 1 , x 2 ∈ A such that f ( x 1 ) = f ( x 2 ). So, g β—¦ f ( x 1 ) = g β—¦ f ( x 2 ), contradicting g β—¦ f is injective! g is not one-to-one (Example): f , g : R β†’ R are defined as, f ( x ) = e x and g ( x ) = x 2 ( x ∈ R ). Here, g β—¦ f : R β†’ R is defined as, g β—¦ f ( x ) = e 2 x . So, ( g β—¦ f ) is one-to-one, but g is NOT (note that, f is one-to-one as proven)! Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a onto (surjective) function. Then, g is onto (however, f need NOT be onto). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 10 / 17

  50. Composite Function Properties Bijective Nature of Function Compositions Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a one-to-one (injective) function. Then, f is one-to-one (however, g need NOT be one-to-one). Explanation: f is one-to-one (Proof): Assuming f is NOT one-to-one, implies βˆƒ x 1 , x 2 ∈ A such that f ( x 1 ) = f ( x 2 ). So, g β—¦ f ( x 1 ) = g β—¦ f ( x 2 ), contradicting g β—¦ f is injective! g is not one-to-one (Example): f , g : R β†’ R are defined as, f ( x ) = e x and g ( x ) = x 2 ( x ∈ R ). Here, g β—¦ f : R β†’ R is defined as, g β—¦ f ( x ) = e 2 x . So, ( g β—¦ f ) is one-to-one, but g is NOT (note that, f is one-to-one as proven)! Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a onto (surjective) function. Then, g is onto (however, f need NOT be onto). Explanation: g is onto (Proof): As ( g β—¦ f ) is onto, for any z ∈ C , βˆƒ x ∈ A such that, z = g β—¦ f ( x ) = g ( f ( x )), implying that z has a pre-image defined as f ( x ) ∈ B – thus making g onto. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 10 / 17

  51. Composite Function Properties Bijective Nature of Function Compositions Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a one-to-one (injective) function. Then, f is one-to-one (however, g need NOT be one-to-one). Explanation: f is one-to-one (Proof): Assuming f is NOT one-to-one, implies βˆƒ x 1 , x 2 ∈ A such that f ( x 1 ) = f ( x 2 ). So, g β—¦ f ( x 1 ) = g β—¦ f ( x 2 ), contradicting g β—¦ f is injective! g is not one-to-one (Example): f , g : R β†’ R are defined as, f ( x ) = e x and g ( x ) = x 2 ( x ∈ R ). Here, g β—¦ f : R β†’ R is defined as, g β—¦ f ( x ) = e 2 x . So, ( g β—¦ f ) is one-to-one, but g is NOT (note that, f is one-to-one as proven)! Let f : A β†’ B and g : B β†’ C and the composition g β—¦ f : A β†’ C is a onto (surjective) function. Then, g is onto (however, f need NOT be onto). Explanation: g is onto (Proof): As ( g β—¦ f ) is onto, for any z ∈ C , βˆƒ x ∈ A such that, z = g β—¦ f ( x ) = g ( f ( x )), implying that z has a pre-image defined as f ( x ) ∈ B – thus making g onto. f is not onto (Example): f , g : Z β†’ Z are defined as, f ( x ) = 2 x and g ( x ) = ⌊ x 2 βŒ‹ ( x ∈ Z ). Here, g β—¦ f : Z β†’ Z is defined as, g β—¦ f ( x ) = x . So, ( g β—¦ f ) is onto, but f is NOT (note that, g is onto as proven)! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 10 / 17

  52. Inverse Functions and Invertibility Inverse Functions: For a function f : A β†’ B , if f βˆ’ 1 , f βˆ’ 1 : B β†’ A are defined such that L R f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B , then f βˆ’ 1 and f βˆ’ 1 are called the left L R L R inverse and right inverse of f , respectively. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 11 / 17

  53. Inverse Functions and Invertibility Inverse Functions: For a function f : A β†’ B , if f βˆ’ 1 , f βˆ’ 1 : B β†’ A are defined such that L R f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B , then f βˆ’ 1 and f βˆ’ 1 are called the left L R L R inverse and right inverse of f , respectively. Invertible Functions: A function f : A β†’ B is said to be invertible if there exist a function f βˆ’ 1 : B β†’ A such that f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B . f βˆ’ 1 is called the inverse function of f . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 11 / 17

  54. Inverse Functions and Invertibility Inverse Functions: For a function f : A β†’ B , if f βˆ’ 1 , f βˆ’ 1 : B β†’ A are defined such that L R f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B , then f βˆ’ 1 and f βˆ’ 1 are called the left L R L R inverse and right inverse of f , respectively. Invertible Functions: A function f : A β†’ B is said to be invertible if there exist a function f βˆ’ 1 : B β†’ A such that f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B . f βˆ’ 1 is called the inverse function of f . Unique Inverse: An invertible function f : A β†’ B has a unique inverse f βˆ’ 1 : B β†’ A . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 11 / 17

  55. Inverse Functions and Invertibility Inverse Functions: For a function f : A β†’ B , if f βˆ’ 1 , f βˆ’ 1 : B β†’ A are defined such that L R f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B , then f βˆ’ 1 and f βˆ’ 1 are called the left L R L R inverse and right inverse of f , respectively. Invertible Functions: A function f : A β†’ B is said to be invertible if there exist a function f βˆ’ 1 : B β†’ A such that f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B . f βˆ’ 1 is called the inverse function of f . Unique Inverse: An invertible function f : A β†’ B has a unique inverse f βˆ’ 1 : B β†’ A . ( Proof: Assume two inverses, f βˆ’ 1 and f βˆ’ 1 . Using the definition, we get, 1 2 f βˆ’ 1 = f βˆ’ 1 β—¦ 1 B = f βˆ’ 1 β—¦ ( f β—¦ f βˆ’ 1 ) = ( f βˆ’ 1 β—¦ f ) β—¦ f βˆ’ 1 = 1 A β—¦ f βˆ’ 1 = f βˆ’ 1 .) 1 1 1 2 1 2 2 2 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 11 / 17

  56. Inverse Functions and Invertibility Inverse Functions: For a function f : A β†’ B , if f βˆ’ 1 , f βˆ’ 1 : B β†’ A are defined such that L R f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B , then f βˆ’ 1 and f βˆ’ 1 are called the left L R L R inverse and right inverse of f , respectively. Invertible Functions: A function f : A β†’ B is said to be invertible if there exist a function f βˆ’ 1 : B β†’ A such that f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B . f βˆ’ 1 is called the inverse function of f . Unique Inverse: An invertible function f : A β†’ B has a unique inverse f βˆ’ 1 : B β†’ A . ( Proof: Assume two inverses, f βˆ’ 1 and f βˆ’ 1 . Using the definition, we get, 1 2 f βˆ’ 1 = f βˆ’ 1 β—¦ 1 B = f βˆ’ 1 β—¦ ( f β—¦ f βˆ’ 1 ) = ( f βˆ’ 1 β—¦ f ) β—¦ f βˆ’ 1 = 1 A β—¦ f βˆ’ 1 = f βˆ’ 1 .) 1 1 1 2 1 2 2 2 Examples: (1) Let f , g : Z β†’ Z are defined as f ( x ) = 2 x and g ( x ) = ⌊ x +1 2 βŒ‹ ( x ∈ Z ). So, g β—¦ f , f β—¦ g : Z β†’ Z are defined by, g β—¦ f ( x ) = g (2 x ) = x οΏ½ x + 1 , if x is odd and f β—¦ g ( x ) = f ( ⌊ x +1 if x is even . So, g β—¦ f = 1 Z 2 βŒ‹ ) = x , meaning g is the left inverse of f , but f β—¦ g οΏ½ = 1 Z meaning g is NOT the right inverse of f . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 11 / 17

  57. Inverse Functions and Invertibility Inverse Functions: For a function f : A β†’ B , if f βˆ’ 1 , f βˆ’ 1 : B β†’ A are defined such that L R f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B , then f βˆ’ 1 and f βˆ’ 1 are called the left L R L R inverse and right inverse of f , respectively. Invertible Functions: A function f : A β†’ B is said to be invertible if there exist a function f βˆ’ 1 : B β†’ A such that f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B . f βˆ’ 1 is called the inverse function of f . Unique Inverse: An invertible function f : A β†’ B has a unique inverse f βˆ’ 1 : B β†’ A . ( Proof: Assume two inverses, f βˆ’ 1 and f βˆ’ 1 . Using the definition, we get, 1 2 f βˆ’ 1 = f βˆ’ 1 β—¦ 1 B = f βˆ’ 1 β—¦ ( f β—¦ f βˆ’ 1 ) = ( f βˆ’ 1 β—¦ f ) β—¦ f βˆ’ 1 = 1 A β—¦ f βˆ’ 1 = f βˆ’ 1 .) 1 1 1 2 1 2 2 2 Examples: (1) Let f , g : Z β†’ Z are defined as f ( x ) = 2 x and g ( x ) = ⌊ x +1 2 βŒ‹ ( x ∈ Z ). So, g β—¦ f , f β—¦ g : Z β†’ Z are defined by, g β—¦ f ( x ) = g (2 x ) = x οΏ½ x + 1 , if x is odd and f β—¦ g ( x ) = f ( ⌊ x +1 if x is even . So, g β—¦ f = 1 Z 2 βŒ‹ ) = x , meaning g is the left inverse of f , but f β—¦ g οΏ½ = 1 Z meaning g is NOT the right inverse of f . (2) Let f , g : R β†’ R are defined as f ( x ) = 2 x and g ( x ) = x 2 ( x ∈ R ). So, g β—¦ f , f β—¦ g : R β†’ R are defined by, g β—¦ f ( x ) = g (2 x ) = x and f β—¦ g ( x ) = f ( x 2 ) = x . So, g β—¦ f = f β—¦ g = 1 R meaning g is inverse of f . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 11 / 17

  58. Properties of Invertible Functions Properties f : A β†’ B is invertible if and only if it is bijective (one-to-one + onto). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 12 / 17

  59. Properties of Invertible Functions Properties f : A β†’ B is invertible if and only if it is bijective (one-to-one + onto). Proof: [ If ] f is invertible means inverse function f βˆ’ 1 : B β†’ A exists. f βˆ’ 1 β—¦ f = 1 A and 1 A is injective, so f is injective. f β—¦ f βˆ’ 1 = 1 B and 1 B is surjective, so f is surjective. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 12 / 17

  60. Properties of Invertible Functions Properties f : A β†’ B is invertible if and only if it is bijective (one-to-one + onto). Proof: [ If ] f is invertible means inverse function f βˆ’ 1 : B β†’ A exists. f βˆ’ 1 β—¦ f = 1 A and 1 A is injective, so f is injective. f β—¦ f βˆ’ 1 = 1 B and 1 B is surjective, so f is surjective. [Only-If] Since f is bijective, y ∈ B has one and only one pre-image x ∈ A . We define f βˆ’ 1 : B β†’ A as f βˆ’ 1 ( y ) = x (pre-image of y under f ), y ∈ B . So, f βˆ’ 1 β—¦ f ( x ) = f βˆ’ 1 ( y ) = x and f β—¦ f βˆ’ 1 ( y ) = f ( x ) = y , implying f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B β‡’ f is invertible. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 12 / 17

  61. Properties of Invertible Functions Properties f : A β†’ B is invertible if and only if it is bijective (one-to-one + onto). Proof: [ If ] f is invertible means inverse function f βˆ’ 1 : B β†’ A exists. f βˆ’ 1 β—¦ f = 1 A and 1 A is injective, so f is injective. f β—¦ f βˆ’ 1 = 1 B and 1 B is surjective, so f is surjective. [Only-If] Since f is bijective, y ∈ B has one and only one pre-image x ∈ A . We define f βˆ’ 1 : B β†’ A as f βˆ’ 1 ( y ) = x (pre-image of y under f ), y ∈ B . So, f βˆ’ 1 β—¦ f ( x ) = f βˆ’ 1 ( y ) = x and f β—¦ f βˆ’ 1 ( y ) = f ( x ) = y , implying f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B β‡’ f is invertible. If f : A β†’ B , g : B β†’ C are invertible, then g β—¦ f : A β†’ C is invertible and ( g β—¦ f ) βˆ’ 1 = f βˆ’ 1 β—¦ g βˆ’ 1 . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 12 / 17

  62. Properties of Invertible Functions Properties f : A β†’ B is invertible if and only if it is bijective (one-to-one + onto). Proof: [ If ] f is invertible means inverse function f βˆ’ 1 : B β†’ A exists. f βˆ’ 1 β—¦ f = 1 A and 1 A is injective, so f is injective. f β—¦ f βˆ’ 1 = 1 B and 1 B is surjective, so f is surjective. [Only-If] Since f is bijective, y ∈ B has one and only one pre-image x ∈ A . We define f βˆ’ 1 : B β†’ A as f βˆ’ 1 ( y ) = x (pre-image of y under f ), y ∈ B . So, f βˆ’ 1 β—¦ f ( x ) = f βˆ’ 1 ( y ) = x and f β—¦ f βˆ’ 1 ( y ) = f ( x ) = y , implying f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B β‡’ f is invertible. If f : A β†’ B , g : B β†’ C are invertible, then g β—¦ f : A β†’ C is invertible and ( g β—¦ f ) βˆ’ 1 = f βˆ’ 1 β—¦ g βˆ’ 1 . Proof: f , g are invertible implies that f , g are bijective functions. So, ( g β—¦ f ) is also bijective and hence invertible (using above property). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 12 / 17

  63. Properties of Invertible Functions Properties f : A β†’ B is invertible if and only if it is bijective (one-to-one + onto). Proof: [ If ] f is invertible means inverse function f βˆ’ 1 : B β†’ A exists. f βˆ’ 1 β—¦ f = 1 A and 1 A is injective, so f is injective. f β—¦ f βˆ’ 1 = 1 B and 1 B is surjective, so f is surjective. [Only-If] Since f is bijective, y ∈ B has one and only one pre-image x ∈ A . We define f βˆ’ 1 : B β†’ A as f βˆ’ 1 ( y ) = x (pre-image of y under f ), y ∈ B . So, f βˆ’ 1 β—¦ f ( x ) = f βˆ’ 1 ( y ) = x and f β—¦ f βˆ’ 1 ( y ) = f ( x ) = y , implying f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B β‡’ f is invertible. If f : A β†’ B , g : B β†’ C are invertible, then g β—¦ f : A β†’ C is invertible and ( g β—¦ f ) βˆ’ 1 = f βˆ’ 1 β—¦ g βˆ’ 1 . Proof: f , g are invertible implies that f , g are bijective functions. So, ( g β—¦ f ) is also bijective and hence invertible (using above property). ( f βˆ’ 1 β—¦ g βˆ’ 1 ) β—¦ ( g β—¦ f ) = f βˆ’ 1 β—¦ ( g βˆ’ 1 β—¦ g ) β—¦ f = f βˆ’ 1 β—¦ 1 B β—¦ f = f βˆ’ 1 β—¦ f = 1 A . ( g β—¦ f ) β—¦ ( f βˆ’ 1 β—¦ g βˆ’ 1 ) = 1 B . So, ( f βˆ’ 1 β—¦ g βˆ’ 1 ) is the inverse of ( g β—¦ f ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 12 / 17

  64. Properties of Invertible Functions Properties f : A β†’ B is invertible if and only if it is bijective (one-to-one + onto). Proof: [ If ] f is invertible means inverse function f βˆ’ 1 : B β†’ A exists. f βˆ’ 1 β—¦ f = 1 A and 1 A is injective, so f is injective. f β—¦ f βˆ’ 1 = 1 B and 1 B is surjective, so f is surjective. [Only-If] Since f is bijective, y ∈ B has one and only one pre-image x ∈ A . We define f βˆ’ 1 : B β†’ A as f βˆ’ 1 ( y ) = x (pre-image of y under f ), y ∈ B . So, f βˆ’ 1 β—¦ f ( x ) = f βˆ’ 1 ( y ) = x and f β—¦ f βˆ’ 1 ( y ) = f ( x ) = y , implying f βˆ’ 1 β—¦ f = 1 A and f β—¦ f βˆ’ 1 = 1 B β‡’ f is invertible. If f : A β†’ B , g : B β†’ C are invertible, then g β—¦ f : A β†’ C is invertible and ( g β—¦ f ) βˆ’ 1 = f βˆ’ 1 β—¦ g βˆ’ 1 . Proof: f , g are invertible implies that f , g are bijective functions. So, ( g β—¦ f ) is also bijective and hence invertible (using above property). ( f βˆ’ 1 β—¦ g βˆ’ 1 ) β—¦ ( g β—¦ f ) = f βˆ’ 1 β—¦ ( g βˆ’ 1 β—¦ g ) β—¦ f = f βˆ’ 1 β—¦ 1 B β—¦ f = f βˆ’ 1 β—¦ f = 1 A . ( g β—¦ f ) β—¦ ( f βˆ’ 1 β—¦ g βˆ’ 1 ) = 1 B . So, ( f βˆ’ 1 β—¦ g βˆ’ 1 ) is the inverse of ( g β—¦ f ). Example f : R β†’ R is defined by f ( x ) = 3 x + 1 ( x ∈ R ). Note that, f is bijective (Why?) and hence invertible. Now, f βˆ’ 1 : R β†’ R defined by f βˆ’ 1 ( y ) = y βˆ’ 1 3 , y ∈ R . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 12 / 17

  65. Properties with Direct and Inverse Images Direct Image: Let f : A β†’ B and (non-empty) A β€² βŠ† A . The direct image of A β€² under f is f ( A β€² ) βŠ† B given by, f ( A β€² ) = { f ( x ) | x ∈ A β€² } . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 13 / 17

  66. Properties with Direct and Inverse Images Direct Image: Let f : A β†’ B and (non-empty) A β€² βŠ† A . The direct image of A β€² under f is f ( A β€² ) βŠ† B given by, f ( A β€² ) = { f ( x ) | x ∈ A β€² } . Inverse Image: Let f : A β†’ B and (non-empty) B β€² βŠ† B . The inverse image (pre-image) of B β€² under f is f βˆ’ 1 ( B β€² ) βŠ† A given by, f βˆ’ 1 ( B β€² ) = { x | f ( x ) ∈ B β€² } . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 13 / 17

  67. Properties with Direct and Inverse Images Direct Image: Let f : A β†’ B and (non-empty) A β€² βŠ† A . The direct image of A β€² under f is f ( A β€² ) βŠ† B given by, f ( A β€² ) = { f ( x ) | x ∈ A β€² } . Inverse Image: Let f : A β†’ B and (non-empty) B β€² βŠ† B . The inverse image (pre-image) of B β€² under f is f βˆ’ 1 ( B β€² ) βŠ† A given by, f βˆ’ 1 ( B β€² ) = { x | f ( x ) ∈ B β€² } . Example: f : R β†’ R is defined by f ( x ) = x 2 ( x ∈ R ). Let P = { x ∈ R | x ∈ [0 , 2] } . The direct image f ( P ) = { y | y ∈ [0 , 4] } ( y ∈ R ) and the inverse image of set f ( P ) is f βˆ’ 1 ( f ( P )) = { x | x ∈ [ βˆ’ 2 , 2] } . So, f βˆ’ 1 ( f ( P )) οΏ½ = P and f is not a bijection / invertible. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 13 / 17

  68. Properties with Direct and Inverse Images Direct Image: Let f : A β†’ B and (non-empty) A β€² βŠ† A . The direct image of A β€² under f is f ( A β€² ) βŠ† B given by, f ( A β€² ) = { f ( x ) | x ∈ A β€² } . Inverse Image: Let f : A β†’ B and (non-empty) B β€² βŠ† B . The inverse image (pre-image) of B β€² under f is f βˆ’ 1 ( B β€² ) βŠ† A given by, f βˆ’ 1 ( B β€² ) = { x | f ( x ) ∈ B β€² } . Example: f : R β†’ R is defined by f ( x ) = x 2 ( x ∈ R ). Let P = { x ∈ R | x ∈ [0 , 2] } . The direct image f ( P ) = { y | y ∈ [0 , 4] } ( y ∈ R ) and the inverse image of set f ( P ) is f βˆ’ 1 ( f ( P )) = { x | x ∈ [ βˆ’ 2 , 2] } . So, f βˆ’ 1 ( f ( P )) οΏ½ = P and f is not a bijection / invertible. Properties: (RECAP) Let f : A β†’ B , with A 1 , A 2 βŠ† A . Then, (i) If A 1 βŠ‚ A 2 β‡’ f ( A 1 ) βŠ‚ f ( A 2 ), (ii) f ( A 1 βˆͺ A 2 ) = f ( A 1 ) βˆͺ f ( A 2 ), and (iii) f ( A 1 ∩ A 2 ) βŠ‚ f ( A 1 ) ∩ f ( A 2 ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 13 / 17

  69. Properties with Direct and Inverse Images Direct Image: Let f : A β†’ B and (non-empty) A β€² βŠ† A . The direct image of A β€² under f is f ( A β€² ) βŠ† B given by, f ( A β€² ) = { f ( x ) | x ∈ A β€² } . Inverse Image: Let f : A β†’ B and (non-empty) B β€² βŠ† B . The inverse image (pre-image) of B β€² under f is f βˆ’ 1 ( B β€² ) βŠ† A given by, f βˆ’ 1 ( B β€² ) = { x | f ( x ) ∈ B β€² } . Example: f : R β†’ R is defined by f ( x ) = x 2 ( x ∈ R ). Let P = { x ∈ R | x ∈ [0 , 2] } . The direct image f ( P ) = { y | y ∈ [0 , 4] } ( y ∈ R ) and the inverse image of set f ( P ) is f βˆ’ 1 ( f ( P )) = { x | x ∈ [ βˆ’ 2 , 2] } . So, f βˆ’ 1 ( f ( P )) οΏ½ = P and f is not a bijection / invertible. Properties: (RECAP) Let f : A β†’ B , with A 1 , A 2 βŠ† A . Then, (i) If A 1 βŠ‚ A 2 β‡’ f ( A 1 ) βŠ‚ f ( A 2 ), (ii) f ( A 1 βˆͺ A 2 ) = f ( A 1 ) βˆͺ f ( A 2 ), and (iii) f ( A 1 ∩ A 2 ) βŠ‚ f ( A 1 ) ∩ f ( A 2 ). Note: In general, f ( A 1 ∩ A 2 ) οΏ½ = f ( A 1 ) ∩ f ( A 2 ). Consider, f : R β†’ R as f ( x ) = x 2 and A 1 = { 0 , 1 , 1 2 , 1 3 , . . . } , A 2 = { 0 , βˆ’ 1 , βˆ’ 1 2 , βˆ’ 1 3 , . . . } . Here, f ( A 1 ∩ A 2 ) = { 0 } οΏ½ = { 0 , 1 , 1 2 2 , 1 3 2 } = f ( A 1 ) ∩ f ( A 2 ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 13 / 17

  70. Properties with Direct and Inverse Images Direct Image: Let f : A β†’ B and (non-empty) A β€² βŠ† A . The direct image of A β€² under f is f ( A β€² ) βŠ† B given by, f ( A β€² ) = { f ( x ) | x ∈ A β€² } . Inverse Image: Let f : A β†’ B and (non-empty) B β€² βŠ† B . The inverse image (pre-image) of B β€² under f is f βˆ’ 1 ( B β€² ) βŠ† A given by, f βˆ’ 1 ( B β€² ) = { x | f ( x ) ∈ B β€² } . Example: f : R β†’ R is defined by f ( x ) = x 2 ( x ∈ R ). Let P = { x ∈ R | x ∈ [0 , 2] } . The direct image f ( P ) = { y | y ∈ [0 , 4] } ( y ∈ R ) and the inverse image of set f ( P ) is f βˆ’ 1 ( f ( P )) = { x | x ∈ [ βˆ’ 2 , 2] } . So, f βˆ’ 1 ( f ( P )) οΏ½ = P and f is not a bijection / invertible. Properties: (RECAP) Let f : A β†’ B , with A 1 , A 2 βŠ† A . Then, (i) If A 1 βŠ‚ A 2 β‡’ f ( A 1 ) βŠ‚ f ( A 2 ), (ii) f ( A 1 βˆͺ A 2 ) = f ( A 1 ) βˆͺ f ( A 2 ), and (iii) f ( A 1 ∩ A 2 ) βŠ‚ f ( A 1 ) ∩ f ( A 2 ). Note: In general, f ( A 1 ∩ A 2 ) οΏ½ = f ( A 1 ) ∩ f ( A 2 ). Consider, f : R β†’ R as f ( x ) = x 2 and A 1 = { 0 , 1 , 1 2 , 1 3 , . . . } , A 2 = { 0 , βˆ’ 1 , βˆ’ 1 2 , βˆ’ 1 3 , . . . } . Here, f ( A 1 ∩ A 2 ) = { 0 } οΏ½ = { 0 , 1 , 1 2 2 , 1 3 2 } = f ( A 1 ) ∩ f ( A 2 ). Let f : A β†’ B be an onto mapping, with B 1 , B 2 βŠ† B . Then, (i) If B 1 βŠ‚ B 2 β‡’ f βˆ’ 1 ( B 1 ) βŠ‚ f βˆ’ 1 ( B 2 ), (ii) f βˆ’ 1 ( B 1 ) = f βˆ’ 1 ( B 1 ), (iii) f βˆ’ 1 ( B 1 βˆͺ B 2 ) = f βˆ’ 1 ( B 1 ) βˆͺ f βˆ’ 1 ( B 2 ), and (iv) f βˆ’ 1 ( B 1 ∩ B 2 ) = f βˆ’ 1 ( B 1 ) ∩ f βˆ’ 1 ( B 2 ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 13 / 17

  71. Properties with Direct and Inverse Images Direct Image: Let f : A β†’ B and (non-empty) A β€² βŠ† A . The direct image of A β€² under f is f ( A β€² ) βŠ† B given by, f ( A β€² ) = { f ( x ) | x ∈ A β€² } . Inverse Image: Let f : A β†’ B and (non-empty) B β€² βŠ† B . The inverse image (pre-image) of B β€² under f is f βˆ’ 1 ( B β€² ) βŠ† A given by, f βˆ’ 1 ( B β€² ) = { x | f ( x ) ∈ B β€² } . Example: f : R β†’ R is defined by f ( x ) = x 2 ( x ∈ R ). Let P = { x ∈ R | x ∈ [0 , 2] } . The direct image f ( P ) = { y | y ∈ [0 , 4] } ( y ∈ R ) and the inverse image of set f ( P ) is f βˆ’ 1 ( f ( P )) = { x | x ∈ [ βˆ’ 2 , 2] } . So, f βˆ’ 1 ( f ( P )) οΏ½ = P and f is not a bijection / invertible. Properties: (RECAP) Let f : A β†’ B , with A 1 , A 2 βŠ† A . Then, (i) If A 1 βŠ‚ A 2 β‡’ f ( A 1 ) βŠ‚ f ( A 2 ), (ii) f ( A 1 βˆͺ A 2 ) = f ( A 1 ) βˆͺ f ( A 2 ), and (iii) f ( A 1 ∩ A 2 ) βŠ‚ f ( A 1 ) ∩ f ( A 2 ). Note: In general, f ( A 1 ∩ A 2 ) οΏ½ = f ( A 1 ) ∩ f ( A 2 ). Consider, f : R β†’ R as f ( x ) = x 2 and A 1 = { 0 , 1 , 1 2 , 1 3 , . . . } , A 2 = { 0 , βˆ’ 1 , βˆ’ 1 2 , βˆ’ 1 3 , . . . } . Here, f ( A 1 ∩ A 2 ) = { 0 } οΏ½ = { 0 , 1 , 1 2 2 , 1 3 2 } = f ( A 1 ) ∩ f ( A 2 ). Let f : A β†’ B be an onto mapping, with B 1 , B 2 βŠ† B . Then, (i) If B 1 βŠ‚ B 2 β‡’ f βˆ’ 1 ( B 1 ) βŠ‚ f βˆ’ 1 ( B 2 ), (ii) f βˆ’ 1 ( B 1 ) = f βˆ’ 1 ( B 1 ), (iii) f βˆ’ 1 ( B 1 βˆͺ B 2 ) = f βˆ’ 1 ( B 1 ) βˆͺ f βˆ’ 1 ( B 2 ), and (iv) f βˆ’ 1 ( B 1 ∩ B 2 ) = f βˆ’ 1 ( B 1 ) ∩ f βˆ’ 1 ( B 2 ). Proof: (i) Let x ∈ f βˆ’ 1 ( B 1 ) β‡’ f ( x ) ∈ B 1 . Since B 1 βŠ‚ B 2 , therefore f ( x ) ∈ B 1 β‡’ f ( x ) ∈ B 2 . So, x ∈ f βˆ’ 1 ( B 2 ) implying f βˆ’ 1 ( B 1 ) βŠ‚ f βˆ’ 1 ( B 2 ). Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 13 / 17

  72. Properties with Direct and Inverse Images Direct Image: Let f : A β†’ B and (non-empty) A β€² βŠ† A . The direct image of A β€² under f is f ( A β€² ) βŠ† B given by, f ( A β€² ) = { f ( x ) | x ∈ A β€² } . Inverse Image: Let f : A β†’ B and (non-empty) B β€² βŠ† B . The inverse image (pre-image) of B β€² under f is f βˆ’ 1 ( B β€² ) βŠ† A given by, f βˆ’ 1 ( B β€² ) = { x | f ( x ) ∈ B β€² } . Example: f : R β†’ R is defined by f ( x ) = x 2 ( x ∈ R ). Let P = { x ∈ R | x ∈ [0 , 2] } . The direct image f ( P ) = { y | y ∈ [0 , 4] } ( y ∈ R ) and the inverse image of set f ( P ) is f βˆ’ 1 ( f ( P )) = { x | x ∈ [ βˆ’ 2 , 2] } . So, f βˆ’ 1 ( f ( P )) οΏ½ = P and f is not a bijection / invertible. Properties: (RECAP) Let f : A β†’ B , with A 1 , A 2 βŠ† A . Then, (i) If A 1 βŠ‚ A 2 β‡’ f ( A 1 ) βŠ‚ f ( A 2 ), (ii) f ( A 1 βˆͺ A 2 ) = f ( A 1 ) βˆͺ f ( A 2 ), and (iii) f ( A 1 ∩ A 2 ) βŠ‚ f ( A 1 ) ∩ f ( A 2 ). Note: In general, f ( A 1 ∩ A 2 ) οΏ½ = f ( A 1 ) ∩ f ( A 2 ). Consider, f : R β†’ R as f ( x ) = x 2 and A 1 = { 0 , 1 , 1 2 , 1 3 , . . . } , A 2 = { 0 , βˆ’ 1 , βˆ’ 1 2 , βˆ’ 1 3 , . . . } . Here, f ( A 1 ∩ A 2 ) = { 0 } οΏ½ = { 0 , 1 , 1 2 2 , 1 3 2 } = f ( A 1 ) ∩ f ( A 2 ). Let f : A β†’ B be an onto mapping, with B 1 , B 2 βŠ† B . Then, (i) If B 1 βŠ‚ B 2 β‡’ f βˆ’ 1 ( B 1 ) βŠ‚ f βˆ’ 1 ( B 2 ), (ii) f βˆ’ 1 ( B 1 ) = f βˆ’ 1 ( B 1 ), (iii) f βˆ’ 1 ( B 1 βˆͺ B 2 ) = f βˆ’ 1 ( B 1 ) βˆͺ f βˆ’ 1 ( B 2 ), and (iv) f βˆ’ 1 ( B 1 ∩ B 2 ) = f βˆ’ 1 ( B 1 ) ∩ f βˆ’ 1 ( B 2 ). Proof: (i) Let x ∈ f βˆ’ 1 ( B 1 ) β‡’ f ( x ) ∈ B 1 . Since B 1 βŠ‚ B 2 , therefore f ( x ) ∈ B 1 β‡’ f ( x ) ∈ B 2 . So, x ∈ f βˆ’ 1 ( B 2 ) implying f βˆ’ 1 ( B 1 ) βŠ‚ f βˆ’ 1 ( B 2 ). (ii), (iii) and (iv) Left for You as an Exercise! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 13 / 17

  73. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  74. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  75. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  76. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  77. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  78. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  79. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 If A = { w , x , y , z } , B = { 1 , 2 , 3 } , then all possible functions = 3 4 ; Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  80. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 If A = { w , x , y , z } , B = { 1 , 2 , 3 } , then all possible functions = 3 4 ; this includes 2 4 non-onto functions each from A β†’ { 1 , 2 } , A β†’ { 1 , 3 } and A β†’ { 2 , 3 } . Now, the running count for onto functions = 3 4 βˆ’ 3 . 2 4 . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  81. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 If A = { w , x , y , z } , B = { 1 , 2 , 3 } , then all possible functions = 3 4 ; this includes 2 4 non-onto functions each from A β†’ { 1 , 2 } , A β†’ { 1 , 3 } and A β†’ { 2 , 3 } . Now, the running count for onto functions = 3 4 βˆ’ 3 . 2 4 . But, we removed the constant function { ( w , 2) , ( x , 2) , ( y , 2) , ( z , 2) } twice – both during function removal from A β†’ { 1 , 2 } , A β†’ { 2 , 3 } . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  82. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 If A = { w , x , y , z } , B = { 1 , 2 , 3 } , then all possible functions = 3 4 ; this includes 2 4 non-onto functions each from A β†’ { 1 , 2 } , A β†’ { 1 , 3 } and A β†’ { 2 , 3 } . Now, the running count for onto functions = 3 4 βˆ’ 3 . 2 4 . But, we removed the constant function { ( w , 2) , ( x , 2) , ( y , 2) , ( z , 2) } twice – both during function removal from A β†’ { 1 , 2 } , A β†’ { 2 , 3 } . So, the final onto functions count = 3 4 βˆ’ 3 . 2 4 + 3 = 3 4 βˆ’ 2 4 + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 4 . οΏ½ οΏ½ οΏ½ 3 2 1 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  83. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 If A = { w , x , y , z } , B = { 1 , 2 , 3 } , then all possible functions = 3 4 ; this includes 2 4 non-onto functions each from A β†’ { 1 , 2 } , A β†’ { 1 , 3 } and A β†’ { 2 , 3 } . Now, the running count for onto functions = 3 4 βˆ’ 3 . 2 4 . But, we removed the constant function { ( w , 2) , ( x , 2) , ( y , 2) , ( z , 2) } twice – both during function removal from A β†’ { 1 , 2 } , A β†’ { 2 , 3 } . So, the final onto functions count = 3 4 βˆ’ 3 . 2 4 + 3 = 3 4 βˆ’ 2 4 + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 4 . οΏ½ οΏ½ οΏ½ 3 2 1 If |A| = m β‰₯ n = |B| , how many Onto functions? = O ( m , n ) Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  84. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 If A = { w , x , y , z } , B = { 1 , 2 , 3 } , then all possible functions = 3 4 ; this includes 2 4 non-onto functions each from A β†’ { 1 , 2 } , A β†’ { 1 , 3 } and A β†’ { 2 , 3 } . Now, the running count for onto functions = 3 4 βˆ’ 3 . 2 4 . But, we removed the constant function { ( w , 2) , ( x , 2) , ( y , 2) , ( z , 2) } twice – both during function removal from A β†’ { 1 , 2 } , A β†’ { 2 , 3 } . So, the final onto functions count = 3 4 βˆ’ 3 . 2 4 + 3 = 3 4 βˆ’ 2 4 + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 4 . οΏ½ οΏ½ οΏ½ 3 2 1 If |A| = m β‰₯ n = |B| , how many Onto functions? = O ( m , n ) What do the above steps reveal? Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  85. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 If A = { w , x , y , z } , B = { 1 , 2 , 3 } , then all possible functions = 3 4 ; this includes 2 4 non-onto functions each from A β†’ { 1 , 2 } , A β†’ { 1 , 3 } and A β†’ { 2 , 3 } . Now, the running count for onto functions = 3 4 βˆ’ 3 . 2 4 . But, we removed the constant function { ( w , 2) , ( x , 2) , ( y , 2) , ( z , 2) } twice – both during function removal from A β†’ { 1 , 2 } , A β†’ { 2 , 3 } . So, the final onto functions count = 3 4 βˆ’ 3 . 2 4 + 3 = 3 4 βˆ’ 2 4 + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 4 . οΏ½ οΏ½ οΏ½ 3 2 1 If |A| = m β‰₯ n = |B| , how many Onto functions? = O ( m , n ) What do the above steps reveal? β‡’ Principle of Inclusion-Exclusion! Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  86. The Leftover: Number of Onto Functions under f : A β†’ B If 0 < |A| = m < n = |B| , how many Onto functions? = 0 If |A| = m = 1 = n = |B| , how many Onto functions? = 1 If |A| = m β‰₯ n = 2 = |B| , how many Onto functions? = 2 m βˆ’ 2 If A = { x , y , z } , B = { 1 , 2 } , then all possible functions = |B| |A| = 2 3 ; but f 1 = { ( x , 1) , ( y , 1) , ( z , 1) } and f 2 = { ( x , 2) , ( y , 2) , ( z , 2) } are NOT onto. Hence, number of onto functions = 2 3 βˆ’ 2 = 6. 3 m βˆ’ 2 m + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 m οΏ½ οΏ½ οΏ½ If |A| = m β‰₯ n = 3 = |B| , how many Onto functions? = 3 2 1 If A = { w , x , y , z } , B = { 1 , 2 , 3 } , then all possible functions = 3 4 ; this includes 2 4 non-onto functions each from A β†’ { 1 , 2 } , A β†’ { 1 , 3 } and A β†’ { 2 , 3 } . Now, the running count for onto functions = 3 4 βˆ’ 3 . 2 4 . But, we removed the constant function { ( w , 2) , ( x , 2) , ( y , 2) , ( z , 2) } twice – both during function removal from A β†’ { 1 , 2 } , A β†’ { 2 , 3 } . So, the final onto functions count = 3 4 βˆ’ 3 . 2 4 + 3 = 3 4 βˆ’ 2 4 + οΏ½ 3 οΏ½ 3 οΏ½ 3 1 4 . οΏ½ οΏ½ οΏ½ 3 2 1 If |A| = m β‰₯ n = |B| , how many Onto functions? = O ( m , n ) What do the above steps reveal? β‡’ Principle of Inclusion-Exclusion! οΏ½ n οΏ½ n n m βˆ’ ( n βˆ’ 1) m + ( n βˆ’ 2) m βˆ’ Β· Β· Β· + ( βˆ’ 1) n βˆ’ 2 οΏ½ n 2 m + ( βˆ’ 1) n βˆ’ 1 οΏ½ n οΏ½ n 1 m οΏ½ οΏ½ οΏ½ οΏ½ οΏ½ O ( m , n ) = n n βˆ’ 1 n βˆ’ 2 2 1 n βˆ’ 1 n ( βˆ’ 1) i οΏ½ n ( βˆ’ 1) i οΏ½ n οΏ½ ( n βˆ’ i ) m οΏ½ ( n βˆ’ i ) m = οΏ½ = οΏ½ n βˆ’ i n βˆ’ i i =0 i =0 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 14 / 17

  87. Stirling Number of the Second Kind Combinatorial Definition For m β‰₯ n , Number of ways to distribute m objects into n identical (but i =0 ( βˆ’ 1) i οΏ½ n numbered) containers with no container empty = οΏ½ n οΏ½ ( n βˆ’ i ) m . n βˆ’ i Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 15 / 17

Recommend


More recommend


Explore More Topics

Stay informed with curated content and fresh updates.