Engaging students: Compound interest

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Mason Maynard. His topic, from Precalculus: compound interest.

green line

What interesting (i.e., uncontrived) word problems using this topic can your students do now? (You may find resources such as http://www.spacemath.nasa.gov to be very helpful in this regard; feel free to suggest others.)

  • A deposit of $3000 earns 2% interest compounded semiannually. How much money is in the bank after for 4 years?
  • A deposit of $2150 earns 6% interest compounded quarterly. How much money is in the bank after for 6 years?
  • A deposit of $495 earns 3% interest compounded annually. How much money is in the bank after for 3 years?

These word problems are some of the basic compound interest problems that your students learn how to do where you just plug in the correct values for their corresponding variables.

  • If you invested $1,000 in an account paying an annual percentage rate (quoted rate) compounded daily (based on a bank year of 360 days) and you wanted to have $2,500 in your account at the end of your investment time, what interest rate would you need if the investment time were 1 year, 10 years, 20 years, 100 years?
  • If you invested $500 in an account paying an annual percentage rate compounded quarterly , and you wanted to have $2,500 in your account at the end of your investment time, what interest rate would you need if the investment time were 1 year, 10 years, 20 years, 100 years?

These are the types of problems that get more difficult for the students. You want them to use compound interest to solve but then they must incorporate logs into their solutions because they are looking for time instead of interest.

green line

How does this topic extend what your students should have learned in previous courses?

With compound interest, students first learn about the simple interest formula. The only main difference is that you start to include exponents with compound interests. Then when you introduce your students to compound interest, you start to get into some more complicated problems. After they learn about compound interest and its basic problems, then you transition into logs with your students. This is used in compound interest and instead of just looking for the interest that will be accumulated after a specific amount of time, you then shift the variable around that you are looking for. The most coming type of problem that refers to this is they give you all of the information except for the amount time it takes to get a certain amount of interest. The last thing that leads up to compound interest in Calculus is when you transition from calculating the amount of interested over specific time intervals and a specific amount of times you compound it to calculating it with compounding it continuously over a specific time interval.

green line

How have different cultures throughout time used this topic in their society?

Interest is something you have to pay on a load. Depending on what side you are and how thinks go, you are either getting some more money back that what you invested or you are paying off a massive debt. Some think that the idea behind charging loans on interest came from the early days of neighbors loaning there cattle to one another. What is really unique about this is that the words in the Egyptian, ancient Greek and Sumerian languages is connected to cattle and their offspring. This leads some to believe that interest came about due to the natural increase of the herd that occurred when you loaned out your cattle.

The first evidence that comes of a compound interest problem dates back to 2000-1700 B.C. in Babylon. A clay tablet was found and the unique thing is that the interest rate use to solve it was not written. Some researchers assume that the rate was 20% due to that mainly all the other compound interest problems dating back closer to this used it. What is really crazy is that 20% worked to solve the problem. The only thing that was wrong was that the time was corresponding to the Babylon calendar of 360 days instead of our 365 days.

In 50 B.C. Cicero writes to a friend in Rome. The letter tells that he would not normally recognize more than 12 percent interest on a loan, even though a decree was passed which required money lenders to charge no more than 12 percent. Cicero would then write a few days later that they will pay back the loan in 6 years will 12 percent interest and more money will be added each year.

Resources:

Compound Interest History:

https://www.cambridge.org/core/services/aop-cambridge-core/content/view/799CB1D40CDD46F3010767BFC60F24DB/S1357321719000254a.pdf/emergence_of_compound_interest.pdf

Word Problems:

https://www.basic-mathematics.com/compound-interest-word-problems.html

http://www.sosmath.com/algebra/logs/log5/log51/log51.html

Thoughts on Numerical Integration (Part 8): Left and right endpoint rules and exploration of error analysis

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:

  • Why is numerical integration necessary in the first place?
  • Where do these formulas come from (especially Simpson’s Rule)?
  • How can I do all of these formulas quickly?
  • Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?
  • Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?
  • Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?

In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.

In the previous post in this series, I discussed three different ways of numerically approximating the definite integral \displaystyle \int_a^b f(x) \, dx, the area under a curve f(x) between x=a and x=b.

In this series, we’ll choose equal-sized subintervals of the interval [a,b]. If h = (b-a)/n is the width of each subinterval so that x_k = x_0 + kh, then the integral may be approximated as

\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n

using left endpoints,

\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n

using right endpoints, and

\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n

using the midpoints of the subintervals. We have also derived the Trapezoid Rule

\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n)] \equiv T_n

