Problem 43592. Sample from random roulette
Solution Stats
Problem Comments
-
8 Comments
See my new solution which takes advantage of the weakness of your test suite. It is essentially "deterministic", but it passes your test.
Hi, Jakub. One more fairly simple check you could add would be to ensure that the result of diff( output ) does not produce mostly zeros. .... BTW, you do not need to put all checks inside one assert command. Indeed, it may be helpful for players to know which assertion is tripping them up, with the addition of text error messages. —DIV
To be fair, Jakub, it is certainly a lot of work to set up a robust Test Suite for this problem. It is not possible to make a perfect Test Suite that will stop all cheating, so the plan would be just to make cheating difficult in comparison to a genuine solution. BTW, the leeway you allow on the sums (±50%) seems too generous. According to https://www.mathworks.com/matlabcentral/cody/problems/43592-sample-from-random-roulette/solutions/1351272 it seems ±2% would be about right, or perhaps ±5% if you still want to be extremely conservative / very generous.
Solution Comments
Show commentsProblem Recent Solvers21
Suggested Problems
-
13577 Solvers
-
Find common elements in matrix rows
2665 Solvers
-
506 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
767 Solvers
-
Find the area of the four walls
280 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!