# Math Help - [SOLVED] probability question(digits)

1. ## [SOLVED] probability question(digits)

Question:
A four-digit number, in the range 0000 to 9999 inclusive, is formed. Find the probability that
(a) the number begins or ends with 0,
(b) the number contains exactly two non-zero digits.

Can you help me solve this question? I have tried but didn't manage to get the real answer(but I strongly support my own answer).

Thanks

2. For part A, here are my thoughts:

For the first 0000 to 0999, there are 1000 numbers. Then you have to add in all the numbers ending in 0. These are a little trickier to see. So we are looking for 1000, 1010, 1020, ... , 1090. That's a total of 10 numbers between 1000 and 1090 (inclusive). We also have to remember 1100, 1110, 1120, ... , 1190. So there are 10 numbers between each increment of a hundred. And between each thousand there are 10 increments of 100. Finally we are starting at 999 and proceeding to 9999, in which there are 9 increments of a thousand. So my total for part A comes to:

$\frac {1000 + 10 * 10 * 9}{10000} = \frac{19}{100}$

3. Originally Posted by stpmmaths
Question:
A four-digit number, in the range 0000 to 9999 inclusive, is formed. Find the probability that
(a) the number begins or ends with 0,
(b) the number contains exactly two non-zero digits.

Can you help me solve this question? I have tried but didn't manage to get the real answer(but I strongly support my own answer).

Thanks
(a) You want the combinations 0 X X X or X X X 0. Using the pigeon hole principle:

(1)(10)(10)(10) + (10)(10)(10)(1) = 2000.

But you have to subtract numbers of the form 0 X X 0 otherwise they get counted twice in the above: (1)(10)(10)(1) = 100.

So the total number of numbers satisfying the restriction is 1900.

The total number of numbers withut restriction is (10)(10)(10)(10) = 10000.

So the probability is 1900/10000 = 19/100.

You can take a similar approach for (b).

4. A more systematic way of doing part A is to count first the numbers beginning with 0, and then the numbers ending with 0 and then subtracting the number of numbers beginning and ending with 0 to get the total number of numbers beginning or ending with 0. We get $10^3+10^3-10^2$, giving the same probability as eXist calculated.
For part B,there are 4 choose 2 =6 ways to pick the two zero digits and 9*9 ways to choose the two non-zero digits. It is worth thinking about how many 4 digit numbers contain respectively exactly 0,1,2,3 and 4 0s. You should see a connection with the binomial theorem (expand $(9+1)^4$ to see it more clearly).

5. Hello stpmmaths

Welcome to Math Help Forum!
Originally Posted by stpmmaths
Question:
A four-digit number, in the range 0000 to 9999 inclusive, is formed. Find the probability that
(a) the number begins or ends with 0,
(b) the number contains exactly two non-zero digits.

Can you help me solve this question? I have tried but didn't manage to get the real answer(but I strongly support my own answer).

Thanks
Part (b). If the number contains exactly two non-zero digits, then it contains 2 non-zero and 2 zero digits.

So: imagine you have 4 empty boxes in a line in front of you. You have to (i) place a zero into two of the boxes, and then (ii) place a digit from 1 to 9 in the remaining two boxes.

For stage (i), there are $\binom42 = 6$ ways of choosing which boxes shall contain the zeros.

For stage (ii), there are 9 choices of non-zero digit to go in the remaining left-hand empty box, and 9 to go in the right-hand box. Total number of choices = $9 \times 9 = 81$.

So the number of different numbers with exactly two non-zero digits is $6 \times 81 = 486$. So the probability is $\frac{486}{10000}=0.0486$.

6. Originally Posted by mr fantastic
(a) You want the combinations 0 X X X or X X X 0. Using the pigeon hole principle:

(1)(10)(10)(10) + (10)(10)(10)(1) = 2000.

But you have to subtract numbers of the form 0 X X 0 otherwise they get counted twice in the above: (1)(10)(10)(1) = 100.

So the total number of numbers satisfying the restriction is 1900.

The total number of numbers withut restriction is (10)(10)(10)(10) = 10000.

So the probability is 1900/10000 = 19/100.

You can take a similar approach for (b).
For part A,
As you said, (1)(10)(10)(10) + (10)(10)(10)(1) - (1)(10)(10)(1) = 1900. If we do this we still consider 0XX0 in the probability, right? But the question stated begins or ends with 0 not with both

7. Originally Posted by stpmmaths
For part A,
As you said, (1)(10)(10)(10) + (10)(10)(10)(1) - (1)(10)(10)(1) = 1900. If we do this we still consider 0XX0 in the probability, right? But the question stated begins or ends with 0 not with both
If the statement is "begins or ends with a zero digit" it means begins with a zero digit or ends with a zero digit or both begins and ends with a zero.
That is the logical nature of the connective or.

Hello stpmmaths

Welcome to Math Help Forum!
Part (b). If the number contains exactly two non-zero digits, then it contains 2 non-zero and 2 zero digits.

So: imagine you have 4 empty boxes in a line in front of you. You have to (i) place a zero into two of the boxes, and then (ii) place a digit from 1 to 9 in the remaining two boxes.

For stage (i), there are $\binom42 = 6$ ways of choosing which boxes shall contain the zeros.