and Simpson’s Rule (if n is even)

\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{3} \left[y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{n-2} + 4 y_{n-1} +  y_{n} \right] \equiv S_n.

All of the above approximations to \displaystyle \int_a^b f(x) \, dx are precisely that — approximations. That begs the obvious question: how can we get better approximations. One obvious answer is taking more subintervals. The figures below show the left-endpoint approximations using n = 4 and n = 40 subintervals. Geometrically, it’s clear that the orange rectangles in the second picture do a better job of approximating the area under the curve. Unfortunately, simply taking more subintervals has its limitations. Using a spreadsheet as in the previous post in this series, one can implement 100 or even 1000 subintervals without much difficult. However, as demonstrated in the video below, implementing any of these methods with 10,000 subintervals is pretty time-consuming. (Tl/dw: It can take literally a couple of minutes.)

Instead of relying on sheer computational firepower, let’s instead investigate how good these numerical methods actually are. To begin, let’s explore the left-endpoint rule applied to \displaystyle \int_1^2 x^9 \, dx = 102.3 using different numbers of subintervals. The results are summarized in the table below. As n increases, the left endpoint approximations L_n are indeed getting closer and closer to the actual value of \displaystyle \int_1^2 x^9 \, dx = 102.3. Interestingly, when the width h is plotted with these approximations, the data points fall almost exactly on a straight line. The same phenomenon occurs when using right endpoints: So, it appears that the errors in both the left- and right-endpoint rules are a linear function of the size of the subintervals. Said another way, if twice as many subintervals are taken, then the error appears to go down by a factor of 2. If ten times as many subintervals are used, then the error should go down by a factor of 10. As we’ll see in the next few posts, the errors for the Midpoint Rule, the Trapezoid Rule, and especially Simpson’s Rule are much better than the errors from these two methods.

Engaging students: Infinite geometric series

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Brendan Gunnoe. His topic, from Precalculus: infinite geometric series.

green line

Curriculum:

Students can use the formula for an infinite geometric series to discover the formula for a finite geometric series. The teacher would start by posing the question “Can we use the infinite geometric series to come up with a formula for the finite version?” and writing out a series like so

\displaystyle \sum_{i=0}^\infty ar^i = ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n + ar^{n+1} + \dots

Next, the instructor could ask questions like “If we’re looking for the sum up to the nth term, where do we need to chop off the terms to get what we want?,” “Does the ending part look familiar?”, and “How can we rewrite the chopped off part so that it looks like what we already know?”. The teacher guides the students into manipulating the formula to get this result

\displaystyle \sum_{i=0}^\infty ar^i = ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n + ar^{n+1} + \dots

\displaystyle \sum_{i=0}^\infty ar^i = ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n +  \sum_{j=n+1}^\infty ar^j

 ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n = \displaystyle \sum_{i=0}^\infty ar^i - \sum_{j=n+1}^\infty ar^j

The teacher notes that the last sum can be simplified to make it easier to see by doing a substitution of k = j -n-1. Adjusting the bounds and substituting in the new index, we get

 ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n = \displaystyle \sum_{i=0}^\infty ar^i - \sum_{k=0}^\infty ar^{n+1+k}

 = \displaystyle \sum_{i=0}^\infty ar^i - \sum_{k=0}^\infty ar^{n+1}r^k

 = \displaystyle \sum_{i=0}^\infty ar^i - r^{n+1} \sum_{k=0}^\infty ar^k

Note that the two sums are identical, besides the index name, so we can factor and get

 ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n = a(1-r^{n+1}) \displaystyle \sum_{i=0}^\infty r^i

Lastly, we utilize our formula for an infinite geometric series and get

ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n = a(1-r^{n+1}) \displaystyle \frac{1}{1-r}

ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n = \displaystyle a\frac{1-r^{n+1}}{1-r}

ar^0 + ar^1 + ar^2 + \dots + ar^{n-1} + ar^n = \displaystyle a\frac{r^{n+1}-1}{r-1}

Although the infinite series requires |r|<1 , the finite version works for all real r. Although the formal proof that this is the correct formula might be beyond the scope of the intended class, it can easily be done with induction.

green line

Technology:

https://www.khanacademy.org/math/geometry-home/geometry-volume-surface-area/koch-snowflake/v/area-of-koch-snowflake-part-1-advanced

