Maths probability question

Associate
Joined
26 Jan 2006
Posts
1,049
Hey guys

Simple maths question but it's playing with me


Picking 2 random numbers, between 0 and 99 (range of 100).

What's the probability in them both being the same? What's the maths?

If we pick 3 random numbers, what's the probability of 2 being the same? Again what's the equation?

Trying to figure out if picking random numbers for some program is a good idea :(
 
a) 0.01

b) 2C1 * 0.01

Something like that, anyway

Edited: visage is clever
 
Last edited:
Hey guys

Simple maths question but it's playing with me


Picking 2 random numbers, between 0 and 99 (range of 100).

What's the probability in them both being the same? What's the maths?

If we pick 3 random numbers, what's the probability of 2 being the same? Again what's the equation?

Trying to figure out if picking random numbers for some program is a good idea :(

Well you pick one numebr at random, and then the question is 'What is the probablity that the 2nd matches the first'

In other words, 1/100.
 
I agree with Visage. Since your first number doesn't have to be anything specific, you're only interested in the outcome of picking a certain number from one iteration, the second iteration. So it's 1/100.

If you wanted a specific number in the first iteration, and the same specific number in the second, it would be 0.01x0.01. i.e. 1 in 10,000

So from a coding point of view, you're going to get greater randomisation if you specify a variable with a value, and THEN check that against two randomly generated values.
 
Last edited:
For the 2nd one:
You randomly choose a number, then you have 2 get a matching number from the next 2 trials. Therefore you have 2 possibilities of 1 in 100, so probability is 2 in 100. The other possibility is that the last 2 numbers are the same, this is the same question as the first - 1 in 100. Total probability is 3 in 100.
 
OP: What's the application? One needs to be very careful when generating random numbers - algorithms that seem to fit the job can sometimes be not very random at all....
 
As people have said above, if the first number has to be specific picking two the same is 1 in 10000 (1/100 x 1/100). if the first number is not specific then it is 1 in 100 (100/100 x 1/100).

as for the 2 out of 3 if the first number is specific then it is 1 in 5000 (1/100 x (1/100 + 1/100)) if not then 1 in 50 (100/100 x (1/100 + 1/100))
 
Best way to think about it is to use dice.

Roll two dice - what are the probability that they both have the same number face up?

6/36 -> 1/6. :)
 
Perhaps a more intuitive explanation:

The probability of picking a given number, say 23, is 1/100 for each draw. The probability of picking 23 twice is therefore 0.01 * 0.01 = 1/10000. However, there are 100 numbers in the set, so there are one hundred possible matching draws. We therefore have probability 100 * 1/10000 = 1/100.
 
EDIT: I made a huge mistake and realised it when i walked out the dooor - so i couldnt edit :(

I've gtg now - i'll work on the second later
 
Last edited:
the answer to the first is 1/100 surely, as you are 1/1 likely to get 0-99 the next one to match that number though is going to be 1/100 so 1/1 * 1/100 = 1/100
 
Back
Top Bottom