0% found this document useful (0 votes)
50 views10 pages

Practice - Permutations-And-Combinations - Tom Davis - Solutions To Counting - 40 Solutions

This document provides solutions to miscellaneous counting problems from another document. It solves 29 problems involving counting combinations, permutations, and arrangements of various objects and groups. The solutions range from 1 to several sentences and use mathematical notation to clearly show the counting steps and reasoning involved in arriving at each answer.

Uploaded by

alroy dcruz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views10 pages

Practice - Permutations-And-Combinations - Tom Davis - Solutions To Counting - 40 Solutions

This document provides solutions to miscellaneous counting problems from another document. It solves 29 problems involving counting combinations, permutations, and arrangements of various objects and groups. The solutions range from 1 to several sentences and use mathematical notation to clearly show the counting steps and reasoning involved in arriving at each answer.

Uploaded by

alroy dcruz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Counting Things—Solutions

Tom Davis
[email protected]
http://www.geometer.org/mathcircles
March 17, 2006

Abstract
These are solutions to the “Miscellaneous Problems” in the “Counting Things” article at:

http://www.geometer.org/mathcircles/counting.pdf

1 Miscellaneous Problems
22. How many diagonals are there in a convex n-gon?
You can choose the first diagonal from any of n vertices. The two adjacent vertices cannot be used to form
a diagonal, since the line connecting the chosen vertex to the adjacent one would lie on the boundary, so
there are n − 3 possibilities for the second choice. Thus n(n − 3) is the number of ways to choose first one
vertex and then the next, but this must be divided by two, since each vertex is counted twice. The solution
is n(n − 3)/2. Check this for some small polygons: squares, pentagons, et cetera.
23. There are 3 rooms in a dormitory, a single, a double, and a quad. How many ways are there to assign 7
people to the rooms?

We need to choose 4 people for the quad, which can be done in 74 ways. Once this is done, 2 people

must be chosen for the double from the 3 remaining, and this can be done in 32 ways. The one remaining
 
person goes in the single. Thus there are 74 32 = 35 · 3 = 105 ways to make the assignments.
24. How many 10-digit numbers have at least 2 equal digits?
The only ones that do not have at least 2 equal digits contain one copy of each digit. Since there are
10! ways to rearrange the digits, at first it appears that there are 10! such numbers, but we usually do not
consider a number beginning with 0 to be a valid representation, and 1/10 of the rearrangements of the
digits from 0 to 9 begin with 0. Thus there are (9/10) · 10! = 3265920 such numbers.
All the rest of the 10-digit numbers must contain at least 2 equal digits. Altogether, there are 9000000000
10-digit numbers (each begins with a digit between 1 and 9 and the other digits can be chosen freely).
Thus there are 9000000000 − 3265920 = 8996734080 numbers with at least 2 equal digits.
25. How many ways can you put 2 queens on a chessboard so that they don’t attack each other? (Queens attack
both on the rows and on the diagonals of a chessboard.)
The first queen can be placed on any of the 64 squares. Once she is placed, all the squares in her row,
column, and diagonals are eliminated as possibilities for the second queen (and of course the second queen
cannot be placed on the same square, either). Every queen’s row and column contain 15 squares, but
the number of diagonal squares depends on the position of the queen. A cursory examination shows that
queens in the outermost ring of squares have 7 additional squares in their diagonals, that queens in the next
ring in have 9 additional squares, those in the third ring in have 11, and queens on the 4 squares in the
center have 13 diagonal squares.

1
The outermost ring contains 28 squares, the next one in contains 20, the third ring contains 12, and the
innermost, 4. Thus there are 28·(64−15−7)+20·(64−15−9)+12·(64−15−11)+4·(64−15−13) =
28 · 42 + 20 · 40 + 12 · 38 + 4 · 36 = 2576 ways to choose first one queen, then the next. Of course this
double-counts each arrangement since we don’t care which queen was selected first, and the solution is
2576/2 = 1288 arrangements of two non-attacking queens.
26. How many ways can you split 14 people into 7 pairs?
 
For the first pair, there are 14 12
2 = 91ways to do it.For the second, . . . seventh pairs, there are 2 = 66,
10
  
2 = 45, 82 = 28, 62 = 15, 42 = 6, and 22 = 1 ways to make the selections. But among these
91 · 66 · 45 · 28 · 15 · 6 · 1 = 681080400 ways, every set of pairs is counted 7! = 5040 times, so the answer
is 681080400/5040 = 135135 ways.

Another solution is this: There are 14 7 = 3432 ways to choose one member of each group. The seven
remaining members must be assigned to those groups and this can be done in 7! = 5040 ways. Thus there
are 3432 · 5040 ways to do this, but then each list of 7 pairs is counted 2 7 = 128 ways, since every one of
the 7 can be listed in two different ways. Thus there are 3432 · 5040/128 = 135135 valid arrangements.
27. There are N boys and N girls in a dance class. How many ways are there to pair them all up?
The answer is simply N !, since there are N ways to choose the girl for boy number 1, then N − 1 ways to
choose the partner for boy number 2, and so on.
28. Ten points are marked on the plane so that no three of them are in a straight line. How many different
triangles can be formed using these 10 points as vertices?

There are 103 = 120 sets of three different points, and each set of three different points uniquely deter-
mines a triangle.
29. A group of soldiers contains 3 officers, 6 sergeants, and 30 privates. How many ways can a team be formed
consisting of 1 officer, 2 sergeants, and 20 privates?
  
There are 31 = 3 ways to pick the officer, 62 = 15 ways to pick the sergeants, and 30 20 = 30045015
ways to choose the 20 privates. Thus there are 30045015 · 15 · 3 = 1352025675 ways to make the complete
selection.
30. Ten points are marked on a straight line and 11 on another line, parallel to the first. How many triangles
can be formed from these points? How many quadrilaterals?
Three points determine a triangle, but in this case, the three points cannot be on the same line. Thus two
of the pointshave to be on one line, and one on the other. If the two points are on the line with 10 points,
there are 10 2 = 45 ways to select them, and for each of those 45, there are 11 ways to choose the third,
for a total of 11 · 45 = 495 triangles. Similarly, if the two points are on the line with 11 points, there are
11
2 · 10 = 55 · 10 = 550 triangles. In total there are 495 + 550 = 1045 possible triangles.
 11
For the quadrilaterals, it’s clear that two points need to be chosen from each line. There are 10 2 · 2 =
45 · 55 = 2475 ways to do this. If the quadrilateral is simple (in other words, if the lines are not allowed to
cross), then the selection of the four points completely determines the quadrilateral. If the lines are allowed
to cross, forming a sort of “bow-tie” pattern, there are two ways to connect the four dots, making a total of
4950 quadrilaterals (simple and crossing).
31. How many ways can you put 10 white and 10 black checkers on the black squares of a checkerboard?

There are 32 black squares on a checkerboard. There are 32 10 = 64512240 ways to pick 10 squares for the
10 black pieces. Once these are selected, there remain 22 squares of which 10 must be selected for the white

2

pieces. There are 22
10 = 646646 ways to do this. Thus there are 64512240 · 646646 = 41716581947040
possible arrangements.
32. ? How many 10-digit numbers have the sum of their digits equal to 1? The sum equal to 2? To 3? To 4?
Assuming that we do not allow numbers that begin with the digit 0, there is only one way to make a 10-digit
number whose digits add to 1: 1000000000.
If the digits add to 2 there can be a single 2: 2000000000 or 2 1s. In this case, the first digit must be 1 and
the second can be chosen in any of 9 positions. Thus there are 10 total ways to make a 10-digit number
whose digits add to 2.
The case where the digits add to 3 is more complicated. First we need to list the “partitions” of 3—the
number of ways to add positive integers to obtain 3. These include: 3, 2 + 1 and 1 + 1 + 1. In the first
case, there is only one 10-digit number: 3000000000. In the second case, as above, there are 9 ways to do
it if the first digit is 2 and 9 more if the first digit is 1. If all three of the non-zero digits are 1, the first must
be 1 and the other two are chosen arbitrarily from among the other 9 which can be done in 92 = 36 ways.
Thus there are 1 + 9 + 9 + 36 = 55 ways to make a 10-digit number whose digits add to 3.
If they add to 4, it is even uglier. The partitions of 4 include: 4, 3 + 1, 2 + 2, 2 + 1 + 1 and 1 + 1 + 1 + 1.
Each case has to be handled. For the partition 4 the only possibility is 4000000000. For 3 + 1 there are
9 possibilities with 3 as the initial digit and 9 more with 1 as the initial digit. For 2 + 2, the first digit is
2 and
 the position of the other 2 can be chosen in 9 ways. For 2 + 1 + 1, if the first digit is 2, there are
