![]() ![]() See the history of edits if they seem confusing. Note: Some of the comments below refer to older versions of the questions. The description there is in terms of cards.) (See my blog post for an example run of this algorithm if it's not clear. Clearly there are $2^n$ states with at most $n$ moves each. It is also known as the Tower of Brahma puzzle and appeared as an intelligence test for apes in the film Rise of the Planet of the Apes (2011) under the name 'Lucas Tower. A move affects the state by deleting a number in this list and the energy consumed by the move is the absolute difference between the deleted number and the number coming after. The tower of Hanoi (commonly also known as the ' towers of Hanoi'), is a puzzle invented by E. Represent the initial state by the list $x_1$, $x_2$. What's the fastest such program you can find? Is the problem NP-complete? If it helps, consider a simplifications that restrict $x_k$'s to be rational, integers, integers in a certain range, etc. If the answer is N, there's no point in even attempting the task-you are too tired.) (If the answer is Y, then clearly the list of moves is proof enough that the answer is correct, so the problem is NP. The Tower of Hanoi: The 127 Solution by Mr Gareth Jones 5.0 (1) Paperback 823 FREE Delivery by Amazon 9 Rings Towers of Hanoi 4.3 (97) 4502 Free international delivery if you spend over 49 on eligible international orders Tower of Hanoi by Lambert M. Now, you'd like to write a program that tells you whether the energy you have is enough to perform the task. For example, the energy consumed by the first move is $|x_k-x_|$. ![]() The energy you consume to perform such a move is the distance traveled by the moved mini-tower. You are allowed to move a tower whose base is a disk of size k only on top of the disk with size k+1 (which may be the top of another mini-tower). Your goal is to make a tower with all n discs, consuming as little energy as possible in the process. There are n disks on the real line, one of size 1 at position $x_1$, one of size 2 at position $x_2$. This was really inspired by Solitaire, but a few people reacted with ``oh, it's like the towers of Hanoi, isn't it?'' so I'll try to pose the problem in terms of discs here. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |