Computing e to Any Power (Part 3)

In this series, I’m exploring the following ancedote from the book Surely You’re Joking, Mr. Feynman!, which I read and re-read when I was young until I almost had the book memorized.

One day at Princeton I was sitting in the lounge and overheard some mathematicians talking about the series for e^x, which is 1 + x + x^2/2! + x^3/3! Each term you get by multiplying the preceding term by x and dividing by the next number. For example, to get the next term after x^4/4! you multiply that term by x and divide by 5. It’s very simple.

When I was a kid I was excited by series, and had played with this thing. I had computed e using that series, and had seen how quickly the new terms became very small.

I mumbled something about how it was easy to calculate e to any power using that series (you just substitute the power for x).

“Oh yeah?” they said. “Well, then what’s e to the 3.3?” said some joker—I think it was Tukey.

I say, “That’s easy. It’s 27.11.”

Tukey knows it isn’t so easy to compute all that in your head. “Hey! How’d you do that?”

Another guy says, “You know Feynman, he’s just faking it. It’s not really right.”

They go to get a table, and while they’re doing that, I put on a few more figures.: “27.1126,” I say.

They find it in the table. “It’s right! But how’d you do it!”

“I just summed the series.”

“Nobody can sum the series that fast. You must just happen to know that one. How about e to the 3?”

“Look,” I say. “It’s hard work! Only one a day!”

“Hah! It’s a fake!” they say, happily.

“All right,” I say, “It’s 20.085.”

They look in the book as I put a few more figures on. They’re all excited now, because I got another one right.

Here are these great mathematicians of the day, puzzled at how I can compute e to any power! One of them says, “He just can’t be substituting and summing—it’s too hard. There’s some trick. You couldn’t do just any old number like e to the 1.4.”

I say, “It’s hard work, but for you, OK. It’s 4.05.”

As they’re looking it up, I put on a few more digits and say, “And that’s the last one for the day!” and walk out.

What happened was this: I happened to know three numbers—the logarithm of 10 to the base e (needed to convert numbers from base 10 to base e), which is 2.3026 (so I knew that e to the 2.3 is very close to 10), and because of radioactivity (mean-life and half-life), I knew the log of 2 to the base e, which is.69315 (so I also knew that e to the.7 is nearly equal to 2). I also knew e (to the 1), which is 2. 71828.

The first number they gave me was e to the 3.3, which is e to the 2.3—ten—times e, or 27.18. While they were sweating about how I was doing it, I was correcting for the extra.0026—2.3026 is a little high.

I knew I couldn’t do another one; that was sheer luck. But then the guy said e to the 3: that’s e to the 2.3 times e to the.7, or ten times two. So I knew it was 20. something, and while they were worrying how I did it, I adjusted for the .693.

Now I was sure I couldn’t do another one, because the last one was again by sheer luck. But the guy said e to the 1.4, which is e to the.7 times itself. So all I had to do is fix up 4 a little bit!

They never did figure out how I did it.

My students invariably love this story; let’s take a look at the first calculation.

Feynman knew that $e^{2.3026} \approx 10$ and $e^1 \approx 2.71828$, so that

$e^{3.3026} = e^{2.3026} \times e^1 \approx 10 \times 2.71828 = 27.1828$.

That’s all well and good, but how did Feynman give an initial answer of $27.11$ in his head? The book doesn’t say, but we can guess that he used the Taylor series approximation:

$e^x = 1 + x - \displaystyle \frac{x^2}{2!} + \frac{x^3}{3!} + \dots$

$e^{-0.0026} \approx 1 - 0.0026$

Therefore,

$e^{3.3} = e^{3.3026} e^{-0.0026} \approx 27.1828 (1 - 0.0026)$

$\approx 27.18 - 27 \times 26 \times 0.0001$

$\approx 27.18 - 700 \times 0.0001$

$= 27.18 - 0.07$

$= 27.11$.

However, I’m not going to lie… I have no idea (other than his sheer genius with numbers) how he was able to mentally tack on two extra digits. The above calculation, to four decimal places, yields $e^{3.3} \approx 27.1121$, which is incorrect in the fourth decimal place. Indeed, if we use the more precise value of $\ln 10 = 2.3025851\dots$, we would obtain

