[Math] Combinatorics – Total # of possibilities of a number sequence with given conditions

combinatorics

Consider a ten-digit sequence of positive integers 0 – 9.
The 1st, 4th, and 5th digits are either 7 or 9
3rd and tenth digits are either 2 or 4.
Somewhere in the phone number are 2 zeros, and the sum of all the digits equate to 42.
What are all possible such sequence of 10 digits??

Just from going by total possible ways of arranging said numbers we have $2^5 * 10^3 * 5!$ (for each specified digit slot there are 2 ways of doing it. In the 5 slots left in 2 digits it has to be zero so 1 way of picking those, and 10 ways of picking the unspecified digits and 5! ways of arranging those digits. From that I guess we can use method of complements and find set of all possible number that DO NOT add up to 42 and subtract the total permutations by that, but my problem is calculating the cardinality of said set. Is the only way of doing so directly/explicitly? If so then it seems like I have a lot of calculating to do..

Best Answer

The two possibilities for the half-fixed digits all differ by $2$. The lowest value for their sum is $3\cdot7+2\cdot2=25$ and the highest is $25+5\cdot2=35$. For the six values $25+2n$, there are $\binom5n$ ways of choosing the half-fixed digits to make that sum. That leaves $17-2n$ to be composed by the remaining digits. The rest I'm afraid is details; you'll have to figure out the numbers of compositions with parts not greater than $9$ of the various possible remaining sums.

Related Question