Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.

Similar presentations


Presentation on theme: "1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5."— Presentation transcript:

1 1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan melikyan@nccu.edu Today we will review sections 7.3, 7.4 and 7.5

2 2 Melikyan/DM/Fall09 Pigeonhole Principle If n pigeons fly into m pigeonholes and n > m, then at least one hole must contain two or more pigeons

3 3 Melikyan/DM/Fall09 If more pigeons than pigeonholes, Pigeonhole Principle

4 4 Melikyan/DM/Fall09 Pigeonhole Principle then some hole must have at least two pigeons! Pigeonhole principle A function from a larger set to a smaller set cannot be one- to-one injective. (There must be at least two elements in the domain that havethe same image in the codomain.)

5 5 Melikyan/DM/Fall09 Examples: A function from one finite set to a smaller finite set cannot be one-to-one In a group of 13 people must there be at least two who have birthday in the same month? A drawer contains 10 black and 10 white socks. How many socks need to be picked to ensure that a pair is found? Let A = {1, 2, 3, 4, 5, 6, 7, 8}. If 5 integers are selected must at least one pair have sum of 9? There is no FSA that accepts the following language: L = {s = a k b k, for positive k}

6 6 Melikyan/DM/Fall09 Pigeonhole Principle Generalized Pigeonhole Principle : For any function f : X  Y acting on finite sets, if n(X) > k * n(Y), then there exists some y from Y so that there are at least k + 1 distinct x’s so that f(x) = y There are 42 students who are to share 12 computers. Each student uses exactly 1 computer and no computer is used by more than 6 students. Show that at least 5 computers are used by 3 or more students. Generalized Pigeonhole Principle( contrapositive form): For any function f : X  Y acting on finite sets and any positive integer k, if for each y  Y, f -1 (y) has at most k elements, then X has at most k * n(Y) elements

7 7 Melikyan/DM/Fall09 ♠ ♥ ♣ ♦ If n pigeons and h holes, then some hole has at least Cannot have < 3 cards in every hole. Generalized Pigeonhole Principle

8 8 Melikyan/DM/Fall09 Exercises Let f : X  Y and n(X) = n(Y), then f is bijective iff f is surjective Let A be a set of 6 integers less than 13. Show that there must be two distinct subsets of A whose sum of elements adds up to the same number Given 52 distinct integers, show that there must be two whose sum or difference is divisible by 100 Show that if 101 integers are chosen from 1 to 200 inclusive, there must be two with the property that one is divisible by the other Suppose a 1, a 2, …, a n is a sequence of n integers none of which is divisible by n. Show that at least one difference a i – a j is divisible by n

9 9 Melikyan/DM/Fall09 9 Cardinality and Countability Up to now cardinality has been the number of elements in a finite sets. Really, cardinality is a much deeper concept. Cardinality allows us to generalize the notion of number to infinite collections and it turns out that many type of infinities exist. EG: –{,  } –{, } –{Ø, {Ø,{Ø,{Ø}}} } These all share “2-ness”.

10 10 Melikyan/DM/Fall09 L610 Cardinality and Countability For finite sets, can just count the elements to get cardinality. Infinite sets are harder. First Idea: Can tell which set is bigger by seeing if one contains the other. –{1, 2, 4}  N –{0, 2, 4, 6, 8, 10, 12, …}  N So set of even numbers ought to be smaller than the set of natural number because of strict containment. Q: Any problems with this?

11 11 Melikyan/DM/Fall09 L611 Cardinality and Countability Set of even numbers is obtained from N by multiplication by 2. I.e. {even numbers} = 2 N For finite sets, since multiplication by 2 is a one-to-one function, the size doesn’t change. EG: {1,7,11} –  2  {2,14,22} Another problem: set of even numbers is disjoint from set of odd numbers. Which one is bigger?

12 12 Melikyan/DM/Fall09 L612 Cardinality and Countability – Finite Sets Definition: Two sets A and B have the same cardinality if there’s a bijection f : A  B For finite sets this is the same as the old definition: {,  } {, }

13 13 Melikyan/DM/Fall09 13 Cardinality and Countability – Infinite Sets Notation, the Hebrew letter Aleph is often used to denote infinite cardinalities. Countable sets are said to have cardinality. Intuitively, countable sets can be counted in the sense that if you allocate 1 second to count each member, eventually any particular member will be counted after a finite time period. Paradoxically, you won’t be able to count the whole set in a finite time period! Definition: If S is finite or has the same cardinality as N, S is called countable

14 14 Melikyan/DM/Fall09 L614 Countability – Examples Q: Why are the following sets countable? 1. {0,2,4,6,8,…} 2. {1,3,5,7,9,…} 1. {1,3,5,7, } 2. Z

15 15 Melikyan/DM/Fall09 L615 Countability – Examples 1. {0,2,4,6,8,…}: Just set up the bijection f ( n ) = 2 n 2. {1,3,5,7,9,…} : Because of the bijection f ( n ) = 2 n +1 3. {1,3,5,7, } has cardinality 5 so is therefore countable 4. Z : This one is more interesting. Continue on next page:

16 16 Melikyan/DM/Fall09 16 Countability of the Integers Let’s try to set up a bijection between N and Z. One way is to just write a sequence down whose pattern shows that every element is hit (onto) and none is hit twice (one-to-one). The most common way is to alternate back and forth between the positives and negatives. I.e.: 0,1,-1,2,-2,3,-3,… It’s possible to write an explicit formula down for this sequence which makes it easier to check for bijectivity:

17 17 Melikyan/DM/Fall09 17 Demonstrating Countability. Useful Facts Because is the smallest kind of infinity, it turns out that to show that a set is countable one can either demonstrate an injection into N or a surjection from N. Theorem: Suppose A is a set. If there is an one-to-one function f : A  N, or there is an onto function g : N  A then A is countable. The proof requires the principle of mathematical induction.

18 18 Melikyan/DM/Fall09 18 Uncountability of R A: This is not a trivial matter. Here are some typical reasoning: 1. R strictly contains N so has bigger cardinality. What’s wrong with this argument 1. R contains infinitely many numbers between any two numbers. Surprisingly, this is not a valid argument. Q has the same property, yet is countable. 1. Many numbers in R are infinitely complex in that they have infinite decimal expansions. An infinite set with infinitely complex numbers should be bigger than N.

19 19 Melikyan/DM/Fall09 19 Uncountability of R Last argument is the closest. Here’s the real reason: Suppose that R were countable. In particular, any subset of R, being smaller, would be countable also. So the interval [0,1] would be countable. Thus it would be possible to find a bijection from Z + to [0,1] and hence list all the elements of [0,1] in a sequence. What would this list look like? r 1, r 2, r 3, r 4, r 5, r 6, r 7, …

20 20 Melikyan/DM/Fall09 L20 Uncountability of R Cantor’s Diabolical Diagonal So we have this list r 1, r 2, r 3, r 4, r 5, r 6, r 7, … supposedly containing every real number between 0 and 1. Cantor’s diabolical diagonalization argument will take this supposed list, and create a number between 0 and 1 which is not on the list. This will contradict the countability assumption hence proving that R is not countable.

21 21 Melikyan/DM/Fall09 21 Cantor's Diagonalization Argument r 1 0. r 2 0. r 3 0. r 4 0. r 5 0. r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

22 22 Melikyan/DM/Fall09 L622 Cantor's Diagonalization Argument r 1 0.1234567 r 2 0. r 3 0. r 4 0. r 5 0. r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

23 23 Melikyan/DM/Fall09 L623 Cantor's Diagonalization Argument r 1 0.1234567 r 2 0.1111111 r 3 0. r 4 0. r 5 0. r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

24 24 Melikyan/DM/Fall09 24 Cantor's Diagonalization Argument r 1 0.1234567 r 2 0.1111111 r 3 0.2542090 r 4 0. r 5 0. r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

25 25 Melikyan/DM/Fall09 25 Cantor's Diagonalization Argument r 1 0.1234567 r 2 0.1111111 r 3 0.2542090 r 4 0.7890623 r 5 0. r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

26 26 Melikyan/DM/Fall09 L626 Cantor's Diagonalization Argument r 1 0.1234567 r 2 0.1511111 r 3 0.2542090 r 4 0.7890623 r 5 0.0110101 r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

27 27 Melikyan/DM/Fall09 L627 Cantor's Diagonalization Argument r 1 0.1234567 r 2 0.1511111 r 3 0.2542090 r 4 0.7890623 r 5 0.0110101 r 6 0.5555555 r 7 0. : r evil 0.  Decimal expansions of r i 

28 28 Melikyan/DM/Fall09 28 Cantor's Diagonalization Argument r 1 0.1234567 r 2 0.1511111 r 3 0.2542090 r 4 0.7890623 r 5 0.0110101 r 6 0.5555555 r 7 0.7679544 : r evil 0.  Decimal expansions of r i 

29 29 Melikyan/DM/Fall09 L629 Cantor's Diagonalization Argument r 1 0.1234567 r 2 0.1511111 r 3 0.2542090 r 4 0.7890623 r 5 0.0110101 r 6 0.5555555 r 7 0.7679544 : r evil 0.5455545  Decimal expansions of r i 

30 30 Melikyan/DM/Fall09 30 Uncountability of R Cantor’s Diabolical Diagonal GENERALIZE: To construct a number not on the list “ r evil ”, let r i,j be the j ’th decimal digit in the fractional part of r i. Define the digits of r evil by the following rule: The j ’th digit of r evil is 5 if r i,j  5. Otherwise the j ’ ’th digit is set to be 4. his guarantees that r evil is an anti-diagonal. I.e., it does not share any elements on the diagonal. But every number on the list contains a diagonal element. This proves that it cannot be on the list and contradicts our assumption that R was countable so the list must contain r evil. //QED

31 31 Melikyan/DM/Fall09 31 Impossible Computations Notice that the set of all bit strings is countable. Here’s how the list looks: 0,1,00,01,10,11,000,001,010,011,100,101,110,111,0000,… DEF: A decimal number 0. d 1 d 2 d 3 d 4 d 5 d 6 d 7 … Is said to be computable if there is a computer program that outputs a particular digit upon request. EG: 1. 0.11111111… 2. 0.12345678901234567890… 3. 0.10110111011110….

32 32 Melikyan/DM/Fall09 32 Impossible Computations Claim: There are numbers which cannot be computed by any computer. Proof : It is well known that every computer program may be represented by a bit-string (after all, this is how it’s stored inside). Thus a computer program can be thought of as a bit string. As there are bit-strings yet R is uncountable, there can be no onto function from computer programs to decimal numbers. In particular, most numbers do not correspond to any computer program so are incomputable!


Download ppt "1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5."

Similar presentations


Ads by Google