A bug starts at one vertex of a cube and moves along one edge at a time. It must make exactly 7 moves and end at the vertex opposite its starting vertex. The bug is not allowed to traverse the same edge on two consecutive moves. How many different walks are possible?
Solution ApproachShowHide
Step-by-step approach
Label vertices by parity of coordinates. Track state as (current vertex type, last edge direction). Use dynamic programming / transfer matrices over the cube graph with the 'no-repeat-edge' constraint for 7 steps ending at the antipodal vertex.
Ready for more competition problems?
Practice the full SolveFire course and compete in ranked math battles — free to play.