Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-100-arranged-probability.md
Oliver Eyton-Williams 0bd52f8bd1 Feat: add new Markdown parser (#39800)
and change all the challenges to new `md` format.
2020-11-27 10:02:05 -08:00

1.1 KiB
Raw Blame History

id, title, challengeType, forumTopicId
id title challengeType forumTopicId
5900f3d01000cf542c50fee3 Problem 100: Arranged probability 5 301724

--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 1012 = 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.

assert(typeof arrangedProbability() === 'number');

arrangedProbability() should return 756872327473.

assert.strictEqual(arrangedProbability(), 756872327473);

--seed--

--seed-contents--

function arrangedProbability() {

  return true;
}

arrangedProbability();

--solutions--

// solution required