An integer is selected at random in the range . What is the probability that the remainder when is divided by is ?
- A)
- B)
- C)
- D)
- E)
Answer
D
Key insight
The fourth powers of 1, 2, 3, 4 all leave remainder 1 when divided by 5. So N to the 16th leaves 1 unless N is a multiple of 5.
Solution
is far too big to compute, but we only need its remainder when divided by . The remainder of a product depends only on the remainders of the factors, so only 's own remainder matters. For example, and both leave remainder , and and both leave remainder .
- Try the small remainders and raise each to the fourth power:
| remainder when divided by |
- So whenever is not a multiple of , leaves remainder . In symbols, , which just means " leaves remainder when divided by ."
- Now . Four factors that each leave remainder multiply to something that leaves remainder .
- If is a multiple of , then is too, and the remainder is .
- So the remainder is exactly when is not a multiple of .
- From to there are multiples of . That leaves numbers that work.
- The probability is .
The answer is .
Why this works
For remainder questions about huge powers, work with remainders from the start and look for a power that brings you back to . Here the fourth power does it for every number not divisible by (a fact known as Fermat's little theorem), and is a multiple of . Because is a multiple of , each remainder appears equally often, giving exactly .
The trap
Forgetting that multiples of 5 give remainder 0, and answering 1, or getting lost trying to compute such large powers directly.
Concise solution
Only the remainder of mod matters. Compute fourth powers of each nonzero residue:
So whenever , . If , then .
Thus leaves remainder exactly when is not a multiple of . Since , the range to contains multiples of and non-multiples. The probability is
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 12: Introduction to Modular Arithmetic
- Introduction to Counting & Probability, Chapter 7: Introduction to Probability
- Prealgebra, Chapter 15: Problem-Solving Strategies (§15.1)
- Introduction to Number Theory, Chapter 10: Units Digits
Techniques
Compute small cases, spot the pattern, generalize