9
2 = 36 ways to choose the positions of the two 1s. If the first digit is 1, there are 9 · 8 = 72 ways to
choose the positions of the remaining 1 and 2. Finally, with four 1s, the  first digit is 1, and the other three
can be chosen arbitrarily from among the 9 remaining positions in 93 = 84 ways. Thus there are a total
of 1 + (9 + 9) + 9 + (36 + 72) + 84 = 220 ways to make a 10-digit number whose digits add to 4.
33. To win the California lottery, you must choose 6 numbers correctly from a set of 51 numbers. How many
ways are there to to make your 6 choices?

We need to choose 6 items from a set of 51, so there are 51
6 = 18009460 ways to fill in your California
lottery card.
34. A person has 10 friends. Over several days he invites some of them to a dinner party in such a way that he
never invites exactly the same group of people. How many days can he keep this up, assuming that one of
the possibilities is to ask nobody to dinner?
Basically we are counting the number of possible subsets of his 10 friends. In every subset, each particular
person is either included of not. The choice of whether a person is included or not is independent of the
choice for another person, so there are 210 = 1024 subsets.
35. There are 7 steps in a flight of stairs (not counting the top and bottom of the flight). When going down, you
can jump over some steps if you like, perhaps even all 7. In how many different ways can you go down the
stairs?
Imagine that each step down is a dot, so the entire staircase would look like a series of 7 dots: “· · · · · · ·”.
Imagine a vertical line between the dots where you stop on the way down. If the first step is a jump
down all 7 steps, then there are no vertical lines. If you step down 4 and then down 3, it looks like this:
“· · · · | · · ·”. If you stop on every step, it looks like this: “· | · | · | · | · | · | ·”. If you think about it, every
possible assignment of vertical bars to the 6 available spaces corresponds to a method of descending, so
there are 26 = 64 ways to go down the stairs.
36. ? The following illustration is a map of a city, and you would like to travel from the lower left to the upper
right corner along the roads in the shortest possible distance. In how many ways can you do this?

3
One way to solve this problem is to list at each vertex the number of ways to arrive at that vertex. Clearly
the vertex in the lower left is labeled with a 1. In fact, all the vertices along the bottom and left edges are
also labeled with 1 since there’s only one route leading to them. The number of routes leading to a point
inside the rectangle is the sum of the paths leading to the point below it and to the point on its left. If you
fill in the points this way, you’ll see that you are essentially filling in Pascal’s triangle, so the point in the
upper right corresponds to the value in the 14th row (counting
 the first as row 0) and it is the 8th entry in
14
that row (again beginning with 0). Thus the value is 8 = 3003.
Another way to think of this is that among the 9 vertical lines, 6 steps up have to be distributed. This is the
number of ways to place 6 identical items in 9 “boxes”. Imagine the 9 boxes placed next to each other and
represented by 8 vertical lines. The numbers 1 through 9 represent the interiors of boxes 1 through nine:
“1|2|3|4|5|6|7|8|9”. The 6 dots need to be placed in some of those 9 positions, perhaps more than one in
some positions. Thus: “· · ||| · ||| · · · ||” represents the configuration with two items in box 1, one item
in box 4, and three items in box 7. It should be clear that every combination of 8 vertical bars and 6 dots
represents a valid arrangement. Of the 14 “slots” which are either dots or vertical lines, 8 must be chosen
to be lines. This can be done in 148 = 3003 different ways.

