Formula for an arithmetic series (Part 4)

As I’ve said before, I’m not particularly a fan of memorizing formulas. Apparently, most college students aren’t fans either, because they often don’t have immediate recall of certain formulas from high school when they’re needed in the collegiate curriculum.

While I’m not a fan of making students memorize formulas, I am a fan of teaching students how to derive formulas. Speaking for myself, if I ever need to use a formula that I know exists but have long since forgotten, the ability to derive the formula allows me to get it again.

Which leads me to today’s post: the derivation of the formulas for the sum of an arithmetic series. This topic is commonly taught in Precalculus but, in my experience, is often forgotten by students years later when needed in later classes.

green line
To get the idea across, consider the arithmetic series

S = 16 + 19 + 22 + 25 + 28 + 31 + 34 + 37 + 40 + 43

Now write the sum in reverse order. This doesn’t change the value of the sum, and so:

S = 43 + 40 + 37 +34+ 31 + 28 + 25 + 22 + 19 + 16

Now add these two lines vertically. Notice that 16 + 43 = 59, 19 + 40 = 59, and in fact each pair of numbers adds to 59. So

2S = 59 + 59 + 59 + 59 + 59 + 59 + 59 + 59 + 59 + 59

2S = 59 \times 10 = 590

S = 295

Naturally, this can be directly confirmed with a calculator by just adding the 10 numbers.

When I show this to my students, they often complain that there’s no way on earth that they would have thought of that for themselves. They wouldn’t have thought to set the sum equal to S, and they certainly would not have thought to reverse the terms in the sum. To comfort them, I tell them my usual tongue-in-cheek story that this idea comes from the patented Bag of Tricks. Socrates gave the Bag of Tricks to Plato, Plato gave it to Aristotle, it passed down the generations, my teacher taught the Bag of Tricks to me, and I teach it to my students.

green lineThe derivation of the general formula proceeds using the same idea. If a_1, \dots, a_n are the first n terms of an arithmetic sequence, let

S = a_1 + a_2 + \dots + a_{n-1} + a_n

Recalling the formula for an arithmetic sequence, we know that

a_2 = a_1 + d

\vdots

a_{n-1} = a_1 + (n-2)d

a_n = a_1 + (n-1)d

Substituting, we find

S = a_1 + [a_1 + d] + \dots + [a_1 + (n-2)d] + [a_1 + (n-1)d]

As above, we now return the order…

S = [a_1 + (n-1)d] + [a_1 + (n-2)d] + \dots + [a_1 + d] + a_1

… and add the two equations:

2S = [2a_1 + (n-1)d] + [2a_1 + d+(n-2)d] + \dots + [2a_1 +(n-2)d+ d] + [2a_1+(n-1)d]

2S = [2a_1 + (n-1)d] + [2a_1 + (n-1)d] + \dots + [2a_1 +(n-1)d] + [2a_1+(n-1)d]

2S = n[2a_1 + (n-1)d]

S = \displaystyle \frac{n}{2} [2a_1 + (n-1)d]

green line

We also note that the formula may be rewritten as

S = \displaystyle \frac{n}{2} [a_1 + \{a_1 + (n-1)d\} ]

or

S = \displaystyle \frac{n}{2} [a_1 + a_n]

This latter form isn’t too difficult to state as a sentence: the sum of a series with n  is the average of the first and last terms, multiplied by the number of terms.

Indeed, I have seen textbooks offer proofs of this formula by using the same logic that young Gauss used to find the sum 1 + 2 + \dots + 99 + 100. The “proof” goes like this: Take the terms in pairs. The first term plus the last term is a_1 + a_n. The second term plus the second-to-last term is a_2 + a_{n-1} = a_1 + d + a_n - d = a_1 + a_n. And so on. So each pair adds to a_1 + a_n. Since there are n terms, there are n/2 pairs, and so we derive the above formula for S.

You’ll notice I put “proof” in quotation marks. There’s a slight catch with the above logic: it only works if n is an even number. If n is odd, the result is still correct, but the logic to get the result is slightly different. That’s why I don’t particularly recommend using the above paragraph to prove this formula for students, even though it fits nicely with the almost unforgettable Gauss story.

That said, for talented students looking for a challenge, I would recommend showing this idea, then point out the flaw in the argument, and then ask the students to come up with an alternate proof for handling odd values of n.

Calculation of a famous arithmetic series (Part 3)

In this post, we’ll consider the calculation of a very famous arithmetic series… not because the series is particularly important, but because it’s part of a legendary story about one of the greatest mathematicians who ever lived. My frank opinion is that every math teacher should know this story. While I’m not 100% certain about small details of the story — like whether young Gauss was 9 or 10 years old when the following event happened — I’m just going to go with the story as told by the website http://www.math.wichita.edu/history/men/gauss.html.

Carl Friedrich Gauss (1777-1855) is considered to be the greatest German mathematician of the nineteenth century. His discoveries and writings influenced and left a lasting mark in the areas of number theory, astronomy, geodesy, and physics, particularly the study of electromagnetism.

Gauss was born in Brunswick, Germany, on April 30, 1777, to poor, working-class parents. His father labored as a gardner and brick-layer and was regarded as an upright, honest man. However, he was a harsh parent who discouraged his young son from attending school, with expectations that he would follow one of the family trades. Luckily, Gauss’ mother and uncle, Friedrich, recognized Carl’s genius early on and knew that he must develop this gifted intelligence with education.

While in arithmetic class, at the age of ten, Gauss exhibited his skills as a math prodigy when the stern schoolmaster gave the following assignment: “Write down all the whole numbers from 1 to 100 and add up their sum.” When each student finished, he was to bring his slate forward and place it on the schoolmaster’s desk, one on top of the other. The teacher expected the beginner’s class to take a good while to finish this exercise. But in a few seconds, to his teacher’s surprise, Carl proceeded to the front of the room and placed his slate on the desk. Much later the other students handed in their slates.

At the end of the classtime, the results were examined, with most of them wrong. But when the schoolmaster looked at Carl’s slate, he was astounded to see only one number: 5050. Carl then had to explain to his teacher that he found the result because he could see that, 1+100=101, 2+99=101, 3+98=101, so that he could find 50 pairs of numbers that each add up to 101. Thus, 50 times 101 will equal 5050.

Pedagogical thoughts about sequences and series (Part 2)

After yesterday’s post about arithmetic and geometric sequences, I’d like to contribute some thoughts about teaching this topic, based on my own experience over the years.

1. Some students really resist the subscript notation a_n when encountering it for the first time. To allay these concerns, I usually ask my students, “Why can’t we just label the terms in the sequence as a, b, c, and so on?” They usually can answer: what if there are more than 26 terms? That’s the right answer, and so the a_n is used so that we’re not limited to just the letters of the English alphabet.

Another way of selling the a_n notation to students is by telling them that it’s completely analogous to the f(x) notation used more commonly in Algebra II and Precalculus. For a “regular” function f(x), the number x is chosen from the domain of real numbers. For a sequence a_n, the number n is chosen from the domain of positive (or nonnegative) integers.

2. The formulas in Part 1 of this series (pardon the pun) only apply to arithmetic and geometric sequences, respectively. In other words, if the sequence is neither arithmetic nor geometric, then the above formulas should not be used.

While this is easy to state, my observation is that some students panic a bit when working with sequences and tend to use these formulas on homework and test questions even when the sequence is specified to be something else besides these two types of sequences. For example, consider the following problem:

Find the 10th term of the sequence 1, 4, 9, 16, \dots

I’ve known pretty bright students who immediately saw that the first term was 1 and the difference between the first and second terms was 3, and so they answered that the tenth term is 1 + (10-1)\times 3 = 28… even though the sequence was never claimed to be arithmetic.

I’m guessing that these arithmetic and geometric sequences are emphasized so much in class that some students are conditioned to expect that every series is either arithmetic or geometric, forgetting (especially on tests) that there are sequences other than these two.

3. Regarding arithmetic sequences, sometimes it helps by giving students a visual picture by explicitly make the connection between the terms of an arithmetic sequence and the points of a line. For example, consider the arithmetic sequence which begins

13, 16, 19, 22, \dots

The first term is 13, the second term is 16, and so on. Now imagine plotting the points (1,13), (2,16), (3,19), and (4,22) on the coordinate plane. Clearly the points lie on a straight line. This is not surprising since there’s a common difference between terms. Moreover, the slope of the line is 3. This matches the common difference of the arithmetic sequence.

4. In ordinary English, the words sequence and series are virtually synonymous. For example, if someone says either, “a sequence of unusual events” or “a series of unusual events,” the speaker means pretty much the same thing

However, in mathematics, the words sequence and series have different meanings. In mathematics, an example of an arithmetic sequence are the terms

1, 3, 5, 7, 9, \dots, 99

However, an example of an arithmetic series would be

1 + 3 + 5 + 7 + 9 + \dots + 99

In other words, a sequence provides the individual terms, while a series is a sum of the terms.

When teaching this topic, I make sure to take a minute to emphasize that the words sequence and series will mean something different in my class, even though they basically mean the same thing in ordinary English.

Formulas for arithmetic and geometric sequences (Part 1)

I’m not particularly a fan of memorizing formulas. Apparently, most college students aren’t fans either, because they often don’t have immediate recall of certain formulas from high school when they’re needed in the collegiate curriculum.

While I’m not a fan of making students memorize formulas, I am a fan of teaching students how to derive formulas. Speaking for myself, if I ever need to use a formula that I know exists but have long since forgotten, the ability to derive the formula allows me to get it again.

Which leads me to today’s post: the derivation of the formulas for the nth term of an arithmetic sequence and of a geometric sequence. This topic is commonly taught in Precalculus but, in my experience, is often forgotten by students years later when needed in later classes.

green lineAn arithmetic sequence is specified by two numbers: the first term and the common difference between terms. For example, if the first term is 16 and the common difference is 3, then the sequence begins as

16, 19, 22, 25, 28, 31, 34, \dots

If the first term is 29 and the common difference is -4, then the sequence begins as

29, 25, 21, 17, 13, 9, 5, 1, -3, \dots

For those of us old enough to remember, our favorite arithmetic sequences came from Schoolhouse Rock:

Let’s discuss the first arithmetic sequence, whose first seven terms are:

16, 19, 22, 25, 28, 31, 34, \dots

How do we get the 8th term? That’s easy: we just add 3 to 34 to get 37.

How to we get the 100th term. That’s easy: we just add 3 to the 99th term.

Oops. We don’t know the 99th term. To get the 99th term, we need the 98th term, which in turn requires the 97th term. Et cetera, et cetera, et cetera.

The trouble (so far) is that an arithmetic sequence is recursively defined: to get one term, I add something to the previous term. Mathematically, the arithmetic sequence is defined by

a_n = a_{n-1} + d,

where d is the common difference. This can be very intimidating to students when seeing it for the first time. So, to make this formula less intimidating, I usually read this equation as “Each next term in the sequence is equal to the previous term in the sequence plus the common difference.”

It would be far better to have a closed-form formula, where I could just plug in 100 to get the 100th term, without first figuring out the previous 99 terms.

To this end, we notice the following pattern:

  • Second term: 19 = 16 + 3
  • Third term: 22 = 19 + 3 = 16 + 3 + 3 = 16 + 2 \times 3
  • Fourth term: 25 = 22+ 3 = 16 + (2 \times 3) + 3 = 16 + 3 \times 3
  • Fifth term: 28 = 25+ 3 = 16 + (3 \times 3) + 3 = 16 + 4 \times 3
  • Sixth term: 31 = 28+ 3 = 16+ (4 \times 3) + 3 = 16 + 5 \times 3
  • Seventh term: 34 = 31 + 3 = 16 + (5 \times 3) + 3 = 16 + 6 \times 3

It looks like we have a pattern, so we can guess that:

  • One hundredth term = 16 + (100-1) \times 3 = 313

In general, we have justified the closed-form formula

a_n = a_1 + (n-1)d,

where a_1 is the first term, and d is the common difference.  In words: to get the nth term of an arithmetic sequence, we add d to the first term n-1 times. (This may be formally proven using mathematical induction, though I won’t do so here.)

green lineA closed-form formula for a geometric sequence is similarly obtained. In a geometric sequence, each term is equal to the previous term multiplied by a common ratio. Mathematically, the geometric sequence is recursively defined by

a_n = a_{n-1}r,

where r is the common ratio. For example, if the first term is 3 and the common ratio is 2, then the first few terms of the sequence are

3, 6, 12, 24, 48, dots

By the same logic used above, to get the nth term of an geometric sequence, we multiply r to the first term n-1 times. Thus justifies the formula

a_n = a_1 r^{n-1},

which may be formally proven using mathematical induction.

 

Why does 0.999… = 1? (Part 3)

In this series, I discuss some ways of convincing students that 0.999\dots = 1 and that, more generally, a real number may have more than one decimal representation even though a decimal representation corresponds to only one real number. This can be a major conceptual barrier for even bright students to overcome. I have met a few math majors within a semester of graduating — that is, they weren’t dummies — who could recite all of these ways and were perhaps logically convinced but remained psychologically unconvinced.

Method #4. This is a direct method using the formula for an infinite geometric series… and hence will only be convincing to students if they’re comfortable with using this formula. By definition,

0.999\dots = \displaystyle \frac{9}{10} + \frac{9}{100} + \frac{9}{1000} + \dots

This is an infinite geometric series. Its first term is \displaystyle \frac{9}{10}, and the common ratio needed to go from one term to the next term is \displaystyle \frac{1}{10}. Therefore,

0.999\dots = \displaystyle \frac{ \displaystyle \frac{9}{10}}{ \quad \displaystyle 1 - \frac{1}{10} \quad}

0.999\dots = \displaystyle \frac{ \displaystyle \frac{9}{10}}{ \quad \displaystyle \frac{9}{10} \quad}

0.999\dots = 1

Engaging students: Computing the determinant of a matrix

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 again comes from my former student Caitlin Kirk. Her topic: computing the determinant of a matrix.

green line

B. Curriculum: How does this topic extend what your students should have learned in previous courses?

 Students learn early in their mathematical careers how to calculate the area of simple polygons such as triangles and parallelograms. They learn by memorizing formulas and plugging given values into the formulas. Matrices, and more specifically the determinant of a matrix, can be used to do the same thing.

For example, consider a triangle with vertices (1,2), (3, -4), and (-2,3). The traditional method for finding the area of this circle would be to use the distance formula to find the length of each side and the height before plugging and chugging with the formula A = \frac{1}{2} bh. Matrices can be used to compute the same area in fewer steps using the fact that the area of a triangle the absolute value of one-half times the determinant of a matrix containing the vertices of the triangle as shown below.

First, put the vertices of the triangle into a matrix using the x-values as the first column and the corresponding y-values as the second column. Then fill the third column with 1’s as shown:

caitlin1

Next, compute the determinant of the matrix and multiply it by ½ (because the traditional area formula for a triangle calls for multiplying by ½ to account for the fact that a triangle is half of a rectangle, it is necessary to keep the ½ here also) as shown:

caitlin2Obviously, the area of a triangle cannot be negative. Therefore it is necessary to take the absolute value of the final answer. In this case |-8| = 8, making the area positive eight instead of negative eight.

The same idea can be applied to extend students knowledge of the area of other polygons such as a parallelogram, rectangle, or square. Determinants of matrices are a great extension of the basic mathematical concept of area that students will have learned in previous courses.

green line

D. History: What are the contributions of various cultures to this topic?

The history of matrices can be traced to four different cultures. First, Babylonians as early as 300 BC began attempting to solve simultaneous linear equations like the following:

There are two fields whose total area is eighteen hundred square yards. One produces grain at the rate of two-thirds of a bushel per square yard while the other produces grain at the rate of on-half a bushel per square yard. If the total yield is eleven hundred bushels, what is the size of each field?

While the Babylonians at this time did not actually set up matrices or calculate any determinants, they laid the framework for later cultures to do so by creating systems of linear equations.

The Chinese, between 200 BC and 100 BC, worked with similar systems and began to solve them using columns of numbers that resemble matrices. One such problem that they worked with is given below:

There are three types of corn, of which three bundles of the first, two of the second, and one of the third make 39 measures. Two of the first, three of the second and one of the third make 34 measures. And one of the first, two of the second and three of the third make 26 measures. How many measures of corn are contained of one bundle of each type?

Unlike the Babylonians, the Chinese answered this question using their version of matrices, called a counting board. The counting board functions the same way as modern matrices but is turned on its side. Modern matrices write a single equation in a row and the next equation in the next row and so forth. Chinese counting boards write the equations in columns. The counting board below corresponds to the question above:

1   2   3

2   3   2

3   1   1

26  34  39

They then used what we know as Gaussian elimination and back substitution to solve the system by performing operations on the columns until all but the bottom row contains only zeros and ones. Gaussian elimination with back substitution did not become a well known method until the early 19th century, however.

Next, in 1683, the Japanese and Europeans simultaneously saw the discovery and use of a determinant, though the Japanese published it first. Seki, in Japan, wrote Method of Solving the Dissimulated Problems which contains tables written in the same manner as the Chinese counting board. Without having a word to correspond to his calculations, Seki calculated the determinant and introduced a general method for calculating it based on examples. Using his methods, Seki was able to find the determinants of 2×2, 3×3, 4×4, and 5×5 matrices.

In the same year in Europe, Leibniz wrote that the system of equations below:

10+11x+12y=0

20+21x+22y=0

30+31x+32y=0

has a solution because

(10 \times 21 \times 32)+(11 \times 22 \times 30)+(12 \times 20 \times 31)=(10 \times 22 \times 31)+(11 \times 20 \times 32)+(12 \times 21 \times 30).

This is the exact condition under which the matrix representing the system has a determinant of zero. Leibniz was the first to apply the determinant to finding a solution to a linear system. Later, other European mathematicians such as Cramer, Bezout, Vandermond, and Maclaurin, refined the use of determinants and published rules for how and when to use them.

Source: http://www-history.mcs.st-and.ac.uk/HistTopics/Matrices_and_determinants.html

green line

B. Curriculum: How can this topic be used in you students’ future courses in mathematics or science?

Calculating the determinant is used in many lessons in future mathematics courses, mainly in algebra II and pre-calculus. The determinant is the basis for Cramer’s rule that allows a student to solve a system of linear equations. This leads to other methods of solving linear systems using matrices such as Gaussian elimination and back substitution.  It can also be used in determining the invertibility of matrices.  A matrix whose determinant is zero does not have an inverse. Invertibility of matrices determines what other properties of matrix theory a given matrix will follow. If students were to continue pursuing math after high school, understanding determinants is essential to linear algebra.

Thoughts on 1/7 and other rational numbers (Part 7)

In a previous post concerning roundoff error, I mentioned that the number 1/10 equals

\displaystyle \frac{1}{2^4} + \frac{1}{2^5} +\frac{1}{2^8} + \frac{1}{2^9} + \frac{1}{2^{12}} + \frac{1}{2^{13}} + \dots

In other words, the binary expansion of 1/10 is

0.0001100110011001100110011001100....

That’s the expansion of the fraction in base 2, as opposed to base 10.

In the previous post, I verified that the above infinite series actually converges to 1/10:

