Author |
Topic: Re: Probability Problem 1 (Read 744 times) |
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Probability Problem 1
« on: Jun 17th, 2018, 12:14pm » |
Quote Modify
|
experimentally it's around 36% mathematically, I think it should be 4 times the number of ways to split 8 passengers over 3 non-empty carriages, divided by the number of ways to split 8 passengers over 4 carriages. Which I'd hope would be 4*([5+3-1]!/5!/[3-1]!) / ([8+4-1]!/8!/[4-1]!), but isn't. So I'm making a mistake somewhere
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Probability Problem 1
« Reply #1 on: Jun 17th, 2018, 10:52pm » |
Quote Modify
|
Ah like railway companies, I had trouble looking at the passengers as individuals. It should be (4*3^8 - 12*2^8 + 12) / 4**8 = 1449/4096 ~= 35.4%
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
rmsgrey
Uberpuzzler
Gender:
Posts: 2873
|
|
Re: Probability Problem 1
« Reply #2 on: Jun 18th, 2018, 4:36pm » |
Quote Modify
|
A quick and dirty program to count all possibilities agrees with towr's second answer. C# code: hidden: | static void Main(string[] args) { int[] pass = {0,0,0,0,0,0,0,0}; int total = 0; int success = 0; while (pass[7] < 4) { int[] car = { 0, 0, 0, 0 }; for (int i = 0; i < 8; i++) car[pass[i]] = 1; if (car[0] + car[1] + car[2] + car[3] == 3) success++; total++; int j = 0; pass[j]++; while (j < 7 && pass[j] == 4) { pass[j] = 0; j++; pass[j]++; } } Console.WriteLine("{0} successes out of {1} total", success, total); Console.ReadLine(); } | Output: 23184 successes out of 65536 total
|
|
IP Logged |
|
|
|
navdeep1771
Newbie
Let your thoughts go beyond your imagination
Gender:
Posts: 28
|
|
Re: Probability Problem 1
« Reply #3 on: Jun 18th, 2018, 8:59pm » |
Quote Modify
|
Your second answer is correct towr.
|
|
IP Logged |
|
|
|
|