[plt-scheme] HtDP Exercise 23.4.1

From: Daniel Prager (danprager at optusnet.com.au)
Date: Tue Feb 10 02:22:50 EST 2009

Hi Dave

It seems to me that part of the art of programming is learning enough  
about the domain that you are modeling to get by.  Otherwise how can  
you tell if your program is correct?

Unfortunately math(s) is a bugbear for many (most?) people at some  
level, and especially calculus.  But I believe that one of the side- 
aims of htdp is to help people better understand some fundamental (I  
won't say "basic") mathematical concepts, brought to life and  
clarified in programs.

I am not sure if that is the kind of answer that you want to hear, but  
good luck regardless!

-- Dan "give math a chance" Prager


On 10/02/2009, at 12:34 PM, David Yrueta wrote:

> Hi Dan --
>
> Thanks for the reply. Unfortunately for me, I'm not mathematically  
> literate enough to understand how to derive the bases and altitudes  
> of the trapezoids from the proposed function arguments. Or in other  
> words, I don't understand how the function arguments relate to one  
> another, and what the terms [a,(a+b)/2 and [(a+b)/2, b] mean once  
> the argument values are plugged in. Never made it past high school  
> trig, and the metaphysics of Being studied in my university  
> philosophy courses didn't have much to say about areas under a  
> curve :)
>
> I'm hoping that the principal author of the problem (MF) might come  
> to my rescue here.
>
> Thanks again for the time!
>
> Cheers,
> Dave
>
> On Mon, Feb 9, 2009 at 5:02 PM, <danprager at optusnet.com.au> wrote:
> Hi Dave
>
> Without having the time (or patience) to read the example, it's  
> almost certainly a divide-and-conquer approach.
>
> You use a trapezoid to approximate the area under the curve.   
> There's some error involved, but by using 2 (or 4 or ..) smaller  
> trapezoids the net error using the smaller trapezoids gets smaller  
> as they get more numerous, because the multiple line segments hug  
> the curve more closely.
>
> Drawing pictures with an example non-linear function should help a  
> lot here.
>
> -- Dan
>
>
>
> > David Yrueta <dyrueta at gmail.com> wrote:
> >
> > Thanks Dan.  Looks like the original formatting from HtDP didn't  
> carry
> > over
> > from my cut-and-paste.  Still don't really understand how this  
> relates
> > to
> > the question of computing the "area of each trapezoid," though.
> >
> > Cheers,
> > Dave
> >
> > On Mon, Feb 9, 2009 at 3:32 PM, <danprager at optusnet.com.au> wrote:
> >
> > >
> > > > divide the interval into two parts: [a,(a + b/2)] and [(a + b/ 
> 2),b];
> > >
> > > Try: [a,(a+b)/2 and [(a+b)/2, b]
> > >
> > > (a+b)/2 is the mid-point between a and b: (a + b/2) ain't.
> > >
> > > -- Dan
> > >
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090210/43238139/attachment.html>

Posted on the users mailing list.