31
Computability Andreas Klappenecker and Hyunyoung Lee Texas A&M University 1 / 26

Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Computability

Andreas Klappenecker and Hyunyoung Lee

Texas A&M University

1 / 26

Page 2: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Motivation

QuestionAre there computational problems that we cannot solve

with a computer, even if we give an arbitrary amount of

time and space?

2 / 26

Page 3: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Motivation

AnswerThe answer is a resounding YES!

How can we Show It?We need a bit of set theory to show this. It is nothing

deep, but religiously use the definitions, as your intuition

might fail you.

3 / 26

Page 4: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Motivation

AnswerThe answer is a resounding YES!

How can we Show It?We need a bit of set theory to show this. It is nothing

deep, but religiously use the definitions, as your intuition

might fail you.

3 / 26

Page 5: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Sizes of Sets

A “ ta, b, cu

B “ t5, 6, 7u

C “ tA,Z , 1, 2u

Z, N0, R

4 / 26

Page 6: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Cardinality

Two sets A and B are said to have the same cardinalityor are equipotent if and only if there exists a bijectivefunction from A onto B .

The cardinality of A is less than or equal to the

cardinality of B if and only if there exists an injectivefunction from A to B .

5 / 26

Page 7: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Cardinality

Two sets A and B are said to have the same cardinalityor are equipotent if and only if there exists a bijectivefunction from A onto B .

The cardinality of A is less than or equal to the

cardinality of B if and only if there exists an injectivefunction from A to B .

5 / 26

Page 8: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Notation

For sets A and B , we write

|A| ď |B |

if and only if the cardinality of A is less than or equal to

the cardinality of B . We write

|A| “ |B |

if and only if A and B have the same cardinality.

6 / 26

Page 9: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Properties of Cardinalities

Proposition

Let A, B , and C be sets. Then

(a) |A| “ |A|,

(b) if |A| ď |B | and |B | ď |A|, then |A| “ |B |,

(c) if |A| ď |B | and |B | ď |C |, then |A| ď |C |.

7 / 26

Page 10: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Finite Sets

A set A is called finite if and only if there exists a

nonnegative integer n such that |n| “ |A|. If |n| “ A, then

we say that A has n elements and write the cardinality in

the more pleasing form n “ |A|.

8 / 26

Page 11: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Pigeonhole Principle

Pigeonhole Principle

It is impossible to place n pigeons into fewer than n pigeonholeswithout occupying at least one pigeonhole twice.

For instance, it is impossible to place five pigeons

f f f f finto four pigeonholes

�̋ �̋ �̋ �̋

such that each pigeonhole contains at most one pigeon.

9 / 26

Page 12: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Pigeonhole Principle

Proposition (Pigeonhole Principle)

There is no injective mapping from n “ t0, 1, . . . , n ´ 1u onto asubset of n.

10 / 26

Page 13: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Hilbert’s Hotel

Hilbert’s hotel has an infinite number of rooms, all occupied:

0 1 2 3 ¨ ¨ ¨

1 2 3 ¨ ¨ ¨

A new guest arrives, so Hilbert asks everyone to move to the nextroom, so the guest in room n moves to room n ` 1.Now each old guest has a room and the new guest can move intoroom 0.

11 / 26

Page 14: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Hilbert’s Hotel

Why does Hilbert’s trick work?

The map f : N0 Ñ N1 given by

f pnq “ n ` 1

is an injective (in fact bijective) map from the set of

nonnegative numbers onto the subset of positive integers.

Wow!

12 / 26

Page 15: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Cardinality of Infinite Sets

|N0| “ |N1|

|N0| “ |tx P N0 | x is evenu|

|N1| “ |tx P N1 | x is primeu|

13 / 26

Page 16: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Cardinality of Infinite Sets

|N0| “ |N1|

|N0| “ |tx P N0 | x is evenu|

|N1| “ |tx P N1 | x is primeu|

13 / 26

Page 17: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Cardinality of Infinite Sets

|N0| “ |N1|

|N0| “ |tx P N0 | x is evenu|

