1.7 KiB
1.7 KiB
id | challengeType | title | forumTopicId |
---|---|---|---|
5900f4c01000cf542c50ffd2 | 5 | Problem 339: Peredur fab Efrawg | 301997 |
Description
Initially each flock consists of n sheep. Each sheep (regardless of colour) is equally likely to be the next sheep to bleat. After a sheep has bleated and a sheep from the other flock has crossed over, Peredur may remove a number of white sheep in order to maximize the expected final number of black sheep. Let E(n) be the expected final number of black sheep if Peredur uses an optimal strategy.
You are given that E(5) = 6.871346 rounded to 6 places behind the decimal point. Find E(10 000) and give your answer rounded to 6 places behind the decimal point.
Instructions
Tests
tests:
- text: <code>euler339()</code> should return 19823.542204.
testString: assert.strictEqual(euler339(), 19823.542204);
Challenge Seed
function euler339() {
// Good luck!
return true;
}
euler339();
Solution
// solution required