The Gambling Machine Puzzle An entrepreneur has devised a gambling machine that chooses two independent random variables x and y that are uniformly and independently distributed between 0 and 100. He plans to tell any customer the value of x and to ask him whether y > x or x > y. If the customer guesses correctly, he is given y dollars. If x = y, he.s given y/2 dollars. And if he.s wrong about which is larger, he.s given nothing. The entrepreneur plans to charge his customers $40 for the privilege of playing the game. Would you play? Solution Readers approached Gambling Machine as both a discrete and continuous problem to arrive at the same conclusion: The expected payout from playing the game was a bit more than the $40. As put by Richardo Ech, who solved using integers to arrive at a payoff of $40.28, .So unless you are risk averse, you would play this game for a $40 entry fee.. Here.s Dr. Blachman.s own solution: When you.re told the value of x, you need to compare the expected payoffs G(x) from guessing that y>x and L(x) from guessing that yx or y70.7107. G(x) and L(x) are both 25 when x = 0.707107. The best strategy is therefore to guess y>x whenever x<0.707107 and to guess x0.707107. To see what average payoff the use of the optimum decision threshold 70.7107 provides, we integrate G(x) times the probability density 1/100 of x from 0 to 70.7107, getting 29.462, and L(x)/100 from 70.7107 to 100, getting 10.7741, their total being a 40.2369 average expected payoff from using this strategy. One of more intriguing solutions was proposed by Bowen Kerins: A terrific problem! I ended up picturing the problem as a triangular prism, with dimensions X-by-Y-by-Y (the triangle.s height is the value you.ll be paid in dollars if you pick correctly). Then, break the prism into parts based on whether you pick higher or lower, and whether the choice is correct. The main shape is a pyramid inside the triangular prism, so the appropriate volumes can be calculated exactly (using similarity instead of calculus). Doing this I got the exact value of the game, 50/3 * (1 + sqrt 2), which is just barely enough. Wow! The graphic shown in Bowen Kerins. comment above was created by grade school teacher Avery Pickford, who teaches Bingo Hi-Lo, the inspiration for Gambling Machine. Mr. Pickford.s full solution (click here) starts with a review of different student reactions to the problem: A few students approached this experimentally and wrote Scratch programs to run thousands of simulations. By varying their rule for when to say .higher. and when to say .lower., they narrowed in on the optimal place to switch. The most common student solution started by picking a card around 60. With the speci.c example of 60, you can say that your expected winnings would be the probability of getting a particular card times the amount you would win if that card was selected. Really, this is just a fancy average. So if we chose lower after seeing 60, we would expect a payout of: 1/99·1 + 1/99·2 + 1/99·3 + .+ 1/99·59 + 1/99·0 . I have a 1/99 chance of winning $1, a 1/99 chance of winning $2, etc. up to a 1/99 chance of winning $59. If the second number is above 60, I win nothing. If, on the other hand, you choose .higher. your expected winnings are: 1/99·0 + 1/99·0 + 1/99·0 + . + 1/99·61 + 1/99·62 . + 1/99·98 + 1/99·99 + 1/99·100. Calculating these results (which can be done using one of a number of clever methods that avoid having to compute lots of sums) gives you expected winnings of approximately $17.88 if you choose lower, and $32.53 if you choose higher. Even though you will win less than half the time if you choose higher, when you do win you will win more money. If that still sounds .shy, consider an even more extreme example: Which bet would you rather take, a 50% chance of winning $1 or a 10% chance of winning $1,000,000? You.d have to be extremely risk adverse to choose the former. From here, some students continued with larger values in an attempt to .nd the break even point. A third group of students observed that in the case where your .rst number is 60, the average number less than 60 is (1+59)/2 and that you have a 59/99 chance of choosing correctly. (1+59)/2 · 59/99 . $17.88 The above example can be generalized to .nd the break-even point by calling the .rst card x. This leads to solving the equation (1+(x.1) )/2 · (x .1)/99 = ((x+1)+100)/2 · (100.x)/99 which simpli.es to x2 = 5050, which has a positive solution of x . 71.06. This means, in order to maximize your expected winnings, you should choose .higher. when the .rst number is 71 or less.