[Math] Number of $5$-digit numbers which are divisible by $11$ and whose digits add up to $43$

combinatoricselementary-number-theory

Problem Statement:-

Consider the collection of all $5$-digit numbers such that the sum of digits of each number is $43$. A number is selected at random from the collection. Find the probability that the number is divisible by $11$.

My Solution:-

Let the five-digit numbers be represented by $x_1x_2x_3x_4x_5$.

As the digits of these numbers should add up to $43$, we have

$$x_1+x_2+x_3+x_4+x_5=43\tag{where $1\le x_i\le9$, $x_i\in\mathbb{N}$}$$

So, the number of such numbers is equal to the coefficient of $x^{43}$ in $\left(\dfrac{1-x^{10}}{1-x}\right)^5=15$

As this is a listable amount of numbers so lets just list them

$$99997\\
99979\\
99799\\
97999\\
79999\\
99988\\
99889\\
98899\\
88999\\
99898\\
98989\\
89899\\
98998\\
89989\\
89998$$

Its easy to spot the numbers divisible by 11 which are $97999,\; 99979,\; 98989$

So, the required probability comes out to be $\dfrac{3}{15}=\dfrac{1}{5}$


The number of numbers in this list turned out to be small hence just listing them turned out to be good enough for finding the numbers divisible by $11$, but what if the sum of the digits of the number turns out to be such that the number of numbers satisfying the condition turns out to be too big. In that case, how am I supposed to find the number of numbers which are divisible by $11$ without the help of a computer but just with pen and paper.

Best Answer

As you note, the requirement for a digit sum of $43$ restricts the possible digit choices quite sharply.

In general numbers divisible by $11$ have alternating digit sums (eg. adding $a$s and $b$s from $abababa$) that differ by a multiple of $11$ (which could be zero, if sums are equal). This is due to powers of $10$ alternating between $-1$ and $1 \bmod 11$.

In this case since the total digit sum is odd, we must have alternating sums that differ by $11$, that is $16$ and $27$ for the two- and three-digit sums respectively. Clearly this gives us something of the form $9\;\square\;9\;\square\;9$ and the options for the intervening digits adding to $16$ are $(7,9),(8,8),(9,7)$ as you found.


By request in comments:

If the digit sum were $36$, all other conditions unchanged, we would have to have the digit sums equal $\to (18,18)$ (as a difference of $22 \to (29,7)$ is not feasible). Then there is only one option for the two-digit set $(9,9)$ and we can find the number of divisions on the three-digit set by a small inclusion-exclusion to partition the $18$ into three valid digits. First there are two options that include a zero, $(99099,99990)$ after which we can take the partitions as being non-zero. Then without constraint on the upper size of partition, the options would be $\binom {17}2$, and removing the cases with a digit greater than $9$ reduces this by $3\cdot \binom 82$, giving $2+136-84=54$ options.