37. In how many ways can 12 identical pennies be put in 5 purses? What if none of the purses can be empty?
This is very similar to the previous problem. With no constraints against empty purses, it’s the number
of ways
 to place 12 items in 5 boxes, and an argument identical to the one above shows that there are
16
12 = 1820 ways to do it.
If none of the purses can be empty, it’s as if 5 pennies are committed to be one in each purse, leaving 7
pennies
 to distribute freely. This is the same as the number of ways to place 7 items in 5 boxes which is
11
7 = 330 ways.
38. In how many ways can you put k identical things into n boxes, where the boxes are numbered 1, · · · , n?
What if you must put at least one thing in each box (so, of course, k > n)?

From the previous problems the same argument shows that there are k+n−1 k ways to assign k things to
n boxes without constraints. With the constraint that there be at least one item per box, the problem is
k−1
equivalent to that of assigning k − n items to n boxes which can be done in k−n ways.
39. A bookbinder must bind 12 identical books using red, green, or blue covers. In how many ways can this
be done?
This is again similar to the questions above. Imagine a line of 12 unbound books in a row. Two markers
are stuck into the line. Then, beginning from the left, books are bound red until the first marker is reached.
Then they are bound green until the second is reached, and the rest are bound blue. Notice that if both
markers appear on the left of all the books, all will be bound blue, et cetera. So every combination of 12
books and 2 markers
 generates a valid combination. These 14 items (the books plus the markers) can be
arranged in 142 = 91 ways, since an arrangement is equivalent to picking which 2 of the 14 are markers.
40. ? A train with M passengers must make N stops. How many ways are there for the passengers to get off
the train at the stops? What if we only care about the number of passengers getting off at each stop?

4
The first question is equivalent to listing, for each passenger, which stop he or she uses. There are N M
ways to do this.
The second part is similar to the previous problem (problem 39). We make a line of M passengers and
insert N − 1 markers between them. Those before the first marker get off at stop 1, et cetera. Altogether,
there are M + N − 1 passengers and markers, of which we must identify M as passengers. This gives
M +N −1
M ways to do it.
41. How many ways are there to arrange 5 red, 5 green, and 5 blue balls in a row so that no two blue balls lie
next to each other?
Once the blue balls are placed, any arrangement of the other balls is valid in the 10 available slots. Thus
for every valid blue ball arrangement, there are 10
5 = 252 arrangements.
If b represents a blue ball and x represents a non-blue ball and we begin with the arrangement: bxbxbxbxb,
we have used 4 of the 10 non-blue positions. The additional 6 non-blue balls must go into  one of the 6
positions before all the bs, between a pair of bs or after all the bs. We know there are 11
6 = 462 ways to
place 6 objects in 6 boxes, so there are 462 · 252 = 116424 arrangements of the 15 balls with no adjacent
pair of blue balls.
42. How many ways are there to represent 100000 as the product of 3 factors if we consider products that
differ in the order of factors to be different?
We can factor 100000 as 25 · 55 . Consider the three factors to be three bins into which some number
(possibly
 zero) of 2s and 5s are placed. We can place the 5s and 2s independently into those bins. There
are 75 = 21 ways to place the 5s and similarly, 21 ways to place the 2s, so there are 21 · 21 = 441 total
factorizations.
43. There are 12 books on a shelf. In how many ways can you choose 5 of them so that no two of the chosen
books are next to each other on the shelf?
This is similar to the first part of problem 41. If the chosen books are called c and the others x, begin with
the arrangement cxcxcxcxc.
 The remaining 3 books need to be placed into the 6 available boxes which
