cardinality with applications to computability

39
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006

Upload: nonnie

Post on 20-Jan-2016

61 views

Category:

Documents


0 download

DESCRIPTION

Cardinality with Applications to Computability. Lecture 33 Section 7.5 Wed, Apr 12, 2006. Cardinality of Finite Sets. For finite sets, the cardinality of a set is the number of elements in the set. For a finite set A , let | A | denote the cardinality of A. Cardinality of Infinite Sets. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Cardinality with Applications to Computability

Cardinality with Applications to Computability

Lecture 33

Section 7.5

Wed, Apr 12, 2006

Page 2: Cardinality with Applications to Computability

Cardinality of Finite Sets

For finite sets, the cardinality of a set is the number of elements in the set.

For a finite set A, let |A| denote the cardinality of A.

Page 3: Cardinality with Applications to Computability

Cardinality of Infinite Sets

We wish to extend the notion of cardinality to infinite sets.

Rather than talk about the “number” of elements in an infinite set, for infinite sets A and B, we will speak of the cardinality of A.A having the same cardinality as B, orA having a lesser cardinality than B, orA having a greater cardinality than B.

Page 4: Cardinality with Applications to Computability

Definition of Same Cardinality

Two sets A and B have the same cardinality if there exists a one-to-one correspondence from A to B.

Write |A| = |B|. Note that this definition works for finite

sets, too.

Page 5: Cardinality with Applications to Computability

Definition of Same Cardinality

Theorem: If |A| = |B| and |B| = |C|, then |A| = |C|.

Page 6: Cardinality with Applications to Computability

Same Cardinality

Theorem: |2Z| = |Z|, where 2Z represents the even integers.

Proof:Define f : Z 2Z by f(n) = 2n.Clearly, f is a one-to-one correspondence.Therefore, |2Z| = |Z|.

Page 7: Cardinality with Applications to Computability

Cardinality of Z+

Theorem: |Z+| = |Z|, where Z+ represents the positive integers.

Proof:Define f : Z Z+ by

• f(n) = 2n if n > 0 • f(n) = 1 – 2n if n 0.

Verify that f is a one-to-one correspondence.

Therefore, |Z+| = |Z|.

Page 8: Cardinality with Applications to Computability

Definition of Lesser Cardinality

Set A has a cardinality less than or equal to the cardinality of a set B if there exists a one-to-one function from A to B.

Write |A| |B|. Then |A| < |B| means that there is a one-to-

one function from A to B, but there is not a one-to-one correspondence from A to B.

Page 9: Cardinality with Applications to Computability

Order Relations Among Infinite Sets

Corollary: If |A| |B| and |B| |C|, then |A| |C|.

Corollary: If A B, then |A| |B|. Proof:

Let A B.Define the function f : A B by f(a) = a.Clearly, f is one-to-one.Therefore, |A| |B|.

Page 10: Cardinality with Applications to Computability

Definition of Greater Cardinality

We may define |A| |B| to mean |B| |A| and define |A| > |B| to mean |B| < |A|.

Page 11: Cardinality with Applications to Computability

Definition of Greater Cardinality

Theorem: |A| |B| if and only if there exists an onto function from A to B.

A B

Page 12: Cardinality with Applications to Computability

Definition of Greater Cardinality

Theorem: |A| |B| if and only if there exists an onto function from A to B.

A B

f

one-to-onefunction

Page 13: Cardinality with Applications to Computability

Definition of Greater Cardinality

Theorem: |A| |B| if and only if there exists an onto function from A to B.

A B

g

its inverse

Page 14: Cardinality with Applications to Computability

Definition of Greater Cardinality

Theorem: |A| |B| if and only if there exists an onto function from A to B.

A B

g

onto function

Page 15: Cardinality with Applications to Computability

Order Relations Among Infinite Sets

Corollary: If |A| |B| and |B| |C|, then |A| |C|.

Corollary: If |A| |B| and |B| |A|, then |A| = |B|.

Etc.

Page 16: Cardinality with Applications to Computability

Cardinality of the Interval (0, 1)

Theorem: The interval (0, 1) has the same cardinality as R.

Proof:The function f(x) = (x – ½) establishes that

|(0, 1)| = |(–/2, /2)|.The function g(x) = tan x establishes that

|(–/2, /2)| = |R|.Therefore, |(0, 1)| = |R|.

Page 17: Cardinality with Applications to Computability

Countable Sets

A set is countable if it either is finite or has the same cardinality as Z+.

Examples: 2Z and Z are countable. To show that an infinite set is countable, it

suffices to give an algorithm for listing, or enumerating, the elements in such a way that each element appears exactly once in the list.

Page 18: Cardinality with Applications to Computability

Example: Countable Sets

Theorem: The number of strings of finite length consisting of the characters a, b, and c is countable.

Correct proof:Group the strings by length: {}, {a, b, c},

{aa, ab, …, cc}, …Arrange the strings alphabetically within

groups.

Page 19: Cardinality with Applications to Computability

Canonical Ordering

This gives the canonical order, a, b, c, aa, ab, ac, ba, …, cc,

aaa, aab, …, ccc, aaaa, aaab, …,

where denotes the empty string. Consider the string bbabc.

How do we know that it will appear in the list?

In what position will it appear?

Page 20: Cardinality with Applications to Computability

Incorrect Proof

Incorrect Proof:Group the strings by their first letter {a, aa, ab, …}, {b, ba, bb, …}, {c, ca, cb, …}.

Within those groups, group those words by their second letter, and so on.

