There is a vertical stack of books
marked 1, 2 and 3 on Table A, with 1 at the bottom and 3 on the top. These are
to be placed vertically on Table B with 1 at the bottom and 2 on the top, by
making a series of moves from one table to the other. During a move, the
topmost book, or the topmost two books, or all the three, can be moved from one
of the tables to the other. If there are any books on the other table, the
stack being transferred should be placed on top of the existing books, without
changing the order of books in the stack that is being moved in that move. If
there are no books on the other table, the stack is simply placed on the other
table without disturbing the order of books in it. What is the minimum number
of moves in which the above task can be accomplished?
For min steps 1st move would be to
place book 3 from A to B 2nd move would be to place book 2 from A to
B, 3rd move would be to place book 2 and 3 from B to A. Last move
would be to place books 2,3,1 from table A to Table B. So 4 moves are atleast
needed.