can be done in 83 = 56 ways.
44. In how many ways can a necklace be made using 5 identical red beads and 2 identical blue beads?
There are only 3 ways to do this. The blue beads can be adjacent, can have one red bead between them,
or two red beads between them. If they are three apart, then they are only two apart in the other direction,
et cetera. This is a very simple example of the sort of problem that can be solved using Pólya’s counting
theory.
45. Given 6 vertices of a regular hexagon, in how many ways can you draw a path that hits all the vertices
exactly once?
This problem can be interpreted in two different ways. If “a path” means to begin at one vertex and then
pass to 5 others, there are clearly 6! = 720 ways to do it. The beginning vertex can be chosen to be any of
6. Once that is chosen, there are 5 vertices available for the second choice, et cetera.
If instead we consider closed paths that begin and end at a vertex after passing through the five others, we
must divide our answer by 12 giving 60 paths. That is because if ABCDEF is one path where vertex F is
connected to vertex A, it is equivalent to paths BCDEF A, CDEF AB, et cetera for 6 rotations, but paths
in the reverse order should also be the same: F EDCBA, EDCBAF , et cetera. Each of the original 720
paths has 12 equivalent paths under this assumption.

5
46. Within a table of m rows and n columns a box is marked at the intersection of the p th row and q th column.
How many of the rectangles formed by the boxes of the table contain the marked box?
Instead of considering the boxes, consider the vertical and horizontal lines that mark the edges of the boxes.
There are m + 1 and n + 1 of these. The box in row p has p lines to the left of it and m + 1 − p to the
right. Similarly, the box in column q has q lines below it and n + 1 − q above. A rectangle is completely
determined by picking the top, bottom, left, and right lines. This can be done in p(m + 1 − p)q(n + 1 − q)
ways.
47. ? A 10×10×10 cube is formed of small unit cubes. A grasshopper sits in the center O of one of the corner
cubes. At a given moment, it can jump to the center of any of the cubes which has a common face with
the cube where it sits, as long as the jump increases the distance between point O and the current position
of the grasshopper. How many ways are there for the grasshopper to reach the unit cube at the opposite
corner?
This is very similar to problem 36, but in three dimensions. We can mark the center of each box with
the number of paths that would take us to that center. If the point O were on top, and the cube “hanging
down” from it, the cubes in the upper edges of the large cube would all contain a 1. The numbers in the
upper faces would contain the entries from Pascal’s triangle, just as in problem 36. The number in any
interior cube (or the cubes on the bottom) is determined by adding together the numbers in the three cubes
touching it and above it. In this way, the numbers could be filled in mechanically.
Another way to look at it is that there are three sorts of moves along the x, y and z directions that the
grasshopper can make. He has to make  27 moves consisting of 9 in the x direction, 9 in the y direction,
and 9 in the z direction. There are 27
9 = 4686825 ways to choose the x moves, and after they are chosen,

there are 189 = 48620 ways to choose which of the remaining moves are in the y direction. Once those
are chosen, the z moves are fixed. Thus there are 4686825 · 48620 = 227873431500 possible paths that
the grasshopper can take.
For those interested, this is also the trinomial coefficient: (m + n + p)!/((m!)(n!)(p!)). This can be
interpreted as the coefficient of am bn cp in the expansion of (a + b + c)m+n+p . The binomial coefficients
are related to the two-dimensional Pascal’s triangle; these could be listed in a three-dimensional version.
48. Find the number of integers from 0 to 999999 that have no two equal neighboring digits in their decimal
representation.
This is a bit of a mess since we do not list leading zeroes. If we were just looking for the number of ways
to list patterns of 6 digits with no equal neighboring digits, there are 10 ways to choose the first digit, and
then 9 ways to choose each of the following digits, so there are 10 · 9 5 ways to do this.
But the same idea works. There are 10 one-digit numbers that satisfy the conditions. There are 9 · 9 =
92 two-digit numbers. There are 9 · 9 · 9 = 93 three-digit numbers, et cetera. Thus the grand total is
10 + 92 + 93 + 94 + 95 + 96 = 597880 integers.
49. How many ways are there to divide a deck of 52 cards into two halves such that each half contains exactly
2 aces?

