Probability question for the qualified hive mind

New Topic
This topic has been archived, and won't accept reply postings.
 McHeath 19 Sep 2022

Struggling with this one:

Say you have a set of 30 cards numbered 1-30. They are shuffled, a card is drawn and the number noted. The card is replaced and the process is repeated for a total of 54 times.

What is the probability that the 1 will be drawn exactly 5 times out of 54? (and what's the formula? Link?)

Many thanks in advance!

Post edited at 21:54
 JLS 19 Sep 2022
In reply to McHeath:

I’ll play… not much more than a guess really

(30x5) / 54 = 8100

1 in 8100 chance.

 Jamie Wakeham 19 Sep 2022
In reply to McHeath:

The probability is 2.47%

If you just want to be able to find the answer, there are calculators online.  This is binomial probability, with a probability of success of 1/30 and 54 trials.  See here, for example: https://stattrek.com/online-calculator/binomial

Edit to include working:

On each trial your chance of success is 1/30 (is about 0.0333).  Your probability of failure is 1-0.0333 which is 0.9667.

To 'win' five times means you need to hit five events with a probability of 0.0333, and 49 events with a probability of 0.9667.  So the probability is 0.0333^5 x 0.9667^49.  This is a very small number indeed - it's 0.00000000781

However, that gives you the probability of hitting five 'wins' followed by 49 'fails'.  You don't care what order the successes and failures come in.  So we have to multiply by how many ways I can arrange the five successes and 49 failures.  This is done by finding nCr (read out loud 'n choose r), which most decent calculators have a function for.  So you're looking for 54C5, which my calculator tells me is 3162510 - there are that many ways of arranging five successes and 49 failures.

If you want to know how it's doing nCr, then the formula is n! / r!(n-r)! where ! means factorial.  Explaining that one on a text based forum is going to be a bit lengthy...

Post edited at 22:24
 JLS 19 Sep 2022
In reply to Jamie Wakeham:

where does the 5 come into play?

 ablackett 19 Sep 2022
In reply to McHeath:

It’s a binomial probability, X~B(1/30,54)

P(x=5)=0.02472

working…

https://stattrek.com/online-calculator/binomial
 

I will write it out tomorrow if you need more explanation.

 ablackett 19 Sep 2022
In reply to Jamie Wakeham:

Snap

 tjhare1 19 Sep 2022
In reply to McHeath:

Unless I’m mistaken it’s a binomial. Each go is independent, there is a fixed 1/30 chance of success. So the probability is 54C5 x (1/30)^5 x (29/30)^49 = approx 2.5%

edit: lots of snap!

Post edited at 22:18
 ablackett 19 Sep 2022
In reply to tjhare1:

UKC is still brilliant.

 Jamie Wakeham 19 Sep 2022
In reply to JLS:

Hopefully my edited version makes that clear!

 lowersharpnose 19 Sep 2022
In reply to McHeath:

The probability of getting a 1 is 1/30 (success)

The probability of not getting a 1 is 29/30 (fail)

If you select a card 54 times and get 5 x 1s, then the probability for a given permutation of 5 successes and 49 failures is (1/30)^5 x (29/30)^49

= 7.81 x 10^-9

Then we need to work out the number of ways of choosing 5 from 54,

nCr = n!/(r!(n-r)!)

54C5 = 54!/(5!49!) = 54 x 53 x 52 x 51 x 50 /(5 x 4 x 3 x 2 x 1) = 3162510

p = 3162510 x 7.81 x 10^-9

p = 0.0247

 Michael Hood 19 Sep 2022
In reply to lowersharpnose:

That is very nicely clear.

