[Math] Probability that 4-digit number is divisible by 4 both with, and without repetition.

permutationsprobability

I am practicing probability with, and without replacement and would like to try the following:

From the set of numbers {0,1,2,3,…,9}, a 4-digit number is formed (where the first digit cannot be 0). To form the 4-digit number, the numbers are drawn and written down in order (if a 0 is drawn for the first digit, the 0 is put back and a number is redrawn until a number other than 0 is drawn). Find the probability that the number is divisible by 4 with, and then without replacement.

For with replacement –

There are $9 \times 10^3 = 9000$ total possibilities for all 4 digits.

The number can be divided by 4 if the last 2 digits are a multiple of 4. So – $00, 04, 08,…,96$ (25 possibilities).

So, there are 25 possibilities for the last 2 digits, 9 for the first digit, and 10 for the second digit.

Therefore, P(divisible by 4 w/replacement) = $\frac{9 \times 10 \times 25}{9000}$

How's that look?

For without replacement –

Here, I am stuck! I'm not sure what it would look like? Any advice would be greatly appreciated.

Could it be something along the lines of:

First number $9C1$ (since 0 can't be picked); second number $9C1$ (since first number can't be picked), and for the last 2 digits $22C1$ since there are 22 possibilities that can be divisible by 4?

Best Answer

Your computation of "with replacement" has a bit of a problem, in that you're assuming that there are $10^4$ possibilities -- but $1000$ of those are not actually possibilities, because you're explicitly specifying that the first digit cannot be $0$.

A shorter computation: "With replacement" the possible numbers are $1000$ through $9999$, and all of these $9000$ numbers are equally probable. Every fourth of them is divisible by $4$ -- no need to consider digits here, just notice that the interval from $1000$ to $9999$ contains a whole number of four-periods.

So the probability in this case should be $\dfrac14$.

Without replacement, imagine choosing the two last digits first, which can be done in $90$ ways. How you choose the two remaining digits is then immaterial. How many endings from 00 to 99 are divisible by 4 and don't repeat digits? All the 25 you know, except for 00, 44, and 88.

Actually, that may not work. We run into the problem that it is not even well-defined what it means to choose the four digits "without replacement" when the leftmost of them cannot be $0$.

We can see this clearer if we imagine choosing two digits "without replacement", where the left one must not be $0$.

If we choose the left digit first (and that is not $0$), there will be nine digit to choose from for the right digit, and $0$ is always among them -- so the probability of the right digit being $0$ is $\frac19$. On the other hand, if the choose the right digit first, all ten digits will be available at that time, so now the probability of the right digit being $0$ is only $\frac1{10}$.

You need to specify which order the digits are picked in, if you want "without replacement" at the same time as "leftmost digit must be nonzero". Otherwise it is ambiguous what the probability of picking each particular number is.

Of course you can also specify that you're choosing uniformly in a single step between all sequences of 4 diferent digits that do not start with $0$. But it seems to be hard to argue that "without replacment" is an accurate description of that procedure.