There are 42 = 6 ways to choose 2 aces, and once they are chosen, the other two are determined. Once the
two sets of aces are picked, there remain 48 cards of which24 must be selected to go with one pair of aces.
The remaining 24 go with the other. Thus there are 6 · 4824 = 6 · 32247603683100 = 193485622098600
ways to do it.
50. How many ways are there to place four black, four white, and four blue balls into six different boxes?

6

The placing of the black, white, and blue balls are independent. There are 94 = 126 ways of dividing up
each color of balls, so there are a total of 1263 = 2000376 ways to place all of them.
51. In Lotto, 6 numbers are chosen from the set {1, 2, . . . , 49}. In how many ways can this be done such that
the chosen subset has at least one pair of neighbors?

There are 49 6 = 13983816 ways to choose any 6 numbers from 49. We also know from problems 41 and
43 how to count
 the number with no adjacent numbers. This is the number of ways to place 38 items in 7
boxes, or 4438 = 7059052, so there are 13983816 − 7059052 = 6924764 solutions. (Remember that if we
start with the pattern cxcxcxcxcxc where c is a chosen number and x is not, that accounts for 11 of the 49
numbers. The other 38 must be distributed in the “boxes” between and outside the cs.)
52. Given a set of 3n + 1 objects, assume that n are indistinguishable, and the other 2n + 1 are distinct. Show
that we can choose n objects from this set in 22n ways.
We can choose n, n − 1, . . . 1, or 0 of the items from the set of distinguishable objects. Once those are
chosen, the rest must come from the set of indistinguishable items which can be done in only one way.
Thus, there are a total of:
       
2n + 1 2n + 1 2n + 1 2n + 1
+ +··· + +
n n−1 1 0

total ways of doing this. This is exactly half of row number 2n + 1 in Pascal’s triangle (where the top row
is called row 0). Remember that each row in Pascal’s triangle is symmetric, like “1 3 3 1” or “1 5 10 10 5
1”. Also note that each odd row has an even number of entries. All the items in row k add to 2 k , so all the
items in row 2n + 1 add to 22n+1 . But since we only have a half row, we get half the sum, or 22n .
53. In how many ways can you take an odd number of objects from a set of n objects?
This is:      
n n n
+ +···
1 3 n
or      
n n n
+ +··· ,
1 3 n−1
depending upon whether n is odd or even.
Both of these sums are equal to half the sum of the row, so the solution is 2 n /2 = 2n−1 .
54. n persons sit around a circular table. How many of the n! arrangements are distinct, i.e., do not have the
same neighboring relations?
Any arrangement can be rotated to n possible starting positions, so we need to divide n! by n. We also
need to divide by 2 (unless n = 1 or n = 2) because the orientation of the seating can be reversed from
clockwise to anti-clockwise. Thus there are n!/(2n) arrangements unless n = 1 or n = 2 in which case
there is only 1 seating arrangement.
55. ?? 2n points are chosen on a circle. In how many ways can you connect them all in pairs such that none
of the segments overlap?
See problem 57.
56. ?? In how many ways can you triangulate a convex n-gon using only the original vertices?
See problem 57.

7
57. ?? If you have a set of n pairs of parentheses, how many ways can you arrange them “sensibly”. For
example, if you have 3 pairs, the following 5 arrangements are possible: ((())), (())(), ()(()), (()()), ()()().
2n

All three problems, 55, 56 and 57 have the same solution, namely: n+1 1
n . These are known as the
Catalan numbers, and for n = 0, . . . 5, they are: 1, 1, 2, 5, 14, 42. A discussion of the Catalan numbers is
beyond the scope of this article.
For more information, see the book, The Book of Numbers by John H. Conway and Richard K. Guy.
58. ?? How many subsets of the set {1, 2, 3, . . . , N } contain no two successive numbers?
This is like problems 41 and 43. We can do the same analysis and obtain:
     
N N −1 N −2
+ + +···
N −1 N −3 N −5

The sum above is finite, since eventually the lower number will get to zero. The formula above is equivalent
to:      
N N −1 N −2
+ + + ···
1 2 3

