## Poll

10 votes (47.61%) | |||

8 votes (38.09%) | |||

5 votes (23.8%) | |||

2 votes (9.52%) | |||

7 votes (33.33%) | |||

3 votes (14.28%) | |||

4 votes (19.04%) | |||

3 votes (14.28%) | |||

9 votes (42.85%) | |||

6 votes (28.57%) |

**21 members have voted**

Quote:Ace2New puzzle:

Imagine the following game, which costs $1.00 to play. At the beginning of each round, a random number between 0 and 1 is generated and then multiplied by $1.00. You get paid a portion of that as follows. If, for instance, you’re on round 3 and the random number is 0.8169 then you get paid 0.8169 / (3 * 3.8169) = $0.07.

You can play as many rounds as you want and you keep winnings from all rounds. Total winnings are paid when you decide to stop playing, and that is the only time they are rounded to the nearest cent.

What is the house edge on this game?

Edit: Never mind. I see that on each round, the player get paid RAND / [ round * ( RAND + round)]. So, the series of wins would converge, and my guess is definitely wrong. (RAND = the random number, round = the round number.)

Quote:unJonThis one will be truly easy for those on this forum, but it’s an old classic and I used to use it as an interview question (updated for the current crisis):

With 10% of the population having COVID-19, the world is in extreme crisis. Thankfully, a new Pharma company has just created an instant COVID-19 test that is 90% accurate. World leaders have mandated that everyone take the test in the hopes this will enable the virus to finally be contained. You dutifully show up at Walmart (wearing your N95 mask and staying six feet away from everyone else) to get tested in the pharmacy. Bad news: the test is positive for COVID-19.

What is the probability you actually have COVID-19?

This puzzle shows the problem with coming up with a quick test that isn't accurate enough and why it's taking so long to develop a test that is reliable enough to use. It's all down to Bayes Theorem...Quote:Ace2New puzzle:

Imagine the following game, which costs $1.00 to play. At the beginning of each round, a random number between 0 and 1 is generated and then multiplied by $1.00. You get paid a portion of that as follows. If, for instance, you’re on round 3 and the random number is 0.8169 then you get paid 0.8169 / (3 * 3.8169) = $0.07.

You can play as many rounds as you want and you keep winnings from all rounds. Total winnings are paid when you decide to stop playing, and that is the only time they are rounded to the nearest cent.

For calculation purposes, you can assume players will play forever. What is the house edge of this game?

Keeping things simple take a step back and look at a typical population of 100.

90 of them are clear, but if tested 81 would show up clear and 9 would get a false positive.

The other 10 have the disease, and if tested 9 would show up as having the disease and 1 would get a false negative.

Thus

(a) 9 are clear but get a false positive.

(b) 9 have the disease and get the correct result.

So if someone comes back with a positive test result it could be any of the 9 (a) or any of the 9 (b). Thus it is 50-50 whether they have the disease.

This is why it's so important to get a better test.

Using a test which is 99% correct, then in 1000 people; 900 clear, 9 get false positives; 100 have it, and 99 get correct result; so we're 91% (99/108) certain they have the disease. Similarly 95% test gets 68%, so you need a better test to be useful. Still better than 50% with the 90% test.

Quote:Ace2New puzzle:

Imagine the following game, which costs $1.00 to play. At the beginning of each round, a random number between 0 and 1 is generated and then multiplied by $1.00. You get paid a portion of that as follows. If, for instance, you’re on round 3 and the random number is 0.8169 then you get paid 0.8169 / (3 * 3.8169) = $0.07.

You can play as many rounds as you want and you keep winnings from all rounds. Total winnings are paid when you decide to stop playing, and that is the only time they are rounded to the nearest cent.

For calculation purposes, you can assume players will play forever. What is the house edge of this game?

Quote:Ace2New puzzle:

Imagine the following game, which costs $1.00 to play. At the beginning of each round, a random number between 0 and 1 is generated and then multiplied by $1.00. You get paid a portion of that as follows. If, for instance, you’re on round 3 and the random number is 0.8169 then you get paid 0.8169 / (3 * 3.8169) = $0.07.