As an extra, how would you prove that nCr [i.e n!/(r!(n-r)!) is the number of permutations? Would it be a "double" inductive proof?

 lowersharpnose 19 Sep 2022
In reply to Michael Hood:

If you are happy with the idea that there n! permutations n objects, then the answer to this question may do it.

https://math.stackexchange.com/questions/1590875/proof-for-combination-form...

I have seen induction proofs for this in A level (further) maths, nothing to hand to show you.

 Michael Hood 19 Sep 2022
In reply to lowersharpnose:

I think I could inductively prove n! as the number of permutations of n objects. My maths degree is sooo long ago 😁

In reply to Michael Hood:

> how would you prove that nCr [i.e n!/(r!(n-r)!) is the number of permutations?

It isn't; it's the number of combinations... Order isn't important in this case. Permutations are when order (sequence) matters.

Post edited at 00:14
 supersteve 20 Sep 2022
In reply to McHeath:

All probability is 50:50 - you either do or you don't. I apply that logic to winning the lottery....

 Chris Murray 20 Sep 2022
In reply to supersteve:

I've taught kids who genuinely believe this...

> All probability is 50:50 - you either do or you don't. I apply that logic to winning the lottery....

 mike123 20 Sep 2022
In reply to supersteve:

> All probability is 50:50 - you either do or you don't. I apply that logic to winning the lottery....

This is a load of crap  . Every time I go to the Spa to buy   A vape I toss a coin to see if I should buy a lottery ticket . Heads - I’ll win  . Tails  - I’ll loose .  As I said - doesn’t work .

 ablackett 20 Sep 2022
In reply to McHeath:

I went to bed thinking about a variation on this problem, and have woken up still thinking about it.

What is the probability that there will be at least one number which will be drawn 5 times out of 54? 

I'm sure i've seen something similar before, but I can't remember a method.  We can't just multiplly our answer by 30 because the different numbers aren't mutually exclusive (I could get 5 1's and 5 2's).  It feels like a generating function type problem, but i've not studied such things for 20 years.

Post edited at 07:08
OP McHeath 20 Sep 2022
In reply to Jamie Wakeham:

This is a great explanation, the sort of thing I'd been looking for and not finding on the Web, thanks!

Thanks also to all other contributors, I hadn't been expecting this degree of response and really enjoyed reading all the answers! 

 tjhare1 20 Sep 2022
In reply to ablackett:

Might be being thick (very much not my area of expertise), but don’t we want 1-P(no number appears 5times)? In which case can’t we use the same logic to work out P(0,1,2,3,4), use that as P(<5) and it’s then obvious - job done?

 john arran 20 Sep 2022
In reply to ablackett:

> What is the probability that there will be at least one number which will be drawn 5 times out of 54? 

Surely it's simply the original answer x 30? More tricky would be for exactly one number to be drawn five times, as then you'd need to discount multiple occurrences of the same number being drawn five times.

 ablackett 20 Sep 2022
In reply to john arran:

> Surely it's simply the original answer x 30? More tricky would be for exactly one number to be drawn five times, as then you'd need to discount multiple occurrences of the same number being drawn five times.

I dont' think it is.

P(1 appears 5 times)=0.0247
P(2 appears 5 times)=0.0247
P(1 or 2 appears 5 times)=0.0247+0.0247-P(1 and 2 appear 5 times)

Following the same logic
P(1 or 2 or 3 or... or 30 appears 5 times)=0.0247 x 30 minus a whole load of messy intersection business.

See this explanation for 4 sets,
https://www.thoughtco.com/probability-union-of-three-sets-more-3126263
I am trying to follow the same logic with 30 sets I think.

 ablackett 20 Sep 2022
In reply to tjhare1:

> Might be being thick (very much not my area of expertise), but don’t we want 1-P(no number appears 5times)? In which case can’t we use the same logic to work out P(0,1,2,3,4), use that as P(<5) and it’s then obvious - job done?

Yes, I think you are right, 1-P(no number appears 5 times) would do the job, but I don't know how to calculate P(no number appears 5 times).  I don't follow your explanation above about P(0,1,2,3,4).

 john arran 20 Sep 2022
In reply to ablackett:

I'm not following why you need to do this bit: -P(1 and 2 appear 5 times)

If there are 5 1s and also 5 2s, then there is still "at least one number which will be drawn 5 times out of 54", so there's no need to remove those situations from the calculated probability.

 ablackett 20 Sep 2022
In reply to john arran:

Because when you calculate the P(1 appears 5 times) that will include such combinations as

1,1,1,1,1,2,2,2,2,2,3,3,4,4,5,5,6,6,7,7,8,8,...21,21,22,22

and when you calculate P(2 appears 5 times) that will include

1,1,1,1,1,2,2,2,2,2,3,3,4,4,5,5,6,6,7,7,8,8,...21,21,22,22

so you would be double counting that combination if you were to add up the two probabilities and, while I want to include this combination, I only want to include it once.

Edit: I'm very much prepared that I may be wrong here!

Post edited at 20:48
 john arran 20 Sep 2022
In reply to ablackett:

I see. Hmm, yes.

 Qwertilot 20 Sep 2022
In reply to ablackett:

Horribly inelegant but you can always just give in and monte carlo it Utterly trivial bit of code of course.

Then perhaps reverse engineer what the closed form answer must have been!

 mbh 21 Sep 2022
In reply to ablackett:

An approach, surely, is to calculate the distribution P(n) of the probabilities, not of some number k appearing 5 times, or whatever, but of any number appearing n times. Then find the value for n=5. 
So, P(54) would be 30 (because k can range from 1 to 30) x (1/30)^54, P(53) = 30 x (29/30) x (1/30)^53 x 54, and so on.

I say and so on, but I can't as yet generalise this for any n.

When I brute force it with code I get 55.6%.

 ablackett 21 Sep 2022
In reply to Qwertilot:

> Then perhaps reverse engineer what the closed form answer must have been!

OK, i've drawn a blank with every other approach, lets go with this....

1-(30^52*20^2)/30^54 = 55.6%

Lovely.*




*I'm fairly sure this is utter nonsense-before anyone spends any time trying to work out what I have done.

 mbh 21 Sep 2022
In reply to ablackett:

I can't see what you are doing I was just thinking that your 'messy intersection business' might best be solved by in some way using an inclusion exclusion approach, which, now I look at it, is what the article you linked to above is doing.

Post edited at 20:40

New Topic
This topic has been archived, and won't accept reply postings.
Loading Notifications...