If we work out the first few terms, we obtain for N = 0, 1, 2, . . .: 0, 1, 2, 4, 7, 12, 20, . . .. These are all one
less than the numbers in the Fibonacci series: 1, 1, 2, 3, 5, 8, 13, 21, . . ., where after the first two numbers,
each is obtained by adding the previous two.
Thus, if this pattern continues to hold, if f (N ) is the number of such subsets that exist, we need to show
that f (N + 2) = f (N + 1) + f (N ) + 1. We can check this for the values of N = 0 and N = 1, and then
prove the general case by induction. We would like to show that the first two lines in the equation below
add to the final line:
     
N N −1 N −2
1 + + + + ···
1 2 3
       
N +1 N N −1 N −2
+ + + + ···
1 2 3 4

       
N +2 N +1 N N −1
+ + + + ···
1 2 3 4

This is equivalent to showing that:


     
N −k N −k N −k+1
+ = .
k+1 k+2 k+2

If we write these in terms of factorials, this is equivalent to:

(N − k)! (N − k)! (N − k + 1)!


+ = .
(N − 2k − 1)!(k + 1)! (N − 2k − 2)!(k + 2)! (N − 2k − 1)!(k + 2)!

If we find a common denominator and add, this is easily checked to be true:

8
(k + 2)(N − k)! (N − 2k − 1)(N − k)! (N − k + 1)!
+ =
(N − 2k − 1)!(k + 2)! (N − 2k − 1)!(k + 2)! (N − 2k11)!(k + 2)!
((k + 2) + (N − 2k11))(N − k)! (N − k + 1)!
=
(N − 2k − 1)!(k + 2)! (N − 2k11)!(k + 2)!
((N − k + 1)(N − k)! (N − k + 1)!
=
(N − 2k − 1)!(k + 2)! (N − 2k − 1)!(k + 2)!

59. How many ways are there to put seven white and two black billiard balls into nine pockets? Some of the
pockets may be empty and the pockets are considered distinguishable.
This is just an objects-into-boxes problem similar to problem 50. We need onlymultiply  together the
number of ways of placing 7 balls in 9 pockets and 2 balls in 9 pockets. This is 15
7 · 10
2 = 6435 · 45 =
289575.
60. ?? How many ways are there to group 4 pieces of luggage? 5 pieces? (Here are the groupings of 3 pieces,
A, B, and C: ABC, A|BC, B|AC, C|AB, A|B|C. The vertical bars represent divisions into groups.)
The solution to this problem for a general number of pieces of luggage is beyond the scope of this paper.
The solutions for a general number n of items is called the Bell number b n . Here are the first few values:
b1 = 1, b2 = 2, b3 = 5, b4 = 15, b5 = 52 and b6 = 203.
For more information, see the book, The Book of Numbers by John H. Conway and Richard K. Guy, or
Donald Knuth’s The Art of Computer Programming, Volume 1: Fundamental Algorithms.
61. ? Find the number of poker hands of each type. For the purposes of this problem, a poker hand consists of
5 cards chosen from a standard pack of 52 (no jokers). Also for the purposes of this problem, the ace can
only be a high card. In other words, the card sequence A♣, 2♦, 3♦, 4♠, 5♥ is not a straight, since the ace
is a high card only. The suit of a card is one of: ♣, ♦, ♥, or ♠. The rank of a card is the number or letter:
2, 3, . . . , 10, J, Q, K, A.
Here are the definitions of the hands followed by an example of each in parenthesis. The hands are listed
here in order with the most powerful first. If a hand satisfies more than one of these, it is classified as the
strongest class it satisfies. For example, the hand (9♣, 9♦, 9♠, 6♠, 2♥) is certainly a pair, but it is also
three of a kind.
Royal flush: 10 through A in the same suit. (10♠, J♠, Q♠, K♠, A♠)
Straight flush: 5 cards in sequence in the same suit. (4♦, 5♦, 6♦, 7♦, 8♦)
Four of a kind: Four cards of the same rank. (Q♠, Q♥, Q♦, Q♣, 7♠)
Full house: Three cards of one rank and two of another. ( 3♠, 3♦, 3♣, 9♥, 9♦)
Flush: Five cards in the same suit. (3♣, 4♣, 5♣, 6♣, 8♣)
Straight: Five cards in sequence. (6♣, 7♣, 8♦, 9♠, 10♣)
Three of a kind: Three cards of the same rank. (J♣, J♦, J♠, 7♦, K♥)
Two pairs: Two pairs of cards. (5♥, 5♠, 8♦, 8♣, A♠)
Pair: A single pair of cards. (3♣, 3♦, 5♠, 9♦, Q♦)
Bust: A hand with none of the above. (2♣, 4♠, 6♦, 8♥, 10♣)

Total Hands: There are 52
5 = 2598960 total hands.

9
Royal Flush: There are 4 of these, since the hand is completely determined by the suit, and there are 4
possible suits.

Straight Flush: The hand is completely determined by the lowest card, which can be anything between
2 and 9 in any suit (if the lowest card is 10, it’s a royal flush). There are 8 choices in 4 suits, making 32
straight flushes.
Sometimes the ace can be considered to be either a high card or a low card. If a straight flush can have the
ace as the low card, then there are 4 additional straight flushes, or a total of 36.

Four of a kind: There are 13 different ranks to choose for the four of a kind, and once that’s picked, there
are 48 additional cards to complete the hand. Therefore there are 13 · 48 = 624 hands.

Full house: There are 13 ways to choose the rank that appears 3 times, and then 12 ways topick the pair.
There are 43 ways to pick the triplet, and 42 ways to pick the pair. Thus there are 13 · 12 · 43 · 42 = 3744
ways to make a full house.

Flush: There are 4 suits. Once the suit is chosen, there are 13 5 ways to pick the cards, but 9 of those

choices are either straight or royal flushes. Therefore, there are 4 · ( 13
5 − 9) = 5112 flushes.

Straight: The lowest card in a straight can be of any rank between 2 and 10, so there are 9 possible lowest
ranks. We then need to pick a card of each rank, which can be done in 4 5 ways. But 4 of those ways will
all be in the same suit, so there are 9 · (45 − 4) = 9180 different straights.
If an ace can be the low card in a straight, then we must multiply by 10 instead of 9, making 10200 total
straights.

Three of a kind: There are 13 kinds, from which you can pick the 3 cards in 43 ways. Once they’re
picked, you need to choose 2 other cards. The first can be chosen in 48 ways, and once it’s picked, the
second in 44 ways. But those last two cards can be picked in either order, so we must divide by 2, giving a
grand total of 13 · 43 · 48 · 44/2 = 54912.
 
Two pairs: The two ranks can be chosen in 13 4
2 ways. Once they’re picked, there are 2 ways to pick
the two particular
 cards
 of  each rank. Finally, the final card can be picked in any of 44 ways, making the
grand total: 13
2 · 4
2 · 4
2 · 44 = 123552.

Pair: The rank can be chosen in 13 ways, and the two cards of that rank in 42 ways. Next, we must
choose 3 cards of different ranks, which can be done in 48, 44, and 40 ways. Since they can be picked in
any order, we must divide by the number of permutations of the 3 cards, or 3!. The total number of pairs is
thus: 13 · 42 · 48 · 44 · 40/3! = 1098240.

Bust: The easiest way to get this is to subtract all the above numbers from the grand total, but if we can
calculate it in a different way, we have a check on all our numbers. The 5 cards must be chosen in 5
different ranks, so there are 52 · 48 · 44 · 40 · 36 ways, but they can be picked in any order so we must divide
by 5!. This set includes the straights, flushes, straight flushes, and royal flushes, so subtract them out, for a
grand total of (52 · 48 · 44 · 40 · 36/5!) − 9180 − 5112 − 32 − 4 = 1303560.
Obviously, there are fewer busts if the ace can be considered to be the low card in a straight or straight
flush.

Check answers: 4+32+624+3744+5112+9180+54912+123552+1098240+1303560 = 2598960.

10

You might also like