CMPSCI 240: Reasoning About Uncertainty
First Midterm Exam
David Mix Barrington
30 September 2009
Directions:
- Answer the problems on the exam pages.
- There are six problems
for 100 total points plus 10 extra credit.
Actual scale is A=93, C=63.
- If you need extra space use the back of a page.
- No books, notes, calculators, or collaboration.
- The first four questions are true/false, with five points for the correct
boolean answer and up to five for a correct justification.
- When the answer to a question is a number,
you may give your answer in the form
of an expression using arithmetic operations, powers, falling powers, or the
factorial function. If you give your answer using the "choose" notation, also
give it using only operations on this list. In addition, if your answer is a
non-negative integer less than or equal to 100, you must compute
the number for full credit.
Q1: 10 points
Q2: 10 points
Q3: 10 points
Q4: 10 points
Q5: 30 points
Q6: 30+10 points
Total: 100+10 points
- The first two true-false questions involve a situation where six people,
named A, B, C, D, E, and F, are going to run a race. We assume that all will
finish and that it is not possible for two or more of them to finish at exactly
the same time.
- Question 1 (10):
True or false with justification:
There are fewer than 100 possible choices for who finishes first, second, and
third in the race. (We are counting choices such as "B first, F second, C
third".)
- Question 2 (10):
True or false with justification:
Of the number of orderings of finish for all six racers, the number where either
A finishes first, or F finishes last, but not both, is 5! + 5! - 4!.
- Question 3 (10):
True or false with justification:
Assume that Zane's Noodle Stand offers 13 kinds of vegetables that may be put
in your soup. Then the number of ways to choose a set of exactly four
vegetable types is more than double the number of ways to choose a set of
exactly three vegetable types.
- Question 4 (10):
True or false with justification:
The same six people from Questions 1 and 2 also compete in three rounds of
another contest, each of which has a single winner. Consider the number of
possible outcomes of this contest, such as "A won two rounds and B won one",
or "B, D, and E won one round each". Then this number is exactly (8 choose 5).
- Question 5 (30):
In three-card poker, a player's hand is a set of three cards chosen
from a standard 52-card deck.
- (a,5) How many different possible three-card hands are there in all?
- (b,10) How many possible one-pair hands are there, with two cards of the
same rank and a third card of a different rank?
- (c,10) Recall that a flush is three cards of the same suit, and
a straight is three cards of consecutive ranks. (Note that A-2-3 and
Q-K-A are both straights, but K-A-2 is not.) Which type of hand is more
common in three-card poker -- straight or flush? (Remember that a straight
flush counts as neither a straight nor a flush.)
- (d,5) Which type of hand is more common in three-card poker -- three
of a kind or straight flush?
- Question 6 (30+10):
This multipart question deals with strings using the set of letters {a, b, c}.
- (a,5) If k is any natural number, how many strings of length exactly
k start with b? (Your answer should be a function of k.)
- (b,10) If k is any natural number, let N(k) be the number of strings
of length at most k that start with b. Prove by induction on k, with
a base case of k = 1, that N(k) = (3k - 1)/2.
- The next two parts of the question deal with the following
recursive function f from strings to strings. If a string w does not
start with an a, then f(w) = w. If w does start with an a, so that w
is equal to av for some other string v, then f(w) = f(v). So f(b) = b, and
f(ab) = f(b) = b. If we write λ for the empty string (called
""
in Java), then f(λ) = λ (since λ does not start
with a) and f(a) = f(λ) = λ (because a = aλ).
- (c,5) What are f(ba), f(aca), f(caac), f(aacb), and f(aaa)?
- (d,5) If w is any string, what property of w determines the length of
f(w)? That is, give me a rule that tells me how to determine the length of
f(w) by examining w. You need not prove that your rule is correct.
- The last two parts of the question deal with a fixed number k and
three sets of strings. The set X consists of all strings of length
exactly k. The set B consists of all strings of length at most
k that start with b, and the set C consists of all strings of length at
most k that start with c.
- (e,5) Give a combinatorial proof that |B| = |C|. That is, describe a
bijection that takes strings in B to strings in C, and explain why it is a
bijection.
- (f,5) Give a combinatorial proof that |X| = |B| + |C| + 1, by giving a
bijection that takes strings in X to strings in B ∪ C ∪ {λ}.
Explain why your function is a bijection.
Last modified 2 October 2009