5 kyu

MONTE CARLO 3D

24 of 119raulbc777
Description
Loading description...
Fundamentals
Mathematics
Data Structures
  • Please sign in or sign up to leave a comment.
  • ejini战神 Avatar

    JS Node 14. should be enabled

  • ejini战神 Avatar
    • Ruby function name should use snake_case
  • ejini战神 Avatar
    • Python function name should use snake_case

    • New test framework should be used

  • ejini战神 Avatar
    • Description should be language-agnostic

    • Example tests code blocks should be reformatted

    • Should also mentioned about the relative error must be calculated using the unrounded estimate for pi

  • RealKenshiro Avatar

    A small precision :

    relError= abs(real Val of Pi - estmimated Val of Pi) / (real Val of Pi) * 100 where estmimated Val of Pi is NOT rounded.

  • dyoho001 Avatar

    I don't know if anyone'll see this because it's such an old one, but when I 'attempt' it, some are solved and some aren't. The trouble comes in the radius estimation. When it gets it wrong, it's always like 1 or 2 off. Also, any tips on reducing computing speed because it's running out of time? I'm not really sure how I could make my could more concise.

  • Vinay S R Avatar

    Relative error should be calculated with unrounded value of estimate pi. Pi should be estimated to 4 places instead of 2 places. Please mention the same in the problem statemnt.

  • bouchert Avatar

    It might be helpful to mention in the description that even though the returned estimated value of pi should be rounded to four decimal places, the relative error must be calculated using the unrounded estimate for pi. Rarely, it makes a difference.

  • HanQiao Avatar

    This comment has been hidden.

  • ekailia Avatar

    Need help to understand relError "rounded with two decimals". Why 0.0703488232816 expects '7.04%' and 0.0588531595204 expects '5.88%'?

    why not 7.03% and 5.89%?

    Interesting kata.

  • Voile Avatar

    Approved

  • dcsmith Avatar

    Cool Kata! Only minor thing is the relative error rounding requirement says 2 decimals, but if the relative error rounds evenly to one digit after the decimal point, the test is expecting only one digit, not two.

  • ChristianECooper Avatar

    Nice Kata, I have a solution, but I'm having real difficulty interpreting the error percentage requirement.

    Do you want the answer rounded to 4dp?

  • SleepingCode Avatar

    This comment has been hidden.