# Probability of a natural number being divisible by 2, 3, or 5?

I'm trying to calculate the probability of a natural number being divisible by 2, 3, or 5 and I feel as if I may have found the answer. But I wanted to see if anyone sees anything wrong with my "work". Thank you all for your time and help.

Let ~ signify 'n is divisible by':

P[~2 ∨ ~3] = P[~2] + P[~3] - P[~2 ∧ ~3] = 1/2 + 1/3 - 1/6 = 2/3

P[(~2 ∨ ~3) ∨ ~5] = P[~2 ∨ ~3] + P[~5] - P[(~2 ∨ ~3) ∧ ~5] = 2/3 + 1/5 - something

something = P[(~2 ∨ ~3) ∧ ~5] = P[(~2 ∧ ~5) ∨ (~3 ∧ ~5)] = 1/10 + 1/15 - 1/30 = 4/30 = 2/15 so

P[(~2 ∨ ~3) ∨ ~5] = 2/3 + 1/5 - 2/15 = 11/15

Are these calculations correct and am I even using probabilities and such correctly?

You have to describe how you randomize a natural number. It is not possible to have a discrete uniform distribution on $\mathbb{N}$. If you are talking about the natural density of natural numbers divisible by $2$, $3$, or $5$, then the answer is $\frac{11}{15}$. Alternatively, if you are talking about the discrete uniform distribution on $\mathbb{Z}/30\mathbb{Z}$, then your calculation is correct.

• I have heard of natural density before and thought that was what I was dealing with but I wasn't quite sure. Thank you for the clarification! Commented Aug 17, 2015 at 3:03

Out of the $30$ congruences $\bmod 30$ there are $22$ that work. So I would say under any sensible distribution the probability should be $\frac{22}{30}=\frac{11}{15}\approx0.73$.

• Thats the way I was thinking too. So +1 for a neat solution, though I think you should have also pointed out where OP went wrong. OPs attempt was not bad. Commented Aug 17, 2015 at 3:00

It is quite simple: $$P=1-\left(1-\frac12\right)\left(1-\frac13\right)\left(1-\frac15\right)$$

• This is indeed a simple way and I now wish I had realized to do this. Thank you for this insight! Commented Aug 17, 2015 at 3:08
• Than, do you accept it?
– Moti
Commented Aug 17, 2015 at 4:48
• Doesn't that presume that the probabilities are independent? (Which they are - imho - not?) Commented Aug 17, 2015 at 10:46
• @phimuemue They are, but only because they are all prime. Without formalizing the argument: knowing that the prime decomposition of a number contains a 2 does not yield any information about whether it also contains a 3 or 5. Clarifying this point would improve the answer further.
– Erik
Commented Aug 17, 2015 at 11:55

We want to find the probability that a natural number be divisible by either $2$, or $3$, or $5$. We note a few things first. All numbers are prime, so the probabilities $P(2), P(3), P(5)$ are independent (but not mutually exclusive). A chosen number may be divisible by both $3$ and $5$. But this scenario doesn't add complexity, since we require for the number to be divisible by at least one of them. We can use the standard method for calculating the probability of the union of 3 events, namely $P(2), P(3)$ and $P(5)$ which takes care of all the conditions:

$$P(2 \lor 3 \lor 5) = P(2) + P(3) + P(5) - P(2\land 2) - P(2 \land 5) - P(3 \land 5) + P(2 \land 3 \land 5) = 1/2 + 1/3 + 1/5 - 1/6 -1/10 - 1/15 + 1/30 = \ldots = 11/15 = 73.\overset{.}{3}\ \%$$