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.

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

Far too often, students settle for a numerical approximation of a solution that can be found exactly. To give an extreme example, I have met quite intelligent college students who were convinced that \displaystyle \frac{1}{3} was literally equal to 0.3.

That’s an extreme example of something that nearly all students do — round off a complicated answer to a fixed number of decimal places. In trigonometry, many students will compute \sin \left( \cos^{-1} 0.3 \right) by plugging into a calculator and reporting the first three to six decimal places, like 0.95394. This is especially disappointing when there are accessible techniques for getting the exact answer (in this case, \displaystyle \frac{\sqrt{91}}{10}) without using a calculator at all.

pictsqrt9110

TIsqrt9110

Unfortunately, even maintaining eight, nine, or ten decimal places of accuracy may not be good enough, as errors tend to propagate as a calculation continues. I’m sure every math teacher has an example where the correct answer was exactly $\displaystyle\frac{3}{2}$ but students returned an answer of 1.4927 or 1.5031 because of roundoff errors.

Students may ask, “What’s the big deal if I round off to five decimal places?” Here’s a simple example — which can be quickly demonstrated in a classroom — of how such truncation errors can propagate. I’m going to generate a recursive sequence. I will start with \displaystyle \frac{1}{3}. Then I will alternate multiplying by 1000 and then subtracting 333. More mathematically,

 a_1 = \displaystyle \frac{1}{3}

a_{2n} = 1000 a_{2n-1}

a_{2n+1} = a_{2n} - 333 if n > 0

Here’s what happens exactly:

1000 \times \displaystyle \frac{1}{3} = \displaystyle \frac{1000}{3} = \displaystyle 333\frac{1}{3} = 333.\overline{3}

\displaystyle 333\frac{1}{3} - 333 = \displaystyle \frac{1}{3} = 0.\overline{3}

So, repeating these two steps, the sequence alternates between \displaystyle \frac{1}{3} and \displaystyle 333\frac{1}{3}.

But looks what happens if I calculate the first twelve terms of this sequence on a calculator.

TItrunc1

Notice that by the time I reach a_{11}, the terms of the sequence are negative, which is clearly incorrect.

So what happened?

This is a natural by-product of the finite storage of a calculator. The calculator doesn’t store infinitely many digits of $\displaystyle \frac{1}{3}$ in memory because a calculator doesn’t possess an infinite amount of memory. Instead, what gets stored is something like the terminating decimal 0.33333333333333, with about fourteen 3s. (Of course, only the first ten digits are actually displayed.)

So multiplying by 1000 and then subtracting 333 produces a new and different terminating decimal with three less 3s. Do this enough times, and you end up with negative numbers.

Full lesson plan: Platonic solids

Over the summer, I occasionally teach a small summer math class for my daughter and her friends around my dining room table. Mostly to preserve the memory for future years… and to provide a resource to my friends who wonder what their children are learning… I’ll write up the best of these lesson plans in full detail.

This was the first lesson that I taught to this audience: constructing the five regular polyhedra and inductively deriving Euler’s formula. This lesson plan is written in a 5E format — engage, explore, explain, elaborate, evaluate — which promotes inquiry-based learning and fosters student engagement.

Platonic Solids Lesson

Post Assessment 1

Post Assessment 2

V-E-F Chart

Vocabulary Sheet

Engaging students: Distinguishing between inductive and deductive reasoning

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, from Geometry (and proof writing): distinguishing between inductive and deductive reasoning.

green line

C. Culture: How has this topic appeared in pop culture (movies, TV, current music, video games, etc.)?

Inductive and deductive reasoning are often used on TV, radio, or in print in the form of advertising.

Deductive Reasoning

Man: What’s better, faster or slower?

All kids: Faster!

Man: And what’s fast?

Boy: My mom’s car and a cheetah.

Girl: A space ship.

Man: And what’s slow?

Boy: My grandma’s slow.

Man: Would you like her better if she was fast?

Boy: I bet she would like it if she was fast.

Man: Hmm, maybe give her some turbo boosters?

Boy: Or tape a cheetah to her back.

Man: Tape a cheetah to her back, it seems like you’ve thought about this before.

Narrator: It’s not complicated, faster is better. And iPhone 5 downloads fastest on AT&T 4G.

Deductive reasoning, which applies a general rule to specific examples, can be seen in advertisements like the AT&T commercial above. The kids establish in their conversation that faster things are better. The narrator says that iPhone 5 downloads fastest on AT&T 4G. Thus the viewer is left with the conclusion that AT&T 4G is better. This commercial’s deduction can be summed up as follows:

Faster things are better.

AT&T 4G is faster.

AT&T 4G is better. (conclusion)

Inductive Reasoning

Hotch: Sprees usually end in suicide. If he’s got nothing to live for, why wouldn’t he end it?

Reid: Because he’s not finished yet.

Reid: He’s obviously got displaced anger and took it out on his first victim.

Hotch: The stock boy represented someone. We need to know who. What about the other victims.

Reid: Defensive.

Hotch: Was he military?

Garcia: Negative.

Hotch: He’s lashing out. There’s got to be a reason. Rossi and Prentiss, dig through his house. Reid and JJ, get to the station. Morgan and I will take the crime scene. This guy’s got anger, endless targets and a gun. And from the looks of it, he just got started.

Inductive reasoning, which uses specific examples to make a general rule, can be seen frequently in episodes of TV shows or movies that involve crime scene investigation. The show Criminal Minds features a special unit of the FBI that profiles criminals. They do this by interviewing criminals who have already been caught and then inducing general rules about all criminals in order to catch the one they are looking for. Conversations among the profilers, like the one above, lead to inductive reasoning that can be summed up as follows:

He has nothing to live for.

He doesn’t want to commit suicide.

He wasn’t in the military.

He has displaced anger.

He has endless targets.

He has a gun.

He is a dangerous man who will hurt more people. (conclusion)

green line

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

 When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature’s God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.

 We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable rights, that among these are Life, Liberty, and the pursuit of Happiness. That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed. That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness.

-The Declaration of Independence

July, 4, 1776

The Declaration of Independence was drafted as a deductive argument as to why the United States can and should be a country independent of Great Britain. Thomas Jefferson drafted the declaration with a series of premises leading to four different conclusions.

  1. George III is a tyrant
  2. The colonies have a right to be free and independent states
  3. All political connections between Britain and the colonies should be dissolved
  4. The “united states” have the right to do all things that free nations do

These four conclusions then serve as premises for the final conclusion that the United States is now an independent country. The declaration is a great example of deductive reasoning because it takes specific examples, such as the 27 grievances against the monarch, and makes logical conclusions, such as “George III is a tyrant,” from the examples. Its deduction can be plainly seen.

The Declaration of Independence is a great example of high culture to use in the classroom because every student who is educated in the United States will have some knowledge of this document. Therefore learning to analyze it “mathematically” in terms of deductive versus inductive reasoning, is a great engagement tool.

green line

E. Technology: How can technology be used to effectively engage students with this topic?

Crime Scene Games & Deductive Reasoning: https://sites.google.com/a/wcsga.net/mock-trial/crime-scene-games-deductive-reasoning

This website contains links to several crime scene investigation games. Several of the games require students to collect clues, compare evidence, and then determine who is responsible for committing a given crime. These games are great for having students use their deductive skills. A couple of the other games require students to review given qualities of a criminal and inductively decide who the criminal in a scenario is based on these broad statements.

This website could be used to engage students easily. Having students play a game, especially one like these where they cannot pick out the mathematical skill they are using, is a great way to get students to abandon their potential distaste for a topic and be involved. After the students have completed a game and solved their crime, the teacher can smoothly transition into a geometrical lesson on inductive and deductive reasoning. The teacher will have activated the students’ knowledge of reasoning through a fun game. They will then be in a better position to learn a new, mathematical application of the reasoning they just used.

Engaging students: Finding the area of a square or rectangle

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 Alyssa Dalling. Her topic, from Geometry: finding the area of a square or rectangle.

green line

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

Giza

  • For three thousand years, the Great Pyramid of Giza was the world’s tallest man-made structure. It is also the oldest structure of the Seven Wonders of the Ancient World. It was built by cutting huge stones into rectangles then placing each stone into place to create the base. It is believed by many that the pharaoh Khufu had his vizier Hemon create the design for the great Pyramids. What is amazing about the design of the Pyramid of Giza is that each of the four sides of the base has an average error of only 58 millimeters in length. Meaning the base is almost a perfect square!
  • It would be fun to start the engage with introducing the Pyramid of Giza and explaining the facts above. Then students would be given the dimensions of other pyramids where they would have to find the area of the base to see whether they created a square or rectangular pyramid. This would get them excited about this topic because students would be exploring math that has actually been used in real life.

Castillo

  • The Mesoamericans also built pyramids with square and rectangular bases. The picture above is in a city known as Chechen Itza which is located in the Mexican state of Yucatan. It is called El Castillo, and also known as the Temple of Kukulkan. Unlike the Egyptian pyramids though, the Mayan pyramids were usually meant as steps to get to a temple on top. The pyramids consisted of several square bases stacked onto each other with steps up each side. El Castillo consists of nine square terraces each about 8.4 feet tall. The main base of the pyramid is approximately 55.3 meters (181 feet).
  • What would be fun to do is have students find the area of each level and compare it to all the levels on the pyramid. I feel students would have fun seeing just how big this type of structure is and understanding the planning it took to create the different levels in this pyramid.

Sources: http://en.wikipedia.org/wiki/Great_Pyramid_of_Giza and http://en.wikipedia.org/wiki/Pyramids#Nigeria

green line

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

  • Finding the area of squares and rectangles will be used a lot in Algebra and Algebra II. One example in Algebra is when students start solving for unknown variables. A student would be asked to find the area of a square when they have two unknown sides.
  • The following is an example engage problem students would use the finding the area of a square or rectangle to solve.

Principal Smith has decided the school needs a new practice basketball court. The current practice court is a square with an area of 144 square feet. She wants the new court to be a rectangle twice as long as it is wide. Find the length of all the sides of both the old court and the new court and find the area of the new court.

rect1rect2

x^2 = 144

So x = 12

Then x(2x) = 2x^2 = 2(12)^2 = 288

The square court has sides of 12.

The rectangular court has sides of 12×24 and an area of 288 square feet.

Engaging students: Equation of a 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 Alyssa Dalling. Her topic, from Precalculus: the equation of a circle.

green line

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

A fun way to engage students and also introduce the standard form of an equation of a circle is the following:

  • Start by separating the class into groups of 2 or 3
  • Pass each group a specific amount of flashcards. (Each group will have the same flashcards)
  • Each flashcard has a picture of a graphed circle and the equation of that circle in standard form
  • The students will work together to figure out how the pictures of the circle relate to the equation

This will help students understand how different aspects of a circle relate to its standard form equation. The following is an example of a flashcard that could be passed out.

equationofcircle

Source: http://www.mathwarehouse.com/geometry/circle/equation-of-a-circle.php

green line

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

Circles have been used through history in many different works of art. One such type is called a tessellation. The word Tessellate means to cover a plane with a pattern in such a way as to leave no region uncovered. So, a tessellation is created when a shape or shapes are repeated over and over again. The pictures above show just a few examples of how circles are used in different types of art. A good way to engage students would be to show them a few examples of tessellations using circles.

Source: http://mathforum.org/sum95/suzanne/whattess.html

equationofcircle4equationofcircle2equationofcircle3

green line

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

Khan Academy has a really fun resource for using equations to graph circles. At the beginning of class, the teacher could allow students to play around with this program. It allows students to see an equation of a circle in standard form then they would graph the circle. It gives hints as well as the answer when students are ready. The good thing about this is that even if a student goes straight to the answer, they are still trying to identify the connection between the equation of the circle and the answer Khan Academy shows.

http://www.khanacademy.org/math/trigonometry/conics_precalc/circles-tutorial-precalc/e/graphing_circles

Square roots with a calculator (Part 11)

This is the last in a series of posts about square roots and other roots, hopefully providing a deeper look at an apparently simple concept. However, in this post, we discuss how calculators are programmed to compute square roots quickly.

Today’s movie clip, therefore, is set in modern times:

So how do calculators find square roots anyway? First, we recognize that \sqrt{a} is a root of the polynomial f(x) = x^2 - a. Therefore, Newton’s method (or the Newton-Raphson method) can be used to find the root of this function. Newton’s method dictates that we begin with an initial guess x_1 and then iteratively find the next guesses using the recursively defined sequence

x_{n+1} = x_n - \displaystyle \frac{f(x_n)}{f'(x_n)}

For the case at hand, since f'(x) = 2x, we may write

x_{n+1} = x_n - \displaystyle \frac{x_n^2 -a}{2 x_n},

which reduces to

x_{n+1} = \displaystyle \frac{2x_n^2 - (x_n^2 -a)}{2 x_n} = \frac{x_n^2 + a}{2x_n} = \frac{1}{2} \left( x_n + \frac{a}{x_n} \right)

This algorithm can be programmed using C++, Python, etc.. For pedagogical purposes, however, I’ve found that a spreadsheet like Microsoft Excel is a good way to sell this to students. In the spreadsheet below, I use Excel to find \sqrt{2000}. In cell A1, I entered 1000 as a first guess for \sqrt{2000}. Notice that this is a really lousy first guess! Then, in cell A2, I typed the formula

=1/2*(A1+2000/A1)

So Excel computes

x_2 = \frac{1}{2} \left( x_1 + \displaystyle \frac{2000}{x_1} \right) = \frac{1}{2} \left( 1000 + \displaystyle \frac{2000}{1000} \right) = 501.

Then I filled down that formula into cells A3 through A16.

squareroot

Notice that this algorithm quickly converges to \sqrt{2000}, even though the initial guess was terrible. After 7 steps, the answer is only correct to 2 significant digits (45). After 8 steps, the answer is correct to 4 significant digits (44.72). On the 9th step, the answer is correct to 9 significant digits (44.7213595).

Indeed, there’s a theorem that essentially states that, when this algorithm converges, the number of correct digits basically doubles with each successive step. That’s a lot better than the methods shown at the start of this series of posts which only produced one extra digit with each step.

This algorithm works for finding kth roots as well as square roots. Since \sqrt[k]{a} is a root of f(x) = x^k - a, Newton’s method reduces to

x_{n+1} = x_n - \displaystyle \frac{x_n^k - a}{k x_n^{k-1}} = \displaystyle \frac{(k-1) x_n^k + a}{k x_n^{k-1}} = \displaystyle \frac{k-1}{k} x_k + \frac{1}{k} \cdot \frac{a}{x_n},

which reduces to the above sequence if k =2.

See also this Wikipedia page for further historical information as well as discussion about how the above recursive sequence can be obtained without calculus.

Square roots and logarithms without a calculator (Part 10)

This is the fifth in a series of posts about calculating roots without a calculator, with special consideration to how these tales can engage students more deeply with the secondary mathematics curriculum. As most students today have a hard time believing that square roots can be computed without a calculator, hopefully giving them some appreciation for their elders.

Today’s story takes us back to a time before the advent of cheap pocket calculators: 1949.

The following story comes from the chapter “Lucky Numbers” of Surely You’re Joking, Mr. Feynman!, a collection of tales by the late Nobel Prize winning physicist, Richard P. Feynman. Feynman was arguably the greatest American-born physicist — the subject of the excellent biography Genius: The Life and Science of Richard Feynman — and he had a tendency to one-up anyone who tried to one-up him. (He was also a serial philanderer, but that’s another story.) Here’s a story involving how, in the summer of 1949, he calculated \sqrt[3]{1729.03} without a calculator.

The first time I was in Brazil I was eating a noon meal at I don’t know what time — I was always in the restaurants at the wrong time — and I was the only customer in the place. I was eating rice with steak (which I loved), and there were about four waiters standing around.

A Japanese man came into the restaurant. I had seen him before, wandering around; he was trying to sell abacuses. (Note: At the time of this story, before the advent of pocket calculators, the abacus was arguably the world’s most powerful hand-held computational device.) He started to talk to the waiters, and challenged them: He said he could add numbers faster than any of them could do.

The waiters didn’t want to lose face, so they said, “Yeah, yeah. Why don’t you go over and challenge the customer over there?”

The man came over. I protested, “But I don’t speak Portuguese well!”

The waiters laughed. “The numbers are easy,” they said.

They brought me a paper and pencil.

The man asked a waiter to call out some numbers to add. He beat me hollow, because while I was writing the numbers down, he was already adding them as he went along.

I suggested that the waiter write down two identical lists of numbers and hand them to us at the same time. It didn’t make much difference. He still beat me by quite a bit.

However, the man got a little bit excited: he wanted to prove himself some more. “Multiplição!” he said.

Somebody wrote down a problem. He beat me again, but not by much, because I’m pretty good at products.

The man then made a mistake: he proposed we go on to division. What he didn’t realize was, the harder the problem, the better chance I had.

We both did a long division problem. It was a tie.

This bothered the hell out of the Japanese man, because he was apparently well trained on the abacus, and here he was almost beaten by this customer in a restaurant.

Raios cubicos!” he says with a vengeance. Cube roots! He wants to do cube roots by arithmetic. It’s hard to find a more difficult fundamental problem in arithmetic. It must have been his topnotch exercise in abacus-land.

He writes down a number on some paper— any old number— and I still remember it: 1729.03. He starts working on it, mumbling and grumbling: “Mmmmmmagmmmmbrrr”— he’s working like a demon! He’s poring away, doing this cube root.

Meanwhile I’m just sitting there.

One of the waiters says, “What are you doing?”.

I point to my head. “Thinking!” I say. I write down 12 on the paper. After a little while I’ve got 12.002.

The man with the abacus wipes the sweat off his forehead: “Twelve!” he says.

“Oh, no!” I say. “More digits! More digits!” I know that in taking a cube root by arithmetic, each new digit is even more work that the one before. It’s a hard job.

He buries himself again, grunting “Rrrrgrrrrmmmmmm …,” while I add on two more digits. He finally lifts his head to say, “12.0!”

The waiter are all excited and happy. They tell the man, “Look! He does it only by thinking, and you need an abacus! He’s got more digits!”

He was completely washed out, and left, humiliated. The waiters congratulated each other.

How did the customer beat the abacus?

The number was 1729.03. I happened to know that a cubic foot contains 1728 cubic inches, so the answer is a tiny bit more than 12. The excess, 1.03, is only one part in nearly 2000, and I had learned in calculus that for small fractions, the cube root’s excess is one-third of the number’s excess. So all I had to do is find the fraction 1/1728, and multiply by 4 (divide by 3 and multiply by 12). So I was able to pull out a whole lot of digits that way.

A few weeks later, the man came into the cocktail lounge of the hotel I was staying at. He recognized me and came over. “Tell me,” he said, “how were you able to do that cube-root problem so fast?”

I started to explain that it was an approximate method, and had to do with the percentage of error. “Suppose you had given me 28. Now the cube root of 27 is 3 …”

He picks up his abacus: zzzzzzzzzzzzzzz— “Oh yes,” he says.

I realized something: he doesn’t know numbers. With the abacus, you don’t have to memorize a lot of arithmetic combinations; all you have to do is to learn to push the little beads up and down. You don’t have to memorize 9+7=16; you just know that when you add 9, you push a ten’s bead up and pull a one’s bead down. So we’re slower at basic arithmetic, but we know numbers.

Furthermore, the whole idea of an approximate method was beyond him, even though a cubic root often cannot be computed exactly by any method. So I never could teach him how I did cube roots or explain how lucky I was that he happened to choose 1729.03.

The key part of the story, “for small fractions, the cube root’s excess is one-third of the number’s excess,” deserves some elaboration, especially since this computational trick isn’t often taught in those terms anymore. If f(x) = (1+x)^n, then f'(x) = n (1+x)^{n-1}, so that f'(0) = n. Since f(0) = 1, the equation of the tangent line to f(x) at x = 0 is

L(x) = f(0) + f'(0) \cdot (x-0) = 1 + nx.

The key observation is that, for x \approx 0, the graph of L(x) will be very close indeed to the graph of f(x). In Calculus I, this is sometimes called the linearization of f at x =a. In Calculus II, we observe that these are the first two terms in the Taylor series expansion of f about x = a.

For Feynman’s problem, n =\frac{1}{3}, so that \sqrt[3]{1+x} \approx 1 + \frac{1}{3} x if $x \approx 0$. Then $\latex \sqrt[3]{1729.03}$ can be rewritten as

\sqrt[3]{1729.03} = \sqrt[3]{1728} \sqrt[3]{ \displaystyle \frac{1729.03}{1728} }

\sqrt[3]{1729.03} = 12 \sqrt[3]{\displaystyle 1 + \frac{1.03}{1728}}

\sqrt[3]{1729.03} \approx 12 \left( 1 + \displaystyle \frac{1}{3} \times \frac{1.03}{1728} \right)

\sqrt[3]{1729.03} \approx 12 + 4 \times \displaystyle \frac{1.03}{1728}

This last equation explains the line “all I had to do is find the fraction 1/1728, and multiply by 4.” With enough patience, the first few digits of the correction can be mentally computed since

\displaystyle \frac{1.03}{500} < \frac{1.03}{432} = 4 \times \frac{1.03}{1728} < \frac{1.03}{400}

\displaystyle \frac{1.03 \times 2}{1000} < 4 \times \frac{1.03}{1728} < \frac{1.03 \times 25}{10000}

0.00206 < 4 \times \displaystyle \frac{1.03}{1728} < 0.0025075

So Feynman could determine quickly that the answer was 12.002\hbox{something}.

By the way,

\sqrt[3]{1729.03} \approx 12.00238378\dots

\hbox{Estimate} \approx 12.00238426\dots

So the linearization provides an estimate accurate to eight significant digits. Additional digits could be obtained by using the next term in the Taylor series.

green line

I have a similar story to tell. Back in 1996 or 1997, when I first moved to Texas and was making new friends, I quickly discovered that one way to get odd facial expressions out of strangers was by mentioning that I was a math professor. Occasionally, however, someone would test me to see if I really was a math professor. One guy (who is now a good friend; later, we played in the infield together on our church-league softball team) asked me to figure out \sqrt{97} without a calculator — before someone could walk to the next room and return with the calculator. After two seconds of panic, I realized that I was really lucky that he happened to pick a number close to 100. Using the same logic as above,

\sqrt{97} = \sqrt{100} \sqrt{1 - 0.03} \approx 10 \left(1 - \displaystyle \frac{0.03}{2}\right) = 9.85.

Knowing that this came from a linearization and that the tangent line to y = \sqrt{1+x} lies above the curve, I knew that this estimate was too high. But I didn’t have time to work out a correction (besides, I couldn’t remember the full Taylor series off the top of my head), so I answered/guessed 9.849, hoping that I did the arithmetic correctly. You can imagine the amazement when someone punched into the calculator to get 9.84886\dots

Square roots and logarithms without a calculator (Part 9)

This post is not really about finding square roots but continues Part 8 of this series. Continuing the theme of this series, let’s go back in time to when scientific calculators were not invented… say, 1850.

This is a favorite activity that I use when teaching logarithms to precalculus students. I begin by writing the following on the board, in three or four columns:

\log_{10} 1

\log_{10} 2 \approx 0.301

\log_{10} 3 \approx 0.477

\log_{10} 4

\log_{10} 5

\log_{10} 6

\log_{10} 7

\log_{10} 8

\log_{10} 9

\log_{10} 10

\log_{10} 11

\log_{10} 12

\log_{10} 13

\log_{10} 14

\log_{10} 15

\log_{10} 16

\log_{10} 17

\log_{10} 18

\log_{10} 19

\log_{10} 20

\log_{10} 30

\log_{10} 40

\log_{10} 50

\log_{10} 60

\log_{10} 70

\log_{10} 80

\log_{10} 90

\log_{10} 100

In other words, I tell the answer to only \log_{10} 2 and \log_{10} 3. The challenge: fill in the rest without a calculator.

In my classes, we found these logarithms by large-group discussion. However, there’s no reason why this couldn’t be done by dividing a class into small groups and letting the groups collaborate. Indeed, I suggested this idea to a former student who was struggling to come up with an engaging activity involving logarithms for an Algebra II class that she was about to teach. She took this idea and ran with it, and she told me it was a big hit with her students.

I provide a thought bubble if you’d like to think about it before I give the answers.

green_speech_bubbleStep 1. Three of these values — 1, 10, and 100 — can be found exactly since they’re powers of 10.

Step 2. Most of the others can be found by using the laws of logarithms for products, quotients, and powers involving 2, 3, and 10. For example,

\log_{10} 9 = \log_{10} 3^2 = 2 \log_{10} 3 \approx 2 \times 0.477 = 0.954

\log_{10} 20 = \log_{10} 2 + \log_{10} 10 = 1.301

\log_{10} 5 = \log_{10} 10 - \log_{10} 2 = 0.699.

Of this group, usually \log_{10} 5 is the hardest for students to recognize.

Step 3 (optional). A few of the logarithms, like \log_{10} 7, cannot be determined in terms of \log_{10} 2 and \log_{10} 3. But they can be approximated to reasonable accuracy with a little creativity. For example,

\log_{10} 7 = \log_{10} \sqrt{49} = \frac{1}{2} \log_{10} 49 \approx \frac{1}{2} \log_{10} 50 = \frac{1}{2} (1.699) = 0.850.

For a really good approximation, we use the fact that 7^4 = 2401 \approx 2400.

\log_{10} 7 = \frac{1}{4} \log_{10} 2401 \approx \frac{1}{4} \log_{10} 2400 = \frac{1}{4} (3 \log_{10} 2 + \log_{10} 3 + \log_{10} 100) = 0.845.

To approximate \log_{10} 17, we could use the fact that (16-1) \times (16 + 1) = 16^2-1, or 15 \times 17 = 255 \approx 2^8. So

\log_{10} 17 \approx 8 \log_{10} 2 - \log_{10} 15 = 8 \log_{10} 2 - \log_{10} 3 - \log_{10} 5 = 1.232

Naturally, any and all of the above results can be confirmed with a scientific calculator.

green lineIn my opinion, here are some of the pedagogical benefits of the above activity.

1. This activity solidifies students’ knowledge about the laws of logarithms. The laws of logarithms become less abstract, changing from \log_{10} xy = \log_{10} x + \log_{10} y into something more tangible and comfortable, like positive integers.

2. Hopefully the activity will demystify for students the curious decimal expansions when a calculator returns logarithms. In other words, hopefully the above activity will help

3. The activity should promote some understanding of the values of base-10 logarithms. For example, 0 \le \log_{10} x < 1 for 1 \le x < 10 and 1 \le \log_{10} x < 2  for 10 \le x < 100.

4. Students should see that, for large x, \log_{10}(x+1) is not much larger than \log_{10} x. This is another way of saying that the graph of y = \log_{10} x increases very slowly as x increases. So this should provide some future intuition for the graphs of logarithmic functions.

5. The values of \log_{10} 2, \log_{10} 3, \dots, \log_{10} 9 are used to construct the unevenly-spaced lines and/or tick marks in log-log graphs and log-linear graphs (which are standard plotting options on many scientific calculators).

Square roots and logarithms without a calculator (Part 8)

I’m in the middle of a series of posts concerning the elementary operation of computing a root. This is such an elementary operation because nearly every calculator has a \sqrt{~~} button, and so students today are accustomed to quickly getting an answer without giving much thought to (1) what the answer means or (2) what magic the calculator uses to find roots. I like to show my future secondary teachers a brief history on this topic… partially to deepen their knowledge about what they likely think is a simple concept, but also to give them a little appreciation for their elders.

To begin, let’s again go back to a time before the advent of pocket calculators… say, 1952.

This story doesn’t go back to 1952 but to Boxing Day 2012 (the day after Christmas). For some reason, my daughter — out of the blue — asked me to compute \sqrt[19]{25727} without a calculator. As my daughter adores the ground I walk on — and I want to maintain this state of mind for as long as humanly possible — I had no choice but to comply. So I might as well have been back in 1952.

In the past few posts, I discussed how log tables and slide rules were used by previous generations to perform this calculation. The problem was that all of these tools were in my office and not at home, and hence were not of immediate use.

The good news is that I had a few logarithms memorized:

\log_{10} 2 \approx 0.301, \log_{10} 3 \approx 0.477, \log_{10} 7 = 0.845,

and \ln 10 = 2.3.

I had the first two logs memorized when I was a child; the third I memorized later. As I’ll describe, the first three logarithms can be used with the laws of logarithms to closely approximate the base-10 logarithm of nearly any number. The last logarithm was important in previous generations for using the change-of-base formula from \log_{10} to \ln. It was also prominently mentioned in the chapter “Lucky Numbers” from a favorite book of my childhood, Surely You’re Joking Mr. Feynman, so I had that memorized as well.

I also knew that \ln(1+x) \approx x for x = 0 from the Taylor expansion of \ln(1+x).

green lineTo begin, I first noticed that 25727 \approx 25600, and I knew I could get \log_{10} 25600 since 25600 = 2^8 \times 100. So I started with

\log_{10} 25727 = \log_{10} \left(100 \times 256 \times \displaystyle \frac{257.27}{256} \right)

\log_{10} 25727 \approx \log_{10} 100 + 8 \log_{10} 2 + \log_{10} 1.005

\log_{10} 25727 \approx 2 + 8(0.301) + \displaystyle \frac{\ln 1.005}{\ln 10}

\log_{10} 25727 \approx 4.408 + \displaystyle \frac{0.005}{2.3}

\log_{10} 25727 \approx 4.408 + 0.002

\log_{10} 25727 \approx 4.410

I did all of the above calculations by hand, cutting off after three decimal places (since I had those base-10 logarithms memorized to only three decimal places). Therefore,

\log_{10} 25727^(1/19) = \displaystyle \frac{1}{19} \log_{10} 25727 \approx \displaystyle \frac{4.410}{19} \approx 0.232

So, to complete the calculation, I had to find the value of x so that \log_{10} x = 0.232. This was by far the hardest step, since it could only be done by trial and error. I forget exactly what steps I tried, but here’s a sample:

\log_{10} 2 \approx 0.301. Too big.

\log_{10} 1.5 = \log_{10} \displaystyle \frac{3}{2} = \log_{10} 3 - \log_{10} 2 \approx 0.477 - 0.301 = 0.176. Too small.

\log_{10} 1.6 = \log_{10} \displaystyle \frac{2^4}{10} = 4\log_{10} 2 - \log_{10} 10 \approx 4(0.301) - 1 = 0.203. Too small.

\log_{10} 1.8 = \log_{10} \displaystyle \frac{2 \cdot 3^2}{10} \approx 0.301 + 2(0.477) - 1 = 0.255. Too big.

Eventually, I got to

\log_{10} 1.71 = \log_{10} \displaystyle \frac{3^2 \cdot 19}{100}

\log_{10} 1.71 = 2\log_{10} 3 + \log_{10} 19 - \log_{10} 100

\log_{10} 1.71 \approx 2(0.477) + \displaystyle \frac{\log_{10} 18 + \log_{10} 20}{2} - 2

\log_{10} 1.71 \approx -1.046 + \frac{1}{2} (\log_{10} 2 + 2 \log_{10} 3 + \log_{10} 2 + \log_{10} 10)

\log_{10} 1.71 \approx -1.046 + \frac{1}{2}(2.556)

\log_{10} 1.71 \approx 0.232

So, after a hour or two of arithmetic, I told her my answer: \sqrt[19]{25727} \approx 1.71. You can imagine my sheer delight when we checked my answer with a calculator:

TI25727

green lineIn Part 9, I’ll discuss my opinion about whether or not these kinds of calculations have any pedagogical value for students learning logarithms.