Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-469-empty-chairs.english.md
Oliver Eyton-Williams bd68b70f3d Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00

1.2 KiB

id, challengeType, title, forumTopicId
id challengeType title forumTopicId
5900f5411000cf542c510053 5 Problem 469: Empty chairs 302144

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.

Instructions

Tests

tests:
  - text: <code>euler469()</code> should return 0.56766764161831.
    testString: assert.strictEqual(euler469(), 0.56766764161831);

Challenge Seed

function euler469() {
  // Good luck!
  return true;
}

euler469();

Solution

// solution required