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

Slides:



Advertisements
Similar presentations
COUNTING AND PROBABILITY
Advertisements

Functions; Sequences, Sums, Countability
1 Diagonalization Fact: Many books exist. Fact: Some books contain the titles of other books within them. Fact: Some books contain their own titles within.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 10 Cardinality Uncountability of the real numbers.
Functions, Pigeonhole Principle Lecture 14: Nov 4 A B f( ) =
EE1J2 – Discrete Maths Lecture 9
Great Theoretical Ideas in Computer Science.
Discrete Structures Chapter 5 Pigeonhole Principle Nurul Amelina Nasharuddin Multimedia Department.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Copyright © Zeph Grunschlag, Counting Techniques Zeph Grunschlag.
Discrete Mathematics Lecture 7 Alexander Bukharovich New York University.
Functions f( ) = A B Lecture 15: Nov 4.
CHAPTER 4 Decidability Contents Decidable Languages
Pigeonhole.
Sequence A list of objects arranged in a particular order.
Discrete Mathematics Lecture 7 Harper Langston New York University.
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L5- CountingAndEnumeration.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul.
Great Theoretical Ideas in Computer Science.
Cantor’s Legacy: Infinity And Diagonalization Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 25Apr 13, 2004Carnegie.
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
1 CMSC 250 Chapter 7, Functions. 2 CMSC 250 Function terminology l A relationship between elements of two sets such that no element of the first set is.
Functions A B f( ) =. This Lecture We will define a function formally, and then in the next lecture we will use this concept in counting. We will also.
Cardinality of Sets Section 2.5.
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
Fall 2015 COMP 2300 Discrete Structures for Computation
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Lecture 6: Signal Processing III EEN 112: Introduction to Electrical and Computer Engineering Professor Eric Rozier, 2/25/13.
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
Week 7 - Friday.  What did we talk about last time?  Set disproofs  Russell’s paradox  Function basics.
1 Chapter Facts about Functions. 2 Section 2.3 Properties of Functions Let ƒ : A → B be a function. There are three properties that ƒ might possess.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Copyright © Cengage Learning. All rights reserved. CHAPTER 7 FUNCTIONS.
Ch. 11: Cantor’s Infinity!. N = {1, 2, 3, 4, 5, 6, …} “the natural numbers” Z = {…, –3, –2, –1, 0, 1, 2, 3, …} “the integers” Q = {all quotients “a/b”
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.1 and 7.2.
Mathematical Induction
Copyright © 2014 Curt Hill Cardinality of Infinite Sets There be monsters here! At least serious weirdness!
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
Relations, Functions, and Countability
CS201: Data Structures and Discrete Mathematics I
COMPSCI 102 Introduction to Discrete Mathematics.
Sets. Definitions (I) Collection of elements such that: There are no duplicates There is no order Special sets Universe (U or E): all elements under consideration.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Introduction to Real Analysis Dr. Weihu Hong Clayton State University 8/27/2009.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Great Theoretical Ideas in Computer Science.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
Lecture 4 Infinite Cardinals. Some Philosophy: What is “2”? Definition 1: 2 = 1+1. This actually needs the definition of “1” and the definition of the.
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
CS 285- Discrete Mathematics
To Infinity And Beyond! CS Lecture 11 The Ideal Computer: no bound on amount of memory Whenever you run out of memory, the computer contacts the.
Pigeonhole Principle. If n pigeons fly into m pigeonholes and n > m, then at least one hole must contain two or more pigeons A function from one finite.
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
Sequences Lecture 11. L62 Sequences Sequences are a way of ordering lists of objects. Java arrays are a type of sequence of finite size. Usually, mathematical.
1-1 Copyright © 2013, 2005, 2001 Pearson Education, Inc. Section 2.4, Slide 1 Chapter 2 Sets and Functions.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Discrete Mathematics Lecture 6
Discrete Mathematics CS 2610
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
2.4 Sequences and Summations
Cardinality of Sets Section 2.5.
Lecture 7 Functions.
Discrete Structures for Computer Science
COUNTING AND PROBABILITY
SE-561 Math Foundations of Software Engineering VIII. Functions
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Cardinality Definition: The cardinality of a set A is equal to the cardinality of a set B, denoted |A| = |B|, if and only if there is a one-to-one correspondence.
Presentation transcript:

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

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 Melikyan/DM/Fall09 If more pigeons than pigeonholes, Pigeonhole Principle

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 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 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 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 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 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 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 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 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 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 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 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,5,7, } has cardinality 5 so is therefore countable 4. Z : This one is more interesting. Continue on next page:

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 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 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 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 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 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 Melikyan/DM/Fall09 L622 Cantor's Diagonalization Argument r 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 Melikyan/DM/Fall09 L623 Cantor's Diagonalization Argument r r r 3 0. r 4 0. r 5 0. r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

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

25 Melikyan/DM/Fall09 25 Cantor's Diagonalization Argument r r r r r 5 0. r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

26 Melikyan/DM/Fall09 L626 Cantor's Diagonalization Argument r r r r r r 6 0. r 7 0. : r evil 0.  Decimal expansions of r i 

27 Melikyan/DM/Fall09 L627 Cantor's Diagonalization Argument r r r r r r r 7 0. : r evil 0.  Decimal expansions of r i 

28 Melikyan/DM/Fall09 28 Cantor's Diagonalization Argument r r r r r r r : r evil 0.  Decimal expansions of r i 

29 Melikyan/DM/Fall09 L629 Cantor's Diagonalization Argument r r r r r r r : r evil  Decimal expansions of r i 

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

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!