正在加载图片...
6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 6.5.2 Integration as a procedure Remember from calculus that integration is just the idea of Integration under a curve f is given roughly by summation. That is, to integrate a function f, we take the area of dx(f(a)+f(a+dx)+f(a+2dx)+.+f(b) a set of rectangles that approximate the area under f, and this is just a sum of a set of values, all scaled by the width of the rectangles Slide 6.5.3 Integration as a procedure That is just shown here dx(f(a)+f(a+dx)+f(a+ 2dx)+,+ f(b) Integration as a procedure Slide 6.5.4 o capture the idea of integration, we just build on the idea of dx(f(a)+ f(a+dx)+f(a+2dx)+,.+ f(b) summation. In particular, we can reduce integration to a simpler problem, that of summation. Thus we simply sum f from a to b Note the use of f as a parameter for the term to be added. We use the number of terms in the summation(or the number of sample points )to determine the increment delta to add at each (let ((delta(/(ba)n)) Note that the inputs to sum are all of the expected type. And ((sum f a delta n) delta)) sum we know returns a number, so we can complete the process by multiplying this number by the number delta Clearly as we increase n, the number of terms summation, we get a better approximation to the integral6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 6.5.2 Remember from calculus that integration is just the idea of summation. That is, to integrate a function f, we take the area of a set of rectangles that approximate the area under f, and this is just a sum of a set of values, all scaled by the width of the rectangles. Slide 6.5.3 That is just shown here. Slide 6.5.4 To capture the idea of integration, we just build on the idea of summation. In particular, we can reduce integration to a simpler problem, that of summation. Thus we simply sum f from a to b. Note the use of f as a parameter for the term to be added. We use the number of terms in the summation (or the number of sample points) to determine the increment delta to add at each stage Note that the inputs to sum are all of the expected type. And sum we know returns a number, so we can complete the process by multiplying this number by the number delta. Clearly as we increase n, the number of terms in the summation, we get a better approximation to the integral
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有