Functions and Infinite Sets
Total Page:16
File Type:pdf, Size:1020Kb
Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Instructor Chennai 600 127, India N.Sadagopan An Autonomous Institute under MHRD, Govt of India Scribe: An Institute of National Importance S.Dhanalakshmi www.iiitdm.ac.in A. Mohanapriya COM205T Discrete Structures for Computing-Lecture Notes Functions and Infinite Sets Objective: We shall introduce functions, special functions and related counting problems. We shall see the importance of functions in the context of infinite sets and discuss infinite sets in detail. Further, we introduce the notion counting in the context of infinite sets. Revisit: Relations Consider the following relations and its graphical representation, and this representation is dif- ferent from the one we discussed in the context of relations. A = B = f1; 2; 3; 4; 5g, R1 = f(1; 2); (1; 3); (2; 3); (2; 4); (2; 5)g A = B = f1; 2; 3g, R2 = f(1; 1); (2; 2); (3; 3)g A = B = f1; 2; 3g, R3 = f(1; 1); (2; 2); (2; 3)g A = B = f1; 2; 3g, R4 = f(1; 1); (2; 1); (3; 1)g We define special relations; relations satisfying the following properties. 1 1 1 1 1 1 1 1 2 2 3 3 2 2 2 2 2 2 4 4 5 5 3 3 3 3 3 A B A B A B A B (a) R1 (b) R2 (c) R3 (d) R4 Fig. 1: (a),(b),(c),(d) represent relations using two partitions. 1. Property P1: 8a 2 A 9!b 2 B [(a; b) 2 R] 2. Property P2: relation satisfying P1 and @a 2 A @b 2 A ^ a 6= b ^ 8c 2 B [(a; c) 2 R ^ (b; c) 2 R] 3. Property P3: relation satisfying P1 and 8b 2 B 9a 2 A[(a; b) 2 R] A binary relation R satisfying P 1 is known as a function in the theory of relations. Similarly, the one satisfying P2 is known as one-one functions and the one satisfying P3 is known as onto functions. Definition 1 (Function) Let A and B be non-empty sets. A function or a mapping f from A into B, written as f : A ! B, where every element a 2 A is mapped to a unique element b 2 B. Definition 2 (One-one function/Injective) A function is said to be injective if for every element in the range there exists a unique pre-image. i.e., no two elements in the domain map to same element in the co-domain. Definition 3 (Onto function/Surjective) A function is said to be surjective if for every element in co-domain there exists a pre-image. Definition 4 (Bijective) A function is said to be bijective if it is both one-one and onto function. From the Figure 1, we can observe that (a) is not satisfying property P1 because elements 1 and 2 in A are mapped to two ele- ments in B which is a forbidden structure according to property P1 and elements 4 and 5 in A is not mapped to any element in B. Since R1 is not satisfying the property P1, it does not satisfy P2 and P3 as well. Therefore, (a) is not a function. (b) is satisfying properties P1, P2 and P3. (c) is satisfying properties P1 and P3 but not P2 because 2 and 3 in A are mapped to same element in B which is forbidden according P2. (d) satisfies Property P1 but not P2 because 1; 2; 3 in A is mapped to same element in B which is forbidden according to P2 and it does not satisfy P3 because there exist elements 2 and 3 in B which is not mapped to any elements in A which is forbidden according to property P3. Note: 1. The element b 2 B is called the image of a under f and is written as f(a). 2. If f(a) = b then a is called the pre-image of b under f. 3. A is called the domain of f and f(A) = ff(a) j a 2 Ag is called the range of f. B is called the co-domain of f. 4. Examples of functions: a) Domain = Set of apples and Range = weight of apples. b) Domain = Set of students and Range = CGPA of students. 5. Every function is a relation but the converse is not true. 6. For every element a 2 A, there exists an image f(a). i.e., f(a) is well defined. 7. For one-one functions, jBj ≥ jAj and for onto functions jAj ≥ jBj. 8. For functions that satisfy both one-one and onto, jBj = jAj. Things to know: 1. Is there a function for which A = ; and B 6= ; ? Yes, an empty function. 2. Is there a function for which A 6= ; and B = ; ? No. 3. Is there a function for which A = ; and B = ; ? Yes, void function. • Let A = B = N(set of natural numbers). - Give an example of a function f : N ! N, which is one-one and not onto ? f(x) = x+1 x - Give an example of a function f : N ! N, which is not one-one but onto ? f(x) = d 2 e - Give an example of a function f : N ! N, which is one-one and onto ? f(x) = x 2 A B A B 1 a 1 a 2 b 2 b 3 c 3 c 4 d 4 d e (a) (b) A B A B 1 a 1 a 2 b 2 b 3 3 c 4 c 4 d (d) (c) Fig. 2: (a) Not one-one and not onto (b) one-one but not onto (c) onto but not one-one (d) one-one and onto • Let A = B = I(set of integers). - Give an example of a function f : I ! I, which is one-one and not onto ? f(x) = 2x x - Give an example of a function f : I ! I, which is not one-one but onto ? f(x) = d 2 e. - Give an example of a function f : I ! I, which is one-one and onto ? f(x) = x • Give an example bijective function f : (0; 1) ! (4; 5) in real numbers ? f(x) = x + 4. Counting functions: Consider two sets A and B and a relation R ⊆ A × B and jAj = n; jBj = m. Number of functions (Number of R satisfying P1): a1 b1 a2 b2 am bm 3 The element a1 in A can be mapped to m elements in B, a2 in A can also be mapped to m elements in B. Similarly each element in A can be mapped to m elements in B. Since each element is having m choices to be mapped. Therefore, Number of functions from A to B =Number of Relations R ⊆ A × B satisfying P1 =m × m × m × ::: × m(n times) = mn or in general, jBjjAj. Number of one-one functions (Number of R satisfying P2): a1 b1 a2 b2 c a am bm b A B A B (a) R (b) forbidden structure forP2 For property P2, note that m ≥ n, otherwise one-one function does not exist. The element a1 has m possibilities, the element a2 has (m − 1) possibilities, (m − 1) because except the element in B which was mapped to a1, similarly an will have (m − (n − 1)) possibilities. a1 a2 a3 ::: an has m possibilities has m − 1 possibilities has m − 2 possibilities ::: has m − (n − 1) b1; b2; : : : ; bm suppose bi has been B n fbig suppose bj has been selected ::: ::: selected for a1 then for a2 then B n fbi; bjg =m × m − 1 × m − 3 × ::: × m − (n − 1) m × m − 1 × m − 3 × ::: × m − (n − 1) × (m − n) × ::: × 3 × 2 × 1 = (m − n) × ::: × 3 × 2 × 1 m! = (m − n)! =mPn = n! × mCn • Let j A j= n and j B j= m. The number of different one-one functions are mCn ×n! = mPn . Remarks: 1. Note that any one-one function from A to B is a bijective function from A to f(A). 2. Counting one-one functions is equivalent to selecting n elements out of m elements from codomain. 3. Counting one-one functions is equivalent to choosing n elements out of m elements from codomain and considering all possible bijective functions on a set of size n. 4. Let j A j= n and j B j= m. If X = fR j R is a relation defined w.r.t (A; B)g and Y = fR j R is a function w.r.t (A; B)g then, j X |≥| Y j (Since, j X j= 2mn and j Y j= mn). Number of onto functions (Number of R satisfying P3): We shall next count the number of onto functions using PIE. 4 Let j A j= n and j B j= m. Number of onto functions = Number of functions - Number of functions that are not onto. The number of functions from A to B = mn Let B = fa1; a2;:::g. The number of functions between A and B in which there is no pre- n image for a1 = (m − 1) . Similarly, for a2; a3;::: n Therefore, the total number of functions in which there is no pre-image for ai = mc1 (m−1) . n Similarly, the total number of functions in which there is no pre-image for (a1; a2) = (m−2) . n Therefore, for any two (ai; aj) = mc2 (m − 2) . The function not having pre-image for both a1 and a2 is counted thrice in the above count- ing.