List the a-group first, the b-group second, and the c-group last.

In what position will we find the string bbabc? the string abc? the string aaaab?

Page 21: Cardinality with Applications to Computability

Example: Countable Sets

Theorem: Q is countable. Proof:

Arrange the positive rationals in an infinite two-dimensional array.

1/1 1/2 1/3 1/4 …

2/1 2/2 2/3 2/4 …

3/1 3/2 3/3 3/4 …

4/1 4/2 4/3 4/4 …

: : : :

Page 22: Cardinality with Applications to Computability

Proof of Countability of Q

Then list the numbers by diagonals

1/1 1/2 1/3 1/4 …

2/1 2/2 2/3 2/4 …

3/1 3/2 3/3 3/4 …

4/1 4/2 4/3 4/4 …

: : : :

Page 23: Cardinality with Applications to Computability

Proof of Countability of Q

We get the list

1/1, 2/1, 1/2, 3/1, 2/2, 1/3, 4/1, 2/3, 3/2,

1/4, 5/1, 4/2, 3/3, 2/4, 1/5, … Then remove the repeated fractions, i.e., the

unreduced ones

1/1, 2/1, 1/2, 3/1, 1/3, 4/1, 2/3, 3/2, 1/4,

5/1, 1/5, … In what position will we find 3/5?

Page 24: Cardinality with Applications to Computability

False Proof of the Countability of Q

Incorrect listing #1List the rationals from in order according to

size. Incorrect listing #2

List all fractions with denominator 1 first.Follow that list with all fractions with

denominator 2.And so on.

Page 25: Cardinality with Applications to Computability

Uncountable Sets

A set is uncountable if it is not countable.

Page 26: Cardinality with Applications to Computability

R is Uncountable

Theorem: R is uncountable. Proof:

It suffices to show that the interval (0, 1) is uncountable.

Suppose (0, 1) is countable.Then we may list its members 1st, 2nd, 3rd,

and so on.

Page 27: Cardinality with Applications to Computability

R is Uncountable

Label them x1, x2, x3, and so on.

Represent each xi by its decimal expansion.

x1 = 0.d11d12d13…

x2 = 0.d21d22d23…

x3 = 0.d31d32d33…

and so on, where dij is the j-th decimal digit of xi.

Page 28: Cardinality with Applications to Computability

R is Uncountable

Form a number x = 0.d1d2d3… as follows.

• Define di = 0 if dii 0.

• Define di = 1 if dii = 0.

Then x (0, 1), but x is not in the list x1, x2, x3, …

This is a contradiction.Therefore, R is not countable.

Page 29: Cardinality with Applications to Computability

Functions from Z+ to Z+

Theorem: The number of functions

f : Z+ Z+ is uncountable. Proof:

Suppose there are only countably many.List them f1, f2, f3, …

Page 30: Cardinality with Applications to Computability

Functions from Z+ to Z+

Define a function f : Z+ Z+ as follows.• f(i) = 0 if fi(i) 0.

• f(i) = 1 if fi(i) = 0.

Then f(i) fi(i) for all i in Z+.Therefore, f is not in the list.This is a contradiction.Therefore, the set is uncountable.

Page 31: Cardinality with Applications to Computability

Number of Computer Programs

Theorem: The set of all computer programs is countable.

Proof:Once compiled, a computer program is a

finite string of 0s and 1s.The set of all computer programs is a

subset of the set of all finite binary strings.

Page 32: Cardinality with Applications to Computability

Number of Computer Programs

This set may be listed

, 0, 1,

00, 01, 10, 11,

000, 001, 010, …, 111,

0000, 0001, 0010, 0011, …, 1111, …Therefore, it is countable.As a subset of this set, the set of computer

programs is countable.

Page 33: Cardinality with Applications to Computability

Computability of Functions

Corollary: There exists a function f : Z+ Z+ which cannot be computed by any computer program.

Page 34: Cardinality with Applications to Computability

Subsets of N

There are uncountably many subsets of N. However, there are countably many finite

subsets of N.Can you prove it?

Page 35: Cardinality with Applications to Computability

Cardinality of the Power Set

Theorem: For any set A,|A| < |(A)|.

Proof:There is a one-to-one function f : A (A)

defined by f(x) = {x}.Therefore, |A| |(A)|.We must prove that there does not exist a

one-to-one correspondence from A to (A).

Page 36: Cardinality with Applications to Computability

Proof, continued

That is, we must prove that there does not exist an onto function from A to (A).

Suppose g : A (A) is onto.For every x A, either x g(x) or x g(x).Define a set B = {x A | x g(x)}.Then B (A), since B A.So B = g(a) for some a A (since g is onto,

by assumption).

Page 37: Cardinality with Applications to Computability

Proof, continued

Is a g(a)?Case 1: Suppose a g(a).

• Then a B, by the definition of B.• But B = g(a), so a g(a), a contradiction.

Case 2: Suppose a g(a).• Then a B, by the definition of B.• But B = g(a), so a g(a), a contradiction.

Page 38: Cardinality with Applications to Computability

Proof, concluded

Either way, we have a contradiction.Therefore, no such one-to-one function

exists.Thus, |A| < |(A)|.

Page 39: Cardinality with Applications to Computability

Hierarchy of Cardinalities

Beginning with Z+, consider the sets

Z+, (Z+), ((Z+)), … Each set has a cardinality strictly greater

than its predecessor.

|Z+| < |(Z+)| < |((Z+))| < … These cardinalities are denoted 0,1,2,

…(aleph-naught, aleph-one, aleph-two, …)