2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f44f1000cf542c50ff61
|
|
|
|
title: 'Problem 227: The Chase'
|
2020-11-27 18:02:05 +00:00
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
forumTopicId: 301870
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: problem-227-the-chase
|
2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --description--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
"The Chase" is a game played with two dice and an even number of players.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 12:26:34 +00:00
|
|
|
The players sit around a table; the game begins with two opposite players having one die each. On each turn, the two players with a die roll it.
|
|
|
|
|
|
|
|
If the player rolls a 1, he passes the die to his neighbour on the left.
|
|
|
|
|
|
|
|
If the player rolls a 6, he passes the die to his neighbour on the right.
|
|
|
|
|
|
|
|
Otherwise, he keeps the die for the next turn.
|
|
|
|
|
|
|
|
The game ends when one player has both dice after they have been rolled and passed; that player has then lost.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
In a game with 100 players, what is the expected number of turns the game lasts? Give your answer rounded to ten significant digits.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --hints--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 12:26:34 +00:00
|
|
|
`theChase()` should return `3780.618622`.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```js
|
2021-07-15 12:26:34 +00:00
|
|
|
assert.strictEqual(theChase(), 0.618622);
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --seed--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
## --seed-contents--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
2021-07-15 12:26:34 +00:00
|
|
|
function theChase() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-15 12:26:34 +00:00
|
|
|
theChase();
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|