An horizon broading course on Computer science

3 replies · 2K views · last reply
athrun200
Messages
275
Reaction score
0

Homework Statement


This is really a horizon broading, even music students and histroy students can take this course.
So I think this HW problem is very simple, but it is too simple that I am afraid I will do it wrongly.


Homework problem text: Problem (10 points). In class we discussed a recursive method for the Tower of Hanoi: to move n discs from peg A to peg C, move n-1 discs from A to B, move disc #n from A to C, then move n-1 discs from B to C. Asks to trace the execution when n = 4.



Homework Equations


My Dr. said we don't need to know the C++ or any other cmputer language to do this question and he tell us to searh what is the meaning of "trace" in order to do this question.

But I found it difficult to understand on the web(most of them contain computer language)



The Attempt at a Solution



My thought is that, substitute n=4 into the 3 statements, then it's done.
But it contain 10 marks! So I better ask it.
 
Attachments
  • Homework problem text: 'Problem (10 points)'. Recursive Tower of Hanoi method: to move n discs from peg A to peg C, move n-1 discs from A to B, move disc #n from A to C, move n-1 discs from B to C. Asks to trace execution when n = 4.
    hw1.PNG
    23.6 KB · Views: 584
I would think you'd write a list--of each step as you execute it--until you can write "Finished!" Of course, you won't write the letter n each time, you'll write a numeral. :smile:

And if you are chasing marks, you might draw what the two towers look like after each move. :smile: :smile:
 
I have submitted the first attempt to my teacher and I got the following feedbacks.

I would like to see more "steps" before your step (1),
i.e., moving 3 discs from A to B.


However, I can't think of any extra steps before step 1.
Can anyone help me?
 
Attachments
  • Handwritten Tower of Hanoi solution for n = 4 in three stages: pegs A, B and C drawn, with discs 1 to 4 on peg A, then three discs moved to B, disc 4 moved to C, and the three discs moved from B to C, ending with 'Done!!'.
    SDC15002.jpg
    10.5 KB · Views: 516
I think you should find some coins of increasing diameter, mark 3 spots on the table as your towers, and work through this yourself. Don't be afraid to find practical ways to solve/simulate/investigate maths problems, often you'll discover where your "paper calculations" are going wrong, especially when you think YOU CAN'T POSSIBLE LEARN ANYTHING more by looking at practical methods.

After each and every move of a coin, sketch the 3 towers.