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.

 

 

Engaging students: Using Pascal’s triangle

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 Jaeda Ransom. Her topic, from Precalculus: using Pascal’s triangle.

green line

How could you as a teacher create an activity or project that involves your topic?

A great activity that involves Pascal’s Triangle would be the sticky note triangle activity. For this activity students will be recreating an enlarged version of Pascal’s Triangle. To complete this activity students will need a poster of Pascal’s Triangle, poster board, markers, sticky notes, classroom wall (optional), and tape (optional). The teacher’s role is to show students Pascal’s Triangle, along with an explanation of how it was made. Students will be working in pairs and grabbing the necessary materials needed to complete this activity.On the poster board the students will recreate Pascal’s Triangle. Students will write a number 1 on a sticky note and place it at the top of the posterboard, they will then write 2 number 1’s on a sticky note and place it directly under. The students will continue recreating the triangle on their poster board until they run out of space. You can also consider having students use smaller sticky notes so that students are engaged with creating more rows.green line

What interesting things can you say about the people who contributed to the discovery and/or the development of this topic?

Pascal’s Triangle was named after French mathematician Blaise Pascal. At just the age of 16 years old Pascal wrote a significant treatise on the subject of projective geometry marking him as a child prodigy. Amongst that, Pascal also corresponded with other mathematicians on probability theory, which vastly encouraged the development of modern economics and social science. Pascal was also one of the first two inventors of the mechanical calculator when he started pioneering work on calculating machines, these were called Pascal’s calculators and later Pascalines. Pascal impressively created and invented all of this as a teenager. Though the Pascal Triangle was named after Blaise Pascal, this theory was established well before Pascal in India, Persia, China, Germany, and Italy. As a matter of fact, in China they still call it the Yang Hui’s triangle, named after Chinese mathematician Yang Hui who presented the triangle in the 13th century, though the triangle was known in China since the early 11th century.

green line

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

This topic can be used in my students future mathematics course to introduce binomial expansions, where it is known that Pascal’s Triangle determines the coefficients that arise in binomial expansion. The coefficients aᵢ in a binomial expansion represents the number of row n in the Pascal’s Triangle. Thus, a_i = \displaystyle {n \choose i}.

Another useful application of this topic is in the calculations of combinations. The equation to find the combination is also the formula to find a cell for Pascal’s Triangle. So, instead of performing the calculations using the equation a student can simply use Pascal’s Triangle. In doing this you can continue a lesson over probability or even do an activity using Pascal’s Triangle while implicating probability questions.

Resources:

https://en.wikipedia.org/wiki/Pascal%27s_triangle#Formula

https://study.com/academy/lesson/pascals-triangle-activities-games.html