wu :: forums « wu :: forums - Re: Probability Problem 1 » Welcome, Guest. Please Login or Register. Apr 17th, 2024, 9:56am RIDDLES SITE WRITE MATH! Home Help Search Members Login Register
 wu :: forums    riddles    hard (Moderators: Icarus, Grimbal, ThudnBlunder, towr, SMQ, william wu, Eigenray)    Re: Probability Problem 1 « Previous topic | Next topic »
 Pages: 1 Reply Notify of replies Send Topic Print
 Author Topic: Re: Probability Problem 1  (Read 658 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: 2872
 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

Gender:
Posts: 28
 Re: Probability Problem 1   « Reply #3 on: Jun 18th, 2018, 8:59pm » Quote Modify