موقع الرياضيات العربية أون لاين

أ. محمد عبدالمنعم الملط
مؤسس الموقع يرحب بكم
فى
موقع الرياضيات العربية أون لاين
أشهر مواقعى
www.mathtech.co.nr

برمجيات الرياضيات لجميع المراحل التعليمية


    Tower of Hanoi برج هانوى برمجيات بلغة javascript

    شاطر
    avatar
    Admin
    Admin

    عدد المساهمات : 100
    تاريخ التسجيل : 16/02/2011

    Tower of Hanoi برج هانوى برمجيات بلغة javascript

    مُساهمة  Admin في الأربعاء فبراير 16, 2011 11:49 am


    Tower of Hanoi برج هانوى
    برمجيات بلغة javascript





    Tower of Hanoi

    According to the legend of the Tower of Hanoi (originally the "Tower of Brahma" in a temple in the Indian city of Benares), the temple priests are to transfer a tower consisting of 64 fragile disks of gold from one part of the temple to another, one disk at a time. The disks are arranged in order, no two of them the same size, with the largest on the bottom and the smallest on top. Because of their fragility, a larger disk may never be placed on a smaller one, and there is only one intermediate location where disks can be temporarily placed. It is said that before the priests complete their task the temple will crumble into dust and the world will vanish in a clap of thunder.
    Does this make mathematical sense?
    In the classic math problem, there are three posts. Disks of different sizes (call the number of disks "n") are placed on the lefthand post, arranged by size with the smallest on top. You are to transfer all the disks to the righthand post in the fewest possible moves, without ever placing a larger disk on a smaller one. One move is considered to be moving one disk from one post to another post.
    How many moves will it take to transfer n disks from the left post to the right post?
    Let's look for a pattern in the number of steps it takes to move just one, two, or three disks. We'll number the disks starting with disk 1 on the bottom.
    1 disk: 1 move






    Move 1: move disk 1 to post C


    2 disks: 3 moves
    Move 1: move disk 2 to post B
    Move 2: move disk 1 to post C
    Move 3: move disk 2 to post C



    3 disks: 7 moves
    Move 1: move disk 3 to post C
    Move 2: move disk 2 to post B
    Move 3: move disk 3 to post B
    Move 4: move disk 1 to post C
    Move 5: move disk 3 to post A
    Move 6: move disk 2 to post C
    Move 7: move disk 3 to post C



    شغل السكربت من الرابط

    لعبة برج هانوى أون لاين

      الوقت/التاريخ الآن هو الإثنين أكتوبر 23, 2017 9:53 pm