|N1| “ |tx P N1 | x is primeu|

13 / 26

Page 18: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Countable Sets

A set A satisfying |A| ď |N0| is called a countable set.

In other words, it suffices to find an injective function from

A into N0 to prove that A is countable.

Alternatively, we can prove that A is countable if we can

find a surjection from N0 onto A.

14 / 26

Page 19: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Direct Products of Countable Sets

Proposition

Suppose that A and B are countable sets. Then Aˆ B is

a countable set.

15 / 26

Page 20: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Cantor’s Diagonals

Cantor showed that N0 ˆN0 is countable as follows.

0 1 2 3

p0, 0q

p0, 1q

p1, 0q

p0, 2q

p1, 1q

p2, 0q

p0, 3q

p1, 2q

p2, 1q

p3, 0q

k

0 1 2 3

0 1

2

3

4

5

6

7

8

9

16 / 26

Page 21: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Conclusion

|N0| “ |N0 ˆN0|

If A and B are countable sets, then Aˆ B is a countable

set.

17 / 26

Page 22: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Conclusion

|N0| “ |N0 ˆN0|

If A and B are countable sets, then Aˆ B is a countable

set.

17 / 26

Page 23: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Proposition

Let S “ tAi | i P I u be a family of countable sets Ai such

that I is a nonempty countable set. ThenŤ

S is a

countable set.

18 / 26

Page 24: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Sets with Larger Cardinality

Let A and B be sets. We

write

|A| ă |B |

if and only if there exists an

injective function from A into

B , but no bijective function

from A onto B .

19 / 26

Page 25: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Cantor’s Remarkable Argument

Proposition (Cantor)

Let A be a set. There does not exist any surjection from A ontoPpAq.

Proof.

Given any function f : AÑ PpAq, we can construct the set

S “ tx P A | x R f pxqu.

Seeking a contradiction, let us assume that there exists an elementa P A such that f paq “ S . Then we have a P f paq if and only ifa R f paq, which is a contradiction. Thus, f is not surjective.

20 / 26

Page 26: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Strict Increase of Cardinality

Corollary

Let A be a set. Then |A| ă |PpAq|.

Proof.The function f : AÑ PpAq given by f pxq “ txu is

injective, so |A| ď |PpAq|. By the previous proposition,

there cannot exist any surjective map from A onto PpAq.

Therefore, |A| ă |PpAq|.

21 / 26

Page 27: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Characteristic Functions

Example

Set S “ t0, 1, 2u. Then a characteristic function f : S Ñ t0, 1udescribes a subset A of S . For example

f p0q “ 1, , f p1q “ 0, f p2q “ 1

describes the set A “ t0, 2u.

22 / 26

Page 28: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Equipotence of Set of Characteristic Functions and Power Sets

Let us denote by 2N0 the set of all functions from the

nonnegative integers to the set t0, 1u with two elements.

Proposition

The power set PpN0q and the set 2N0 are equipotent,

|2N0| “ |PpN0q|.

23 / 26

Page 29: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Computable Functions

Choose a programming language L of your preference that

is expressive enough to compute functions.

We call a function f in 2N0 computable in L if and only

if there exists a program that for each input n P N0 will

compute f pnq.

24 / 26

Page 30: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Computability

Theorem

There exist functions in 2N0 that cannot be computed in L.

Proof.Let Ak denote the set of all programs in L that have k characters.Then Ak is a finite set. The set of all programs that can beexpressed in L is given

Ť

S , where S “ tAk |P N0u. The setŤ

S iscountable.By contrast, the set 2N0 of characteristic functions is not countable,since |2N0| “ |PpN0q| ą |N0| by the previous Corollary.

25 / 26

Page 31: Andreas Klappenecker and Hyunyoung Leefaculty.cs.tamu.edu/klappi/csce411-s19/csce411-computability.pdf · A into N 0 to prove that A is countable. Alternatively, we can prove that

Conclusion

Remarkable FactWe cannot compute most functions of the type

N0 Ñ t0, 1u.

26 / 26