Thread Rating:

Poll

20 votes (46.51%)
14 votes (32.55%)
6 votes (13.95%)
2 votes (4.65%)
12 votes (27.9%)
3 votes (6.97%)
6 votes (13.95%)
5 votes (11.62%)
12 votes (27.9%)
9 votes (20.93%)

43 members have voted

ChesterDog
ChesterDog
Joined: Jul 26, 2010
  • Threads: 8
  • Posts: 1129
April 3rd, 2020 at 1:21:04 PM permalink
Quote: Ace2

New 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?



House edge = negative infinity

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.)
gordonm888
Administrator
gordonm888
Joined: Feb 18, 2015
  • Threads: 58
  • Posts: 4308
April 3rd, 2020 at 2:00:10 PM permalink
Quote: unJon

This 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?



10%. 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.
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
charliepatrick
charliepatrick
Joined: Jun 17, 2011
  • Threads: 38
  • Posts: 2781
April 3rd, 2020 at 2:28:52 PM permalink
Quote: Ace2

New 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?

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...
We know the test shows the patient has the disease. We also know that (i) 90% of the people are clear and (ii) the test is 90% accurate. Essentially there are two possibilities, the patient is clear but has been given a false negative or the patient has the disease and has been correctly diagnosed as having it.

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.
This explains why the test has to be so accurate before it can become useful.
TomG
TomG
Joined: Sep 26, 2010
  • Threads: 16
  • Posts: 2386
April 3rd, 2020 at 3:18:42 PM permalink
Quote: Ace2

New 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?



I guess an EV of 60-cents, for a house edge of 40%
ChesterDog
ChesterDog
Joined: Jul 26, 2010
  • Threads: 8
  • Posts: 1129
April 3rd, 2020 at 3:18:53 PM permalink
Quote: Ace2

New 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?



a house edge of about 42.295%.
Ace2
Ace2
Joined: Oct 2, 2017
  • Threads: 31
  • Posts: 2309
April 3rd, 2020 at 3:41:44 PM permalink
Quote: ChesterDog

a house edge of about 42.295%.

That’s in the ballpark. But, as usual, I’m looking for a closed-form solution
It’s all about making that GTA
Wizard
Administrator
Wizard
Joined: Oct 14, 2009
  • Threads: 1452
  • Posts: 25253
April 3rd, 2020 at 3:51:27 PM permalink
Quote: gordonm888

10%. 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.



Certain the positive test result increases your probability of actually being positive.
“Extraordinary claims require extraordinary evidence.” -- Carl Sagan
ChesterDog
ChesterDog
Joined: Jul 26, 2010
  • Threads: 8
  • Posts: 1129
April 3rd, 2020 at 5:18:59 PM permalink
Quote: Ace2

Quote: ChesterDog

a house edge of about 42.295%.

That’s in the ballpark. But, as usual, I’m looking for a closed-form solution



if the player decides to play n rounds, then the house edge would be:

1 + LN(n+1) - Hn.

Hn 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 Hn - LN(n), I see it has a name, which is the "Euler-Mascheroni constant (gamma)." Gamma is about 0.5772156649.

The limit of Hn - LN(n) would equal the limit of Hn - LN(n+1), so the house edge, for infinite play, would equal 1 - gamma = 0.4227843351...
ThatDonGuy
ThatDonGuy
Joined: Jun 22, 2011
  • Threads: 114
  • Posts: 5667
April 3rd, 2020 at 6:23:00 PM permalink
Quote: Ace2

Quote: ChesterDog

a house edge of about 42.295%.

That’s in the ballpark. But, as usual, I’m looking for a closed-form solution



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%.

Ace2
Ace2
Joined: Oct 2, 2017
  • Threads: 31
  • Posts: 2309
April 3rd, 2020 at 8:36:05 PM permalink
Good job, ChesterDog, on getting the correct formulaic answer.

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
Last edited by: Ace2 on Apr 3, 2020
It’s all about making that GTA

  • Jump to: