<div>Hi Marco</div> <div>&nbsp;</div> <div>Everything you told me makes perfect sense to me now.&nbsp;&nbsp;I just wasn't used to the idea of recursion.</div> <div>&nbsp;</div> <div>I can picture a&nbsp;function with one recursion is something.&nbsp; I picture the inputs cycling back to the top of the function, one by one, like people riding a Ferris wheel.&nbsp; The syntax still looks kind of paradoxical to me, but I can say, OK it's just circling around.</div> <div>&nbsp;</div> <div>Two recursions, on the other hand, are totally beyond me.&nbsp; My mind just goes blank.&nbsp; I realize that I should try to think of each function separately, but it is still very confusing.&nbsp; </div> <div>&nbsp;</div> <div>You gave me the following advice, which ALMOST did the trick:</div> <div>&nbsp;</div> <div>"Here is where I believe you are really stuck....How do you insert a letter everywhere in (rest a-word)? Once you have this list <U>(call it R)</U> all you need is to
do something with (first a-word).&nbsp; Where does it have to go in each of R?"</div> <div><BR>When you said, "call it R," I did get a sort of picture in my mind of the result of the recursion as a unit, a thing, instead of all these arrows going around in circles all over the place.&nbsp; </div> <div>&nbsp;</div> <div>Then, in your&nbsp;last email, you basically gave me the answer by saying:</div> <div>"It is easy to do using&nbsp;(add-letter-to-all&nbsp; &lt;letter&gt;&lt;list-of-words&gt;). What you need now is to create all the words possible from letter and (rest a-word)."&nbsp;&nbsp; </div> <div>&nbsp;</div> <div>At that point it became clear to me how I could plug in "insert...(rest word)" into &lt;list-of-words&gt;, just like any list.</div> <div>&nbsp;</div> <div>I personally think that Matthias's idea of tables is probably the best way to explain these recursive helper functions.&nbsp; </div> <div>&nbsp;</div> <div>The problem was that he didn't really
explain the fourth table to me.&nbsp;&nbsp;&nbsp;Hopefully in HtDP/2 he will flesh it out like the way you explained it.&nbsp; Section 12.2 could include an introduction like this:&nbsp;</div> <div>&nbsp;</div> <div>"This section is about Recursive Auxiliary functions.&nbsp; We have already used basic recursion in functions that process lists.&nbsp; Now we are going to use recursive helper functions inside other recursive functions.&nbsp; </div> <div>&nbsp;</div> <div>"For example, A-Function&nbsp;is constructed with&nbsp;a recursive expression--A-Function (rest X)--that is input into a&nbsp;helper function, A-Helper, like this:</div> <div>&nbsp;</div> <div>(define (A-Function X) </div> <div>(...(first X)...(A-Helper (A-Function (rest X)))&nbsp; </div> <div>&nbsp;</div> <div>"The inputs to A-Function may pass through&nbsp;2 or more recursive functions.&nbsp; For such complex problems, it is useful to use a table...."</div> <div>&nbsp;</div> <div>...And explain
clearly what the fourth column&nbsp;of the table is all about.&nbsp;</div> <div>&nbsp;</div> <div>Thanks again for your help,</div> <div>&nbsp;</div> <div>cooke</div> <div>&nbsp;</div> <div>&nbsp;</div> <div>In fact, I should have figured it already from reading Section 12.2, Recursive Auxiliary Functions, which introduces the concept which got me stuck.&nbsp; </div> <div>&nbsp;</div> <div>Unfortunately, the Section only explains it indirectly through the problem of "insertion sort":&nbsp; </div> <div>&nbsp;</div> <div>"Inserting a number into a sorted list isn't a simple task. We may have to search through the entire list before we know what the proper place is. Searching through a list, however, can be done only with a function, because lists are of arbitrary size and processing such values requires recursive functions."</div> <div>&nbsp;</div> <div>In retrospect, this paragraph could have been enough to get me through 12.4.2, but at the time it just did not
impress on me the enormous leap I would have to make in my mind.&nbsp; </div> <div>&nbsp;</div> <div><BR><B><I>Marco Morazan &lt;morazanm@gmail.com&gt;</I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Dear Cooke,<BR><BR>I am delighted that you solved the problem. Well done! :-)<BR><BR>I also thank you for that summary of your thoughts through the<BR>process. They provide me with insight as to what kind of advice works<BR>and what those who are stuck are thinking.<BR><BR>I am curious, however, about one more thing regarding the<BR>comments/ideas I provided to you. In one of my messages (the last one<BR>I believe), I tried to explain to you (in mostly prose) how the<BR>problem was decomposed into simpler and simpler problems. Was that<BR>useful at all? Did it complement the tables you were creating well or<BR>was that too abstract to be
useful?<BR><BR>Thanks,<BR><BR>&nbsp;Marco<BR></BLOCKQUOTE><BR><p>&#32;
<hr size=1>Like movies? Here's a limited-time offer: <a href="http://us.rd.yahoo.com/evt=47522/*http://tc.deals.yahoo.com/tc/blockbuster/text4.com
">Blockbuster Total Access</a> for one month at no cost.