Sal Khan, one of recent history’s most well-known STEM educators, has a fantastic video that shows the relationship between a fractal known as the Koch snowflake and the geometric series. Khan works through the derivation of the formulas for the perimeter and area of an the nth­ iteration of the Koch snowflake. It turns out that both the area and perimeters for each iteration can be expressed using a geometric series, but the perimeter diverges to infinity while the area converges. Such a result makes sense intuitively since you can fit every iteration inside of a finite box that is slightly larger than the snowflake, and thus bounding the area, yet it would require an infinitely long wire to go around the perimeter of the limiting shape. Since fractals are not normally included in the math curriculum, showing how math can be used in interesting and different ways to solve problem can be very engaging for students.

green line

Culture:

There is a strong connection between geometric series, fractals, and self-similarity, all with a relatively simple nature. Fractals have been used in architecture and art for a very long time. Examples of self-similarity seen in ancient cultures include Hindu temples, with their structure being composed of self-similar units, and Islamic geometric art found in the domes of mosques.

Since the invention of the computer in the mid-20th century, more detailed and intricate digital art has been made popular. Although not exactly a geometric series, the Mandelbrot set acts very much like a fractal and was among the first of the uses of a computer to investigate the properties of fractals. It has been used in many ways to make animations, photos and other digital arts.

Another link between fractals and art can be found in the Legend of Zelda games. One of the iconic symbols of the game is called the triforce, which is an equilateral triangle that’s been cut into 4 smaller triangles with the middle piece removed. Such a shape is the first iteration of a fractal known as the Sierpinski triangle. As you can see, fractals can be found in all kinds of art, coming in many different forms.

https://en.wikipedia.org/wiki/Fractal_art

Thoughts on Numerical Integration (Part 7): Implementation with Excel

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:

  • Why is numerical integration necessary in the first place?
  • Where do these formulas come from (especially Simpson’s Rule)?
  • How can I do all of these formulas quickly?
  • Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?
  • Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?
  • Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?

In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.

In the previous post in this series, I discussed three different ways of numerically approximating the definite integral \displaystyle \int_a^b f(x) \, dx, the area under a curve f(x) between x=a and x=b.

In this series, we’ll choose equal-sized subintervals of the interval [a,b]. If h = (b-a)/n is the width of each subinterval so that x_k = x_0 + kh, then the integral may be approximated as

\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n

using left endpoints,

\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n

using right endpoints, and

\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n

using the midpoints of the subintervals. We have also derived the Trapezoid Rule

\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n)] \equiv T_n

and Simpson’s Rule (if n is even)

\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{3} \left[y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{n-2} + 4 y_{n-1} +  y_{n} \right] \equiv S_n.

Computing any of the above formulas on a hand-held calculator can tax the patience of even the most error-conscious student. Indeed, I prefer that my students, when first learning these concepts, use a spreadsheet instead of a calculator or even a computer program, as I think that the visual layout of the spreadsheet aids in understanding how the formula works. In what follows, I implement the above formulas for the integral \displaystyle \int_1^2 x^9 \, dx using n=10 subintervals, so that h = (2-1)/10 = 0.1. To implement the left-endpoint rule, I enter the labels “x” and “x^9” in cells A1 and B1 of a spreadsheet. I then enter 1 (the left endpoint) in cell A2. In cell A3, I enter “=A2+0.1”, instructing the spreadsheet to add 0.1 to the value in cell A2. Then, instead of typing all of the other values of x_k, I use the fill-down feature to repeat this pattern for cells A3 through A11. In cell B2, I enter “=A1^9”, applying the function f(x) = x^9 to the x-coordinate in cell A2. Again, I use the fill-down feature to repeat this pattern for cells B3-B11. The fill-down feature saves a lot of time! Finally, in cell B13, I enter “=0.1*SUM(B2:B11)”, adding the values in cells B2 through B11 and multiplying the sum by h. The result, 78.6581, is the approximation using the left-endpoint rule with 10 subintervals. Once this is done, the right-endpoint rule can be obtained almost for free. The only change is to change the value of cell A2 from 1 to 1.1. Everything else should automatically update. The midpoint rule is also obtained quickly by changing the value of cell A2 from 1 to 1.05, the midpoint of the first subinterval [1,1.01]. Implementing the Trapezoid Rule requires a little more work. We reset the value of A2 back to 1, the value of the left-endpoint. We also fill down the pattern one extra row (in this case, row 12). To implement the Trapezoid Rule, we have to multiply all function values (except for those at the endpoints) by 2. To implement this, I introduce column C. These weights can be typed by hand, but again the fill-down feature can speed things up. Then, in column D, I multiply the values in columns B and C. For example, the result in cell D2 is obtained by typing “=B2*C2”. Once again, the fill-down feature is used for all rows. Finally, the approximation itself is obtained by typing “=0.1/2*SUM(D2:D12)” in cell D13. After implementing the Trapezoid Rule, Simpson’s Rule is not much more effort. The biggest change is the alternating weights, so that the endpoints have weight 1 while the others oscillate between 4 and 2, ending on 4 on the second-to-last value of x. Again, these could be typed by hand, but it’s easiest to enter 4 in cell C3, 2 in cell C4, and then “=C3” in cell C5. The fill-down feature can take care of the rest of the weights. The Simpson’s Rule approximation is obtained by typing “=0.1/3*SUM(D2:D12)” in cell D13, with a new denominator of 3.

