1.7 KiB
1.7 KiB
id | challengeType | title |
---|---|---|
5900f4031000cf542c50ff16 | 5 | Problem 151: Paper sheets of standard sizes: an expected-value problem |
Description
At the beginning of each subsequent batch, he takes from the envelope one sheet of paper at random. If it is of size A5, he uses it. If it is larger, he repeats the 'cut-in-half' procedure until he has what he needs and any remaining sheets are always placed back in the envelope. Excluding the first and last batch of the week, find the expected number of times (during each week) that the foreman finds a single sheet of paper in the envelope. Give your answer rounded to six decimal places using the format x.xxxxxx .
Instructions
Tests
tests:
- text: <code>euler151()</code> should return 0.464399.
testString: assert.strictEqual(euler151(), 0.464399, '<code>euler151()</code> should return 0.464399.');
Challenge Seed
function euler151() {
// Good luck!
return true;
}
euler151();
Solution
// solution required