$e^{3.3} = e^{3.3025851\dots} e^{-0.0025851\dots} \approx 27.1828 (1 - 0.0025851\dots)$

$e^{3.3} \approx 27.112548\dots$,

which is still incorrect in the fourth decimal place. In other words, Feynman could not have just used the first two terms of the Taylor expansion of $e^x$ to obtain his answer of $27.1126$. Therefore, Feynman must have used the next term in the Taylor series expansion as well as at least five decimal places of $\ln 10$ to make this calculation:

$e^{3.3} = e^{3.3025851\dots} e^{-0.0025851\dots} \approx 27.1828 \displaystyle \left(1 - 0.0025851\dots + \frac{(0.0025851\dots)^2}{2!} \right)$

And I have no idea how he could possibly have done this in his head in only a minute or two.

Computing e to Any Power (Part 2)

In this series, I’m looking at a wonderful anecdote from Nobel Prize-winning physicist Richard P. Feynman from his book Surely You’re Joking, Mr. Feynman!. This story concerns a time that he computed $e^x$ mentally for a few values of $x$, much to the astonishment of his companions.

Part of this story directly ties to calculus.

One day at Princeton I was sitting in the lounge and overheard some mathematicians talking about the series for e^x, which is 1 + x + x^2/2! + x^3/3! Each term you get by multiplying the preceding term by x and dividing by the next number. For example, to get the next term after x^4/4! you multiply that term by x and divide by 5. It’s very simple.

When I was a kid I was excited by series, and had played with this thing. I had computed e using that series, and had seen how quickly the new terms became very small.

As noted, this refers to the Taylor series expansion of $e^x$, which is can be used to compute $e$ to any power. The terms get very small very quickly because of the factorials in the denominator, thus lending itself to the computation of $e^x$. Indeed, this series is used by modern calculators (with a few tricks to accelerate convergence). In other words, the series from calculus explains how the mysterious “black box” of a graphing calculator actually works.

Continuing the story…

“Oh yeah?” they said. “Well, then what’s e to the 3.3?” said some joker—I think it was Tukey.

I say, “That’s easy. It’s 27.11.”

Tukey knows it isn’t so easy to compute all that in your head. “Hey! How’d you do that?”

Another guy says, “You know Feynman, he’s just faking it. It’s not really right.”

They go to get a table, and while they’re doing that, I put on a few more figures.: “27.1126,” I say.

They find it in the table. “It’s right! But how’d you do it!”

For now, I’m going to ignore how Feynman did this computation in his head and instead discuss “the table.” The setting for this story was approximately 1940, long before the advent of handheld calculators. I’ll often ask my students, “The Brooklyn Bridge got built. So how did people compute $e^x$ before calculators were invented?” The answer is by Taylor series, which were used to produce tables of values of $e^x$. So, if someone wanted to find $e^{3.3}$, they just had a book on the shelf.

For example, the following page comes from the book Marks’ Mechanical Engineers’ Handbook, 6th edition, which was published in 1958 and which I happen to keep on my bookshelf at home.

Look down the fifth and sixth columns of this table, we see that $e^{3.3} \approx 27.11$. Somebody had computed all of these things (and plenty more) using the Taylor series, and they were compiled into a book and sold to mathematicians, scientists, and engineers.

But what if we needed an approximation better more accurate than four significant digits? Back in those days, there were only two options: do the Taylor series yourself, or buy a bigger book with more accurate tables.

Computing e to Any Power (Part 1)

Whenever I teach natural logarithms, I always share the following anecdote from the book Surely You’re Joking, Mr. Feynman!, which I read and re-read when I was young until I almost had the book memorized.

One day at Princeton I was sitting in the lounge and overheard some mathematicians talking about the series for e^x, which is 1 + x + x^2/2! + x^3/3! Each term you get by multiplying the preceding term by x and dividing by the next number. For example, to get the next term after x^4/4! you multiply that term by x and divide by 5. It’s very simple.