S = \displaystyle \left(\frac{1}{2^4} + \frac{1}{2^5}\right) +\left(\frac{1}{2^8} + \frac{1}{2^9}\right) + \left(\frac{1}{2^{12}} + \frac{1}{2^{13}}\right) + \dots

S = \displaystyle \frac{3}{2^5} + \frac{3}{2^9} + \frac{3}{2^{13}} + \dots

S = \displaystyle \frac{\displaystyle \frac{3}{2^5}}{\quad \displaystyle 1 - \frac{1}{2^4} \quad}

S = \displaystyle \frac{\displaystyle \frac{3}{32}}{\quad \displaystyle \frac{15}{16} \quad}

S = \displaystyle \frac{3}{32} \times \frac{16}{15}

S = \displaystyle \frac{1}{10}

Still, a curious student may wonder how one earth one could directly convert 1/10 into binary without knowing the above series ahead of time.

This can be addressed by using the principles that we’ve gleaned in this study of decimal representations, except translating this work into the language of base 2. In the following, I will use the subscripts \hbox{ten} and \hbox{two} so that I’m clear about when I’m using decimal and binary, respectively.

To begin, we note that 10_{\hbox{\scriptsize ten}} = 1010_{\hbox{\scriptsize two}} = 10_{\hbox{\scriptsize two}} \times 101_{\hbox{\scriptsize two}}. (In other words, ten is equal to two times five.) So, following Case 3 of the previous post, we will attempt to write the denominator in the form

10_{\hbox{\scriptsize two}}^d \left(10_{\hbox{\scriptsize two}}^k - 1 \right), or 2_{\hbox{\scriptsize ten}}^d \left(2_{\hbox{\scriptsize ten}}^k - 1 \right)

  • If k = 1_{\hbox{\scriptsize ten}}, then 2_{\hbox{\scriptsize ten}}^1 - 1 = 1_{\hbox{\scriptsize ten}}, but 1_{\hbox{\scriptsize ten}} \div 5_{\hbox{\scriptsize ten}}  is not an integer.
  • If k = 2_{\hbox{\scriptsize ten}}, then 2_{\hbox{\scriptsize ten}}^2 - 1 = 3_{\hbox{\scriptsize ten}}, but 3_{\hbox{\scriptsize ten}} \div 5_{\hbox{\scriptsize ten}}  is not an integer.
  • If k = 3_{\hbox{\scriptsize ten}}, then 2_{\hbox{\scriptsize ten}}^3 - 1 = 7_{\hbox{\scriptsize ten}}, but 7_{\hbox{\scriptsize ten}} \div 5_{\hbox{\scriptsize ten}}  is not an integer.
  • If k = 4_{\hbox{\scriptsize ten}}, then 2_{\hbox{\scriptsize ten}}^4 - 1 = 15_{\hbox{\scriptsize ten}}. This time, 15_{\hbox{\scriptsize ten}} \div 5_{\hbox{\scriptsize ten}} = 3_{\hbox{\scriptsize ten}}. Written in binary,

101_{\hbox{\scriptsize two}} \times 11_{\hbox{\scriptsize two}} = 1111_{\hbox{\scriptsize two}}

We now return to the binary representation of 1/10_{\hbox{\scriptsize ten}} = 1/1010_{\hbox{\scriptsize two}}.

\displaystyle \frac{1}{1010_{\hbox{\scriptsize two}}} = \displaystyle \frac{1}{1010_{\hbox{\scriptsize two}}} \times \frac{11_{\hbox{\scriptsize two}}}{11_{\hbox{\scriptsize two}}}

\displaystyle \frac{1}{1010_{\hbox{\scriptsize two}}} = \frac{11_{\hbox{\scriptsize two}}}{11110_{\hbox{\scriptsize two}}}

Therefore, the binary representation has a delay of one digit and a repeating block of four digits:

\displaystyle \frac{1}{1010_{\hbox{\scriptsize two}}} = 0.0\overline{0011}

Naturally, this matches the binary representation given earlier.

Thoughts on 1/7 and other rational numbers (Part 5)

Students are quite accustomed to obtaining the decimal expansion of a fraction by using a calculator. Here’s an (uncommonly, I think) taught technique for converting certain fractions into a decimal expansion without using long division and without using a calculator. I’ve taught this technique to college students who want to be future high school teachers for several years, and it never fails to surprise.

First off, it’s easy to divide any number by a power of 10, or 10^k. For example,

\displaystyle \frac{4312}{1000} = 4.312 and \displaystyle \frac{71}{10000} = 0.00071

What’s less commonly known is that it’s also easy to divide by 10^k - 1, or 99\dots 9, a numeral with k consecutive 9s. (This number can be used to prove the divisibility rules for 3 and 9 and is also the subject of one of my best math jokes.) The rule can be illustrated with a calculator:

TI999