Engaging students: Computing trigonometric functions using a unit circle

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Alizee Garcia. Her topic, from Precalculus: computing trigonometric functions using a unit circle.

green line

How can this topic be used in your students’ future courses in mathematics or science?

Being able to compute trig functions using a unit circle will be the base of knowledge for all further calculus classes, as well as others. Being able to understand and use a unit circle will also allow students to start to memorize the trigonometric functions. One of the most important things from pre-calculus to all other calculus classes was being able to solve trig functions and having the unit circle memorized was very useful. Although there are trig functions and values outside of the unit circle, the unit circle almost is like the foundation for trigonometry. Most, if not all, calculus classes after pre-calculus will expect students to have the unit circle memorized. Although it can be solved using a calculator, this will allow equations and problems to be solves easier with less thought when a student knows the unit circle. Even outside of calculus classes, the unit circle is one of many important aspects in math classes.

green line

How does this topic extend what your students should have learned in previous courses?

Before students learn how to compute trigonometric functions using a unit circle, they learn about the trig functions by themselves. This usually starts in high school geometry where students learn sine, cosine, and tangent, yet they do not use them in the way a unit circle does. Most schools only teach the students how to use the calculator to compute the functions to solve sides or angles for triangles. As students enter pre-calculus, they use what they have learned about the trig functions in order to apply them to the unit circle. This will allow students to see that using trig functions can still be used to solve triangles, but it can also be used to solve many other things. Once they learn the unit circle, they will see more examples in which they will apply the functions and make connections to real-world scenarios that they can also be applied to.

green line

How can technology (YouTube, Khan Academy [khanacademy.org], Vi Hart, Geometers Sketchpad, graphing calculators, etc.) be used to effectively engage students with this topic?

There are probably many simulations and websites that can help students compute trig functions using the unit circle, but I think something that will engage the students is a Kahoot or Quizziz that will help the students memorize the unit circle. Giving students an opportunity to apply what they learned into a friendly competition not only gives them practice but will also let them be engaged. Other technology resources such as videos or a website that is teaching the lesson does not really allow the students to apply what they know rather than just being lectured. Although some websites and technology can be useful, I personally, enjoy giving students the opportunity to work out problems as well as being engaged. Also, using calculators could be helpful to check answers but if they have a unit circle it might not be necessary unless they do not have the unit circle in front of them.

Thoughts on Numerical Integration (Part 6): Connection between Simpson’s Rule, Trapezoid Rule, and Midpoint Rule

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:
  • Why is numerical integration necessary in the first place?
  • Where do these formulas come from (especially Simpson’s Rule)?
  • How can I do all of these formulas quickly?
  • Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?
  • Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?
  • Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?
In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.
In the previous post in this series, I discussed three different ways of numerically approximating the definite integral \displaystyle \int_a^b f(x) \, dx, the area under a curve f(x) between x=a and x=b.
In this series, we’ll choose equal-sized subintervals of the interval [a,b]. If h = (b-a)/n is the width of each subinterval so that x_k = x_0 + kh, then the integral may be approximated as

\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n

using left endpoints,

\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n

using right endpoints, and

\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n

using the midpoints of the subintervals. We have also derived the Trapezoid Rule

\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n)] \equiv T_n

and Simpson’s Rule (if n is even)

\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{3} \left[y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{n-2} + 4 y_{n-1} +  y_{n} \right] \equiv S_n.

There is a somewhat surprising connection between the last three formulas. Let’s divide the interval [a,b] into 2n subintervals with h = (b-a)/(2n) and x_0 = a, x_1 = x_0 + h, x_2 = x_0 + 2h, and so on. Then Simpson’s Rule becomes

