Calculating Probability for Repeated Numbers in Random Number Generation

Click For Summary
The discussion focuses on calculating the probability of generating at least 5 identical numbers when using a random number generator that produces digits from 0 to 9 over 6 iterations. Two methods are proposed: the first calculates the total permutations of 6 digits and the specific cases where 5 or 6 digits are the same, yielding a probability of 70 out of 1,000,000. The second method attempts to use combinations with repetition, but it is clarified that this approach is inappropriate for the problem, which involves permutations due to the nature of sampling with replacement. The conversation emphasizes the importance of counting cases rather than relying solely on formulas, highlighting the need to consider configurations for the fifth and sixth digits. Ultimately, the discussion concludes that a systematic counting approach is essential for accurately determining the probability.
Physics_wiz
Messages
227
Reaction score
0
Say I have a random number generator that generates numbers between 0 and 9 inclusive (10 possibilities) and I run it 6 times. What I am trying to find is the probability that at least 5 of those 6 random numbers will be the same.

I could think of 2 ways to find the answer, the first one:

(10^6) is the total number of possible 6 digit numbers generated. The number of numbers that have the same 5 or 6 of the same digits will be
10*[ (6C5 + 6C6) ]. Where 6C5 is the number of choices for the locations of the 5 digits that are the same and 6C6 = 1 is for the possibility when all digits are the same). 10*[ (6C5 + 6C6) ] = 10*(6+1) = 70. The probability would then be 70/(10^6).

The second way:

This involves the number of combinations with repetition of picking out of 10 digits 6 times. The formula I found is (n+r-1)!/(r!(n-1)!) where in this case, n = 10 and r = 6. This gives me the total number of possible combinations after which I would divide 70 by that number to get the probability. However, in this case the number of possible combinations is 5005 instead of 10^6. I believe 5005 is wrong because the first way gives me an answer that I think is closer to the right answer.

What exactly does the formula for combinations with repetition calculate? How can I use it in the above problem?
 
Physics news on Phys.org
The relevant concept for the denominator is not combination; it is permutation. 106 is the number of permutations that one can get out of 10 numbers and 6 slots, where ABCDEF is counted differently from ABCDFE (although A=B, etc., is allowed). In contrast, combination counts subsets, so ABCDEF is treated identical to ABCDFE. See http://en.wikipedia.org/wiki/Combinatorics
 
Last edited:
Ahh I see now. I feel pretty stupid about missing that with the second way I thought the problem could be solved. Thanks for clarifying.
 
A card problem involves sampling without replacement. But, this is a problem that involves sampling with replacement. Why? Well suppose you chose 10 integers for each digit, or 60 integers. Then the chance of pulling any given integer is 1/60, but if we pull a 1, then there are now only 59 integers remaining and the chances of pulling a 1 have dropped to 9/59, where as the chances of a 2 is 10/59. This problem does not work that way.

This problem is worked by attempting to count the cases, rather than first looking for a formula. So just consider five 5s. Now if we want to add another digit we have 6 places to put that, but we have only 9 integers we can so use, because for the 5 itself, we have only one way it can be used because six 5s are all the same. Thus there are 55 ways we can fill the spaces. Since there are 10 integers we can use, including the original choice of 5s, we have 550 such numbers.
 
Last edited:
Consider the following

First, getting the prob of all numbers being the same is standard. Try getting five numbers equal, for every possible configuration(conditional probability).
for each configuration draw a sixth number, which will be either = or unequal to the five equal numbers. "Add" it all up, and you are done.

Regards,
Reilly Atkinson
 
First trick I learned this one a long time ago and have used it to entertain and amuse young kids. Ask your friend to write down a three-digit number without showing it to you. Then ask him or her to rearrange the digits to form a new three-digit number. After that, write whichever is the larger number above the other number, and then subtract the smaller from the larger, making sure that you don't see any of the numbers. Then ask the young "victim" to tell you any two of the digits of the...

Similar threads

  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
692
  • · Replies 11 ·
Replies
11
Views
4K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
15
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K