Midterm #2 answers (questions have been paraphrased)
1. What's the probability of getting a straight dealt in order?
A. The first card can be a 2, 3, ..., 10. That's 9 possibilities. Then each of the five cards can be any suit (but we know what the ranks must be). That's another factor of 4^5. Then we divide by the number of ways of being dealt 5 cards, which is 52 * 51 * 50 * 49 * 48.
A. Put in the k 1s first. Now put in 0s. At the beginning you could have either "0" or "00" before the first 1, likewise at the end, so that's 2*2 choices. Then in between each pairs of 1s (and there are k-1 such gaps) you can have "00", "0", or "". That's 3^(k-1) choices. So the total is 4 * 3^(k-1).
A. Well, a_n is bounded by a_(n-1) + n, which is bounded by a_(n-2) + (n-1) + n, ..., which is bounded by 1 + 2 + ... + n. That's an okay answer, though summing it and getting [n+1 choose 2] is much nicer.
3b. How many such sequences are there?
A. Each time we decide on our a_n, we choose a number between a_(n-1) and a_(n-1) + n. That's n+1 different possibilities. So we get 3 choices, then another 4, then another 5, ..., then another n+1. Multiplying these all together, it's (n+1)!/2 (since we skip 2).
4a. What's b_1, b_2?
A. b_1 is three (0,1,2), b_2 is six (00,01,02,11,12,22).
4b. Find a recurrence for b_n.
A. Break our set into those that have 2, 1, or 0 at the end. The ones with 2 at the end correspond to those counted by b_(n-1) (by ripping the 2 off). The ones with 1 at the end must have been all 0s then all 1s; there are n of those (depending on where the first 1 is). There's one with 0 at the end. So
4c. Find a formula for b_n.
A. This is a stars and bars: we have a_0 zeroes, a_1 ones, a_2 twos, adding up to n. So the answer is (n+2 choose 2).
(If you find this first, you can answer 4b with Pascal's recurrence, which is anyway proved by essentially the same analysis used in the answer written there.)