* fix: improve Project Euler descriptions and test case Improve formatting of Project Euler test descriptions. Also add poker hands array and new test case for problem 54 * feat: add typeof tests and gave functions proper names for first 100 challenges * fix: continue fixing test descriptions and adding "before test" sections * fix: address review comments * fix: adjust grids in 18 and 67 and fix some text that reference files rather than the given arrays * fix: implement bug fixes and improvements from review * fix: remove console.log statements from seed and solution
66 lines
1.4 KiB
Markdown
66 lines
1.4 KiB
Markdown
---
|
||
id: 5900f3d01000cf542c50fee3
|
||
challengeType: 5
|
||
title: 'Problem 100: Arranged probability'
|
||
forumTopicId: 301724
|
||
---
|
||
|
||
## Description
|
||
<section id='description'>
|
||
|
||
If a box contains twenty-one coloured discs, composed of fifteen blue discs and six red discs, and two discs were taken at random, it can be seen that the probability of taking two blue discs, P(BB) = (15/21)×(14/20) = 1/2.
|
||
|
||
The next such arrangement, for which there is exactly 50% chance of taking two blue discs at random, is a box containing eighty-five blue discs and thirty-five red discs.
|
||
|
||
By finding the first arrangement to contain over 10<sup>12</sup> = 1,000,000,000,000 discs in total, determine the number of blue discs that the box would contain.
|
||
|
||
</section>
|
||
|
||
## Instructions
|
||
<section id='instructions'>
|
||
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>arrangedProbability()</code> should return a number.
|
||
testString: assert(typeof arrangedProbability() === 'number');
|
||
- text: <code>arrangedProbability()</code> should return 756872327473.
|
||
testString: assert.strictEqual(arrangedProbability(), 756872327473);
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function arrangedProbability() {
|
||
// Good luck!
|
||
return true;
|
||
}
|
||
|
||
arrangedProbability();
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
|
||
</section>
|