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. <br>
<br>Cheers, <br>Dave<br><br><div class="gmail_quote">On Mon, Feb 9, 2009 at 3:32 PM, <span dir="ltr"><<a href="mailto:danprager@optusnet.com.au">danprager@optusnet.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
> divide the interval into two parts: [a,(a + b/2)] and [(a + b/2),b];<br>
<br>
</div>Try: [a,(a+b)/2 and [(a+b)/2, b]<br>
<br>
(a+b)/2 is the mid-point between a and b: (a + b/2) ain't.<br>
<br>
-- Dan<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
> dave yrueta <<a href="mailto:dyrueta@gmail.com">dyrueta@gmail.com</a>> wrote:<br>
><br>
> Hi All --<br>
><br>
> Am sending out a message in a virtual bottle for help with HtDP<br>
> exercise 23.4.1, reproduced below:<br>
><br>
> A general integration function must consume three inputs: a, b, and<br>
> the function f. The fourth part, the x axis, is implied. This suggests<br>
> the following contract:<br>
><br>
> ;; integrate : (number -> number) number number -> number<br>
> ;; to compute the area under the graph of f between a and b<br>
> (define (integrate f a b) ...)<br>
> Kepler suggested one simple integration method. It consists of three<br>
> steps:<br>
><br>
> divide the interval into two parts: [a,(a + b/2)] and [(a + b/2),b];<br>
><br>
> compute the area of each trapezoid; and<br>
><br>
> add the two areas to get an estimate at the integral.<br>
><br>
> Exercise 23.4.1. Develop the function integrate-kepler. It computes<br>
> the area under some the graph of some function f between left and<br>
> right using Kepler's rule.<br>
><br>
> Specifically, I'm stuck at the "create examples" part of the design<br>
> recipe, because I don't understand the "integration method" outlined<br>
> by the exercise.<br>
><br>
> First, what does it mean to "divide the interval into two parts?"<br>
> Suppose I substitute values for variables a and b (a=3 and b=6). I<br>
> end up with a pair of values: [3, 6] and [6, 6]. Are these x,y<br>
> coordinates for points on a graph? If so, how do they relate to the<br>
> second step of the integration method, which is to determine the area<br>
> for "each trapezoid?"<br>
><br>
> I know the area for a trapezoid = a (b1 + b2 /2) where a is the<br>
> altitude, and b1 and b2 are the length of the two bases. My problem<br>
> is deriving values for a, b1 and b2 from the integrate-kepler function<br>
> arguments.<br>
><br>
> Finally, I have no idea how argument f, the line function, fits into<br>
> all this. I don't even know what a function for a line looks like (y<br>
> = x + 10?)<br>
><br>
> HtDP supplies an illustration to help visualize the problem (http://<br>
> <a href="http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-29.html#node_sec_23.4" target="_blank">www.htdp.org/2003-09-26/Book/curriculum-Z-H-29.html#node_sec_23.4</a>). I<br>
> haven't the faintest idea how to interpret it:<br>
><br>
> I'm sure someone even casually acquainted with basic calculus could<br>
> solve this problem easily. Unfortunately, I'm relatively math-<br>
> illiterate, so figuring out how all the parts fit together has eluded<br>
> me. I did manage to solve the other mathematical examples which<br>
> appeared earlier in the chapter because the mechanics of determining<br>
> the solution appeared clear to me. Not so here. I'm hoping that if<br>
> someone can help me formulate some examples, I'd be on my way.<br>
><br>
> Thanks!<br>
><br>
> Dave Yrueta<br>
</div></div>> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>
</blockquote></div><br>