In other words, if M < 10^k - 1, then the decimal expansion of \displaystyle \frac{M}{10^k-1} is a repeating block of k digits containing the numeral M, possibly adding enough zeroes to fill all k digits.

To prove that this actually works, we notice that

\displaystyle \frac{M}{10^k - 1} = M \times \frac{ \displaystyle \frac{1}{10^k}}{\quad \displaystyle 1 - \frac{1}{10^k} \quad}

 \displaystyle \frac{M}{10^k - 1} = M \times \left(\displaystyle \frac{1}{10^k} + \frac{1}{10^{2k}} + \frac{1}{10^{3k}} + \dots \right)

\displaystyle \frac{M}{10^k-1} = M \times 0.\overline{00\dots01}

The first line is obtained by multiplying the numerator and denominator by \displaystyle \frac{1}{10^k}. The second line is obtained by using the formula for an infinite geometric series in reverse, so that the first term is \displaystyle \frac{1}{10^k} and the common ratio is also \displaystyle \frac{1}{10^k}. The third line is obtained by converting the series — including only powers of 10 — into a decimal expansion.

If M > 10^k - 1, then the division algorithm must be used to get a numerator that is less than 10^k-1. Fortunately, dividing big numbers by 10^k-1 is quite easy and can be done without a calculator. For example, let’s find the decimal expansion of \displaystyle \frac{123456}{9999} without a calculator. First,

123456 = 12(10000) + 3456

123456 = 12(9999 + 1) + 3456

123456 = 12(9999) + 12(1) + 3456

123456 = 12(9999) + 3468

Therefore,

\displaystyle \frac{123456}{9999} = \displaystyle \frac{12(9999) + 3468}{9999}

\displaystyle \frac{123456}{9999} = \displaystyle \frac{12(9999)}{9999} + \frac{3468}{9999}

\displaystyle \frac{123456}{9999} = \displaystyle 12 + \frac{3468}{9999}

\displaystyle \frac{123456}{9999} = \displaystyle 12.\overline{3468}

This can be confirmed with a calculator. Notice that the repeating block doesn’t quite match the digits of the numerator because of the intermediate step of applying the division algorithm.

TI9999

green line

In the same vein, it’s also straightforward to find the decimal expansion of fractions of the form \displaystyle \frac{M}{10^d (10^k-1)}, so that the denominator has the form 99\dots9900\dots00. This is especially easy if M < 10^k -1. For example,

\displaystyle \frac{123}{99900} = \frac{1}{100} \times \frac{123}{999} = \frac{1}{100} \times 0.\overline{123} = 0.00\overline{123}

On the other hand, if M > 10^k-1, then the division algorithm must be applied as before. For example, let’s find the decimal expansion of \displaystyle \frac{51237}{99000}. To begin, we need to divide the numerator by 99, as before. Notice that, for this example, an extra iteration of the division algorithm is needed to get a remainder less than 99.

51237 = 512(100) + 37

51237 = 512(99 + 1) + 37

51237 = 512(99) + 512 + 37

51237 = 512(99) + 549

51237= 512(99) + 5(100) + 49

51237 = 512(99) + 5(99 + 1) + 49

51237 = 512(99) + 5(99) + 5 + 49

51237 = 517(99) + 54

Therefore,

\displaystyle \frac{51237}{99000} = \displaystyle \frac{517(99) + 54}{99000}

\displaystyle \frac{51237}{99000} = \displaystyle \frac{517(99)}{99000} + \frac{54}{99000}

\displaystyle \frac{51237}{99000} = \displaystyle \frac{517}{1000} + \frac{54}{99000}

\displaystyle \frac{51237}{99000} = 0.517 + 0.000\overline{54}

\displaystyle \frac{51237}{99000} = 0.517\overline{54}

In particular, notice that the three 0s in the denominator correspond to a delay of length 3 (the digits 517), while the 99 = 10^2 - 1 in the denominator corresponds to the repeating block of length 2.

These can be confirmed for students who may be reluctant to believe that decimal expansions can be found without a calculator.

TI99000

Thoughts on 1/7 and other rational numbers (Part 4)

In Part 3 of this series, I considered the conversion of a repeating decimal expansion into a fraction. This was accomplished by an indirect technique which was pulled out of the patented Bag of Tricks. For example, if x = 0.\overline{432} = 0.432432432\dots, we start by computing 1000x and then subtracting.

1000x = 432.432432\dots

x = 0.432432\dots

999x = 432

x = \displaystyle \frac{432}{999} = \displaystyle \frac{16}{37}

As mentioned in Part 3, most students are a little bit skeptical that this actually works, and often need to type the final fraction into a calculator to be reassured that the method actually works. Most students are also a little frustrated with this technique because it does come from the Bag of Tricks. After all, the first two steps (setting the decimal equal to x and then multiplying x by 1000) are hardly the most intuitive things to do first… unless you’re clairvoyant and know what’s going to happen next.

