7 kyu
Statistics 101: Coin Sampling
187 of 240Voile
Loading description...
Fundamentals
Mathematics
Statistics
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.
This comment has been hidden.
This comment has been hidden.
Python translation
PHP Translation Kumited - please accept :D
Done!
This comment has been hidden.
This is the only way. The more you flip, the more is the probability you'll pass the tests; and with true random numbers there would still be some chance of failure, even if so small that the end of the world would be more probable.
This comment has been hidden.
Many thanks for your response @Voile, just wanted to clarify that this was indeed the aim of this Kata :D
I don't think it's possible to find the true probability up to any value of error, it's only possible to find it up to a given probability of the found value having some absolute error. A coin with any p, 0 < p < 1, may turn the same side any finite number of times in a row.
Indeed, in statistics we can only talk about confidence intervals. I originally chose an absolute error of 0.1% and found out that it requires too many trials, so it's now at 1%.
Extended reading: https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval