<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">That definitely makes the iterative
solution easier to see. Not sure if it helps with seeing the
recursive solution, but you're right, it *is* the "natural" way to
do the Towers.<br>
<br>
On 2/15/15 7:10 PM, KC wrote:<br>
</div>
<blockquote
cite="mid:CAMLKXykWgrR7h_De68B5S8weuS8cJkKkM5YJX2qz9tMcusRL_w@mail.gmail.com"
type="cite">
<p dir="ltr">The interesting way is to view the pegs not in a
straight line but in another conic section ...<br>
<br>
</p>
<p dir="ltr">--<br>
--</p>
<p dir="ltr">Sent from an expensive device which will be obsolete
in a few months! :D</p>
<p dir="ltr">Casey<br>
</p>
<div class="gmail_quote">On Feb 15, 2015 12:54 PM, "Dudley Brooks"
<<a moz-do-not-send="true"
href="mailto:dbrooks@runforyourlife.org">dbrooks@runforyourlife.org</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">In my
opinion, advising Mr Wobben to watch the pattern of moves will
*not* lead him to the recursive solution, since the pattern of
moves is really iterative.<br>
<br>
My hint would be to remember the very nature of recursion
itself (for *any* problem): Do the first step. Then (to put
it very dramatically) do *everything else* in *a single
step*! (Realizing that "everything else" is really the same
problem, just made slightly smaller.)<br>
<br>
Note: "A single step" might itself have more than one step.
My point is that recursion consists of (to put it
humorously): To do ABCDEFGHIJKLMNOPQRSTUVWXYZ, first you do
A, then you do BCDEFGHIJKLMNOPQRSTUVWXYZ. And, of course,
"first" might actually be "last"! And remembering the story
of the Gordian Knot might help too. (I apologize that trying
not to be too explicit in the hint possibly makes it even more
obscure.)<br>
<br>
Here's another hint that's useful for all kinds of programming
problems, not just recursion: Most problems consist of not
only what you're trying to solve, but also what the
restrictions are on what you're allowed to do to solve it.
Often some good insights come from imagining how you could
solve the problem if you could ignore one or more of the
restrictions (that's what I meant by the Gordian Knot
reference). So for the Towers of Hanoi, think about what the
restrictions are on what kind of moves you're allowed to
make. Remove one of those restrictions.<br>
<br>
(Speaking of the iterative solution, the fun thing about
actually physically doing the Towers of Hanoi is that, even
though you're doing it by remembering the steps of the
iterative pattern, as you watch the towers grow and shrink you
can kind of "see" the recursion.)<br>
<br>
On 2/15/15 12:51 AM, Roelof Wobben wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
YCH schreef op 15-2-2015 om 9:45:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
How about if I say "Actually target was c not b and here
is one more<br>
disc. I put it on a. Now you should move all to c"<br>
<br>
<br>
</blockquote>
<br>
Hanoi 1 a b c<br>
<br>
A -> C<br>
<br>
Hanoi 2 a b c<br>
<br>
A -> B<br>
A -> C<br>
B -> C<br>
<br>
Hanoi 3 a b c<br>
<br>
A -> C<br>
A -> B<br>
C -> B<br>
A -> C<br>
B -> A<br>
B -> C<br>
A -> C<br>
<br>
<br>
Roelof<br>
<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a moz-do-not-send="true"
href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a moz-do-not-send="true"
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners"
target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a moz-do-not-send="true" href="mailto:Beginners@haskell.org"
target="_blank">Beginners@haskell.org</a><br>
<a moz-do-not-send="true"
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners"
target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>