-
4 Comments
^Agreed.
Making a sophisticated test suite for such case(s) seems to be an interesting challenge!
@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.
Suggested Problems
-
Return unique values without sorting
935 Solvers
-
Longest run of consecutive numbers
5832 Solvers
-
Matlab Basics - Convert a row vector to a column vector
640 Solvers
-
Electrical Diode Current Calculation
772 Solvers
-
1017 Solvers
More from this Author56
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!