If you've solved the permutations problem, then in my opinion, you have the ability to solve any problem in the book. Sounds like you're just having a weird block. Don't worry -- my guess is it happens to everyone!<div>
<br></div><div>The question Wooks put to you in one of his previous posts -- how can you preserve the original value of n? -- is, I believe, the key to this exercise. </div><div><br></div><div>Try writing a function which accepts a natural number n>0, and returns a list of numbers from 1 to n, but with n leading each number on in the list:</div>
<div><br></div><div>;;test-function : number -> list-of-numbers</div><div>;;accepts n>0, returns a list-of-numbers from 1 to n with n leading each number on the list</div><div>;;(check-expect (test-function 1) (list 1 1)) </div>
<div>;;(check-expect (test-function 2) (list 2 1 2 2))</div><div>;;(check-expect (test-function 3) (list 3 1 3 2 3 3))</div><div><br></div><div>No tricks here -- this is a pretty straightforward function to design. If you can do it, which I'm sure you can, then you've figured out how to write a function which 1) preserves the original input, and 2) uses it as a boundary condition to create a list of numbers. From there you're only a few minor tweeks away from the solution to tabulate-div -- and those minor tweeks are present in your previous attempts. </div>
<div><br></div><div>When you figure out the solution, please don't post it to the list. But if you like, I'd be happy to look at it offline. </div><div><br></div><div>Good luck!</div><div><br></div><div>Dave Yrueta</div>
<div><br></div><div><br></div><div><br><div class="gmail_quote">On Sun, Nov 7, 2010 at 6:16 AM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Nov 7, 2010, at 1:29 AM, Ken Hegeland wrote:<br>
<br>
> I felt very dumb trying to figure this problem out.<br>
<br>
<br>
</div>You shouldn't feel dumb. I suspect that this problem needs to go because it doesn't drive home the points I had had in mind when I wrote it. Sorry<br>
<font color="#888888"><br>
-- Matthias<br>
</font><div><div></div><div class="h5"><br>
_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
</div></div></blockquote></div><br></div>