* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download 04-function
Functional decomposition wikipedia , lookup
Abuse of notation wikipedia , lookup
Big O notation wikipedia , lookup
Large numbers wikipedia , lookup
Real number wikipedia , lookup
Principia Mathematica wikipedia , lookup
List of first-order theories wikipedia , lookup
Georg Cantor's first set theory article wikipedia , lookup
Fundamental theorem of algebra wikipedia , lookup
Series (mathematics) wikipedia , lookup
Continuous function wikipedia , lookup
Mathematics of radio engineering wikipedia , lookup
Dirac delta function wikipedia , lookup
Elementary mathematics wikipedia , lookup
Non-standard calculus wikipedia , lookup
History of the function concept wikipedia , lookup
Function of several real variables wikipedia , lookup
Proofs of Fermat's little theorem wikipedia , lookup
COMP2121 Discrete Mathematics Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts] [O2 Proof Techniques] 1 What you will learn… • Z+ = {1,2,3…..} • E+ = {2,4,6,8,…} • Real numbers • Z+ and E+ are countable sets • Rational numbers are countable • Real numbers are uncountable • To prove that they have different kinds of infinity, we need the concept of function 2 What is a Function? Let us consider some mathematical functions f(x) = 3x-2 square-area(x) = x2 Function represented by table Price (HK$) 5 5.5 6 6.5 7 7.5 Demand (no.) 5000 4700 4500 4350 4250 4200 Function represented by graph 5200 5000 4800 4600 4400 4200 4000 3800 5.0 5.5 6.0 6.5 7.0 7.5 3 Functions and Sets [O1] Let A, B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. We write f : A B We can also write f(a) = b where aA and bB A function is also called a mapping. Example: (Labeled balls into labeled bins) A function f represented by labeled balls into labeled bins from A (the set of balls) to B (the set of bins) is defined as follows: f(i)=j means put ball i into bin j. Hence the function is putting balls into bins and each ball is put into exactly one bin. 4 Basic Terminology Given a function f : A B ( f maps A to B ), A is the domain of f (‘balls’) B B is the codomain of f (‘bins’) A If f(a) = b, b is the image of a. The range of f is the set of all images of elements of A. { b | b B and ( a (f (a) = b) ) } (‘non-empty bins’) Example: Let f : Z Z and f(x) = x2, where Z = set of integers Domain = Z, codomain = Z, range = Z ? 5 Injective Functions (One-to-one) A function f is injective, iff for every distinct x, y in the domain, f(x) f(y). A B “Different inputs imply different outputs” Examples of injective function: f: Z Z: f(x)=2x, f(x)=x3, balls into bins function such that each bin has at most one ball. Examples of not injective function: f: Z Z: f(x)=x4 6 Surjective Functions (Onto) A function f from A to B is called surjective, iff for all b B, there exists an element a A such that f(a) = b. A B “Every element in the codomain is the output of some input” Examples of surjective function: f: Z Z: f(x)=x+2 balls into bins function such that each bin has at least one ball. Examples of not surjective function f: Z Z: f(x)=2x 7 Bijective Functions A function f that is both injective and surjective is called a bijection. A B Examples: f: Z Z: f(x)=x, f(x)=x+2 balls into bins function such that each bin has exactly one ball. which means the number of balls = the number of bins if there are finite number of balls and bins. 8 Examples Determine whether the following functions are injection, surjection, or bijection? f1 : Z Z, f1(x) = x2 Not injection, since f(-1) = f(1) = 1. Not surjection, since there is no integer x such that x2 = -1. f2 : Z Z, f2(x) = x + 1 Injection, since x+1 y+1 implies x y. Surjection, since f(x) = y x + 1 = y x = y – 1. Bijection, since it is both one-to-one and onto. 9 Different Kinds of Infinity • Two sets A and B have the same cardinality iff there exists a bijection f:A→B • Example: Z+ = {1,2,3,4,…..} E+ = {2,4,6,8,…} Does E+ Z+ imply |E+| < |Z+|? NO! Bijection f : Z+→E+ such that f(x)=2x 10 Different Kinds of Infinity • f : Z+→E+ such that f(x)=2x is Injective since if x1, x2 Z+ are different, f(x1) ≠ f(x2) Surjective since for any y E+, there exists x=y/2 such that x Z+ and f(x)=y f(x) is a bijection • Z+ and E+ have the same cardinality: 1 2 3 4 5 …. ↓↓↓↓↓… 2 4 6 8 10 …. 11 Countable Sets Definition. A set S is countable if either: (i) the set S is finite, or (ii) there is a bijection from the set S to Z+. Examples of Countable Sets (i) Z+ (positive integers) is countable. (ii) Set of all integers (iii) Even numbers 12 Some Results • Countable and uncountable: 1. All subsets of a countable set are countable. Proof? 2. If there is a injection from a set A to another set B If A is uncountable, then B is uncountable. If B is countable, then A is countable, too. 13 Q (rational numbers) is countable [O2] • Simple case: Q+ is countable. • Each element of Q+ can be represented by a/b, where a and b are relatively-prime integers and a,b>0. b 1 2 3 4 … 1 1/1 1/2 1/3 1/4 … 2 2/1 2/2 2/3 … … 3 3/1 3/2 … … … 4 4/1 … … … … … … … … … … a Q+ 14 Q (rational numbers) is countable • Simple case: Q+ is countable. • Each element of Q+ can be represented by a/b, where a and b are relatively-prime integers and a,b>0. b 1 2 3 4 … 1 1 1/1 1/2 2 1/3 4 1/4 6 … 2 2/1 3 2/3 7 … … 3 3/1 5 3/2 8 … … … 4 4/1 9 … … … … … … … … … … a Q Z++ Removing duplicates Mapping to integers 15 Question: All infinite sets are countable? • Examples: Z+ = {1,2,3,4,…..} E+ = {2,4,6,8,…} Q = rational numbers R = real numbers 16 Question: Do Z+ and P(Z+) have the same cardinality? • They are all infinite sets. • But they have different kinds of infinities. P(Z+) contains “more” elements and is uncountable. Theorem: There is NO bijection mapping from any non-empty set S to P(S) P(S) has a larger cardinality than S 17 Theorem: There is NO bijection mapping any non-empty set S to P(S) Proof: (proof by cases and contradiction) Case 1: If S is a finite set. Then |P(S)| = 2|S| > |S|. Case 2: If S is a infinite set. Assume there is a bijection f: S → P(S). Then for each xS, f(x)P(S). Define A {x S : x f ( x)} , then A P(S). condition* Since f is also a surjection, for each element X in P(S), there exists x in S such that f(x)=X. Hence there exists an element a in S such that f(a)=A. If a f (a ) , then condition* of A is not satisfied, a A f (a ) . Contradiction. If a f (a ) , then condition* of A is satisfied, a A f (a ) . Contradiction. Hence, such a bijection does not exist. 18 R (real numbers) is uncountable • Intuition: P(Z+) is uncountable and is a “subset” of R. • There is a injection from P(Z+) to R: Input: a subset of Z+, S={s1, s2, s3,…} Output: a real number X in [0,1] such that X=0.x1x2x3x4… where xi=1 if iS and 0 if iS • Examples: f({1,3,4,7,10}) = 0.1011001001 f({2,5,6,8,9}) = 0.0100110110 f(Ø)=0, f(Z+)=0.111111… • R has at least the cardinality as P(Z+) • R is uncountable! 19 Axiom of Choice (Something sounds trivial but has profound implication later) f : C Si Si C f ( Si ) Si 20