2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: 5900f5411000cf542c510053
|
|
|
|
challengeType: 5
|
|
|
|
title: 'Problem 469: Empty chairs'
|
2019-08-05 09:17:33 -07:00
|
|
|
forumTopicId: 302144
|
2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
In a room N chairs are placed around a round table.
|
|
|
|
Knights enter the room one by one and choose at random an available empty chair.
|
|
|
|
To have enough elbow room the knights always leave at least one empty chair between each other.
|
|
|
|
|
|
|
|
|
|
|
|
When there aren't any suitable chairs left, the fraction C of empty chairs is determined.
|
|
|
|
We also define E(N) as the expected value of C.
|
|
|
|
We can verify that E(4) = 1/2 and E(6) = 5/9.
|
|
|
|
|
|
|
|
|
|
|
|
Find E(1018). Give your answer rounded to fourteen decimal places in the form 0.abcdefghijklmn.
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 14:37:37 +01:00
|
|
|
tests:
|
|
|
|
- text: <code>euler469()</code> should return 0.56766764161831.
|
2019-07-26 19:45:56 -07:00
|
|
|
testString: assert.strictEqual(euler469(), 0.56766764161831);
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
function euler469() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler469();
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|
2019-07-18 08:24:12 -07:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
</section>
|