Problem Set 0: Solution
Problem Set 0: Solution
Problem Set 0: Solution
the lecture.
Please follow the homework format guidelines posted on the class web page:
http://www.cs.uiuc.edu/class/sp10/cs373/
1. [
Category:
Notation,
Points:
20]
tion.
or anything else. D1) D2) D3) D4) D5) D6) D7) D8) D9) D10) D11) D12) D13) D14) D15) D16) D17) D18) D19) D20)
{a, b, c} {d, e} = {} {a, b, c} {d, e} = {} {a, b, c} {d, a, e} = {a, b, c, d, a, e} {a, b, c} {d, a, e} = {a, b, c, d, e} {a, b, c} \ {a, d} = {b, c} {, a, b, c} {, a, b, c} a {, a, b, c} {a, c} + {c, b} = {a, b, c} {a, b} {b} = {a} {a, a} = {a} {{a}, {a}} = {a, a} a {a, {a}, {{a}}} {a} {a, {a}, {{a}}} {{{a}}} {a, {a}, {{a}}} {} = {{}} {a, b} {c, d} = {(a, c), (b, d)} {a, b} {c, d} = {c, d} {a, b} |{a, b} {a, b}| = 3
Solution:
D1) D2)
D3) D4) D5) D6) D7) D8) D9) D10) D11) D12) D13) D14) D15) D16) D17) D18) D19) D20)
{a, b, c} {d, a, e} = {a, b, c, d, a, e} true {a, b, c} {d, a, e} = {a, b, c, d, e} true {a, b, c} \ {a, d} = {b, c} true {, a, b, c} true {, a, b, c} true false a {, a, b, c} wrong notation {a, c} + {c, b} = {a, b, c} wrong notation {a, b} {b} = {a} wrong notation (but we will also accept "true") {a, a} = {a} true {{a}, {a}} = {a, a} false a {a, {a}, {{a}}} true {a} {a, {a}, {{a}}} true {{{a}}} {a, {a}, {{a}}} true {} = {{}} true {a, b} {c, d} = {(a, c), (b, d)} false {a, b} {c, d} = {c, d} {a, b} false |{a, b} {a, b}| = 3 false
2.
Category:
Proof,
Points:
16]
Professor Moriarty claims that he has a way of describing every real number between 0 and 1 using an English sentence (of nite length), i.e. for every real number is an English sentence
r,
there
r. 0.a1 a2 a3 . . .,
where
Note: Assume that a real number between 0 and 1 is of the form each as
ai {0, 1, . . . 9}, i.e. is an innite set of decimal points. This is not quite true, 0.09999999 . . . is actually the same as 0.10000 . . ., but ignore this subtlely for this
question.
Solution:
The set of all nite English sentences, is after all a subset of strings over the English alphabet, and is hence countable. The set of all real numbers is the set of all innite sequences over
If there was a description of all real numbers using nite English sentences, then we can build a one-to-one correspondence between a subset of English sentences to the set of all
reals (associate each real with the lexicographically smallest English sentence that describes it). If a set since
a 1-1 correspondence between them (if there was a 1-1 correspondence, say
f : A B,
then
g : N B,
of these
f g :NB
is
not countable). Hence there cannot be a 1-1 correspondence between between a subset of English strings (which is countable) to the set of all reals (which is uncountable),
3.
Category:
Proof,
Points:
16]
Prove that in a class with at least two students, there exist at least two students who have the same number of friends (assuming that friendship is a symmetric relation: if Jane is a friend of Venkatachalam, Venkatachalam is a friend of Jane too).
Solution:
Assume the class has If is
x friends where x {0, 1, , n1}. no two students have the same number of friends, then for each x {0, , n 1} there exactly one student in class with x friends. But if there is a student with n 1 friends in n students.
Each student can have
4.
Category:
Proof,
Points:
16]
A graph is said to be non-isolating, if every vertex has at least one edge incident on it. John guesses the following statement and proves it using induction.
Guess: Every non-isolating graph is connected. proof: We use induction on the number of vertices of the graph to prove our statement.
Base-case: There is no non-isolating graph with one vertex. Moreover every 2-vertex
non-isolating graph is trivially connected.
Induction step: Assume the claim is true for all graphs with
vertices. Let
be a
k -vertex G
u u
to
v . This implies that the k + 1 vertex graph G is connected (since we can u to any other vertex x by going to v rst and -since G is connected and v and x are in G- then getting from v to x) and we are done.
First show that John's guess is incorrect. Second identify clearly what is wrong with this inductive proof.
Solution:
The guess is incorrect since for example the following graph is non-isolating and is not connected.
The aw in the induction is because every possible non-isolating be obtained by adding an additional vertex to a non-isolating
k + 1-vertex
graph cannot
k -vertex
the graph shown above). Therefore the mentioned proof just proves that for the particular graphs that could be obtained in that way the claim is true (but not for all the non-isolating graphs). In general, this is a common mistake many people make. Let us assume that we are proving a property:
P (n):
Every graph of
must satisfy
for all
n N.
P (n + 1)
P (n + 1),
n+1
graph
vertices that satises also satises . To do this we must consider an arbitrary G with n + 1 vertices, and using the assumption i n.P (n), prove that the property holds for the graph G. In many proofs, we can break down the graph G to a smaller graph, use the induction hypothesis on the smaller graph, and show that the graph G satises the property. But we should not take a graph of n vertices (that satises ) and add a vertex to it; that is wrong because we do not know if all graphs with n + 1 vertices that satisfy can be obtained from an n-vertex graph that satises , using such an operation.
5.
Category:
Proof,
Points:
12 players took part in a tennis tournament. tennis). Prove that there exist three players defeated
other exactly one time. There's no player who lost all his games (and there's no tie in
A, B
C,
such that
defeated
B, B
and
defeated
A.
Solution:
We will prove the existence of three players satisfying the condition, for any number of total players
r,
where
r3
12).
r = 3,
by checking all possible tournament results we can nd out that the only
possible option is
defeated
B, B
defeated
and
defeated
A.
r > 3),
k players take part in the tournament (where 3 k < r, A, B and C , such that A defeated B , B defeated C and C
defeated
A.
Inductive step:
players.
B.
Let
A1 , . . . , An
and
C1 , . . . , C m
B.
to
Ci who lost to all other players Cj , j = i. Since he also lost there exists a player At who lost to Ci , otherwise Ci would have lost every game. the desired triple is At , B, Ci . Ci
exists.
B,
Then
(b) No such
C1 , . . . , C m .
Alternative proof:
Assume there are
n players, n 3. Now, let us draw a graph with vertices as players, and directed edges p q if p beats q in the tournament. Note that for every player p there is a player q such that p q (since no player loses all games).
I can pick an arbitrary player
p1 ,
take a successor of
p 1 , p1 p2 ,
take a successor
p3
of
p2 ,
p1 p2 p3 ,
and build a longer and longer path until a vertex repeats. Hence there is
always a directed cycle in this graph. Now consider a directed cycle of the smallest length. can't be of length 2 (since if I claim it has to be of length 3. It
p2 , then p2 didn't beat p1 ). Assume the smallest length cycle is of some length n, where n > 3. Let such a cycle be p1 p2 p3 . . . pn p1 , where n > 3. Then consider the game between p1 and p3 , which someone would have won, giving an edge from p1 to p3 , or from p3 to p1 . If p3 p1 , then p1 p2 p3 p1 is a cycle of length 3, a contradiction. So p1 p3 must hold. But then p1 p3 . . . pn p1 is a cycle of length n 1, again a contradiction. Hence the shortest cycle is of length 3, and
beats we are done. 6. [
p1
Category:
Proof,
Points:
6+10]
X X Y.
Then
X Y.
if
s X.
Since
s X,
then
X = Y,
XY
and prove
Y X.
Now, prove the following theorems formally (using a similar style and level of detail as the proof above).
Let
Let
X Y =X Y. s=t
and
Then
X =Y.
f :NN
f (x) f (y).
s, t N
such that
Write formal proofs. Don't wave hands. Don't say things like it's obvious that, etc. If you are assuming a well known property, then state that property clearly.
Solution:
(a) Let X Y = X Y .
To prove Hence
We will prove
X=Y
by proving
XY
and
and proving
Y X.
X Y . Let s X . s Y . So X Y .
Then, since
X Y = X Y,
s X Y, s X Y,
Y X . Let s Y . s X . So Y X . X =Y.
Then, since
X Y = X Y , and s X Y , s X Y ,
(b)
Let
be the range of
f.
I.e. let
Since
is a set of natural
m0 N be claim x = n0 . n0
f (m0 + 1), xS m0
(as
and let it be
x.
Since
x is in the range), m0 + 1,
such that
and