Calculating Probability for Repeated Numbers in Random Number Generation

  • Context: Undergrad 
  • Thread starter Thread starter Physics_wiz
  • Start date Start date
  • Tags Tags
    Calculation Probability
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 8K views
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