Why are integrals and summations useful in computer science and what do these function mean?

105 Views Asked by At

I am reading my way through an introductory MIT computer science book called Structure and Interpretation of Computer Programming, and while I understand the programming and logic behind the book, some of the math is beyond my level at this point. I'm in high school pre-calculus and I understand the basics of Logarithms, Conic Sections, Trigonometry as the most advanced stuff I've done, and while Logarithms have been very useful to me here, the book just goes beyond my level of math with Summation and Integrals. Can anyone explain what these mean?

At one point the book talks about recursively computing $\frac{1}{1 * 3} + \frac{1}{5 * 7} + \frac{1}{9 * 11} + \cdots$, and that this series converges to $\frac{\pi}{8}$.

At another point it mentions approximating a definite integral using the following formula:

$$\int_{a}^{b} f = \Bigg[ f \Bigg( a + \frac{dx}{2}\Bigg) + f \Bigg( a + dx + \frac{dx}{2}\Bigg) + f \Bigg( a + 2dx + \frac{dx}{2}\Bigg) + \cdots \Bigg]dx$$

Finally the most important one to me, and this one makes more sense to me than the previous ones, is an exercise which says to define a procedure that takes as arguments f, a, b, and n and returns the value of the integral, computed using Simpson’s Rule (the integral of a function f between a and b is approximated as $\frac{h}{3}(y_0 + 4y_1 + 2y_2 + 4y_3 + 2y_4 + \cdots + 2y_{n-2} + 4y_{n-1} + y_n)$ where $h = \frac{b - a}{n}$ for some even integer n and $y_k = f(a + kh)$).

What does all this mean? I've looked ahead and this is pretty much the extent of the maths required for this book, and I really think learning this will be valuable to me in the future.