2018-10-10 22:03:03 +00:00
---
id: 5900f4551000cf542c50ff67
2021-02-06 04:42:36 +00:00
title: 'Problem 232: The Race'
2018-10-10 22:03:03 +00:00
challengeType: 5
2021-02-06 04:42:36 +00:00
forumTopicId: 301876
2021-01-13 02:31:00 +00:00
dashedName: problem-232-the-race
2018-10-10 22:03:03 +00:00
---
2020-12-16 07:37:30 +00:00
# --description--
2018-10-10 22:03:03 +00:00
2021-02-06 04:42:36 +00:00
Two players share an unbiased coin and take it in turns to play "The Race". On Player 1's turn, he tosses the coin once: if it comes up Heads, he scores one point; if it comes up Tails, he scores nothing. On Player 2's turn, she chooses a positive integer T and tosses the coin T times: if it comes up all Heads, she scores 2T-1 points; otherwise, she scores nothing. Player 1 goes first. The winner is the first to 100 or more points.
2018-10-10 22:03:03 +00:00
2021-02-06 04:42:36 +00:00
On each turn Player 2 selects the number, T, of coin tosses that maximises the probability of her winning.
2018-10-10 22:03:03 +00:00
2021-02-06 04:42:36 +00:00
What is the probability that Player 2 wins?
2018-10-10 22:03:03 +00:00
2021-02-06 04:42:36 +00:00
Give your answer rounded to eight decimal places in the form 0.abcdefgh .
2018-10-10 22:03:03 +00:00
2020-12-16 07:37:30 +00:00
# --hints--
2018-10-10 22:03:03 +00:00
2021-02-06 04:42:36 +00:00
`euler232()` should return 0.83648556.
2018-10-10 22:03:03 +00:00
```js
2020-12-16 07:37:30 +00:00
assert.strictEqual(euler232(), 0.83648556);
2018-10-10 22:03:03 +00:00
```
2021-01-13 02:31:00 +00:00
# --seed--
## --seed-contents--
```js
function euler232() {
return true;
}
euler232();
```
2020-12-16 07:37:30 +00:00
# --solutions--
2020-08-13 15:24:35 +00:00
2021-01-13 02:31:00 +00:00
```js
// solution required
```