# Probability that product of any four natural numbers is divisible by 5

Given any four randomly chosen natural numbers (not mentioned if the numbers taken are distinct or not) what is the probability that their product is divisible by 5?

• The numbers chosen will either be of the form $5k$ or $5k+1$ or $5k+2$ or $5k+3$ or $5k+4$ ($k$ is a natural number.). Since each of the form is equally likely to occur (I just feel they will be equally likely and don't know the proof) therefore the probability is $1-P(\text{none of the numbers is divisible by 5})=1-(4/5)^4$.

Is my answer along with justification correct?

• Now let us consider the question in a different way. Let the product of the numbers be $x$. Since $x$ is equally likely to be of form $5k$ or $5k+1$ or $5k+2$ or $5k+3$ or $5k+4$ (Is it?) therefore answer is $4/5$.

Obviously at least one of the two methods posted answer above is wrong. Which one is it? If both are wrong kindly tell the answer along with justification.

PS the question is from my guide book IIT JEE Mathematics: 35 Years Chapterwise Solved Papers 2013 - 1979

• You can't select an element from an infinite set with equal probability.
– user76844
Commented Jan 23, 2015 at 4:08
• Ok..what is the probability of choosing $77,22,1,10^9,20$?
– user76844
Commented Jan 23, 2015 at 4:14
• Could this question be asking about a uniform choice between the congruence classes modulo $5$? If this is the case, then a uniform distribution is possible, with a probability of $\frac{1}{5}$ for a choice of any one class. Commented Jan 23, 2015 at 4:21
• The version by @BrianScholl seems a lot like what you are asking. Also, your analogy about the square is about an interval while you are asking about sets of individual points. Such sets have zero probability.
– user76844
Commented Jan 23, 2015 at 4:25
• Is this problem quoted more or less verbatim from a book? If so, that is very sad. One can, for fixed $N$, ask for the probability if the $4$ numbers are independently chosen uniformly in the interval $[1,N]$ and take the limit as $N\to\infty$. Then we get the number of your first answer, but strictly speaking the numbers are not randomly chosen from the natural numbers. Commented Jan 23, 2015 at 4:25

There are two ways to get the correct solution. The easier way is to consider the set $\left\{\left[5k\right],\left[5k+1\right],\left[5k+2\right],\left[5k+3\right],\left[5k+4\right]\right\}$ of congruence classes modulo $5$ (where $\left[5k\right]$ simply denotes the class with representative of the form $5k$ for an integer $k$, and so on). The probability that you would pick any one of these classes is $\frac{1}{5}$. Thus, the probability that you would pick the class $\left[5k\right]$ is $\frac{1}{5}$. The probability that you will not pick this class is $1-\frac{1}{5}=\frac{4}{5}$. The probability that you would pick $4$ classes that are each not $\left[5k\right]$ is $\left(\frac{4}{5}\right)^{4}=\frac{256}{625}$. Therefore, the probability that you will have a product divisible by $5$ is equivalent to saying that at least one class is $\left[5k\right]$, which has probability $1-\frac{256}{625}=\frac{369}{625}$.

The second method, which is more popular when such classes are not possible, is to take probabilities over the integers in the interval $\left[1,n\right]$, and look at the behavior of these probabilities as $n\to\infty$. Though this is not needed here, it is a good technique to know.

• i get it... can you tell why my second solution is wrong.. and err... why am i getting downvote for this question. i have tried my best to make the question clear. you see that i am in class 10+2 and dont know all the things referred to in comments Commented Jan 23, 2015 at 4:40
• can you please elaborate the second method you posted in your answer ... how will i look at the behaviour as n→∞ .. (i know limits) Commented Jan 23, 2015 at 4:44
• The reason that your second solution is wrong is that $x$ is not what is chosen randomly, it is the product of $4$ randomly chosen classes. I believe the question has been down voted because the question is ambiguous and ill formed. This is, unfortunately, the fault of the book that you are using. In the future, if you present the problem by saying that it has been copied from a book, then voters who read only long enough to see the question will understand the situation. Commented Jan 23, 2015 at 4:44
• As for the second method, you would put a uniform distribution on $\left\{1,2,\ldots,n\right\}$ and find the probability that a randomly selected integers among them is divisible by $5$, then find the probability that a product of $4$ randomly selected integers is divisible by $5$, and then take the limit as $n\to\infty$. This should give the same answer. Commented Jan 23, 2015 at 4:46
• @BrianScholl, I looked at your profile and see we are connected. I am from the University of Alabama. Are you a Tigers fan or Tide fan. Looks like you are from south and I suspect that you are a tigers fan. When you are miles apart, we seek some connection without any rivalry to play in. Roll Tide!! Commented Jan 23, 2015 at 7:36

Assuming that you are selecting four numbers from a finite set n which is divisible 4. Then partition that set into four sets.

A = {1,5,9,...,n-3}

B = {2,6,10,....,n-2}

C = {3,7,11,...,n-1}

D = {4,8,12,..., n}

Total number of numbers in each set $= \frac{n}{4}$

In each set, $\frac{n}{5}$ would not be divisible by 5.

The total probability that four numbers picked from these partitions whose product is not divisible by 5 =those numbers picked from each that is not divisible by 5 $= (\frac{4}{5})^4$.

Thus the probability that four numbers picked from these partitions whose product is divisible by 5 $= 1-\frac{256}{625} = \frac{369}{625}$