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 :
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
(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
(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
(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
(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
(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
(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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.