Drawing Two Bingo Balls

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

User avatar
DataGenetics
Posts: 24
Joined: Sat Jan 01, 2011 1:12 am UTC
Location: Seattle

Drawing Two Bingo Balls

Postby DataGenetics » Fri Apr 01, 2016 2:54 pm UTC

A set of bingo balls contains the numbers 1-75.

From a fully shuffled set of bingo balls, you draw one number. Without replacing this ball, you draw a second number. If you win a prize equal to the value of the highest number you draw, what is your expected return?

User avatar
ThirdParty
Posts: 323
Joined: Wed Sep 19, 2012 3:53 pm UTC
Location: USA

Re: Drawing Two Bingo Balls

Postby ThirdParty » Sat Apr 02, 2016 2:56 pm UTC

The first solution that came to mind was this rather-inelegant one:
Spoiler:

Code: Select all

<html><head><title>Brute Force</title>
   <script language="JavaScript">
      function getanswer() {
         var a; var b; var count = 0; var sum = 0;
         for (a = 1; a <= 75; ++a) {
            for (b = 1; b <= 75; ++b) {
               if (a != b) {
                  ++count;
                  if (a > b) { sum += a; } else { sum += b; }
               }
            }
         }
         return (sum/count);
      }
   </script>
</head><body>
   <script language="JavaScript">
      document.write("The answer is "+getanswer());
   </script>
</body></html>
The answer is 50.666... .
A slightly more elegant, but still unsatisfying, approach is:
Spoiler:
There are 5550 different possibilities. (i.e. 75 for the first ball and 74 for the second). We can find their sum by adding up all the cases where the first ball drawn is higher than the second--0 cases worth 1 point, 1 case worth 2 points, 2 cases worth 3 points, etc., up to 74 cases worth 75 points--and then multiplying by 2 to account for the cases where the second is higher:

Code: Select all

<html><head><title>Brute Force</title>
   <script language="JavaScript">
      function getanswer() {
         var a; var sum = 0;
         for (a = 2; a <= 75; ++a) {
            sum += a*(a-1)*2;
         }
         return (sum);
      }
   </script>
</head><body>
   <script language="JavaScript">
      document.write("The sum is "+getanswer());
   </script>
</body></html>
The sum is 281200. So that means the average payoff is 281200/5550 = 50⅔.

Demki
Posts: 199
Joined: Fri Nov 30, 2012 9:29 pm UTC

Re: Drawing Two Bingo Balls

Postby Demki » Sat Apr 02, 2016 8:41 pm UTC

ThirdParty wrote:The first solution that came to mind was this rather-inelegant one:
Spoiler:

Code: Select all

<html><head><title>Brute Force</title>
   <script language="JavaScript">
      function getanswer() {
         var a; var b; var count = 0; var sum = 0;
         for (a = 1; a <= 75; ++a) {
            for (b = 1; b <= 75; ++b) {
               if (a != b) {
                  ++count;
                  if (a > b) { sum += a; } else { sum += b; }
               }
            }
         }
         return (sum/count);
      }
   </script>
</head><body>
   <script language="JavaScript">
      document.write("The answer is "+getanswer());
   </script>
</body></html>
The answer is 50.666... .
A slightly more elegant, but still unsatisfying, approach is:
Spoiler:
There are 5550 different possibilities. (i.e. 75 for the first ball and 74 for the second). We can find their sum by adding up all the cases where the first ball drawn is higher than the second--0 cases worth 1 point, 1 case worth 2 points, 2 cases worth 3 points, etc., up to 74 cases worth 75 points--and then multiplying by 2 to account for the cases where the second is higher:

Code: Select all

<html><head><title>Brute Force</title>
   <script language="JavaScript">
      function getanswer() {
         var a; var sum = 0;
         for (a = 2; a <= 75; ++a) {
            sum += a*(a-1)*2;
         }
         return (sum);
      }
   </script>
</head><body>
   <script language="JavaScript">
      document.write("The sum is "+getanswer());
   </script>
</body></html>
The sum is 281200. So that means the average payoff is 281200/5550 = 50⅔.

Spoiler:
Instead of looping through all the cases(there aren't many, but still), here is the solution for N balls.
number of cases = 2 * sum of n from 1 to N-1 = (N-1)*N
total worth of all cases = 2 * sum of n(n+1) from 1 to N-1 = 2 * sum of n^2+n from 1 to N-1
total worth of all cases = 2 * (sum of n^2 from 1 to N-1 + sum of n from 1 to N-1) = 2 * ((N-1)*N*(2N-1)/6 + N*(N-1)/2)
total worth of all cases = 2/3*(N-1)*N*(N+1)
expected payoff = (total worth of all cases)/(number of cases) = 2/3 * (N-1)*N*(N+1)/((N-1)*N) = 2(N+1)/3

For 75 balls: 2*(75+1)/3=152/3=50⅔

User avatar
ThirdParty
Posts: 323
Joined: Wed Sep 19, 2012 3:53 pm UTC
Location: USA

Re: Drawing Two Bingo Balls

Postby ThirdParty » Sat Apr 02, 2016 9:19 pm UTC

Yeah, that's better. Good job.


Return to “Logic Puzzles”

Who is online

Users browsing this forum: No registered users and 3 guests