A seven-digit positive integer is chosen at random. What is the probability that the number is divisible by , given that the sum of its digits is
- A)
- B)
- C)
- D)
- E)
Answer
A
Key insight
A digit sum of 61 is only 2 below the maximum 63, so the number is seven 9s short by 2, and the alternating sum is 7, 9 or 11.
Solution
The sample space. Seven digits sum to at most , so a digit sum of means the digits are all except for a total shortfall of . There are exactly two ways to distribute that shortfall:
- one digit is and the other six are : numbers, one for each position;
- two digits are and the other five are : numbers.
Every digit is at least , so the leading digit is never and all strings are genuine seven-digit numbers. The condition leaves equally likely numbers.
The divisibility test. A number is divisible by exactly when its alternating digit sum
is a multiple of . Four positions () carry a plus sign and three () carry a minus sign, so if every digit were then
Lowering a digit in a plus position decreases by the same amount; lowering one in a minus position increases . The total shortfall is , so
and the only multiple of in that range is . So , which happens exactly when the whole shortfall of sits in minus (even) positions.
Counting.
- One . It must occupy one of the three even positions: numbers.
- Two s. Both must occupy even positions: numbers.
That is numbers out of , so the probability is
The answer is .
Why this works
Conditioning on a digit sum that sits right at the top of its range collapses an enormous sample space to a list short enough to handle by hand — the useful reformulation is "shortfall from all nines", not "digits summing to 61". The -test is linear in the digits, so instead of testing numbers one at a time, compute the alternating sum of the all-nines baseline and track how each shortfall moves it. That also produces the bound for free, which is what rules out every multiple of except one and removes all remaining casework.
The trap
Noticing only one of the two ways to fall 2 short of 63; keeping just the numbers with a single 7 gives 3 out of 7, which is (E).
Common mistakes
- Noticing only one of the two ways to fall 2 short of 63; keeping just the numbers with a single 7 gives 3 out of 7, which is (E).
- Requiring the alternating sum to be rather than any multiple of , which rejects all numbers.
- Miscounting the plus and minus positions: with seven digits there are four plus positions and three minus positions, so the baseline is , not .
Techniques
Split into exhaustive cases and handle each · Set up the equation/formula and compute; no special trick needed