[plt-scheme] Re: HTDP - evidently not for everyone.
On Feb 12, 2010, at 12:41 PM, wooks wrote:
> We formed a human list in class. Each member was allocated a number.
>
> I asked them who is (first human-list). They told me.
> I asked them which bit is (rest human-list). They showed me.
> I asked them what is the value of (first human-list). They told me.
> I asked them when (first human-list) is being added to (sum (rest
> human-list)) what value is being passed from (sum (rest human-list)).
> They told me.
>
> I moved my way down the human list. At every stage they told me what
> constituted (rest human-list) and what the value of (sum (rest human-
> list)) was.
Sounds good.
> Is that active enough.
Probably; it may be that in this case the difficulty was the leap
from human-list to Scheme-list. So the next thing I would do is
write a Scheme list with the exact same numbers in the exact same
order and ask the exact same questions. Then write a different
Scheme list with different numbers and ask the exact same questions.
Which you may well have also done. So what is the next problem to
give them?
count-list is fairly similar, but LOOKS different to your students
because it doesn't actually use the elements of the list. Another
possibility is "concat-all", which takes in a list of strings and
concatenates them into one long string; its solution is isomorphic to
that of "sum", but it uses a different data type.
You could try "sum-squares", which adds up the squares of the
numbers. This does introduce an additional concept -- applying a
unary function to each element before combining it with the rest --
but it's not too hard to understand, and it still uses addition, and
the answer to the base case is the same.
If you're working with graphics, and either 2htdp/image or my
teachpacks, you could next write a function "beads" that takes a list
of numbers and produces an image of a bunch of circles of the
specified radii, side by side:
(check-expect (beads (list 3 10 8)) (beside (circle 3 "outline"
"black") (circle 10 "outline" "black") (circle 8 "outline" "black")))
This one is isomorphic to "sum-squares"; whether your students find
it easier or harder depends on how scared they are of "math".
Stephen Bloch
sbloch at adelphi.edu