Você está na página 1de 12

Lesson 2 Countable and Uncountable Sets

Cardinality of a set
Sets: S = {a, b}, T = {a, b, c}
|S| = 2, |T| = 3
Counting the elements in a set one establishes a bijection (1 1 and onto mapping)
from that set into N here N N (the natural numbers! i"e" #! 1! 2! $! %)"
Definition: & function f from a set ' (the domain to a set C ( codomain )!
ritten f: D C is a relation such that:
i.
f(d
i
) = c
j
and f(d
i
) = c
k
c
j
= c
k
alternately! one may rite
(d
i,
c
j
) f and (d
i,
c
k
) f c
j =
c
k
d
i
D
ii.
d
i
D! c
j
C : f(d
i
) = c
j
i"e" e(ery element in the domain has an image
)n the definition for a function! if only property (i) is satisfied then e ha(e a partial
function as opposed to a (total) function"
f
1
' C
This arrow diagram depicts a relation that is not a function. Explain why not. Is f
1
a
partial function?
f
2
' C
Is this relation a function? Why or why not? Is f
2
a partial function?
1
d
1

d
2

c
1
c
2
c
$
d
1

d
2

c
1
c
2

Definition: & function f is said to be injective ( or ! " if f(d
i
) * c
k
and f(d
j
) *
c
k
implies that d
i
* d
j
" c
k
is said to be the image of d
i
under f! and d
i
is
called the pre#image of c
k
! ritten f
-1
(c
k
) = d
i
" So! e may say that a
function f is injective if pre-images (where they exist!) are unique.
f
3
f
4
' C ' C
Diagrams of f
3
and f
4
$re %oth of these relations e&amples of functions? % Are you sure?
Is either (or %oth?" an e&ample of an injective function?
Definition: & function is said to be surjective (onto) if
c
j
C, d
i
D! : f
-1
(c
j
) = d
i
i"e" Every element in the coomain has a (not necessarily unique) pre-
image.
Is either f
3
or f
4
an e&ample of a surjective (onto" function?
Definition: +he range of a function! R is that subset of the coomain for which pre-
images exist.
i"e" R = {c
j
C | d
i
D ith f(d
i
) = c
j
}subset o

What is the range of f
3
? $nd that of f
4
?
'ive an alternative definition for a surjective function"
2
d
1

d
2


c
1


d
1

d
2


c
1

c
2

c
$
Definition: & function f is said to be %ijective if it is !oth injective an surjective! ie"
+here is a 1 1 correspondence beteen the elements in D and C"
f
5
' C
$ %ijection from D to C
,unctions -ractice -roblems

1" .hich of the folloing relations are functions/


a) * 0(1! 1
2
2 1) 3 1 is a real number 4
b) * 0(1
2
! 1) 3 1 is a real number4
c) * 0( 1
$
! 1) 3 1 is a real number 4
d) * 0(log 1! 1) 3 1 is a real number 4
e) * 0(1! log 1) 3 1 is a real number 4
2" Let & be the set 0#! 1! 2! $! 54" ,or each relation on & gi(en belo! decide if - is a
i) partial function
ii) total function
iii) one6to6one function
i() onto function
a) * 0(#! 5)! ($! 2)! (1! $)! (2! $)! (5!1)4
b) * 0($! 1)! (2! #)! (1! 5)! (5! $)! (#! 2)4
c) * 0(#! $)! (1! 5)! ($! 2)! (2! #)! (1! 5)4
d) * 0(1! $)! ($! 2)! (5! $)! (#! #)! ($! 2)4
.e no return to our pre(ious discussion concerning the cardinality of a set"
Suppose S = {a, b}! then to obtain the cardinality of S e count its elements! i"e" e
establish a bijection from the elements of S into N here N N! the set of natural
numbers"
S: f(a) = 1 77less trouble to start at 1
8
-roblems from (achine) *anguages) and Computation by 'enning! 'ennis! and 9ualit:; -rentice 6 <all
$
d
1

d
2

c
1
c
2

f(b) = 2
<ence e conclude that the cardinality of S is to"
.e obser(e that it is often possible to compare the cardinality of to sets ithout
e1plicitly counting the elements of either"
=1ample:
Let - be the set of people at >an?ee Stadium
Let C be the set of seats at >an?ee Stadium
+hen e ?no:
3 - 3 @ 3 C 3 hen %%%%%""%""%%
3 - 3 A 3 C 3 hen %%%%%%%%%
3 - 3 * 3 C 3 hen %%%%%%%%%
Definition: & set & is finite ith cardinality n N if there is a !ijection from the
set {, 1, !, " # 1} to &" & set is infinite if it is not finite"
Theorem: +he set B of natural numbers is infinite"
+roof: +o pro(e N is not finite! e must sho that there is no " N such that a
!ijection e1ists from {, 1, 2, !, " # 14 to N" Let " be any
element of N and f an arbitrary function from 0#! 1! 2! %! n 14 to N"
Let
$ = 1 % &a' {f(), f(1), !, f(" # 1)}.
+hen $ N! but for e(ery ' {, 1, 2, !, " # 14! f(')
$" <ence! f cannot be a surjection and not a bijection" Since " and f
ere chosen arbitrarily! e conclude that N is infinite"
"t is often easier to prove that a set is infinite !y using the following alternative
efinition"
Definition: & set & is infinite if there e1ists an injection f: & & such that f(&) is a
proper subset of &" A set is finite if it is not infinite.
Theorem: +he set N of natural numbers is an infinite set"
5
+roof: +he map f: N N defined by f(') = 2' is an injection hose
image is the proper subset of nonnegati(e e(en integers"
,&amples
a) +he set of real numbers! R is infinite
Consider:
f: R R,
f(') = ' % 1 if '
f(') = ' if ' (
+hen f is an injection and f(R) = {' | ' R and ' ), 1)}
b) +he closed inter(al ), 1* is infinite" +he function f: ), 1* ), 1*
defined by f(') = '+2 is an injection hose image is the proper subset C#! DE
c) Let * 0a! b4" +hen
F
is infinite"
Let f:
F

F
be defined by f(') = a'! then f is an injection and the image
of f is the proper subset of
F
hich contains all strings beginning ith the letter
a"
Definition: & set , is of cardinality #! denoted |, 3 * #! if there is a !ijection from
N -. ,"

77 # &leph6naught is the first letter of the <ebre alphabet
Definition: & set , is countably infinite if |, 3 * #" +he set , is countable! or
denumerable! if it is either finite or countably infinite" +he set , is
uncountably! or uncountably infinite! if it is not countable"
Examples:
+he set of positi(e integers! /
%
= {1, 2, 3, !} is counta!ly infinite (has
cardinality #)
+he function f : N / defined by f(') = ' % 1 is a !ijection.
G
Would you argue that |Z| > |N| # i.e. Z is uncounta%ly infinite %ased on the
following:
f : N /% { } defined by f(') = '! i"e" the identity function is a
bijection from N to just part of /! the non6negati(e part" &nd hence 3/| 2 |
N| ////
#int re6read the first definition abo(e
Definition: Let , be a set" &n enumeration of , is a surjecti(e function f from an
initial segment of N to ," if f is injecti(e as ell (and therefore !ijective)!
then f is an enumeration ithout repetitions; if f is not injecti(e! the f is
an numeration ith repetitions"
,&amples:
(i) )f , = {a, b, c}! then < a, b, a, c> and <b, c,
a> are both finite enumerations of ,! the first ith repetitions
and the second ithout"
(ii) Let , be the set of e(en natural numbers" +hen
<, 2, 4, !> and
<2, , 0, 4, 1, 1, !> are both enumerations of ,"
+he second enumeration is f(") = 2(" % 1) if " is e(en
and f(") = 2(" - 1) if " is odd"
Theorem: & set , is countable if and only if there e1ist an enumeration of ,"
Definition: Let be a finite alphabet ith an associated alphabetic (linear) order! and
let 33 1 33 denote the length of 1

" +hen 1 y in the standard ordering of

if: (i) 33133 @ 33y33 or (ii) 33133 * 33y33 and 1 precedes y in the le1icographical
ordering of

"
,&amples:
(i) +he set

is countably infinite for any finite alphabet " +he enumeration of

in standard order is (hen * 0a! b4)


<! a! b! aa! ab! ba! bb! aaa! aab! %>
H
(ii) +he set of positi(e rational numbers 9
2
is countably infinite" Clearly! 9
2
is not
finite (hy not/I)"
.e can sho that 9
2
is countable by e1hibiting an enumeration ith
repetitions" +he order of the enumeration is specified by the directed path in
the folloing array: (Cantor-s .irst Diagonali/ation +roof"
01(,2$T32
1 2 $ 5 G %
1 171 271 $71 571 G71 %
2 172 272 $72 572 %
D,03(I0$T32 $ 17$ 27$ $7$ 57$
5 175 275 $75
G 17G 27G
H 17H
+his enumeration ill include e(ery integer ratio m/n! therefore it is an enumeration of
9
2
! and hence 9
2
is counta!ly infinite" +he enumeration is ith repetitions e"g" 172 and
275 denote the same element of 9
2
" +herefore e ?no a bijection from B to 9
2
"
Theorem: +he union of a countable collection of countable sets is countable"
How might we employ this theorem to prove that Q is countably infinite?
Bot all sets are countableI .e employ Cantor-s 4econd Diagonali/ation +roof %elow.
Theorem: +he subset of real numbers o(er C#! 1E is uncounta%le (or uncountably
infinite)

+roof: Jecall that C#! 1E denotes the set 01 3 1 J # 1 14" =ach 1 C#! 1E
can be represented by an infinite decimal e1pression
1 * "1#1121$%%%
here each 1i is a decimal digit" .e note that the representation is not
uniKue! for e1ample:
"G###%%"" * "5LLL%%%
M
Let 1 * "5LLL%"" then
1#1 * 5"LLL%%%
1##1* 5L"LLL%%%
and then 1##1 1#1 * 5G from hich it follo that 1 * "G
f: B C#! 1E be an arbitrary function from the natural numbers to the set
C#! 1E" &rrange the elements f(#)! f(1)! % in a (ertical array! using a
decimal representation for each (alue f(1)
+he resulting array appears as follos:
f(#) : .1##1#11#2 % %
f(1) : .11#111112 % %
:
:
:
f(n) : .1n#1n11n2 % %
here 1ni is the i
th
digit in the decimal e1pansion of f(n)"
.e no specify a real number y C#! 1E as follos:
> * .y#y1y2 % %! here
yi * 1ii (the LNs complement of 1ii)
+he number y is determined by the digits on the diagonal of the array" Clearly! y C#! 1E"
#owever$ y iffers from each f(n) in at least one igit of the e1pansion (namely the n
th

digit)" <ence! y f(n)! for any n! and e conclude that the mapping f : B C#! 1E is not
surjecti(e f is not an enumeration of C#! 1E" Since f as arbitrary! e may conclude
3 C#! 1E 3 #
Theorem: )f is a finite nonempty alphabet! then (

) is uncountably infinite"
(Jecall that a language L

! hence (

) may be (ieed as a set of all languages o(er

! i"e" (

) * L * 0Li 3 Li

4)"
+roof: Start by letting < #! 1! 2! %> be an enumeration of

and let <L#!


L1! L2! % > be an enumeration of languages o(er

"
O
Pne must sho that there is a language o(er

hich is not in the enumeration"



w5 w w6 77
*5 a## a#1 a#2 %%
* a1# a11 a12 %%
*6 a2# a21 a22 %% :
:
:
+his is a binary matri1 (possibly infinite)" Let the i
th
ro represent the characteristic
function of Li" +hen a1j * QLi(j)! i"e" aij * 1 if j Li! otherise aij * #"
.inish this proof.
.hen you are done ith the preceding proof! you ill ha(e an important result"
Jecall that

is counta!ly infinite" Rut e rite our algorithm ith strings of symbols


(hether in SR! Ta(a! C22 etc")" 8ence the num%er of possi%le algorithms is
counta%ly infinite.
.e also shoed in lesson 1 an eKui(alence beteen problems and languages" <ence e
ha(e shon that the num%er of languages over some alpha%et (and correspondingly
the num%er of pro%lems" is uncounta%ly infinite.
<ence there are more pro%lems than there are possi%le algorithms" +herefore) there
must e&ist pro%lems with no possi%le solution" %e shall investigate several such
unsolvable problems later in this course.
Definition: & set & is of cardinality c (is uncountably infinite! or eKui(alently has the
same cardinality as the continuum) if there is a bijection from C#! 1E to &"
,&amples9pro%lems
(i) 3 Ca! bE 3 * c here Ca! bE is any closed inter(al in J ith a @ b"
Bote: f(1) * (b a)1 2 a is a !ijection from C#! 1E to Ca! bE"
(ii) Sho that

is counta%ly infinite here * 0a4"


(iii) Sho that the set 0<1! y> 3 1! y J 1
2
2 y
2
* 14 is uncounta%ly infinite
(has cardinality c)"
L
-ost Correspondence -roblem
&n instance of -ostNs Correspondence -roblem (-C-) consists of to lists
& * 1! 2! %! ?
R * 11! 12! %! 1?
of strings o(er some alphabet " +his instance of the -C- has a solution if there is any
seKuence of integers i1! i2! i$! %! im! ith m 1 such that:
i1! i2! %! im * 1i1! 1i2! %! 1im"
+he seKuence i1! i2! i$! %! im is a solution to this instance of the -C-"
,&amples
(i) Let * 0#! 14 and let & and R be lists of three strings each as defined belo"
List & List R
i i 1i
1
2
$
1
1#11
1#
111
1#
#
+his instance of the -C- has a solution"
Let m * 5! i1 * 2! i2 * 1! i$ * 1 and i5 * $! then
w6www: ; &6&&&: ; 55
1#
(ii) Let * 01! #4" Let & and R be lists of three strings as shon belo:
List & List R
i i 1i
1
2
$
1#
#11
1#1
1#1
11
#11
Suppose that this instance of the -C- has a solution:
i1! i2! %! im"
i
1
must eKual 1 77.hy/
So far e ha(e
from list &: 1#
from list R: 1#1
+he ne1t selection from & must begin ith a 1" +herefore! i2 * 1 or i$ * $" Rut
i2 * 1 onNt or?" 77.hy not?
.ith i2 * $ e ha(e 1#1#1
1#1#11
Clearly i$ * i5 * % * $" <oe(er string R is alays one character longer" +his
instance of -C- has no solution"
It is undecida%le whether an ar%itrary instance of the +C+ has a solution"
A proof of this will have to wait several months.
<oe(er! for no e can employ some intuition
.e reKuire first one unsol(able problem" )n $#5 e ha(e seen that the +uring machine
halting problem is undecidable! i"e" gi(en an arbitrary +uring machine U ith arbitrary
input tape ! it is undecidable if U() ill halt"
Second! e must reduce the +uring machine halting problem to the -C-" +hen a solution
for the -C- ould mean that a solution e1ists for the +uring machine halting problem"
&ut it oesn't.
11
#ence the ()( must !e unecia!le as well.
=ssentially! the string in the -C- ill correspond to portions of +uring machine
instantaneous descriptions"
+hen to i"d"Ns ill match iff the +m ould enter its halt state" Rut e cannot a priori
?no this
7 hence 777..
12

Você também pode gostar