Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: tower hanoi problem (Roelof Wobben)
2. Re: tower hanoi problem (Roelof Wobben)
----------------------------------------------------------------------
Message: 1
Date: Mon, 16 Feb 2015 08:59:41 +0100
From: Roelof Wobben <[email protected]>
To: [email protected], The Haskell-Beginners Mailing List -
Discussion of primarily beginner-level topics related to Haskell
<[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Thanks,
My way of working is one problem at the time.
So first solve the itterate one and after that I gonna try to solve the
recursion one.
Otherwise I get confused.
Roelof
Dudley Brooks schreef op 15-2-2015 om 21:54:
> 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.
>
> 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.)
>
> 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.)
>
> 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.
>
> (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.)
>
> On 2/15/15 12:51 AM, Roelof Wobben wrote:
>> YCH schreef op 15-2-2015 om 9:45:
>>> How about if I say "Actually target was c not b and here is one more
>>> disc. I put it on a. Now you should move all to c"
>>>
>>>
>>
>> Hanoi 1 a b c
>>
>> A -> C
>>
>> Hanoi 2 a b c
>>
>> A -> B
>> A -> C
>> B -> C
>>
>> Hanoi 3 a b c
>>
>> A -> C
>> A -> B
>> C -> B
>> A -> C
>> B -> A
>> B -> C
>> A -> C
>>
>>
>> Roelof
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
------------------------------
Message: 2
Date: Mon, 16 Feb 2015 09:00:11 +0100
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
KC schreef op 16-2-2015 om 4:10:
>
> The interesting way is to view the pegs not in a straight line but in
> another conic section ...
>
Still no clue what you mean
Roelof
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 80, Issue 31
*****************************************