Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-100-arranged-probability.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

49 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f3d01000cf542c50fee3
title: 'Problem 100: Arranged probability'
challengeType: 5
forumTopicId: 301724
dashedName: problem-100-arranged-probability
---
# --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.
# --hints--
`arrangedProbability()` should return a number.
```js
assert(typeof arrangedProbability() === 'number');
```
`arrangedProbability()` should return 756872327473.
```js
assert.strictEqual(arrangedProbability(), 756872327473);
```
# --seed--
## --seed-contents--
```js
function arrangedProbability() {
return true;
}
arrangedProbability();
```
# --solutions--
```js
// solution required
```