When I was a kid I was excited by series, and had played with this thing. I had computed e using that series, and had seen how quickly the new terms became very small.

I mumbled something about how it was easy to calculate e to any power using that series (you just substitute the power for x).

“Oh yeah?” they said. “Well, then what’s e to the 3.3?” said some joker—I think it was Tukey.

I say, “That’s easy. It’s 27.11.”

Tukey knows it isn’t so easy to compute all that in your head. “Hey! How’d you do that?”

Another guy says, “You know Feynman, he’s just faking it. It’s not really right.”

They go to get a table, and while they’re doing that, I put on a few more figures.: “27.1126,” I say.

They find it in the table. “It’s right! But how’d you do it!”

“I just summed the series.”

“Nobody can sum the series that fast. You must just happen to know that one. How about e to the 3?”

“Look,” I say. “It’s hard work! Only one a day!”

“Hah! It’s a fake!” they say, happily.

“All right,” I say, “It’s 20.085.”

They look in the book as I put a few more figures on. They’re all excited now, because I got another one right.

Here are these great mathematicians of the day, puzzled at how I can compute e to any power! One of them says, “He just can’t be substituting and summing—it’s too hard. There’s some trick. You couldn’t do just any old number like e to the 1.4.”

I say, “It’s hard work, but for you, OK. It’s 4.05.”

As they’re looking it up, I put on a few more digits and say, “And that’s the last one for the day!” and walk out.

What happened was this: I happened to know three numbers—the logarithm of 10 to the base e (needed to convert numbers from base 10 to base e), which is 2.3026 (so I knew that e to the 2.3 is very close to 10), and because of radioactivity (mean-life and half-life), I knew the log of 2 to the base e, which is.69315 (so I also knew that e to the.7 is nearly equal to 2). I also knew e (to the 1), which is 2. 71828.

The first number they gave me was e to the 3.3, which is e to the 2.3—ten—times e, or 27.18. While they were sweating about how I was doing it, I was correcting for the extra.0026—2.3026 is a little high.

I knew I couldn’t do another one; that was sheer luck. But then the guy said e to the 3: that’s e to the 2.3 times e to the.7, or ten times two. So I knew it was 20. something, and while they were worrying how I did it, I adjusted for the .693.

Now I was sure I couldn’t do another one, because the last one was again by sheer luck. But the guy said e to the 1.4, which is e to the.7 times itself. So all I had to do is fix up 4 a little bit!

They never did figure out how I did it.

My students invariably love this story.

In this series, I’d like to take a deeper look at this wonderful anecdote.

Difference of Two Powers (Index)

I’m doing something that I should have done a long time ago: collecting a series of posts into one single post. The following links comprised my series on getting students to discover the formula for factoring $x^n - y^n$.

Part 1: A numerical way of discovering the formula for $x^2 - y^2$.

Part 2: A geometric way of discovering the formula for $x^2 - y^2$.

Part 3: Pedagogical thoughts on the importance of students discovering the formula for $x^3 - y^3$.

Part 4: A geometric way of discovering the formula for $x^3 - y^3$.

Part 5: Guiding students to the formula for $x^n - y^n$.

Lessons from teaching gifted elementary students (Part 7b)

Every so often, I’ll informally teach a class of gifted elementary-school students. I greatly enjoy interacting with them, and I especially enjoy the questions they pose. Often these children pose questions that no one else will think about, and answering these questions requires a surprising depth of mathematical knowledge.

Here’s a question I once received after a really big hailstorm:

How big would a 1000-pound hailstone be?

The guesses from the students ranged from the size of a small car to the size of a large pick-up truck. Here’s how I gave a reasonably accurate answer using only mental arithmetic. This kind of describes the way that I try to size up things when only an approximation (and not an exact answer) is necessary.

