freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-286-scoring-probabilities.english.md
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

1.1 KiB
Raw Blame History

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f48a1000cf542c50ff9d 5 false Problem 286: Scoring probabilities 301937

Description

Barbara is a mathematician and a basketball player. She has found that the probability of scoring a point when shooting from a distance x is exactly (1- x/q), where q is a real constant greater than 50.

During each practice run, she takes shots from distances x=1, x=2, ..., x=50 and, according to her records, she has precisely a 2% chance to score a total of exactly 20 points.

Find q and give your answer rounded to 10 decimal places.

Instructions

Tests

tests:
  - text: <code>euler286()</code> should return 52.6494571953.
    testString: assert.strictEqual(euler286(), 52.6494571953);

Challenge Seed

function euler286() {
  // Good luck!
  return true;
}

euler286();

Solution

// solution required