CEMC Banner

Problem of the Month
Solution to Problem 5: February 2024

  1. The binomial coefficient (n+12) is equal to (n+1)!2!(n1)!, and since (n+1)!(n1)!=(n+1)n, we get that (n+12)=n(n+1)2. By the well-known formula for the sum of the first n positive integers, we have 1+2+3++(n1)+n=n(n+1)2, and so the answer to (i) is (n+12).

    For (ii), we will consider the possible values of x. Note that since x and y are non-negative and x+yn1, we must have that 0xn1.

    If x=0 and x+yn1, then y can be any of the integers from 0 through n1, for a total of n possibilities.

    If x=1, then y can be any of the integers from 0 through n11=n2, for a total of n1 possibilities.

    In general, if x=k for some k with 0kn1, then y can be any integer from 0 through n1k. There are a total of nk integers from 0 through n1k.

    Therefore, the number of pairs is n+(n1)+(n2)++[n(n1)], but this is just the sum 1+2+3++n written in reverse order. By part (i), we conclude that the number of non-negative integer pairs (x,y) with x+yn1 is (n+12).

    For (iii), observe that if x and y are non-negative integers with x+yn1, then there is exactly one non-negative integer z for which x+y+z=n1. Therefore, the number of non-negative integer pairs (x,y) with x+yn1 is exactly the same as the number of non-negative integer triples (x,y,z) with x+y+z=n1.

  2. Suppose the r distinguishable cups are labelled Cup 1, Cup 2, and so on, up to Cup r. Suppose the n balls are placed in the r cups. If we let xk be equal to the number of balls in Cup k (noting that it is possible that xk=0), then we will have x1+x2++xr=n since there are n balls in total. On the other hand, if we have a non-negative integer solution (x1,x2,,xr) to x1+x2++xr=n, then if we place xk balls in Cup k for each k, then we will have distributed exactly n balls among the r cups. Finally, observe that every placement of n balls in the r cups leads to a distinct solution to x1+x2++xr=n, and every solution to this equation gives a distinct way to distribute n balls in the r cups. This shows that the answers to questions (i) and (ii) are equal.

    We will now show that the answer to question (ii) (and hence, the answer to question (i)), is (n+r1r1).

    We need to reimagine the distribution of balls into cups as a choice of some objects. To give an idea of how it works, we will focus on the special case with n=10 and r=4. That is, we want to count the number of ways to place 10 indistinguishable balls in 4 distinguishable cups.

    Imagine laying the 10 balls in a row. We want to place them among 4 cups, which means we want to break the 10 balls into 4 groups (where some of the groups could be empty). We can do this by placing three partitions somewhere among the 10 balls that are now lined up in a row. For example, the partitions could be placed as shown in the diagram below. Each ball is represented by a circle and each partition is represented by a vertical line.

    In a row, from left to right, there are 2 circles, a partition, 3 circles, a partition, 1 circle, a partition, then 4 circles.

    This corresponds to placing 2 balls in Cup 1, 3 balls in Cup 2, 1 ball in Cup 3, and 4 balls in Cup 4. For a different example, we could place the partitions as follows.

    In a row, from left to right, there is 1 circle, a partition, 4 circles, two partitions, then 5 circles.

    In this case, two of the partitions are next to each other with no balls between them. This corresponds to the third cup having no balls in it.

    In fact, any arrangement of 10 indistinguishable balls and 3 indistinguishable partitions will corresponds to an ordered list of four non-negative integers that have a sum of 10.

    Therefore, there are 10+3=13 positions where the balls and partitions are to be placed, and every way to choose three of the positions to be partitions corresponds to an ordering of 10 balls and 3 partitions. Therefore, the answer to the question in this case is (133).

    In general, if there are r cups, then we need to use r1 partitions. This means there will be n balls and r1 partitions for a total of n+r1 objects. There are r1 positions that need to be chosen for the partitions. Thus, the number of ways to place n indistinguishable balls in r distinguishable cups is (n+r1r1).

  3. First note that non-negative integers x1,x2,,xr satisfy x1+x2++xrn if and only if x1+x2++xr=m for some integer m with 0mn. From part (b), the number of non-negative integer solutions to x1+x2++xr=m is (r1+mr1). Therefore, the number of non-negative integer solutions to x1+x2++xrn is (r1+0r1)+(r1+1r1)+(r1+2r1)++(r1+nr1)=(r1r1)+(rr1)+(r+1r1)++(r+n1r1)

    Now suppose x0,x1,,xr are non-negative integers with x0+x1++xr=n. Then we must have x1+x2++xrn. On the other hand, if x1+x2++xrn, then there is a unique non-negative integer x0 that satisfies x0+x1++xr=n. This shows that the number of non-negative integer solutions to x0+x1++xr=n is the same as the number of non-negative integer solutions to x1+x2++xrn. From part (b), the number of solutions to x0+x1++xr=n is (n+(r+1)1(r+1)1)=(n+rr).

    We have shown that the number of non-negative integer solutions to the inequality x1+x2++xrn is equal to (r1r1)+(rr1)+(r+1r1)++(r+n1r1) and it is also equal to (n+rr), so we conclude that (r1r1)+(rr1)+(r+1r1)++(r+n1r1)=(n+rr) This identity is sometime called the Hockey Stick Identity. If you are interested in knowing why it has such a strange name, read about Pascal’s Triangle and try to interpret this result using Pascal’s Triangle.

  4. The integer k having the property that k<1010 is the same as the integer k having at most 10 decimal digits. Thus, every such integer takes the form k=a9a8a7a1a0 where a9,a8,a7,,a1,a0 are the digits of k, but some of the leading digits may be equal to 0. For example, to represent the integer 19723 in this way, we would write it as 0000019723 so a9=a8=a7=a6=a5=0, a4=1, a3=9, a2=7, a1=2, and a0=3.

    Thus, to count the non-negative integers with a digit sum of 21, we need to find all non-negative integer solutions to the equation a9+a8+a7++a1+a0=21, but we have an additional restriction that each ai is a digit, meaning 0ai9.

    Switching notation slightly to match earlier parts, the answer to the question is equal to the number of solutions to the equation x1+x2++x10=21 where each xi is an integer with 0xi9.

    By part (b), the number of non-negative integer solutions to x1+x2++x10=21 without the restriction that xi9 is (21+101101)=(309). The total of (309) includes some solutions that violate xi9 for some i. We will now count the solutions that have xi10 for at least one i so we can remove these from the count.

    First, we claim that for each index i, there are (209) solutions that have xi10. For example, consider a non-negative integer solution to x1+x2++x10=21 with x110. If we set y1=x110 then y1 is a non-negative integer and y1+x2++x10=(x110)+x2++x10=(x1+x2++x10)10=2110=11 Also, if we consider a non-negative integer solution to y1+x2++x10=11, and set x1=y1+10, then we obtain a non-negative integer solution to x1+x2++x10=21 with x110. By part (b), there are (209) non-negative integer solutions to y1+x2++x10=11 and so, equivalently, there are (209) non-negative integer solutions to x1+x2++x10=21 with x110.

    Similarly, for each i from 1 through 10, there are exactly (209) non-negative integer solutions to x1+x2++x10=21 with xi10. Note that these different sets of solutions have overlap and so the number of solutions with xi10 for at least one i is not 10(209). This is an overcount. For example, the solution x1=10, x2=10, x3=1, and x4=x5=x6=x7=x8=x9=x10=0 is double counted: once as a solution with x110 and once as a solution with x210.

    Next, we claim that for every pair of indices i and j, with ij, there are (109) non-negative integer solutions to x1+x2++x10=21 with xi10 and xj10. Each of these solutions will be double counted in the count 10(209). Note that there are no solutions to x1+x2++x10=21 that have more than two variables exceeding 9 and so this will give us the complete picture.

    For an example, consider a non-negative integer solution to x1+x2+x3++x10=21 with x110 and x210. If we set y1=x110 and y2=x210 then y1 and y2 are non-negative integers satisfying y1+y2+x3++x10=1. Similarly, a non-negative integer solution to y1+y2+x3++x10=1 corresponds to a non-negative integer solution to x1+x2+x3++x10=21 with x1,x210. By part (b), there are (109) non-negative integer solutions to y1+y2+x3++x10=1 and so, equivalently, there are (109) non-negative integer solutions to x1+x2++x10=21 with x110 and x210.

    Similarly, for each pair i and j, with ij, there are (109) solutions to x1+x2++x10=21 with xi10 and xj10.

    Since there are (102) ways to choose two indices, there are (102)(109)=45(109) non-negative integer solutions that have two variables exceeding 9. From this, we conclude that the number of non-negative integer solutions to x1+x2++x10=21 that have xi10 for at least one i is given by 10(209)45(109).

    Therefore, the total number of non-negative integer solutions to x1+x2++x10=21 with xi9 for all i can be calculated as follows: (309)10(209)+45(109)=1430715010(167960)+45(10)=143071501679600+450=12628000

  5. By the same convention as the previous problem, we can recognize every positive integer less than 108 as an 8-digit integer by possibly prepending some 0s. Thus, we wish to count the number of solutions to the equation x1x2+x3x4+x5x6+x7x8=0 where the xi are integers with 0xi9 for each i.

    We can rearrange this equation to get x1+x3+x5+x7=x2+x4+x6+x8, so we want to count non-negative integer solutions to this equation where xi9 for each i.

    Since 0xi9, we must have that 0x1+x3+x5+x736 and 0x2+x4+x6+x836. For each n from 0 through 36, let An denote the number of non-negative integer solutions to x1+x3+x5+x7=n with xi9 for i=1, i=3, i=5, and i=7. Since all of the 8 variables have the exact same restrictions, we also have that An is the number of non-negative integer solutions to x2+x4+x6+x8=n where each variable is no larger than 9. Thus, for each n from 0 through 36, there are An2 solutions to the equation with each side equal to n. Therefore, the answer to the question is A02+A12+A22++A362 Now suppose that 0n36 and x1+x3+x5+x7=n with 0xi9 for each i. Then (9x1)+(9x3)+(9x5)+(9x7)=36n, and observe that since 0xi9, we have 09xi9, and since 0n36, we have 036n36. You should convince yourself that this shows that the number of solutions to x1+x3+x5+x7=n is the same as the number of solutions to x1+x3+x5+x7=36n. In other words, An=A36n. When n=18, we also have 36n=18, so the total we seek is equal to 2(A02+A12+A22++A172)+A182 For n=0 through n=9, if x1+x3+x5+x7=n, then xi9 for each i since the total is at most 9. This means the number of solutions to x1+x3+x5+x7=n where xi9 for each i is equal to the number of non-negative integer solutions without restriction. By part (b), if 0n9, then An=(n+33).

    For n=10 through n=18, there are still (n+33) unrestricted solutions, but here the count includes solutions with xi10 for some i. Note that since the total is at most 18, it is not possible for more than one variable to exceed 9. Similar to the argument in part (d), for each i, there are (n+3103) solutions with xi10. Since there are 4 variables, there are 4(n+3103) solutions with a variable exceeding 9. Therefore, An=(n+33)4(n+3103).

    We now just need to compute the total. 2(A02++A92)+2(A102++A172)+A182=2((33)2++(123)2)+2(((133)4(33))2++((203)4(103))2)+((213)4(113))2=2(12+42+102+202+352+562+842+1202+1652+2202)+2(79524+121104+172225+230400+291600+350464+400689+435600)+448900=4816030

  6. Let x=a1, y=b1, and z=c1. Then we have 0x<y<z2023 and x+y+z=2024. Thus, we want to count the number of non-negative integer solutions to x+y+z=2024 where x<y<z2023. Suppose T is the number of non-negative integer solutions to x+y+z=2024 where x, y, and z are all distinct and no larger than 2023. Since there are six different arrangements of three distinct integers, exactly one of which puts them in increasing order, the answer to the given question is 16T.

    To compute T, we note that by part (b) there are (20262) non-negative integer solutions to x+y+z=2024 where there are no restrictions on the non-negative integers x, y, and z. We now need to remove those solutions where at least two of the variables are equal as well as any that have at least one of x, y, and z greater than 2023.

    If one of x, y, and z is greater than 2023, then the condition x+y+z=2024 and the fact that x, y, and z are non-negative integers implies that one of the variables equals 2024 and the other two equal 0. Thus, any solutions with a variable greater than 2023 will also have two variables equal to each other, so we can just count the number of solutions with at least two variables equal and subtract this total from (20262). Since 2024 is not a multiple of 3, it is impossible that x=y=z. Therefore, we need to count the number of solutions where exactly two variables are equal.

    To count the number of solutions to x+y+z=2024 with two variables equal, we will count the number of solutions with x=y and triple the result since there are three choices of which two variables are equal.

    We now want to count non-negative integer solutions to 2x+z=2024. This equation implies that z is even, or that z=2w for some non-negative integer w. Thus, we need to count the number of solutions to 2x+2w=2024 or x+w=1012. By part (b), this is 1013, so the number of solutions to the equation with two variables equal to each other is 3×1013=3039.

    We now have that T=(20262)3039, and so the number of solutions is 16((20262)3039)=16(1013×20253039)=1013(337)=341381