wu :: forums
« wu :: forums - Re: Probability Problem 1 »

Welcome, Guest. Please Login or Register.
Nov 25th, 2024, 3:49am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   hard
(Moderators: Grimbal, william wu, Eigenray, SMQ, Icarus, ThudnBlunder, towr)
   Re: Probability Problem 1
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Re: Probability Problem 1  (Read 744 times)
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Probability Problem 1  
« on: Jun 17th, 2018, 12:14pm »
Quote Quote Modify 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: male
Posts: 13730
Re: Probability Problem 1  
« Reply #1 on: Jun 17th, 2018, 10:52pm »
Quote Quote Modify 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
*****





134688278 134688278   rmsgrey   rmsgrey


Gender: male
Posts: 2873
Re: Probability Problem 1  
« Reply #2 on: Jun 18th, 2018, 4:36pm »
Quote Quote Modify 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

    navi
Email

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

Your second answer is correct towr.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board