-
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 all elements less than 0 or greater than 10 and replace them with NaN
15612 Solvers
-
1419 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
484 Solvers
-
708 Solvers
-
Flip the vector from right to left
9501 Solvers
More from this Author56
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!