Pretest
Recall that only students who have been specifically exempted from 401 by me
or who have taken 401 in the past are eligible to enroll in 500. If you did
enroll and do not meet these qualifications, you have one chance (only
one!) to convince me that you should be allowed to stay in the class,
by doing very well (A level) on this pre-test; if you do not do A-level work
on the pretest, I will use a blue card to drop you out of the class.
Those of you who have taken and passed 401 or who have been granted an
exemption should take the pretest, but for you it is only a self-assessment
as you begin the course.
Solution
(A seriously verbose and overdone solution, intended to clarify any
question you might have had...)
-
Let G be a graph. Prove or disprove:
-
Deleting a vertex of maximum degree cannot raise the average degree.
True. We prove it directly.
Let the number of vertices be n, the sum of all vertex degrees be S,
and the maximum degree be m (which is at most n-1);
the average degree is then S/n.
Now remove a vertex of degree m (maximum degree); we obtain a
graph of n-1 vertices, whose degree sum is S-2m (we subtract m twice,
since each of the m edges incident upon the deleted vertex contributed
to the degree of both of its endpoints) and whose average degree
is thus (S-2m)/(n-1). Now we have
n*(n-1)* [ S/n - (S-2m)/(n-1) ] = (n-1)*S - n*(S-2m) = 2mn-S
But this quantity cannot be negative and can only be 0 when all vertices
have degree m. Hence the new average degree is no larger than the old.
-
Deleting a vertex of minimum degree cannot lower the average degree.
False. As a simple counterexample, consider
the graph formed by two vertices joined by an edge (formally, this
graph is K2). Both vertices have minimum degree (degree 1)
and the average degree is 1. Remove one vertex: the result is a graph
with a single vertex (K1) -- that vertex has degree 0 and that
is the average degree, which has thus been lowered.
-
Let G be a connected graph and let k be the maximum length of a simple
path in G. Prove that, if simple paths P1 and P2 both have length k,
then they have at least one vertex in common.
Assume that the two paths do not have any vertex in common. Since
the graph is connected, it is possible to move from one path to the other;
since the two paths are vertex-disjoint, there is at least one edge in the connection between the two that does not belong to either path. Say the
connection is between vertex u on the first path and vertex v on the second,
along a third (disjoint) path from u to v. Vertex u partitions the first path
into two pieces, so choose the larger (if they have the same number of edges,
choose arbitrarily); ditto for vertex v. Now consider moving from the
end of the longer piece from the first path to u, then to v, then to the
end of the longer piece from the second path: the resulting trajectory
contains at least one more edge than either of the given paths, and
so we have found a simple path of length longer than k, a contradiction.
-
Let G be a graph having no cycle of even length. Prove that each edge of
G appears in at most one cycle.
Another proof by contradiction. Suppose edge e appears in cycles C1 and C2.
Consider moving from one endpoint of e along C1 until the other endpoint of
e is reached; instead of now crossing e and returning to the start (as C1
would do), move along C2 instead and follow it until it returns to the
start vertex. We have described a new cycle; its length is the sum of the
lengths of C1 and C2, minus 2 (because e never gets crossed to complete either
cycle). But l(C1)+l(C2) is the sum of two odd numbers and so is even;
and subtracting 2 from it keeps it even, so our new cycle has even length,
the desired contradiction.
-
Consider the following game. A prize is placed behind one of three (closed)
doors. The player chooses a door, which remains closed for now;
the game master then opens one of the other two doors -- always choosing
one that does not contain a prize (if the player chose a wrong door, the
game master opens the one remaining wrong door; if the player chose
the right door, the game master chooses one of the other two doors
uniformly at random). The game master then tells the player "As you can see,
there is no prize behind this door I just opened; now do you want to
stay with your original choice or switch to the other unopened door?"
Decide what is the right strategy and prove it by calculating the odds.
The key to the problem is to realize that, if the player picked the
wrong door at the beginning, then switching guarantees getting the prize!
(Conversely, if the player picked the right door, then clearly switching
guarantees losing.)\ \
The player has a 1/3 chance of picking the correct door; if the player
refuses to switch, 1/3 is then the odds of winning. If the player always
switches however, the situation is better: with probability 1/3 (of
having picked the correct door in the first place), the player
will lose, but with probability 2/3 (of having picked a wrong door),
the player will win, so the odds of winning with a switch are 2/3,
twice as high as for staying with the original choice.
-
From n equally spaced points on a circle (in real coordinates),
three distinct points are chosen uniformly at random. What is
the probability that they form an equilateral triangle? an isosceles
triangle? a triangle with sides of all different lengths?
Since the points are equally spaced, we can only get an equilateral triangle
when the number of points is a multiple of 3, so let us assume n=3k for some k.
Note that there are (n choose 3) possible triangles (roughly n3/6).
But there are very equilateral ones: once we have chosen one vertex of the
triangle, the other two are forced; moreover, choosing any of the three
that form such a triangle forces the same triple, so there really are only
n/3 equilateral triangles. Thus the probability of getting an
equilateral triangle is roughly 2/n2.
Isosceles triangles can be obtained by picking one of the two equal sides
along with the summit of the triangle, at which point the rest is forced.
We have n choices for the summit, then roughly n/2 choices for the other
endpoint (the other n/2 choices are symmetric) -- it is rough because
n/2 may not be integer and also because it ignores the equilateral triangles
with their higher symmetry, but, as we have seen, the equilateral triangles
are too few to affect the asymptotic values. Thus we have roughly
n2/2 isosceles triangles, so that the probability of getting
one is roughly 3/n -- much larger than for equilateral triangles, but
still vanishingly small. Finally, the probability of getting
a triangle with sides of all different lengths is just (1-piso),
or roughly (n-3)/n, which converges rapidly to 1.
It is not too hard to get exact formulas, but not really worth it.
-
Prove that every infinite subset of an infinite countable set is countable
-- i.e., prove that, is set S can be placed in a 1-1 correspondence
(bijection) with the natural integers, then so can any infinite subset of S.
Because S is in 1-1 correspondence with N, we might as well call it N.
S' has a natural injection into S: the identity (map each element of S'
to itself, now regarded as an element of S). Unfortunately, this map
is not surjective and thus not a bijection; this is what we need to fix.
We can define the new bijection recursively; in words, it just renumbers
the elements of S', a subset of S=N, starting from 1 and consecutively.
Formally, define f: S' -> N with
f(i) = f(j)+1, where j = max k {k < i and k belongs to S'}
-
Prove that every positive integer can be written as a sum of all different
Fibonacci numbers.
First let us look at a brute-force proof.
We prove this by induction. 1 and 2 are Fibonacci numbers by themselves
and a fortiori meet the requirements; assume then that all numbers up to
and including n can be written as a sum of distinct Fibonacci numbers.
That's not quite enough: we need a more careful look at what that expression
can be. We have a standard way of reducing (simplifying) a sum of Fibonacci
numbers: the sum of two consecutive ones is just the next one up -- the
recursive definition of Fibonacci numbers. This means that we can assume
that the sum in question never includes two consecutive Fibonacci numbers.
For instance, we could write 3 = F2+F1, but that
is just F3; similarly,
we have 10 = F4+F3+F2,
but we write the simpler 10 = F5+F2.
Let E(F,n) be the expression denoting the sum for the value n -- and
recall that it does not include consecutive terms. Then we write
n+1 = E(F,n) + 1 = E(F,n) + F0
since F0=1. The expression E(F,n)+F0 might
already be a valid E(F,n+1) -- when E(F,n) included neither
F0 nor F1 (it could not have included both, of course).
Otherwise we start a process of replacing consecutive Fibonacci numbers
by the next one up; this process obviously terminates when we reach the
largest Fibonacci number in E(F,n) and it is well defined, since we cannot
generate a second copy of a Fibonacci number in E(F,n), thanks to
the fact that E(F,n) does not contain consecutive Fibonacci numbers.
Now for a more elegant proof, which actually proves the same additional
result (no consecutive numbers in the sum). The proof is also by
induction, with the same basis. Now if given value n+1, either it
is a Fibonacci number, say Fi, in which case we are done,
or it is not, in which case, if the largest Fibonacci number less
than n+1 is Fj, we can write n+1 as the sum
Fj + (sum for (n+1-Fj).
The second sum exists by inductive hypothesis and cannot contain
the jth Fibonacci number, so the resulting sum obeys our conditions.
This completes the proof; to verify that the sum can always avoid consecutive
Fibonacci numbers, it is enough to see that, in the decomposition
Fj + (sum for (n+1-Fj), if the sum for
(n+1-Fj) contained Fj-1, then n+1 would be larger
than Fj+Fj-1=Fj+1,
but we assumed that Fj was the largest Fibonacci number
less than n+1.
-
You are given a stack of cards numbered 1 through n;
the stack is randomly ordered. Play the following game:
if the top card has value i, reverse the order of the top i cards
on the stack; continue until the top card has value 1, at which point the game
stops.
Prove that the game always stops, no matter what the initial order was,
and prove that, if k distinct cards show up at the top during the process,
then the game stops in at most Fk-1 steps, where Fn
is the nth Fibonacci number.
The hardest question -- or, more precisely, the only nontrivial question.
Note that the second proof subsumes the first: it simply gives a numerical
upper bound on the number of moves that can be made before stopping and thus
of course implies that the games always stops. Thus it suffices to prove
the second, more detailed result. We prove it by induction on k, the number
of distinct cards that appear at the top of the pack (the pack has n cards).
The base case, with k=1, is trivially correct -- there cannot be any
reversal, so the top card is already 1. Assume then that
the claim holds for up to and including k-1 distinct cards appearing on top;
call these cards c1, c2, c3, ...,
ck-1, in increasing order of values (of course, that is not
directly related to order of appearance on top, not to mention that the
same card can appear many times on top). Note that we have c1=1
-- because we know that the game ended and so that card 1 ended up on top;
moreover, that card appeared on top only once, of course, at the very end.
Thus a perhaps more productive way to view the inductive hypothesis is
that a game in which at most k-1 different cards appear on top can proceed
for at most Fk-1-2 moves without reaching the final state.
Now consider a game in which exactly one more card shows on top and
call these cards c1, c2, c3, ...,
ck, in increasing order of values (they need not be the same
values as our previous ci). By induction, if only the first k-1 of
these cards showed on top, the game would stop and stop in at most
Fk-1-1 moves; and one of the first k-1 cards would then have value 1.
But that card can only show on top at the very end - as soon as it shows, the
game stops. So, before card ck shows on top the first time,
only cards c2, c3, ..., ck-1 can show on
top; and after card ck shows on top the first time,
only cards c2, c3, ..., ck can show on top,
with card c1 making it to the top in the last, additional move.
Now we can write a recurrence to describe the process: when a total of
k different cards appear on top during a game, only k-2 different
cards can show on top until the first appearance of card ck,
then only k-1 different cards appear on top until the very last move, when card
c1 could move to the top.
We have an additional move from the first to the second part,
so the recurrence is
nbr(k) = nbr(k-2) + 1 + nbr(k-1)
where nbr(k) denotes the number of moves that can be made with k different
cards appearing on top without reaching a final state.
By induction we have
nbr(k) = nbr(k-2) + 1 + nbr(k-1) = Fk-2-1 + 1 + Fk-1-1
and thus
nbr(k) = Fk-2-1 + 1 + Fk-1-1 = Fk-1
as desired.