4 kyu
Dice rolls threshold
43 of 147kirilloid
Loading description...
Probability
Combinatorics
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Very mathematical problem, nice kata however.
python new test frameworks
My received values walk next to the answer with an error of hundredths. I'm really shocked that the decision honestly did not go...Does anyone have a similar problem? Help.
This comment has been hidden.
Python, sample tests:
This line is incorrect.
This problem can be done purely by mathematics, and is definitely not 3kyu. I'd say 5kyu at most.
Actually the thing is it cannot be solved w/o some math. Knowing math, there's not much of a programming here, thoug—I agree on that.
This comment has been hidden.
This comment has been hidden.
Any reason why you don't use
Rational
(akaData.Ratio.Ratio Integer
) orData.Ratio.Ratio Int
instead ofDouble
?Well, first of all I have not enough experience with numeric types in Haskell. So I analyzed this and it turns out that numbers are not as big as I though:
log2 100^20
, which is around132
bits.And actually we don't need such precision. Even though I calculate everyting as
Integer
s to the end in my solution. So I've tried to migrate to Rational and everything seems OK now. Do you think it worths changing?BTW I'd appreciate if you give me some good articles on when Haskell number systems. Cause hackage gives only very basic info.
looks like a typo in the line: ... the probability of that a die with N sides rolled M times (NdM in AD&D notation) ... I suppose, it should be "(MdN in AD&D notation)", as previous in the description the examples are: P(1d6 >= 4), P(2d6 >= 3)
You're right. I've fixed that, thanks.