First, I had some real-world experience that quickly told me the answer was going to be deceptively small. When I was young — maybe 10 or 12 years old — I was getting ready for a picnic, and I was assigned cut a block of ice — maybe a cubic foot of ice, if memory serves — into smaller chunks. (The party organizer bought a block of ice instead of a bag of ice to economize.) I remembered how incredibly heavy that block of ice was even though it wasn’t much larger than a basketball… several of us kids had a lot of trouble lifting the block of ice as we prepared to chop it into pieces. So, for the sake of argument, if that cubic foot of ice weighed about 100 pounds, then 8 cubic feet would weigh 800 pounds. So, based on that chance encounter with a block of ice when I was a kid, my guess would have been that the hailstone would measure 2 feet across.

Back to the problem at hand.

First, I converted to metric. I knew that there are about 2.2 pounds in a kilogram, and so I knew that the block would weigh something like 400 or 450 kilograms. I knew that I would be making plenty of crude approximations, so I just went with 400 kilograms and didn’t worry too much about immediately calculating $1000/2.2$.

Next, I knew that metric units were originally defined so that a cubic centimeter of water weighs a gram, so that a 10 cm-by-10 cm-by 10 cm cube of water weighs one kilogram. Ice (hail) is slightly less dense than water (after all, ice floats in water), but for crude approximation purposes, I ignored this.

So, if a cube of ice with a side length of 1 decimeter (10 cm) weighs 1 kilogram, then a cube of ice with a side length of $\sqrt[3]{400}$ decimeters would weigh about 400 kilograms.

How big is $\sqrt[3]{400}$? Well, I have memorized that $7^3 = 343$ and $8^3 = 512$, so it’s between 7 and 8 someplace… say 7.5. So the answer would be a cube of side length 7.5 decimeters. Also, I have memorized that 1 decimeter (10 cm) is approximately 4 inches, so the cube would have side length $7.5 \times 4 = 30$ inches.

Finally, hailstones are more spherical in shape than cubic, and a sphere of diameter $d$ has less volume than a cube of side length $d$. So the answer should be a bit larger than 30 inches, so I just rounded up to a nice even number: 36 inches (one yard).

This calculation took me about a minute to do in my head and another half-minute to re-do to make sure I didn’t botch the arithmetic. So I held my hands about a yard apart (perhaps the crudest part of this calculation), pretending to hold a ball of diameter a yard across, and announced, “The hailstone would be about this big.”

Of course, a more thoughtful analysis produces the actual answer. The density of ice at the freezing point is 0.9167 grams per cubic centimeter, and 1 pound converts to 0.453592 kilograms. So:

$\displaystyle \frac{4\pi}{3} r^3 \times 0.9167 \frac{\hbox{grams}}{\hbox{cm}^3} = 1000 \hbox{pounds} \times \displaystyle 0.453592 \frac{\hbox{kilograms}}{\hbox{pounds}} \times 1000 \frac{\hbox{grams}}{\hbox{kilograms}}$

$r^3 \approx 118127 \hbox{cm}^3$

$r \approx 49.1 \hbox{cm}$

$r \approx 49.1 \hbox{cm} \times \frac{1 \hbox{inch}}{2.54 \hbox{cm}}$

$r \approx 19.3 \hbox{inches}$

Therefore, the sphere would have a diameter of twice that, or 38.6 inches.

Lessons from teaching gifted elementary school students (Part 7a)

Every so often, I’ll informally teach a class of gifted elementary-school students. I greatly enjoy interacting with them, and I especially enjoy the questions they pose. Often these children pose questions that no one else will think about, and answering these questions requires a surprising depth of mathematical knowledge.

Here’s a question I once received after a really big hailstorm:

How big would a 1000-pound hailstone be?

My head hurts thinking about hail that large. After about a minute of thinking, without using a calculator or even a pencil, I gave my answer: about a yard across.

I’ll reveal how I got this answer — which turns out to be a lot close than I had any right to expect — in tomorrow’s post. In the meantime, I’ll leave a thought bubble if you’d like to think about it on your own without using a calculator.

Lessons from teaching gifted elementary students (Part 6b)

Every so often, I’ll informally teach a class of gifted elementary-school students. I greatly enjoy interacting with them, and I especially enjoy the questions they pose. Often these children pose questions that no one else will think about, and answering these questions requires a surprising depth of mathematical knowledge.

Here’s a question I once received:

