Scale for this exam was A = 93, C = 63.
Question text is in black, solutions in blue.
Q1: 10 points Q2: 10 points Q3: 10 points Q4: 10 points Q5: 30 points Q6: 30+10 points Total: 100+10 points
FALSE. This is an instance of the Second Counting Problem, with n = 6 and k = 3, so the number of choices is 63 = 6*5*4 = 120, more than 100.
FALSE. If X is the set of finishes with A first, and Y is the set with F last, it is true that |X| = 5!, |Y| = 5!, and |X ∩ Y| = 4! by the Second Counting problem with n = k. So by the Double-Counting Rule, |X ∪ Y| = 5! + 5! - 4!, the number given. But the statement doesn't refer to X ∪ Y, which is the set of finishes with A first or F last or both. To get the size of the set referred to, (X - Y) ∪ (Y - X), you need to subtract |X ∩ Y| again to get 5! + 5! - 4! - 4!.
TRUE. The number of ways to pick four vegetables is (13 choose 4) = 13*12*11*10 divided by 1*2*3*4 or 13*11*5. The number of ways to pick three vegtables is (13 choose 3) = 13*12*11 divided by 1*2*3 or 13*11*2. (Both numbers are from the Third Counting Problem.) We can see without multiplying the products out that the first product is 5/2 times the second one, more than twice as big.
TRUE. This is an instance of the Fourth Counting Problem with n (the number of items chosen from) equal to 6 and k (the number of items chosen) equal to 3. By our solution to the Fourth Problem, the answer is (n+k-1 choose k) or (n+k-1 choose n-1), which in this case is (8 choose 5) or (8 choose 3). The reason we use the Fourth Counting Problem instead of the First is that the "outcomes" described in the statement do not indicate the order in which the contests were one, merely the multiset of winners.
(52 choose 3) = 52*51*50 divided by 1*2*3 = 26*17*50 = 13*17*100 = 22100, by the Third Counting Problem.
We pick the rank of the pair in (13 choose 1) = 13 ways, the suits of the two cards in the pair in (4 choose 2) = 6 ways, the rank of the third card in 12 ways (since it must have a different rank from the pair), and the suit of the third card in 4 ways. The number of ways to pick all of these, by the Product Rule, is 13*6*12*4 = 3744. There is no double-counting here, as in the two-pair case in five-card poker, because switching the ranks of the pair and of the third card would result in a different hand.
The number of hands with three cards of the same suit is 4 * (13 choose 3) = 4*13*12*11 divided by 1*2*3 = 13*11*8 = 1144. The number of flushes is thus 1144 - SF, where SF is the number of straight flushes. (We will see in Question 5d that SF = 48, but we won't need that here. The number of rank sequences forming a straight is 12, from A-2-3 through 2-3-4, 3-4-5, etc., to Q-K-A. There are 4*4*4 = 64 suit combinations for each of these rank sequences, so the number of straights is 12*64 - SF. We can compute 12*64 = 768 and see that it is less than 13*11*8 = 1144. (We could even divide both numbers by 8 and see that 12*8 = 96 is less than 13*11.) Thus there are MORE FLUSHES, reversing the situation in five-card poker. The actual numbers are 1096 flushes and 720 straights.
There are 13 ranks and (4 choose 3) = 4 ways to choose three cards of that rank, so there are 13*4 = 52 three-of-a-kind hands. (Given any card, you can make a unique three-of-a-kind hand by taking the other three cards of its rank.) For each of the 12 possible rank sequences for a straight, there are 4 choices for the suit of a straight flush, so there are 12*4 = 48 straight flushes and thus MORE THREE-OF-A-KIND HANDS. In five-card poker, the four-of-a-kind hands outnumber the straight flushes by 13*48 = 624 to 40.
This is an instance of the First Counting Problem because we must choose one of three items for each position other than the first, for 3k-1 total choices.
For the base case, we compute (31 - 1)/2 = 1 and note that there
is exactly one string starting with b and having length at most 1, the string
b. So the formula correctly gives N(1) and the base case is proved.
Now assume as the IH that N(k) = (3k - 1)/2. We want to prove
that N(k+1) = (3k+1 - 1)/2. We analyze N(k+1) in terms of N(k) --
it is equal to N(k) plus the number of strings that start with b and have length
exactly k+1. By the result of Question 6a, this latter number is
3k+1-1 = 3k. So we know that N(k+1) = N(k) +
3k, and thus by the IH we know that N(k+1) = (3k - 1)/2
+ 3k = (3k - 1 + 2*3k)/2 =
(3k+1 - 1)/2 and the formula is correct for N(k+1). Since we proved
that the k-case of the statement implies the (k+1)-case, we have completed the
inductive proof.
""
in Java), then f(λ) = λ (since λ does not start
with a) and f(a) = f(λ) = λ (because a = aλ).
f(ba) = ba, f(aca) = f(ca) = ca, f(caac) = caac. f(aacb) = f(acb) = f(cb) = cb, and f(aaa) = f(aa) = f(a) = f(λ) = λ.
The length of f(w) is the length of w minus the number of consecutive a's (if any) at the start of w.
If w is any string in B, we can write w as bv because w must start with b. Define g(w) to be cv. Then g(w) is certainly in C. There are two ways to show that g is a bijection. First, we could observe that if we define h(cv) to be bv for any string cv in C, the functions g and h are inverses, which is only possible if both are bijections. Alternatively, we can observe that g is both one-to-one and onto. It is one-to-one because if w = bv and w' = bv' are two different strings in B, then g(w) = cv and g(w') = cv' are different strings in C. It is onto because any string in C can be written as cv, and thus equals g(w) for w = bv. (The function g does not change the length of the string.)
The bijection is the function f from Questions 6c and 6d. If w is any string
in X, we know that f(w) either starts with a b, starts with a c, or has no
letters at all. Since f(w) also cannot be longer than w, f(w) must be in the
set B ∪ C ∪ {λ}.
If v is any string in B or C of some length k - m, then f(amv)
= v and amv has length exactly k and is thus in X, so f is onto.
(In addition, f(am) = λ.)
If v and v' are two different strings in X, we must show that f(v) and
f(v') are two different strings. Let m be the number of consecutive a's at
the start of v and m' the number at the start of v'. If m is not equal to
m', by Question 6d we know that f(v) and f(v') have different lengths and
thus cannot be the same string. If m = m', we can write v = amz
and v' = amz', and note that z = z' would imply v = v', which we
are assuming to be false, and therefore we know that z = z'. Since f(v) = z
and f(v') = z', we have completed the proof that f is onto.
Last modified 2 October 2009