Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 4.5.7* (The probability that the sum of $k$ integers in $[\![1,n]\!]$ is divisible by $n$ is $1/n$)
Exercise 4.5.7* (The probability that the sum of $k$ integers in $[\![1,n]\!]$ is divisible by $n$ is $1/n$)
Let and be positive integers with and . Prove that if distinct integers are selected at random from , the probability that their sum is divisible by is .
Answers
I found on the net (math.stackexchange.com) the following crucial hint:
”Think of the numbers as integers modulo . Consider the map
This adds modulo to the sum of the elements of .”
answered Sep 5, 2017 Angina Seng.
Proof. We suppose that and that .
Let denote the set of subsets of with elements, and its cardinality (then ).
Consider
the subset of such that the sum of elements of is divisible by . Then the wanted probability is .
If
Then , because is a complete residue system modulo , so the map
is a bijection. It remains to compute the cardinality of .
Consider the map
(Here .) Then is bijective, with , so is defined for all integers , and
We define the relation between any two elements of by
Then is an equivalence relation: ; if , then for some , then , so ; if and , then for some integers , then , so .
What is the class of for the relation (where are distinct)? Since , and for all , the class of is
Moreover, if , where , then . Therefore
thus , where , so (and ), thus .
This shows that , so all the classes have same cardinality , and the number of classes is (in particular, this shows that if , then , which is not quite obvious).
The important fact is that every class contains a unique element in (such that ). Indeed, consider the class of , and let in the class . Then
Since , there is a unique such that , so every class contains a unique element of . This shows that there are as many classes than elements of . Therefore
so
if and if distinct integers are selected at random from , the probability that their sum is divisible by is . □
Note: In the language of group actions, the group acts on by
By the preceding arguments, if , all orbits have elements, and every orbit contains a unique element of , so