255/256 to what power is equal to 1/2? And please don’t use a calculator.

Here’s how I answered this question without using a calculator… in fact, I answered it without writing anything down at all. I thought of the question as

$\displaystyle \left( 1 - \epsilon \right)^x = \displaystyle \frac{1}{2}$.

$\displaystyle x \ln (1 - \epsilon) = \ln \displaystyle \frac{1}{2}$

$\displaystyle x \ln (1 - \epsilon) = -\ln 2$

I was fortunate that my class chose 1/2, as I had memorized (from reading and re-reading Surely You’re Joking, Mr. Feynman! when I was young) that $\ln 2 \approx 0.693$. Therefore, we have

$x \ln (1 - \epsilon) \approx -0.693$.

Next, I used the Taylor series expansion

$\ln(1+t) = t - \displaystyle \frac{t^2}{2} + \frac{t^3}{3} \dots$

to reduce this to

$-x \epsilon \approx -0.693$,

or

$x \approx \displaystyle \frac{0.693}{\epsilon}$.

For my students’ problem, I had $\epsilon = \frac{1}{256}$, and so

$x \approx 256(0.693)$.

So all I had left was the small matter of multiplying these two numbers. I thought of this as

$x \approx 256(0.7 - 0.007)$.

Multiplying $256$ and $7$ in my head took a minute or two:

$256 \times 7 = 250 \times 7 + 6 \times 7$

$= 250 \times (8-1) + 42$

$= 250 \times 8 - 250 + 42$

$= 2000 - 250 + 42$

$= 1750 + 42$

$= 1792$.

Therefore, $256 \times 0.7 = 179.2$ and $256 \times 0.007 = 1.792 \approx 1.8$. Therefore, I had the answer of

$x \approx 179.2 - 1.8 = 177.4 \approx 177$.

So, after a couple minutes’ thought, I gave the answer of 177. I knew this would be close, but I had no idea it would be so close to the right answer, as

$x = \displaystyle \frac{\displaystyle \ln \frac{1}{2} }{\displaystyle \ln \frac{255}{256}} \approx 177.0988786\dots$

Lessons from teaching gifted elementary school students (Part 6a)

Every so often, I’ll informally teach a class of gifted elementary-school students. I greatly enjoy interacting with them, and I especially enjoy the questions they pose. Often these children pose questions that no one else will think about, and answering these questions requires a surprising depth of mathematical knowledge.

Here’s a question I once received:

255/256 to what power is equal to 1/2? And please don’t use a calculator.

Answering this question is pretty straightforward using algebra:

$\displaystyle \left( \frac{255}{256} \right)^x = \displaystyle \frac{1}{2}$.

$\displaystyle x \ln \frac{255}{256} = \ln \displaystyle \frac{1}{2}$

$x \displaystyle \frac{ \displaystyle \ln \frac{1}{2} }{\ln \displaystyle \frac{255}{256}}$

However, doing this without a calculator — and thus maintaining my image in front of these elementary school students — is a little formidable.

I’ll reveal how I did this — getting the answer correct to the nearest integer — in tomorrow’s post. In the meantime, I’ll leave a thought bubble if you’d like to think about it on your own.

A natural function with discontinuities (Part 3)

This post concludes this series about a curious function:

In the previous post, I derived three of the four parts of this function. Today, I’ll consider the last part ($90^\circ \le \theta \le 180^\circ$).

The circle that encloses the grey region must have the points $(R,0)$ and $(R\cos \theta, R \sin \theta)$ on its circumference; the distance between these points will be $2r$, where $r$ is the radius of the enclosing circle. Unlike the case of $\theta < 90^\circ$, we no longer have to worry about the origin, which will be safely inside the enclosing circle.

Furthermore, this line segment will be perpendicular to the angle bisector (the dashed line above), and the center of the enclosing circle must be on the angle bisector. Using trigonometry,

$\sin \displaystyle \frac{\theta}{2} = \frac{r}{R}$,

or

$r = R \sin \displaystyle \frac{\theta}{2}$.

We see from this derivation the unfortunate typo in the above Monthly article.