In this post, I’d like to discuss a more direct way of converting a repeating decimal into a fraction. In my experience, this approach presents a different conceptual barrier to students. This is a more direct approach, and so students are more immediately willing to accept its validity. However, the technique uses the formula for an infinite geometric series, which (unfortunately) most senior math majors cannot instantly recall. They’ve surely seen the formula before, but they’ve probably forgotten it because a few years have passed since they’ve had to extensively use the formula.

Anyway, here’s the method applied to 0.\overline{432}. To begin, we recall the meaning of a decimal representation in the first place:

0.432432432 \dots = \displaystyle \frac{4}{10} + \frac{3}{100} + \frac{2}{1000} + \displaystyle \frac{4}{10^4} + \frac{3}{10^5} + \frac{2}{10^6} + \displaystyle \frac{4}{10^7} + \frac{3}{10^8} + \frac{2}{10^9} + \dots

Combining fractions three at a time (matching the length of the repeating block), we get

0.432432432 \dots = \displaystyle \frac{432}{10^3} + \displaystyle \frac{432}{10^6} + \frac{432}{10^9} + \dots

This is an infinite geometric series whose first term is \displaystyle \frac{432}{10^3}, and the common ratio that’s multiplied to go from one term to the next is \displaystyle \frac{1}{10^3}. Using the formula for an infinite geometric series and simplifying, we conclude

0.432432432 \dots = \displaystyle \frac{ \quad \displaystyle \frac{432}{1000} \quad }{\quad 1 - \displaystyle \frac{1}{1000} \quad}

0.432432432 \dots = \displaystyle \frac{ \displaystyle \quad \frac{432}{1000} \quad}{ \displaystyle \quad \frac{999}{1000} \quad}

0.432432432 \dots = \displaystyle \frac{ 432}{ 999}

0.432432432 \dots = \displaystyle \frac{ 16}{ 37}

green line

For what it’s worth, the decimal representation could have been simplified by using three separate geometric series. Some students find this to be more intuitive, combining the unlike fractions at the final step as opposed to the initial step.

0.432432432 \dots = \left( \displaystyle \frac{4}{10} + \frac{4}{10^4} + \displaystyle \frac{4}{10^7} + \dots \right)

\quad \quad \quad \quad + \left( \displaystyle \frac{3}{100} + \frac{3}{10^5} + \displaystyle \frac{3}{10^8} + \dots \right)

+ \left( \displaystyle \frac{2}{1000} + \frac{2}{10^6} + \displaystyle \frac{2}{10^9} + \dots \right)

0.432432432 \dots = \displaystyle \frac{ \quad \displaystyle \frac{4}{10} \quad }{\quad 1 - \displaystyle \frac{1}{1000} \quad} + \frac{ \quad \displaystyle \frac{3}{100} \quad }{\quad 1 - \displaystyle \frac{1}{1000} \quad} + \frac{ \quad \displaystyle \frac{2}{1000} \quad }{\quad 1 - \displaystyle \frac{1}{1000} \quad}

0.432432432 \dots = \displaystyle \frac{ \quad \displaystyle \frac{4}{10} \quad }{\quad \displaystyle \frac{999}{1000} \quad} + \frac{ \quad \displaystyle \frac{3}{100} \quad }{\quad \displaystyle \frac{999}{1000} \quad} + \frac{ \quad \displaystyle \frac{2}{1000} \quad }{\quad \displaystyle \frac{999}{1000} \quad}

0.432432432 \dots = \displaystyle \frac{ 400}{ 999} + \frac{30}{999} + \frac{2}{999}

0.432432432 \dots = \displaystyle \frac{ 432}{ 999}

0.432432432 \dots = \displaystyle \frac{ 16}{ 37}

green lineFinally, this direct technique also works for repeating decimals with a delay, like 0.41\overline{6}.

0.41666\dots = \displaystyle \frac{4}{10} + \frac{1}{100} + \left( \frac{6}{1000} + \frac{6}{10^4} + \frac{6}{10^5} + \dots \right)

0.41666\dots = \displaystyle \frac{4}{10} + \frac{1}{100} + \displaystyle \frac{ \quad \displaystyle \frac{6}{1000} \quad }{\quad 1 - \displaystyle \frac{1}{10} \quad}

0.41666\dots = \displaystyle \frac{4}{10} + \frac{1}{100} +\displaystyle \frac{ \quad \displaystyle \frac{6}{1000} \quad }{\quad \displaystyle \frac{9}{10} \quad}

0.41666\dots = \displaystyle \frac{4}{10} + \frac{1}{100} +\frac{6}{900}

0.41666\dots = \displaystyle \frac{375}{900}

0.41666\dots = \displaystyle \frac{5}{12}

Calculator errors: When close isn’t close enough (Part 2)

In the previous post, I gave a simple classroom demonstration to illustrate that some calculators only approximate an infinite decimal expansion with a terminating decimal expansion, and hence truncation errors can propagate. This example addresses the common student question, “What’s the big deal if I round off to a few decimal places?”

