Download 1 Problem Set - Art of Problem Solving

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

Addition wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Partial differential equation wikipedia , lookup

Weber problem wikipedia , lookup

System of polynomial equations wikipedia , lookup

Transcript
Distributions Handout Solutions
James Rowan
1
Problem Set
Here are the solutions to the problem set and the answer to the note on Example 7. Don’t just
immediately go to these if you haven’t thought hard about the problems and asked for hints.
Example 7, sans casework: We’ll proceed by stars and bars. We lay out the 8 pieces of candy
in a row to be our “stars.” Our “bars” will be used to denote which pieces are grouped together into
piles. There are clearly 8 − 1 spaces in between the piles where we could put bars, and to get an
even number of piles, we need to place an odd number of bars.
We now consider the seven-element set of places we could put our bars. This set has 27 subsets.
We want to know how many subsets have an odd number of elements. I claim this is exactly half of
27 , that is, 27−1 = 26 = 64.
For each subset A of, say, S = {1, 2, 3, 4, 5, 6, 7} with an odd number of elements, we consider the
subset of S given by S − A. S − A must have an even number of elements. This gives us a bijection
from the set of subsets of S with an even number of elements to the set of subsets of S with an odd
number of elements. Since these two sets together make up all of the subsets of S and both have
the same cardinality, they must each contain half of 27 elements, or 64 elements.
Since the number of ways to divide the 8 candies into an even number of piles is the same as the
number of ways to make a subset of a seven-element set with an odd number of elements, our final
answer is 64 .
Problem 1: There are four types of donuts at the donut store: jelly, glazed, chocolate, and
cake. You need to buy six donuts, but you must get at least one of each type. How many ways can
you do this?
A constructive counting “solution” to this problem was once given by an anonymous student
along these lines:
Take one of each type; there is only one way to do this. Now you have to pick 2 donuts, and you
have 4 choices of type for each donut, so you have 42 = 16 ways to pick your remaining two donuts
and thus there are 16 ways to pick six donuts with at least one of each type.
Where does this solution break down? Can you use non-distributions techniques to fix it? Then
1
solve the problem with distributions. Which method is easier?
Answer: 10
Solution: The student’s method overcounts. There is no difference between the pick “jelly,
glazed, chocolate, cake, cake, jelly” and the pick “jelly, glazed, chocolate, cake, jelly, cake,” but the
student’s method claims there is a difference because it assumes both picks are independent. On all
4
2 = 6 pairs of two donuts, the student’s method counts twice depending on the order of picking of
the last two donuts. Therefore, the correct answer is 16 − 6 = 10 .
We could also use casework:
We have to buy one of each. Now we have two cases: both of the last two donuts are the same,
or both are different. If both are the same, there are 4 ways to pick a flavor and get two donuts of
that flavor. If both are different, there are 42 = 6 ways to pick two flavors and get one donut of
each flavor. Our answer is then 4 + 6 = 10 .
Distributions, though, is easier. There are 4 distinguishable urns: the four flavors of donut.
There are 6 indistinguishable balls: the six donuts we buy. We need to put the 6 balls in 4 urns, so
5
our answer is 6−1
4−1 = 3 = 10 .
Problem 2: How many solutions are there to a + b + c + d = 19 if b is a negative integer greater
than or equal to −4, a and c are positive integers, and d is a nonnegative integer?
Answer: 884
Solution: We first let e = d + 1. Then the problem is equivalent to solving a + b + c + e = 20
for b a negative integer greater than or equal to −4. We break the problem into cases based on b.
We’ll do the first case explicitly, then leave the details to you on the other three.
Case 1: b = −4.
23
We need to count the number of solutions to a + c + e = 24. This is just 24−1
3−1 = 2 .
21
20
The other three cases give 22
2 , 2 , and 2 , so our final answer is the sum of these terms, or
884 .
Problem 3: Macbeth is paying three witches a total sum of 12 gold pieces for telling him the
future. If the oldest witch wants to earn at least as much gold as the other two witches combined,
and all witches want a positive number of gold pieces, in how many ways can Macbeth pay the three
witches?
Answer: 15.
Solution: We’ll proceed by casework. He can pay the oldest witch anywhere from 6 to 10 gold
2
pieces, leaving anywhere from 6 to 2 gold pieces for the remaining two witches. Since each gets a
positive number of gold pieces, there are a total of 5 + 4 + 3 + 2 + 1 = 15 ways to distribute the
coins.
Problem 4: (classic) When (x + y + z)100 is expanded out, how many distinct terms are there?
For example, xyz 98 and x2 y 2 z 96 are distinct, while two different occurences of xy 50 z 49 are not
distinct; in (x + y)2 = x2 + xy + xy + y 2 = x2 + 2xy + y 2 , there are 3 distinct terms since the two
xy terms are not distinct.
Answer: 5151
Solution: A distinct term of the expansion of (x + y + z)100 is of the form xa y b z c , where
a + b + c = 100 and a, b, c are all nonnegative integers. The number of distinct terms is then just
the number of nonnegative integer solutions to a + b + c = 100. This is just 100+3−1
= 5151 .
3−1
Problem 5: How many solutions (a, b, c, d, e) in the Gaussian integers located in the first
quadrant of the complex plane exist for the equation a + b + c + d + e = 12 + 7i? By “Gaussian
integers in the first quadrant of the complex plane” we mean that all of are complex numbers
(a, b, c, d, e) can be written in the form x + yi where x and y are positive integers.
Answer: 4950
Solution: We represent a = x1 + iy1 , b = x2 + iy2 , c = x3 + iy3 , d = x4 + iy4 , e = x5 + iy5
where all the xi and yi are all positive integers. Clearly the real and imaginary parts of a Gaussian
integer are independent, so we need to multiply the number of ways for the real parts to sum to 12
7−1
and the imaginary parts to sum to 7. This is just 12−1
5−1
5−1 = 4950 .
Problem 6: How many ordered triples of positive integers (a, b, c) exist such that abc = 5184?
Answer: 420
Solution: At first glance, this problem might not look like a distributions problem, since it is an
equation with multiplication not addition. However, we can remedy this. 5184 = 4·1296 = 26 34 , and
so we can write a = 2x1 3y1 , b = 2x2 3y2 , and c = 2x3 3y3 for x1 , x2 , x3 and y1 , y2 , y3 all nonnegative
integers. We can extract a distribution problem from this, since exponents add when we multiply
terms.
We need to count solutions to the equations x1 + x2 + x3 = 6 and y1 + y2 + y3 = 4 in the
nonnegative integers. We can solve the two independently, then multiply the results. We have
6+3−1
= 82 solutions to the equation in xi and 4+3−1
= 62 solutions to the equation in yi .
3−1
3−1
Thus, our answer is 82 62 = 420 .
3
Problem 7: How many ordered 4-tuples (w, x, y, z) of positive integers satisfy the equation
w + x + y + z = 33 with the condition that w ≡ z ≡ 0 (mod 3) and x + y ≡ z (mod 3)?
Answer: 450
Solution: We’ll proceed by casework and then work as we did in example 10. We have three
cases: x ≡ 0, x ≡ 1, or x ≡ 2 (mod 3).
Case 1: x ≡ 0 (mod 3)
In this case, we write w = 3a, x = 3b, y = 3c, and z = 3d. We have 3a + 3b + 3c + 3d = 33, or
a + b + c + d = 11. There are 11−1
4−1 = 120 solutions to this equation.
Case 2: x ≡ 1 (mod 3)
In this case, we write w = 3a, x = 3b−2, y = 3c−1, and z = 3d. We have 3a+3b−2+3c−1+3d =
33, or a + b + c + d = 12. There are 12−1
4−1 = 165 solutions to this equation.
Case 3: x ≡ 2 (mod 3)
In this case, we write w = 3a, x = 3b − 1, y = 3c − 2, and z = 3d. This case is exactly the same
as the case above, except with x and y swapped. There are also 165 solutions to this equation.
In total, there are 120 + 165 + 165 = 450 total solutions.
Problem 8: (AoPS Intermediate Counting and Probability) How many degree 6 polynomials
f (x) with positive integer coefficients are there such that f (1) = 30 and f (−1) = 12?
Answer: 31920
Solution: We let our polynomial be f (x) = ax6 + bx5 + cx4 + dx3 + ex2 + f x + g. f (1) =
a + b + c + d + e + f + g = 30, and f (−1) = a − b + c − d + e − f + g = 12. We also know
all of a, b, ..., g are positive integers. The key now is to extract a distribution problem or some
distributions problems out of this knowledge, as neither one alone gets us the right answer because
the other provides more restrictions.
We add the two equations to get 2a + 2c + 2e + 2g = 42, or a + c + e + g = 21. We subtract the
second equation from the first equation to get 2b + 2d + 2f = 18, or b + d + f = 9. Each of these two
equations is not influenced by the other, as they both contain different variables. Now we can count
the number of solutions to each equation in positive integers, then multiply our two results for our
20
9−1
8
20 8
final answer. We get 21−1
4−1 = 3 and 3−1 = 2 . Our final answer is thus 3
2 = 31920 .
Note that we could also think of the polynomial f (x) as the sum of an even polynomial g(x) and
an odd polynomial h(x). The two equations a + c + e + g = 21 and b + d + f = 9 correspond to the
even and odd portions of f (x), respectively.
4
Problem 9: (Mandelbrot) In a certain lottery, 7 balls are drawn at random from n balls
numbered 1 through n. If the probability that no pair of consecutive numbers is drawn equals the
probability of drawing exactly one pair of consecutive numbers, find n.
Answer: 54
Solution: It might not be immediately obvious how this is a distributions problem, but remember example 9 from the handout? This problem is of a similar flavor. It might be a good idea to
reread its solution before reading this solution.
First, we rehash this probability problem as a counting problem:
In a certain lottery, 7 balls are drawn at random from n balls numbered 1 through n. If the
number of ways to draw the seven balls such that that no pair of consecutive numbers is drawn
equals the number of ways of drawing exactly one pair of consecutive numbers, find n.
Now that we have a counting problem, we need to find how to apply distributions. First, let’s
count the number of ways to draw seven balls such that no two are consecutive. We lay the n balls
out in a line, and we denote by | a picked ball, by
and by
a nonnegative-length run of non-picked balls,
a positive-length run of non-picked balls:
| | | | | | |
This picture indicates that we can not draw zero or more balls, then we draw a ball, don’t
draw one or more balls, and so on until we draw the seventh ball. We then have zero or more
balls we don’t draw. Finding the number of ways to do this is equivalent to solving the equation
a + b + c + d + e + f + g + h + 7 = n for positive b, c, d, e, f, g and nonnegative a, h, since there
are seven balls drawn in the lottery and a balls in the first group, b in the second, and so on for a
total of n balls. There are n−7+2−1
solutions to this equation (we get this by making appropriate
8−1
substitutions to deal with a and h and then moving all nonvariable terms to the right hand side).
Now we count the number of ways we can draw seven balls such that exactly one pair of
consecutive numbers is drawn. In the same vein as our picture above, we’ll have six vertical
bars, five nonempty gaps between them, and the two possibly empty gaps at the end. We have
a + b + c + d + e + f + g + 7 = n, for a, g ≥ 0 and b, c, d, e, f ≥ 1. This equation has n−7+2−1
7−1
solutions. However, we need to multiply this result by 6 becaues there are six ways to pick when we
draw the two consecutive balls: balls one and two, two and three, three and four, four and five, five
and six, or six and seven.
5
So now our problem reduces to finding n such that 6
n−6
6
=
n−6
7
. We expand:
6(n − 6)!
(n − 6)!
=
6 · 5!(n − 12)(n − 13)!
7 · 6 · 5!(n − 13)!
Simplifying, we get n − 12 = 7 · 6 = 42, so n = 42 + 12 = 54 .
Problem 10: Prove the “hockey stick identity” using distributions. That is, prove the following
combinatorial identity using a bijective proof and a distributions-based interpretation:
n X
i
i=k
k
=
n+1
.
k+1
Solution: Consider the problem of putting n+2 indistinguishable balls into k +2 distinguishable
urns such that each urn has at least one ball in it. The right hand side of the identity clearly counts
the number of ways to do this, so we need to figure out what the left hand side counts.
i
k counts the number of ways to put i + 1 indistinguishable balls into k + 1 distinguishable urns,
as long as i ≥ k. I claim that the left hand side of our identity also counts the number of ways to
put n + 2 indistinguishable balls into k + 2 distinguishable urns. Take one of our k + 2 urns and
set it aside. We’ll call it the trash can. We can put anywhere from 1 to (n + 2) − (k + 1) balls in
the trash can, since each urn must get at least one ball. If we put j balls in the trash can, we have
n + 2 − j balls to distribute among k + 1 other urns. The number of ways to do this, summing across
all permissible values of j, is
n−k+1
X j=1
n+1−j
k
=
n X
i
i=k
k
when we let i = n + 1 − j. Since the left hand side of the identity and the right hand side of
the identity count the same thing (the number of ways to distribute n + 2 indistinguishable balls
into k + 2 distinguishable urns) in different ways (putting some in one urn first, then counting the
number of ways to distribute the rest or directly counting the number of distributions), the two
expressions must be equal.
6