Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Structures for Computer Science

Similar presentations


Presentation on theme: "Discrete Structures for Computer Science"โ€” Presentation transcript:

1 Discrete Structures for Computer Science
Presented By: Andrew F. Conn Adapted from: Adam J. Lee Lecture #9: Functions and Sequences September 28th, 2016

2 Announcements Homework 2 is due next class.

3 Todayโ€™s Topics Sequences and Summations Cardinality of Infinite Sets
Important Sequences and Summations Closed form of summations. Cardinality of Infinite Sets Countable Sets Uncountable Sets

4 Important sequences Geometric progressions are sequences of the form ๐‘Ž๐‘Ÿ๐‘› where ๐‘Ž and ๐‘Ÿ are real numbers Examples: 1, 1 2 , 1 4 , 1 8 , 1 16 , โ€ฆ 2,โˆ’2, 2, โˆ’2, 2, โˆ’2, โ€ฆ Arithmetic progressions are sequences of the form ๐‘Ž + ๐‘›๐‘‘ where ๐‘Ž and ๐‘‘ are real numbers. 2, 4, 6, 8, 10, โ€ฆ โˆ’10, โˆ’15, โˆ’20, โˆ’25, โ€ฆ ๐‘Ž=1, ๐‘Ÿ=ยฝ ๐‘Ž=2, ๐‘Ÿ=โˆ’1 ๐‘Ž=2, ๐‘‘=2 ๐‘Ž=โˆ’10, ๐‘‘=โˆ’5

5 Important sequences Recurrence Relations are sequences of the form ๐‘“ ๐‘› =๐‘“( ๐‘“ ๐‘›โˆ’1 , ๐‘“ ๐‘›โˆ’2 ,โ€ฆ) Examples: 1,2,6,24,120,720,โ€ฆ 1,1,2,3,5,8,13,21โ€ฆ ๐‘“ ๐‘› =๐‘›โˆ— ๐‘“ ๐‘›โˆ’1 ๐‘“ ๐‘› = ๐‘“ ๐‘›โˆ’1 + ๐‘“ ๐‘›โˆ’2

6 Important Sums and their Closed Forms
๐‘˜=0 ๐‘› ๐‘Ž ๐‘Ÿ ๐‘˜ , ๐‘Ÿโ‰ 0 ๐‘Ž ๐‘Ÿ ๐‘›+1 โˆ’๐‘Ž ๐‘Ÿโˆ’1 , ๐‘Ÿโ‰ 1 ๐‘˜=1 ๐‘› ๐‘˜ ๐‘› ๐‘›+1 2 ๐‘˜=1 ๐‘› ๐‘˜ 2 ๐‘› ๐‘›+1 2๐‘›+1 6 ๐‘˜=1 ๐‘› ๐‘˜ 3 ๐‘› 2 ๐‘› ๐‘˜=1 โˆž ๐‘ฅ ๐‘˜ , ๐‘ฅ <1 1 1โˆ’๐‘ฅ ๐‘˜=1 โˆž ๐‘˜ ๐‘ฅ ๐‘˜โˆ’1 , ๐‘ฅ <1 1 1โˆ’๐‘ฅ 2 `

7 Infinite Cardinality Problem: It is easy to reason about the cardinality of finite sets by just counting the elements. It is more difficult to reason about the cardinality of infinite sets. Intuition: If we can compare two sets to one another we can determine something about their respective cardinalities. One set that is very useful for comparison to is the Natural Numbers (โ„•).

8 Injective, Surjective, Bijective โ€ฆ
๐ด โ‰ค ๐ต iff there exists an injection ๐‘“:๐ดโ†’๐ต. Intuitively, if all the values from ๐ด can be mapped to ๐ต by ๐‘“, then ๐ต must be at least as large as ๐ด. ๐ด โ‰ฅ ๐ต iff there exists a surjection ๐‘“:๐ดโ†’๐ต Intuitively, every element of ๐ต is mapped by at least one element of ๐ด by ๐‘“. ๐ด = ๐ต iff there exists a bijection ๐‘“:๐ดโ†’๐ต. Intuitively, if all the values from ๐ต can be uniquely mapped to from all the values in ๐ด, then the sets are the same size. ๐ด < ๐ต iff there exists an injection, but not a bijection, ๐‘“:๐ดโ†’๐ต Intuitively, if there exists an element in ๐ต that is not mapped to from ๐ด by ๐‘“, then ๐ต is strictly larger than ๐ด.

9 Countable Definitions
Definition: We say that a set ๐ด is countable iff there exists a injection ๐‘“:๐ดโ†’โ„• Definition: We say that a set ๐ด is countably infinite iff there exists a bijection ๐‘“:๐ดโ†’โ„•

10 Show that the set of even natural numbers is countable
Proof #1: We have the following injective correspondence between โ„• and the even natural numbers: So, the even natural numbers are countable. โ Proof #2: We can define ๐‘“:โ„•โ†’2โ„• as ๐‘“ ๐‘› =2๐‘›. ๐‘“ is a bijection, thus 2โ„• =|โ„•| and the even positive integers are countably infinite. โ 1 2 3 4 5 6 7 8 9 10 โ€ฆ 2 4 6 8 10 12 14 16 18 20 โ€ฆ

11 Show that โ„ค is countably infinite.
Proof: We have the following bijective correspondence between โ„• and โ„ค: So, โ„ค is countably infinite. โ 1 2 3 4 5 6 7 8 9 10 โ€ฆ -1 -2 -3 -4

12 Is the set โ„š + countable? Perhaps surprisingly, yes!
1 2 3 4 0 1 1 1 2 1 3 1 4 1 0 2 1 2 2 2 3 2 4 2 0 3 1 3 2 3 3 3 4 3 0 4 1 4 2 4 3 4 4 4 List p+q = 1 first, then p+q = 2, p+q =3, โ€ฆ This yields the sequence 0 1 , 1 1 , 0 2 , 0 3 , 1 2 , 2 1 , โ€ฆ If we remove the duplicates, we can define a function, ๐‘“: โ„š + โ†’โ„• using this method. Since ๐‘“ is a bijection, โ„š + is countable. โ

13 Is โ„ countable? No, it is not. We can prove this using a proof method called diagonalization, invented by Georg Cantor. Proof: Assume that the set of real numbers is countable. Then the subset of real numbers between 0 and 1 is also countable, by definition. This implies that the real numbers can be listed in some order, say, ๐‘Ÿ 1 , ๐‘Ÿ 2 , ๐‘Ÿ 3 ,โ€ฆ. Let the decimal representation these numbers be: ๐‘Ÿ 1 =0.๐‘‘11๐‘‘12๐‘‘13๐‘‘14โ€ฆ ๐‘Ÿ 2 =0.๐‘‘21๐‘‘22๐‘‘23๐‘‘24โ€ฆ ๐‘Ÿ 3 =0.๐‘‘31๐‘‘32๐‘‘33๐‘‘34โ€ฆ โ‹ฎ = โ‹ฎ. โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ Where ๐‘‘๐‘–๐‘—โˆˆ 0,1,2,3,4,5,6,7,8,9 โˆ€๐‘–,๐‘—

14 Proof (continued) Now, form a new decimal number ๐‘Ÿ=0. ๐‘‘ 1 ๐‘‘ 2 ๐‘‘3โ€ฆ where ๐‘‘๐‘–= 0, if ๐‘‘ ๐‘–,๐‘– =9 1, if ๐‘‘ ๐‘–,๐‘– =0 โ‹ฎ Example: ๐‘Ÿ1 = โ€ฆ ๐‘Ÿ2 = โ€ฆ ๐‘Ÿ3 = โ€ฆ โ€ฆ ๐‘Ÿ = 0.242โ€ฆ ๐‘Ÿ is different from all of the ๐‘Ÿ ๐‘– โ€™s in the list, namely in the ๐‘–th decimal place. We assumed that there was a listing and found an element missing from the listing, thus no such element exists. Therefore the assumption that โ„ is countably infinite is false. โ

15 Final thoughts Sets are the basis of functions, which are used throughout computer science and mathematics Sequences allow us to represent (potentially infinite) ordered lists of elements Functions allow us to compare sets and their relative sizes. Infinity is crazy! Next time: Integers and division (Section 4.1)


Download ppt "Discrete Structures for Computer Science"

Similar presentations


Ads by Google