A friend of mine saw this question on twitter. No reason to think that there’s a clever/interesting/simple solution, and I thought about it a bit and didn’t get anywhere:
Thoughts?
thanks!
A friend of mine saw this question on twitter. No reason to think that there’s a clever/interesting/simple solution, and I thought about it a bit and didn’t get anywhere:
Thoughts?
thanks!
Initially there are 30 groups of 5 (6 groups at each of 5 tables).
Consider just one of those groups and compute the chance they will come together in the second round. This is
(4/29)(3/28)(2/27)*(1/26) ~= .0000421034903793524483
Multiply by 30 to compute the expected number of such conjunctions:
.0012631047113805734495
However this is not quite the answer to OP’s question. Double conjunctions have been counted twice; we must apply “inclusion/exclusion.”
There are 3024 pairs of disjoint 5-groups from Round 1. We’ve already computed the chance one will conjoin; to change this to the chance of a double conjunction multiply by 24(4/24)(3/23)(2/22)*(1/21); then subtract these double conjunctions from the previous answer
.0012631047113805734495 +
.0000028528621375055301 =
.0012602518492430679194 = 1 chance in 793.5
But now we have to add back the number of triple conjunctions! This will be the double conjunction chance multiplied by 18*(4/19)(3/18)(2/17)*(1/16) if I haven’t lost my grip yet, for a net answer of
.0012602518492430679194 +
.0000000132485857778895 =
.0012602650978288458089 = 1 chance in 793.5
We’re almost done: We can’t get more than a quintuple conjunction so two more stages will complete the inclusion/exclusion. But even the triple conjunctions were rare, so I think I’ll stop here.
I did this before my morning coffee and it appears I did indeed lose my grip.
The "3024 pairs of disjoint 5-groups" should be 3024/2, I think, and similarly the triple conjunction chance should be further divided by 3. Not to mention that the double-conjunction exclusion needs a ‘-’ not a ‘+’. :smack:
With these corrections, the chance goes up to 1 in 792.6
… Maybe.
No, its 30 people, in five groups of six at first and then six groups of five.
I think…
Consider just the chances that 5 of the first table’s people will end up on one of the 5-person tables. There are 6 possible person combinations that fulfil this (6choose5) and 6 possible tables that they might be at.
So there are 6*6=36 possible ways to fulfil the condition “five of the people at table 1 end up together somewhere”
The total number T of ways the 30 people can be arranged at 6 tables of 5 (where we don’t care what seat at the table you have) is 30!/(5!*5!*5!*5!*5!*5!) (ie, lots)
So the chance C for 5 of the people at table 1 to end up together somewhere is then 36/T = 4.05256E-19
Formula to extend this to all the tables, not just table 1
Total Probability = 1-(1-C)^5 = 2.02628E-18
That’s a whole lot less likely than I would have guessed first off, so feel free to pick my method apart.
I have a stats exam in 12 hours and 23 minutes BTW - wish me luck!
Yes, it’s 30 people altogether. Among them there are 30 overlapping groups of 5 that would satisfy OP’s criterion.
ETA: Despite my admitted arithmetic foibles, my final answer
1 in 792.6
is, approximately, the answer to OP’s question.
Ah - I realise what I’ve done in the first answer … failed to multiply that 36 ‘total combinations’ by the ways the other 25 people can be arranged - 25!/5!5!5!5!5!
If I do that and don’t do the 1-p thing at the end to account for tables 2-5 in the original, then I get 2/7917.
Which is different from septimus’ answer BUT - I just applied my formula to the case of ‘6 people on 2 tables move to 3 tables’ and then hand-counted. And my hand-counts and formula do agree for the 3->2 (get probability of 0.6 that someone ends up on a new table of all-former-seatmates)
We’ve got a difference in our answers of a factor of … I think exactly 5? Which is an interesting number, given the parameters
Yes. As you said in your first paragraph you’ve computed the chance for “first table” and must multiply by five to answer for all the tables.
This gives 10/7917 as the expected number of coincidental fivesomes, but OP’s question is slightly different — he asks for the the chance of one fivesome or more. For that you need to do inclusion-exclusion and will finish with a number slightly smaller than 10/7917.
OP’s question is slightly ambiguous:
“What are the odds that at one of the new tables …”
Does “one” mean “one specified table” or “any one (or more) of the tables”? In the latter case you need the inclusion-exclusion answer. In the former case, (1/6)*(10/7917) is the exact answer.
Yes, this must be right.
I just wrote myself a little python simulation of the problem, and it’s consistently giving results in around the 8 or 9 /7917 kind of range
I think this gives the exact answer…
(1 * 5 * 6 * 25! * (6!)^1 - 2 * 10 * 15 * 20! * (6!)^2 + 6 * 10 * 20 * 15! * (6!)^3 - 24 * 5 * 15 * 10! * (6!)^4 + 120 * 1 * 6 * 5! * (6!)^5) / (30!)
1026593768/813671751893
~= 0.001261680481854800597229610674629353904601742728058213912…
So approximately…
1:792.5936989449949592914341556766590463073997542521610164304…
I think I have an easier way to do this but I’m getting a slightly different answer.
Imagine yourself as one of the 30 people. After the shuffle, you are sitting at a new table with four other people. What is the probability that all four of those people came from the same old table that you had previously been sitting at before the shuffle? Let’s call the four new people Alan, Barbara, Carlita, and Don. What’s the probability that Alan came from your old table? There are 29 people (not counting you) and five of them were sitting at your old table before the shuffle. The probability that Alan is one of them is 5/29. And the probability that Barbara is also one of them is 4/28. For Carlita, it’s 3/27. For Don, it’s 2/26. Multiply these together to find the probability that everyone at your new table was also at your old table. It’s 5x4x3x2/29x28x27x26. Let’s call that p; it’s exactly 5/23751 and approximately .0002105174519. The probability this won’t happen at your table is 1-p = 23746/23751 or .9997894825481. The probability that it won’t happen at any of the six new tables is (1-p)^6 , approximately .998737559866. The probability that at least one table will have five people who were previously at the same table is 1-(1-p)^6, approximately .001262440134.
We’re almost done. The question asked for “odds”, not probability, so we need to take 1/that and subtract 1. The odds are 791.116769 to 1 against.
I wrote a Pascal program to simulate the shuffle 30 million times, running the simulation five times. The results are as follows:
0.00125830, 0.00125403, 0.00125023, 0.00125950, 0.00125883
This gives a mean of .001256180 and a std dev of +/- .00000395, which implies that the correct answer is between .0012482 and .0012641 (with 95% confidence).
Here’s the program I wrote, for anyone who’s interested.[spoiler]Program Shuffle(output);
type person=record n:integer;s:real end;
arrangement=array[1…30] of person;
var i,count,m:integer;
run:longint;
a:arrangement;
match:boolean;
Procedure Sort(var b:arrangement);
var j,k: integer;
temp: person;
begin
for j:=1 to 29 do
for k:=1 to 29 do
if b[k].s>b[k+1].s then begin
temp:=b[k];
b[k]:=b[k+1];
b[k+1]:=temp end
end;
Begin
randomize;
count:=0;
for m:=1 to 5 do begin
count:=0;
for run:=1 to 30000000 do begin
match:=false;
for i:=1 to 30 do begin
a*.n:=i-1;
a*.s:=random end;
Sort(a);
for i:=1 to 6 do
if (a[i*5].n div 6 = a[i*5-1].n div 6)
and (a[i*5-1].n div 6 = a[i*5-2].n div 6)
and (a[i*5-2].n div 6 = a[i*5-3].n div 6)
and (a[i*5-3].n div 6 = a[i*5-4].n div 6)
then match:=true;
if match then count:=count+1
end;
write(count,’,’)
end;
writeln
End.[/spoiler]
Lance (in #11) and I (in #6) each got 1 in 792.6 as the approximate answer, which corresponds with 791.6 to 1 against. You got 791.1 instead of 791.6. Whose answer is closer?
What about simulation? You did 150 million trials but as you see the error bars are still huge — too big to distinguish Lance and Bunny’s answers. I calculate
(2*sqrt(1/792) / (1/792.1 - 1/792.6))^2 ~= 8 Billion
as the number of trials needed to put two std devs between the two suggested answers.
But we don’t need to simulate. Your calculation assumes that the six probabilities you’re calling (1-p) are* independent*. They’re not. If your table doesn’t have five same-1st-rounders there will be less chance for the other tables to have same-1st-rounders. So your shortcut slightly overestimates the overall same-first-round chance. How much does it overestimate this? You’ve calculated that for us!
I stand corrected. Yes, I inadvertently assumed each table was independent of the others.