Download Countability - Computer Science

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Law of large numbers wikipedia , lookup

History of the function concept wikipedia , lookup

Infinitesimal wikipedia , lookup

Approximations of π wikipedia , lookup

Mathematical proof wikipedia , lookup

Infinite monkey theorem wikipedia , lookup

Four color theorem wikipedia , lookup

Positional notation wikipedia , lookup

Elementary mathematics wikipedia , lookup

Non-standard analysis wikipedia , lookup

Non-standard calculus wikipedia , lookup

List of first-order theories wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Hyperreal number wikipedia , lookup

Infinity wikipedia , lookup

Transcript
Countability
Sizes of finite and infinite sets
Wednesday, September 16, 2009
Reading: Stoughton 1.1.6
CS235 Languages and Automata
Department of Computer Science
Wellesley College
The Pigeon-Hole Principle
The pigeon-hole principle says that if p pigeons are put into less than
p holes, some hole must end up with more than one pigeon in it.
This principle is often invoked in proofs involving counting arguments.
Suppose A and B are finite sets and |A| > |B|.
•
Can a total function in A → B be injective? Explain.
•
Can a total function in A → B be surjective ? Explain.
•
Can a total function in B → A be injective? Explain.
•
Can a total function in B → A be surjective? Explain.
Countability
5-2
1
Set Sizes
Two sets A and B have the same size (written A  B) if there is
some bijection in A → B.
Example
E
mp 1: Bool  {{0,1}
, } by
y the bijection
j
((Bool,, {{0,1},
, }, {(
{(T,0),
, ), (F,
(F,1)})
)})
If A and B are finite sets (|A| = |B|)  (A  B)
Example 2: A x (B x C)  (A x B) x C by the bijection whose graph
has pairs of the form ( (a,(b,c)), ((a,b),c) ). A, B, and C are not
required to be finite! This bijection allows us to treat these
two products effectively interchangeably, giving rise to a kind
of associativity.
associativity
Countability
5-3
Nat and Int Have the Same Size!
Example 3: Int  Nat by the
pictured bijection. How would
you define this bijection
f m ll ? This is an
formally?
n example
x mpl
of proof by construction.
… -3 -2 -1
0
1
2
3 …
… 6
0
1
3
5 …
4
2
Countability
5-4
2
Countable and Uncountable Sets
A set S is
• finite iff S  {1, 2, …, n} for some n.
• infinite iff S is not finite
finite.
• countably infinite iff S  Nat.
• countable iff S is finite or countably infinite.
I.e., there is a procedure for enumerating all the
elements of S.
• uncountable
bl iff
ff S is not countable
bl
We’ve seen that Bool, Nat, and Int are countable.
Now we’ll see that (1) Rat is countable and
(2) Real is uncountable.
Countability
5-5
Countability
5-6
Rat is Countable
Key idea: can enumerate Nat x Nat as follows:
Mopping up:
• Need to eliminate duplicates, e.g., 1/2= 2/4
• Need to handle negative rationals
(as in showing Int countable).
3
Real is Uncountable: Diagonalization
Key idea: use a special form of proof by contradiction known as
diagonalization.
Assume that [0,1)  Real is countable and derive a contradiction.
If [0,1)
[0 1) is countable,
nt bl there
th
must
m st be
b a bijection
bij ti n f  Nat
N t → [0,1)
[0 1)
that enumerates all real numbers between 0 (inclusive) and 1
(exclusive). I.e., if r  [0,1), then there is an n  Nat s.t. f(n) = r.
Draw a table of f whose rows are f(n) and whose columns show the
digits after the decimal point for each number.
f(0)
( )
1
4
1
5
f(1)
7
3
8
2
f(2)
5
4
9
6
f(3)
8
2
7
3
…
..
.
Countability
5-7
Diagonalization Continued
f(0)
1
4
1
5
f(1)
7
3
8
2
f(2)
5
4
9
6
f(3)
8
2
7
3
…
..
.
Focus on the diagonal entries, and construct a number whose
decimal representation differs from every position in the diagonal*.
E.g., .2786 …
Any such number is not a row in the table and so is not in the image
of
ff
f. Th
Thus,
s th
the assumption
ss mpti n that
th t f is a bijection
bij ti n is wrong!
n ! X
A similar argument can be use to show P(Nat) and Nat → Bool are
uncountable.
Diagonalization is the heart of the halting theorem proof.
* For technical reasons, should not use 0 or 9 in the constructed number.
Countability
5-8
4