-
4 Comments
Show
1 older comment
Peter Wittenberg
on 11 Aug 2012
This is not two random rolls. The second number will never match the first, so the statistical distribution is not correct, although the test suite is not sophisticated enough to catch it.
Matthew M.
on 28 Aug 2012
^Agreed.
Dyuman Joshi
on 10 Aug 2024
Making a sophisticated test suite for such case(s) seems to be an interesting challenge!
Christian Schröder
on 12 Aug 2024
@Dyuman Monte Carlo would probably work: call the function 1e4 times, check how often the two rolls are the same, and test whether the result is (statistically) significantly different from the expected value. Setting a very high significance level to avoid false positives would allow valid solutions to pass with a very high probability while catching ones such as this.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!