cse 20 discrete math - university of california, san...

22
CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/

Upload: others

Post on 05-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

CSE 20

DISCRETE MATH

Fall 2017

http://cseweb.ucsd.edu/classes/fa17/cse20-ab/

Today's learning goals• Define and compute the cardinality of a set.

• Use functions to compare the sizes of sets.

• Classify sets by cardinality into: Finite sets, countable sets, uncountable sets.

• Explain the central idea in Cantor's diagonalization argument.

Functions Rosen Sec 2.3; p. 138

Function f: D C means domain D, codomain C, plus rule

Well-defined

Onto

One-to-one

Proving a function is …

Let A = {1,2,3} and B = {2,4,6}.

Define a function from the power set of A to the power set of B by:

Well-defined?

Onto?

One-to-one?

One-to-one + onto Rosen p. 144

one-to-one correspondence

bijection

invertible

The inverse of a function f: AB is

the function g: BA such that

1

2

3

4

5

a

b

c

d

e

One-to-one + onto Rosen p. 144

1

2

3

4

5

a

b

c

d

e

Fact: for finite sets A and B,

there is a bijection between

them if and only if |A| =|B|.

Beyond finite sets Rosen Section 2.5

For all sets, we define

|A| = |B| if and only if there is a bijection between them.

Which of the following is true?

A. |Z| = |N|

B. |N| = |Z+|

C. |Z| = |{0,1}*|

D. All of the above.

E. None of the above.

Cardinality Rosen Defn 3 p. 171

• Finite sets |A| = n for some nonnegative int n

• Countably infinite sets |A| = |Z+| (informally, can be listed out)

"Smallest" infinite set

Sizes and subsets Rosen Theorem 2, p 174 *More on HW*

For all sets A, B we say

|A| ≤ |B| if there is a one-to-one function from A to B.

|A| ≥ |B| if there is an onto function from A to B.

Cantor-Schroder-Bernstein Theorem: |A| = |B| iff |A| ≤ |B| and |A| ≥ |B|

Which of the following is true?

A. If A is a subset of B then |A| ≤ |B|

B. If A is a subset of B then |A| ≠ |B|

C. If A is a subset of B then |A| = |B|

D. None of the above.

E. I don't know

Beyond finite sets Rosen Section 2.5

For all sets, we say

|A| = |B| if and only if there is a bijection between them.

Which of the following is true?

A. |Q| = |Q+|

B. |Q+| = |N x N|

C. |N| = |Q|

D. All of the above.

E. None of the above.

Cardinality Rosen Defn 3 p. 171

• Finite sets |A| = n for some nonnegative int n

• Countably infinite sets |A| = |Z+| (informally, can be listed out)

• Uncountable sets Infinite but not in bijection with Z+

Cardinality Rosen Defn 3 p. 171

• Finite sets |A| = n for some nonnegative int n

Which of the following sets is not finite?

A.

B.

C.

D.

E. None of the above (they're all finite)

Cardinality Rosen p. 172

• Countable sets A is finite or |A| = |Z+| (informally, can be listed out)

Examples:

and also …

- the set of odd positive integers Example 1

- the set of all integers Example 3

- the set of positive rationals Example 4

- the set of negative rationals

- the set of rationals

- the set of nonnegative integers

- the set of all bit strings {0,1}*

Cardinality Rosen p. 172

• Countable sets A is finite or |A| = |Z+| (informally, can be listed out)

Examples:

and also …

- the set of odd positive integers Example 1

- the set of all integers Example 3

- the set of positive rationals Example 4

- the set of negative rationals

- the set of rationals

- the set of nonnegative integers

- the set of all bit strings {0,1}*

Proof strategies?

- List out all and only set elements

(with or without duplication)

- Give a one-to-one function from A to

(a subset of) a set known to be

countable

Proving countabilityWhich of the following is not true?

A. If A and B are both countable then AUB is countable.

B. If A and B are both countable then A B is countable.

C. If A and B are both countable then AxB is countable.

D. If A is countable then P(A) is countable.

E. None of the above

There is an uncountable set! Rosen example 5, page 173-174

Cantor's diagonalization argument

Theorem: For every set A,

There is an uncountable set! Rosen example 5, page 173-174

Cantor's diagonalization argument

Theorem: For every set A,

An example to see what is necessary. Consider A = {a,b,c}.

What would we need to prove that |A| = |P(A)|?

Cantor's diagonalization argument

Theorem: For every set A,

Proof: (Proof by contradiction)

Assume towards a contradiction that . By definition, that

means there is a bijection .

f(x) = Xx

A

f

There is an uncountable set! Rosen example 5, page 173-174

Cantor's diagonalization argument

Consider the subset D of A defined by, for each a in A:

f(x) = Xx

A

f

D

There is an uncountable set! Rosen example 5, page 173-174

Cantor's diagonalization argument

Consider the subset D of A defined by, for each a in A:

Define d to be the pre-image of D in A under f f(d) = D

Is d in D?

• If yes, then by definition of D, a contradiction!

• Else, by definition of D, so a contradiction!

There is an uncountable set! Rosen example 5, page 173-174

Cardinality Rosen p. 172

• Uncountable sets Infinite but not in bijection with Z+

Examples: the power set of any countably infinite set

and also …

- the set of real numbers Example 5

- (0,1) Example 6 (++)

- (0,1] Example 6 (++)

Exercises 33, 34

Happy Thanksgiving!