Download Solutions - CMU Math

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
21-128 and 15-151 problem sheet 7
Solutions to the following five exercises and optional bonus problem are to be submitted
through blackboard by 8:30AM on
Thursday 3rd November 2016.
Problem 1
How many ways are there to pick two cards from a standard 52-card deck, such that the first
card is a spade and the second card is not an ace?
Solution. We count the number of ways of picking such a pair of cards by means of the following
procedure.
Either the first card is an ace or it is not. By the rule of sum, the number of hands we seek is the
sum of the number of hands in each of these cases.
• If the first card is an ace, then it must be the ace of spades, so there is 1 choice. There are
48 non-ace cards remaining, so there are 48 choices of second card.
• If the first card is not an ace, then there are 12 choices for its rank. There are then 47
non-ace cards remaining, so there are 47 choices of second card.
Hence there are 48 + 12 · 47 ways of picking two cards from a standard 52-card deck, such that
the first card is a spade and the second card is not an ace.
Problem 2
Count the number of hands of six cards from a standard deck of 52 cards that contain at least
one card of every suit.
Solution. Consider a hand with at least one card of each suit. Setting aside one card from each
suit, either the remaining two cards have the same suit, or they have different suits. In the first
case, the hand contains three cards of one suit, and one card of each of the remaining three; in the
second case, the hand contains two cards each of two suits, and one card of each of the remaining
two suits. These two cases are mutually exclusive and cover all possibilities, so by the rule of
sum, we count the number of hands in each case separately.
• If there are three cards of one suit and one card of each of the remaining three
suits. Pick the tripled suit; there are 41 choices. Then pick the ranks of the cards in that
suit; there are 13
3 choices. The remaining cards are distinguishable by their suits, so there
4 13 13 3
are 13
choices in total for the first
1 choices of rank for each. Hence there are 1
3
1
case.
• If there are two cards of two suits and
one card of each of the remaining two
4
suits. Pick the doubled suits; there are 2 choices. For each double suit, pick the ranks
for the two cards of that suit; there are 13
case. The remaining two cards
2 choices in each
13
are distinguishable by their suit, so again there are 1 choices of rank for each card. So
2 132
there are 42 13
choices for the second case.
2
1
Thus the total number of such hands is
3 2 2
4 13 13
4 13
13
+
1
3
1
2
2
1
Problem 3
Find the number of functions f : [6] → [6] such that f contains exactly three elements in its
image.
Solution. Such functions are the result of a 2-step process. First choose a 3-element subset S of
[6] and then choose a surjection from [6] to S. There are 63 ways to perform the first step.
Once the first step has been completed, the number of surjections from [6] to S is the number of
functions from [6] to S, minus the number of functions from [6] to S having exactly one element
in their image, minus the number of functions from [6] to S having exactly two elements in their
image.
The number of functions from [6] to S is 36 since they are generated by the 6-step process of
choosing f (1), f (2), . . . , f (6), in order, from among the three elements of S.
The number of functions from [6] to S having exactly one element in their image is 3, since we
pick the element of S to which everything gets mapped.
The number of functions from [6] to S having exactly two elements in their image is 32 (26 − 2),
since we pick two elements of S for the image and then pick a surjection from [6] to those two
elements by considering all functions and then subtracting those having only one element in their
image.
Thus, there are 63 (36 − 3 − 32 (26 − 2)) such functions.
2
Problem 4
We roll a fair six-sided die exactly four times. For k ∈ {0, 1, 2, 3, 4}, determine the probability
that we roll a six exactly k times. Check your answer by verifying that these probabilities sum
to one.
Solution. The total number of outcomes is 64 , resulting from a 4-step process: for each of the
four dice rolls, there are 6 possible outcomes.
For given k, the number of outcomes in which a six is rolled exactly k times is k4 · 54−k . This
results from a 2-step process:
• Step 1. Choose which k rolls show a six.
• Step 2. For each of the remaining 4 − k rolls, choose which of the other five values shows;
there are 5 choices for each, hence 54−k total.
Hence the probability that exactly k sixes are rolled is
(k4)·54−k
64
To verify that these sum to 1, note that
4
4
4
4
4
4
3
2
1
·5 +
·5 +
·5 +
·5 +
· 50
0
1
2
3
4
4 X
4 k 4−k
1 5
=
k
.
using sum notation
k=0
= (1 + 5)4
by the binomial theorem
4
=6
So dividing by 64 we see that the probabilities sum to 1.
Problem 5
By counting in two ways, prove that
Pn
k=1 2
k−1
= 2n − 1 for all n ∈ N.
Solution. Let X = P([n]) − {∅} be the set of nonempty subsets of [n], and for each i ∈ [n] let Yi
be the set of subsets of [n] whose greatest element is i.
Note that SYi ∩ Yj = ∅ when i 6= j, since a subset of [n] can only have one greatest element.
Moreover ni=1 Yi = X. We prove this by double-containment:
3
• (⊆). Let S ∈
S ∈ X.
Sn
i=1 Yi .
Then S ∈ Yi for some i ∈ [n]. But then i ∈ S, so S 6= ∅, and hence
• (⊆). SLet S ∈ X. Since S 6= ∅, S has a greatest element, say i. But then S ∈ Yi , so
S ∈ ni=1 Yi .
Hence {Yi : 1 ≤ i ≤ n} is a partition of X.
By the rule of sum,
n
X
|Yi | = |X|
i=1
Now |X| = 2n − 1, since [n] has 2n subsets of which exactly one is empty.
For each i ∈ [n], |Yi | = 2i−1 . To see this, note that the function f : P([i − 1]) → Yi defined by
f (T ) = T ∪ {i} is a bijection. Certainly f is well-defined: if S ∈ f (T ) then i ∈ S, and for all
x ∈ S we have either x = i or x ≤ i − 1; so i is the greatest element of S and S ∈ Yi . Moreover,
f is injective: if f (T ) = f (T 0 ) then T ∪ {i} = T 0 ∪ {i}, so T = T 0 since i 6∈ T and i 6∈ T 0 . Finally,
f is surjective: if S ∈ Yi then S = f (S − {i}); note that S − {i} ⊆ [i − 1] since i > x for all x ∈ S
with x 6= i.
P
It follows that ni=1 2i−1 = 2n − 1.
Bonus Problem - (2 points)
Tram tickets have six-digit numbers (from 000000 to 999999). A ticket is called lucky if the sum
of its first three digits is equal to the sum of its last three digits. A ticket is called medium if the
sum of all its digits is 27. Let A and B denote the numbers of lucky tickets and medium tickets
respectively. Prove that A = B.
Solution. Let L and M be the sets of lucky and medium tickets, respectively. Define f : L → M
via f (abcdef ) = abc(9 − d)(9 − e)(9 − f ). This specification is valid since abcdef lucky means that
a + b + c = d + e + f , so a + b + c + (9 − d) + (9 − e) + (9 − f ) = (a + b + c − d − e − f ) + 27 = 27
and abc(9 − d)(9 − e)(9 − f ) is medium.
Similarly, the function g : M → L defined via g(abcdef ) = abc(9 − d)(9 − e)(9 − f ) is well-defined,
and we see that g and f compose to the identity in both orders, and are hence inverses of one
another. Thus, g and f are both bijections and |L| = A = B = |M |.
4