For stage (ii), there are 9 choices of non-zero digit to go in the remaining left-hand empty box, and 9 to go in the right-hand box. Total number of choices = $9 \times 9 = 81$.

So the number of different numbers with exactly two non-zero digits is $6 \times 81 = 486$. So the probability is $\frac{486}{10000}=0.0486$.

I thought we should consider the position(placement) of the digits? If we do it by we are not considering the position. According to your statement "
imagine you have 4 empty boxes in a line in front of you. You have to (i) place a zero into two of the boxes, and then (ii) place a digit from 1 to 9 in the remaining two boxes.

For stage (i), there are $\binom42 = 6$ ways of choosing which boxes shall contain the zeros.

"

This makes me confused between and .
Lets say we change the question to:-
A four-digit number, in the range 0000 to 9999 without repetitions for all digits except digit 0, is formed. Find the probability that
(a) ....
(b) the number contains exactly two non-zero digits.

9. ## Permutations and Combinations

Hello stpmmaths
Originally Posted by stpmmaths

I thought we should consider the position(placement) of the digits? If we do it by we are not considering the position. According to your statement "
imagine you have 4 empty boxes in a line in front of you. You have to (i) place a zero into two of the boxes, and then (ii) place a digit from 1 to 9 in the remaining two boxes.

For stage (i), there are $\binom42 = 6$ ways of choosing which boxes shall contain the zeros.

"

This makes me confused between and .
Lets say we change the question to:-
A four-digit number, in the range 0000 to 9999 without repetitions for all digits except digit 0, is formed. Find the probability that
(a) ....
(b) the number contains exactly two non-zero digits.
You are raising two different points here. First, the difference between $^nP_r$ and $^nC_r$.

• $^nP_r$ gives the number of ways of choosing $r$ objects from $n$, and then arranging them in order. So, for instance, if we want to choose 2 from 4, and the objects are A, B, C and D, then the choice A, C will be counted as a different choice from C, A. There are therefore $^4P_2=4 \times 3 = 12$ possible choices.

• $^nC_r$ gives the number of ways of choosing $r$ objects from $n$, where the order doesn't matter. In the above example, A, C and C, A would be counted as the same choice, and there are therefore $^4C_2=\frac{4\times 3}{2}= 6$ possible choices.

As an example, suppose that a committee chairman and secretary have to be chosen from a short-list of 4 people. Here, A, C is a different selection from C, A because A and C are fulfilling different roles. So you use $^4P_2$. But if you have to choose 2 delegates to attend a conference, from 4 people, you'll use $^4C_2$. Why? Because A, C and C, A are now the same choice - there's no difference between the roles of A and C.

So, in question (b), the number of different pairs of positions that can be occupied by a zero is $^4C_2=6$, because one zero looks just like the other - the order in which you place them in the 'empty boxes' doesn't matter.

In each of the remaining boxes (containing non-zeros) the order in which we fill the boxes does matter: 0709 will be different from 0907, for instance. Each box can then be filled in 9 ways, so - using the 'r-s Principle' - the total number of ways in which these two boxes can be filled, one after the other, is $9^2 =81$.

Your second question is: how is this affected if we're not allowed to choose the same non-zero digit twice? The answer is this:

• The first stage - choosing which 'boxes' are to be filled with zeros - is unaltered. It's still 6 choices.

• In the second stage, suppose we fill the left-hand of the two remaining boxes first. There are 9 ways of doing this. Since we're not allowed to choose the same digit again, there are then 8 ways of filling the last box. Total number of choices: $9\times 8 = 72$. Notice that this is the number of ways of choosing 2 items from 9, where the order matters; in other words, it's $^9P_2$.

So the overall answer to your modified question would be $6 \times 72 = 432$ choices, or a probability of $0.0432$.

Does that clear things up?

10. Thanks

So if i modified the question to:-
A five-digit number, in the range 00000 to 99999 inclusive, is formed. Find the probability that
(a) ....
(b) the number contains exactly two non-zero digits.

Then the answer would be 6 x 729 = 4374. Am I right?

11. Hello stpmmaths
Originally Posted by stpmmaths
Thanks

So if i modified the question to:-
A five-digit number, in the range 00000 to 99999 inclusive, is formed. Find the probability that
(a) ....
(b) the number contains exactly two non-zero digits.

Then the answer would be 6 x 729 = 4374. Am I right?
Correct!

And if repetition is not allowed in the non-zero digits, it would be $6 \times ^9P_3 = 6 \times9\times8\times7 = 3024$.

13. ## probability question

So the term C^2_4 relates to choosing the positions for (non) zero digits whereas terms 9^2 or P^2_9 are the numbers of ways to choose non-zero digits for a given positions.

14. Hello kobylkinks
Originally Posted by kobylkinks
So the term C^2_4 relates to choosing the positions for (non) zero digits whereas terms 9^2 or P^2_9 are the numbers of ways to choose non-zero digits for a given positions.
If this is a question, and not just a statement, then yes, you are right in your analysis!

You're also right to write '(non) zero digits' because it doesn't matter whether you think of this part of the 'box-filling' process as choosing the boxes that will contain zeros, or the boxes that will contain non-zeros; the result is the same: there are $^4C_2= 6$ possible choices.