Problem 44756. Lights Out 5 - 5x5, 10 moves
Solution Stats
Problem Comments
-
8 Comments
There seems to be a problem with Lights Out 5. Test cases 4 and 11 can be solved in fewer than 10 moves. Case 4 is solved by [1 3 5 21 23 25], which is easily verified by hand. Case 11 takes 9 moves -- [1 3 7 12 15 16 22 24 25].
@goc
1 William is right.
2 Next problem of this series could be "Lights Out - 5x5, from 3 to 10 moves", I think it is more difficult than this one.
@goc3 Sorry for misspell your name, but I can not delete the comment because of bug of cody.
@William: thanks for catching that. Actually, test case 4 was intentional, as it can also be solved in 10 moves. But, to prevent future confusion, I have replaced it. And, test case 11 was indeed an error—it has been fixed.
@li haitao: the test suite has been updated. Also, problem #7 in the series (not out yet, but will be soon) is similar to what you suggest. Thanks for the comments.
@goc3
A piece of advice, measure the running time(using tic, toc, for example) in the test suit to see which solution is fast.
@li haitao: I got 3.838179s (total time for test suite) for William's solution and 0.986936s (1/4 the time) for your sped-up version. Impressive.
i am surprised about the fact that some test admit a shorter solution than 10 moves :S
Problem Recent Solvers14
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
43985 Solvers
-
3112 Solvers
-
275 Solvers
-
319 Solvers
-
How long is the longest prime diagonal?
376 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!