S_{2n} = \displaystyle \frac{h}{3} \left[y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{2n-2} + 4 y_{2n-1} +  y_{2n} \right].

Next, let’s divide the interval [a,b] into n subintervals, but let’s not redefine the values of h and the x_k. Instead, the width of each subinterval will be (b-a)/n, which is equal to 2h. (In other words, since there are half as many subintervals, each one is twice as long.) Also, the endpoints of these subintervals will be x_0 = a, x_2 = x_0 + 2h, x_4 = x_0 + 4h, and so on. So, keeping the same labeling convention as with Simpson’s Rule, the Trapezoid Rule becomes

T_n = \displaystyle \frac{2h}{2} [f(x_0) + 2f(x_2) + 2f(x_4) + \dots + 2f(x_{2n-2}) + f(x_{2n})]

= h [f(x_0) + 2f(x_2) + 2f(x_4) + \dots + 2f(x_{2n-2}) + f(x_{2n})].

(Again, the width of the subintervals in this case is 2h, where h = (b-a)/2n.) Furthermore, the midpoint of subinterval [x_0, x_2] will be x_1, the midpoint of subinterval [x_2,x_4] will be x_3, and so on. Therefore, keeping the same labeling convention, the Midpoint Rule becomes

M_n = \displaystyle 2h [f(x_1) + f(x_3) + f(x_5) + \dots + f(x_{2n-1}) ].

It turns out that \displaystyle \frac{2}{3} M_n + \frac{1}{3} T_n, a certain weighted average of T_n and M_n, is equal to

\displaystyle \frac{4h}{3} [f(x_1) + f(x_3) + \dots + f(x_{2n-1}) ] + \frac{h}{3} [f(x_0) + 2f(x_2) + \dots + 2f(x_{2n-2}) + f(x_{2n})]

= \displaystyle  \frac{h}{3} [f(x_0) + 4 f(x_1) + 2f(x_2) + \dots + 2f(x_{2n-2}) + 4 f(x_{2n-1} + f(x_{2n})]

= S_{2n}.

So, if the Midpoint Rule and the Trapezoid Rule have already been computed for n subintervals, then Simpson’s Rule for 2n subintervals can be computed at almost no additional effort.

Engaging students: Using a recursively defined sequence

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Enrique Alegria. His topic, from Precalculus: using a recursively defined sequence.

green line

How can this topic be used in your students’ future courses in mathematics or science?

            Recursion is heavily emphasized within the branches of computer science. The technique can be used more than just in arithmetic and geometric sequences for finding the next term. Within computer science, recursion techniques can be utilized for sorting algorithms. The content will be able to transfer easily. Instead of finding the previous term to use to find the current term, within sorting algorithms, a set of numbers is chunked into smaller and smaller sets such that the original set of numbers becomes sorted.

            We can take a deeper look at Merge Sort which is a recursive sorting algorithm. What occurs is the set of numbers repeatedly gets cut in half until there is only one element in the list. From there the elements are sorted in increasing order. Traversing back into the original size of the list with all of the elements contained except the final output is the list in increasing order.

This image has an empty alt attribute; its file name is mergesort1.png

This image has an empty alt attribute; its file name is mergesort2.png

Students can inspect the algorithm visually and need not to understand the implementation of code to comprehend the functionality of recursion. Guiding the students towards the smallest part of the process which is the single element and from there rearranging the elements of the list.

green line

How has this topic appeared in high culture (art, classical music, theatre, etc.)?

            Recursively defined sequences influenced a renowned artist who is M.C. Escher. The concept of a sequence beginning at one point and continuing infinitely is how Escher exhibits recursion. Escher challenges the viewer of his work to determine the patterns from the artistic series.

This image has an empty alt attribute; its file name is drawinghands.png

For example, when observing the piece Drawing Hands, a student can predict what the ‘base case’ of the artwork would be followed by the next steps of the drawing. The spectator of this piece can break it apart into smaller and smaller partitions of the whole. And once they reach a starting point, they can put together the whole picture once again.

This image has an empty alt attribute; its file name is twobirds.png

Similarly, students can view this piece titled Two Birds to follow the patterns. Without saying the name of the piece students can again predict the base case and determine how recursion techniques would be used for this sequence. Students can begin to learn how to think of how recursively defined sequences are applied through visual representations of M.C. Escher’s artwork.

green line

How can technology be used to effectively engage students with this topic?

            Technology can be used to effectively engage students with recursion by showcasing the YouTube video “Recursion: The Music Videos of Michel Gondry” by Polyphonic. Through this video, students can compare recursively defined sequences to music they listen to. The video starts with singular notes and then repeating the notes to create a rhythm. Compiling the initial sounds into something familiar through loops of samples and sound bites. This video goes into the repetitive patterns of the small chunks of sound are shown through visual representations with the music videos by Michel Gondry. In the music video “Star Guitar” by The Chemical Brothers, the video starts off with the listener on a train ride going through a landscape. Slowly patterns emerge as buildings uniquely correspond to the notes and rhythms within the song. With this YouTube video students obtain a great introduction to recursion and hopefully continue to find patterns of recursion to music they listen to in the future.

References

Greenberg I., Xu D., Kumar D. (2013) Drawing with Recursion. In: Processing. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4465-3_8

Miller, B., & Ranum, D. (2020). 6.11. The Merge Sort — Problem Solving with Algorithms and Data Structures. Runestone.academy. https://runestone.academy/runestone/books/published/pythonds/SortSearch/TheMergeSort.html.

https://www.youtube.com/watch?v=-rfezNHtwhg

Thoughts on Numerical Integration (Part 5): Derivation of Simpson’s Rule

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:

  • Why is numerical integration necessary in the first place?
  • Where do these formulas come from (especially Simpson’s Rule)?
  • How can I do all of these formulas quickly?
  • Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?
  • Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?
  • Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?

In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.

In the previous post in this series, I discussed three different ways of numerically approximating the definite integral \displaystyle \int_a^b f(x) \, dx, the area under a curve f(x) between x=a and x=b.

In this series, we’ll choose equal-sized subintervals of the interval [a,b]. If h = (b-a)/n is the width of each subinterval so that x_k = x_0 + kh, then the integral may be approximated as

\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n

using left endpoints,

\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n

using right endpoints, and

\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n

using the midpoints of the subintervals. We have also derived the Trapezoid Rule:

\int_a^b f(x) \, dx \approx \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n)] \equiv T_n

This last approximation was obtained by connecting adjacent points on the curve by line segments, creating trapezoids:

In this post, we will derive Simpson’s Rule. Instead of connecting two adjacent points with line segments, we will connect three adjacent points with a parabola. In the picture below, the points (x_0, f(x_0)), (x_1, f(x_1)) and (x_2,f(x_2)) are connected with one parabola, while the points (x_2, f(x_2)), (x_3, f(x_3)) and (x_4,f(x_4)) are connected with a different second parabola.

Clearly, for this to work, there has to be an even number of subintervals. (By contrast, for the Trapezoid Rule, the Midpoint Rule, or the endpoint rules, the number of subintervals could be even or odd.)

The derivation of Simpson’s Rule is more complicated than the derivation of the Trapezoid Rule because we need to use calculus to find the area under these parabolas. To begin, we make the simplifying assumption that x_1 = 0. Since each subinterval has width h, this means that x_0 = -h and x_2 = h.

To find the area under this parabola, we first need to find the equation of the parabola y = ax^2 + bx + c connecting the three points (-h,y_0), (0,y_1), and (h,y_2). This entails solving a system of three equations in three unknowns:

a(-h)^2 + b(-h) + c = y_0

a(0)^2+b(0) + c = y_1

ah^2 + bh + c = y_2,

or

ah^2 - bh + c = y_0

c = y_1

ah^2 + bh + c = y_2.

While most 3×3 systems are cumbersome to solve, this system is straightforward. Clearly, c = y_1. Also, subtracting the first equation from the third equation yields

2bh = y_2 - y_0, or b = \displaystyle \frac{y_2 - y_0}{2h}

Finally, we solve for a by substituting into the third equation:

ah^2 + \displaystyle \frac{y_2 - y_0}{2h} h + y_1 = y_2

ah^2 + \displaystyle \frac{y_2 - y_0}{2} + y_1 = y_2

ah^2 = \displaystyle \frac{y_0 - y_2}{2} - \frac{2y_1}{2} + \frac{2y_2}{2}

ah^2 = \displaystyle \frac{y_0 - 2y_1 + y_2}{2}

a = \displaystyle \frac{y_0 - 2y_1 + y_2}{2h^2}

Next, we find the integral of y = ax^2 + bx + c between x = -h and x = h:

\displaystyle \int_{-h}^h (ax^2 + bx + c) \, dx = \left[ \frac{ax^3}{3} + \frac{bx^2}{2} + cx \right]^h_{-h}

= \displaystyle \left[ \frac{ah^3}{3} + \frac{bh^2}{2} + ch \right] - \left[ -\frac{ah^3}{3} + \frac{bh^2}{2} - ch \right]

= \displaystyle \frac{2ah^3}{3} + 2ch

= \displaystyle \frac{(y_0 - 2y_1 + y_2)h}{3} + 2y_1h

= \displaystyle \frac{h(y_0 + 4y_1 + y_2)}{3}.

We now turn to the more general case of finding the area under the parabola passing through (x_0,y_0), (x_1,y_1), and (x_2,y_2), where x_1 = x_0 +h and x_2 = x_1 + 2h. Geometrically, it should be clear that this parabola can be obtained from the above parabola by a horizontal translation. Since the area under the curve is not changed by a horizontal translation, the area (and the formula) will be the same.

More formally, if y = ax^2 + bx + c passes through the points (-h,y_0), (0,y_1), and (h,y_2), then y = a(x-x_1)^2 + b(x-x_1) + c will pass through the points (x_0,y_0), (x_1,y_1), and (x_2,y_2). The area under this curve is

\displaystyle \int_{x_0}^{x_2} \left[ a(x-x_1)^2 + b(x-x_1) + c \right] \, dx.

After using the substitution u = x-x_1, this becomes

\displaystyle \int_{-h}^h (au^2 + bu + c) \, du,

which is the same integral that we saw earlier. Therefore,

\displaystyle \int_{x_0}^{x_2} \left[ a(x-x_1)^2 + b(x-x_1) + c \right] \, dx = \displaystyle \frac{h(y_0 + 4y_1 + y_2)}{3}.

Finally, we need to find the sum of the areas under all of these parabolas. Similarly, the area under the parabola passing through (x_2,y_2), (x_3,y_3), and (x_4,y_4) will be \displaystyle \frac{h(y_2 + 4y_3 + y_4)}{3}. So, for the particular example shown above, the total area under the parabolas will be

\displaystyle \frac{h(y_0 + 4y_1 + y_2)}{3} + \frac{h(y_2 + 4y_3 + y_4)}{3} = \frac{h}{3} (y_0 + 4 y_1 + 2 y_2 + 4 y_3 + y_4).

The coefficients of 4 arose from the above integrals, while the coefficient of 2 came from combining the two areas. In general, if there are n subintervals and n is even, then Simpson’s Rule gives the approximation

S_n = \displaystyle \frac{h}{3} \left(y_0 + 4 y_1 + 2 y_2 + 4 y_3 + \dots + 2y_{n-2} + 4 y_{n-1} +  y_{n} \right).

Engaging students: Powers and exponents

In my capstone class for future secondary math teachers, I ask my students to come up with ideas for engaging their students with different topics in the secondary mathematics curriculum. In other words, the point of the assignment was not to devise a full-blown lesson plan on this topic. Instead, I asked my students to think about three different ways of getting their students interested in the topic in the first place.

I plan to share some of the best of these ideas on this blog (after asking my students’ permission, of course).

This student submission comes from my former student Austin Stone. His topic, from Pre-Algebra: powers and exponents.

green line

What interesting (i.e., uncontrived) word problems using this topic can your students do now?

“The number of people who are infected with COVID-19 can double each day. If it does double every day, and one person was infected on day 0, how many people would be infected after 20 days?” This problem can be a current real-life word problem that all students can relate to given the times we are in. This problem would be a good introductory for students to see how quickly numbers can get when using exponents. This would be an engaging introductory to exponents and will get the students interested because they can easily see that this can be used in current problems facing the world. This problem could also work later in Algebra if you ask how many days it would take to infect “blank” amount of people. This makes the question more of a challenge because they would have to solve for “x” (days) which is the exponent.

green line

How has this topic appeared in the news?

This topic has been the news so far in 2020 if we are being honest. COVID-19 is a virus that has an exponential infection rate, just like any virus. When talking about COVID-19, news reporters and doctors usually use graphs to depict the infection rate. These graphs start off small but then grow exponentially until it slows down due to either people being more aware of their hygiene habits and/or the human immune system getting more familiar with the virus. Knowing how exponents work helps people better understand the seriousness of viruses such as COVID-19 and the everlasting impact it can have on the world. Doctors study what are the best ways to slow down the exponential growth so that a limited number of people contract and potentially die from the virus. To do this, they predict the exponential growth keeping in mind the regulations that may be enforced. Whatever regulation(s) slow down the virus the most are the ones that they try to enforce.

green line

How can technology (YouTube, Khan Academy [khanacademy.org], Vi Hart, Geometers Sketchpad, graphing calculators, etc.) be used to effectively engage students with this topic?

An easy way to introduce students who have never seen exponents or exponential growth before is to use a graphing calculator. By plugging in an exponential function into the calculator and viewing the graph and zooming out, students can easily see how quickly numbers start to get massively large. A teacher can set this up by giving the students a problem to think about such as, “how many people would be infected with the virus after “blank” amount of day?” Students then could guess what they believe it would be. After revealing the graph and the actual number, students will probably be surprised at how big the number is in just a short amount of time. After that, the teacher could show a video on YouTube about exponential growth and/or infection rates of viruses and how quickly a small virus can turn into a pandemic. This also has very current real-world applications.

Reference: https://www.osfhealthcare.org/blog/superspreaders-these-factors-affect-how-fast-covid-19-can-spread/

Thoughts on Numerical Integration (Part 4): Derivation of Trapezoid Rule

Numerical integration is a standard topic in first-semester calculus. From time to time, I have received questions from students on various aspects of this topic, including:

  • Why is numerical integration necessary in the first place?
  • Where do these formulas come from (especially Simpson’s Rule)?
  • How can I do all of these formulas quickly?
  • Is there a reason why the Midpoint Rule is better than the Trapezoid Rule?
  • Is there a reason why both the Midpoint Rule and the Trapezoid Rule converge quadratically?
  • Is there a reason why Simpson’s Rule converges like the fourth power of the number of subintervals?

In this series, I hope to answer these questions. While these are standard questions in a introductory college course in numerical analysis, and full and rigorous proofs can be found on Wikipedia and Mathworld, I will approach these questions from the point of view of a bright student who is currently enrolled in calculus and hasn’t yet taken real analysis or numerical analysis.

In the previous post in this series, I discussed three different ways of numerically approximating the definite integral \displaystyle \int_a^b f(x) \, dx, the area under a curve f(x) between x=a and x=b.

In this series, we’ll choose equal-sized subintervals of the interval [a,b]. If h = (b-a)/n is the width of each subinterval so that x_k = x_0 + kh, then the integral may be approximated as

\int_a^b f(x) \, dx \approx h \left[f(x_0) + f(x_1) + \dots + f(x_{n-1}) \right] \equiv L_n

using left endpoints,

\int_a^b f(x) \, dx \approx h \left[f(x_1) + f(x_2) + \dots + f(x_n) \right] \equiv R_n

using right endpoints, and

\int_a^b f(x) \, dx \approx h \left[f(c_1) + f(c_2) + \dots + f(c_n) \right] \equiv M_n

using the midpoints of the subintervals.

All three of these approximations were obtained by approximating the above shaded region by rectangles. However, perhaps it might be better to use some other shape besides rectangles. In the Trapezoidal Rule, we approximate the area by using (surprise!) trapezoids, as in the figure below.

The first trapezoid has height h and bases f(x_0) and f(x_1), and so the area of the first trapezoid is \frac{1}{2} h[ f(x_0) + f(x_1) ]. The other areas are found similarly. Adding these together, we get the approximation

T_n = \displaystyle \frac{h}{2}[f(x_0) + f(x_1)] + \frac{h}{2} [f(x_1) + f(x_2)] + \dots +

+ \displaystyle \frac{h}{2} [f(x_{n-2})+f(x_{n-1})] + \frac{h}{2} [f(x_{n-1})+f(x_n)]

= \displaystyle \frac{h}{2} [f(x_0) + 2f(x_1) + 2f(x_2) + \dots + 2f(x_{n-2}) + 2f(x_{n-1}) + f(x_n)].

Interestingly, T_n is the average of the two endpoint approximations L_n and R_n:

\displaystyle \frac{L_n+R_n}{2} =  \frac{L_n}{2} + \frac{R_n}{2}

= \displaystyle \frac{h}{2} \left[f(x_0) + f(x_1) + f(x_2) + \dots + f(x_{n-1}) \right]

+\displaystyle \frac{h}{2} \left[f(x_1) + f(x_2) + \dots + f(x_{n-1}) + f(x_{n}) \right]

= \displaystyle \frac{h}{2} \left[f(x_0) + 2f(x_1) + \dots + 2f(x_{n-1}) + f(x_n) \right]

= T_n.

Of course, as a matter of computation, it’s a lot quicker to directly compute T_n instead of computing L_n and R_n separately and then averaging.