TItrunc1

(For what it’s worth, I’m aware that some current high-end calculators are miniature computer algebra systems and can formally handle an answer of \displaystyle \frac{1}{3} instead of its decimal expansion.)

Students may complain that the above exercise is artificial and unlikely to occur in real life. I would suggest following up with a real-world, non-artificial, and tragic example of an accident that happened in large part due to truncation error. This incident occurred during the first Gulf War in 1991 (perhaps ancient history to today’s students). I’m going to quote directly from the website http://www.ima.umn.edu/~arnold/disasters/patriot.html, published by Dr. Douglas Arnold at the University of Minnesota. Perhaps students don’t need to master the details of this explanation (a binary expansion as opposed to a decimal expansion might be a little abstract), but I think that this example illustrates truncation error vividly.

On February 25, 1991, during the Gulf War, an American Patriot Missile battery in Dharan, Saudi Arabia, failed to track and intercept an incoming Iraqi Scud missile. The Scud struck an American Army barracks, killing 28 soldiers and injuring around 100 other people. Patriot missile A report of the General Accounting office, GAO/IMTEC-92-26, entitled Patriot Missile Defense: Software Problem Led to System Failure at Dhahran, Saudi Arabia reported on the cause of the failure.

It turns out that the cause was an inaccurate calculation of the time since boot due to computer arithmetic errors. Specifically, the time in tenths of second as measured by the system’s internal clock was multiplied by 1/10 to produce the time in seconds. This calculation was performed using a 24 bit fixed point register. In particular, the value 1/10, which has a non-terminating binary expansion, was chopped at 24 bits after the radix point. The small chopping error, when multiplied by the large number giving the time in tenths of a second, led to a significant error.

Indeed, the Patriot battery had been up around 100 hours, and an easy calculation shows that the resulting time error due to the magnified chopping error was about 0.34 seconds.

The number 1/10 equals

\displaystyle \frac{1}{2^4} + \frac{1}{2^5} +\frac{1}{2^8} + \frac{1}{2^9} + \frac{1}{2^{12}} + \frac{1}{2^{13}} + \dots

In other words, the binary expansion of 1/10 is

0.0001100110011001100110011001100....

Now the 24 bit register in the Patriot stored instead

0.00011001100110011001100

introducing an error of

0.0000000000000000000000011001100... binary,

or about 0.000000095 decimal. Multiplying by the number of tenths of a second in 100 hours gives

0.000000095 \times 100 \times 60 \times 60 \times 10=0.34.

A Scud travels at about 1,676 meters per second, and so travels more than half a kilometer in this time. This was far enough that the incoming Scud was outside the “range gate” that the Patriot tracked.

Ironically, the fact that the bad time calculation had been improved in some parts of the code, but not all, contributed to the problem, since it meant that the inaccuracies did not cancel.

The following paragraph is excerpted from the GAO report.

The range gate’s prediction of where the Scud will next appear is a function of the Scud’s known velocity and the time of the last radar detection. Velocity is a real number that can be expressed as a whole number and a decimal (e.g., 3750.2563…miles per hour). Time is kept continuously by the system’s internal clock in tenths of seconds but is expressed as an integer or whole number (e.g., 32, 33, 34…). The longer the system has been running, the larger the number representing time. To predict where the Scud will next appear, both time and velocity must be expressed as real numbers. Because of the way the Patriot computer performs its calculations and the fact that its registers are only 24 bits long, the conversion of time from an integer to a real number cannot be any more precise than 24 bits. This conversion results in a loss of precision causing a less accurate time calculation. The effect of this inaccuracy on the range gate’s calculation is directly proportional to the target’s velocity and the length of the the system has been running. Consequently, performing the conversion after the Patriot has been running continuously for extended periods causes the range gate to shift away from the center of the target, making it less likely that the target, in this case a Scud, will be successfully intercepted.

green line

A quick note of clarification. To verify the binary expansion of 1/10, we use the formula for an infinite geometric series.

S = \displaystyle \left(\frac{1}{2^4} + \frac{1}{2^5}\right) +\left(\frac{1}{2^8} + \frac{1}{2^9}\right) + \left(\frac{1}{2^{12}} + \frac{1}{2^{13}}\right) + \dots

S = \displaystyle \frac{3}{2^5} + \frac{3}{2^9} + \frac{3}{2^{13}} + \dots

S = \displaystyle \frac{\displaystyle \frac{3}{2^5}}{\quad \displaystyle 1 - \frac{1}{2^4} \quad}

S = \displaystyle \frac{\displaystyle \frac{3}{32}}{\quad \displaystyle \frac{15}{16} \quad}

S = \displaystyle \frac{3}{32} \times \frac{16}{15}

S = \displaystyle \frac{1}{10}

OK, that verifies the answer. Still, a curious student may wonder how one earth one could directly convert 1/10 into binary without knowing the above series ahead of time. I will address this question in a future post.