freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-205-dice-game.engli...

1.0 KiB

id challengeType title forumTopicId
5900f4391000cf542c50ff4c 5 Problem 205: Dice Game 301846

Description

Peter has nine four-sided (pyramidal) dice, each with faces numbered 1, 2, 3, 4. Colin has six six-sided (cubic) dice, each with faces numbered 1, 2, 3, 4, 5, 6.

Peter and Colin roll their dice and compare totals: the highest total wins. The result is a draw if the totals are equal.

What is the probability that Pyramidal Pete beats Cubic Colin? Give your answer rounded to seven decimal places in the form 0.abcdefg

Instructions

Tests

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

Challenge Seed

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

euler205();

Solution

// solution required