-
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
-
Find the largest value in the 3D matrix
1566 Solvers
-
Matrix indexing with two vectors of indices
739 Solvers
-
Remove the two elements next to NaN value
662 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
12452 Solvers
-
489 Solvers
More from this Author56
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!