You can play as many rounds as you want and you keep winnings from all rounds. Total winnings are paid when you decide to stop playing, and that is the only time they are rounded to the nearest cent.

For calculation purposes, you can assume players will play forever. What is the house edge of this game?

That’s in the ballpark. But, as usual, I’m looking for a closed-form solutionQuote:ChesterDoga house edge of about 42.295%.

Quote:gordonm88810%. Because the statement says that 10% of the population have Covid-19. And the question is not about the probability of testing positive, its about whether you actually have the disease.

Quote:Ace2That’s in the ballpark. But, as usual, I’m looking for a closed-form solutionQuote:ChesterDoga house edge of about 42.295%.

1 + LN(n+1) - H

_{n}.

H

_{n}is the "n-th Harmonic Number," which = 1/1 + 1/2 + 1/3 +... + 1/n.

And LN(n+1) is the natural log of n+1.

Looking up the limit as n approaches infinity of H

_{n}- LN(n), I see it has a name, which is the "Euler-Mascheroni constant (gamma)." Gamma is about 0.5772156649.

The limit of H

_{n}- LN(n) would equal the limit of H

_{n}- LN(n+1), so the house edge, for infinite play, would equal 1 - gamma = 0.4227843351...

Quote:Ace2That’s in the ballpark. But, as usual, I’m looking for a closed-form solutionQuote:ChesterDoga house edge of about 42.295%.

In round n, the expecting winnings is INTEGRAL(0,1) {x / (n (n + x)) dx}

= 1/n INTEGRAL(0,1) {x / (n + x) dx}

= 1/n INTEGRAL(0,1) {(1 - n / (n + x)) dx}

= 1/n INTEGRAL(0,1) {1 dx} - 1/n * n INTEGRAL(0,1) {1 / (n + x) dx}

= 1/n (1 - 0) - (ln (n + 1) - ln n)

= 1/n - ln ((n + 1) / n)

The expected winnings over the entire game is the sum of this over all positive integers n, so the house edge = (1 - the expected winnings) x 100%.

The sum over n rounds is 1 + 1/2 + 1/3 + ... + 1/n - (ln 2 - ln 1 + ln 3 - ln 2 + ln 4 - ln 3 + ... + ln (n+1) - ln n)

= 1 + 1/2 + 1/3 + ... + 1/n - ln (n + 1)

The expected winnings is the limit of this as n approaches positive infinity.

However, I do not know how to calculate this, especially as both the sum and the logarithm diverge.

Using Excel, the house edge through 5000 rounds is 42.2884%.

The integral from 1 to n of 1/x dx is Ln(n). You can think of that as the harmonic series in continuous form, which is why, as n gets larger, Ln(n) gets closer to H(n)...the difference converges to the Euler–Mascheroni constant (γ) of ~0.5772

That constant is equal to the integral from 1 to infinity of (1/[x] - 1/x) dx where [x] is the floor function (same as rounddown). Makes sense, it’s just summing all the differences between 1/x (all numbers) and 1/[x] (all parts of harmonic numbers).

The formula for this game, (rand / (round * (round + rand)), is just another way of expressing (1/[x] -1/x). So summed from 1 to infinity it will equal γ. Or I should say, the average of many games will equal γ. Therefore the house edge is 1 - γ =~ 0.4228

Harmonic numbers come up a lot in probability...many “Coupon collector” problems use them. Incidentally, I recently learned that the estimate for the Nth harmonic number can be further refined by adding the term 1/2n - 1/12n^2 + 1/120n^4, which makes approximations very accurate, even for small N. For instance, H(3) is 1/1 + 1/2 + 1/3 = 11/6 = 1.8333333. Using the approximation of Ln(3) + γ + 1/(2*3) - 1/(12*3^2) + 1/(120*3^4) we get 1.833338, so already good to 5 decimal places