Square roots and Logarithms Without a Calculator: Index

I’m using the Twelve Days of Christmas (and perhaps a few extra days besides) to do something that I should have done a long time ago: collect past series of posts into a single, easy-to-reference post. The following posts formed my series on computing square roots and logarithms without a calculator.

Part 1: Method #1: Trial and error.

Part 2: Method #2: An algorithm comparable to long division.

Part 3: Method #3: Introduction to logarithmic tables. At the time of this writing, this is the most viewed page on my blog.

Part 4: Finding antilogarithms with a table.

Part 5: Pedagogical and historical thoughts on log tables.

Part 6: Computation of square roots using a log table.

Part 7: Method #4: Slide rules

Part 8: Method #5: By hand, using a couple of known logarithms base 10, the change of base formula, and the Taylor approximation ln(1+x) \approx x.

Part 9: An in-class activity for getting students comfortable with logarithms when seen for the first time.

Part 10: Method #6: Mentally… anecdotes from Nobel Prize-winning physicist Richard P. Feynman and me.

Part 11: Method #7: Newton’s Method.

 

 

 

Lessons from teaching gifted elementary school students (Part 3b)

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 surprisingly depth of mathematical knowledge.

Here’s a question I once received:

Suppose

A \times A = B

B \times B \times B = C

C \times C \times C \times C= D

If the pattern goes on, and if A = 2, what is Z?

In yesterday’s post, we found that the answer was

Z =2^{26!} =  10^{26! \log_{10} 2} \approx 10^{1.214 \times 10^{26}},

a number with approximately 1.214 \times 10^{26} digits.

How can we express this number in scientific notation? We need to actually compute the integer and decimal parts of 26! \log_{10} 2, and most calculators are not capable of making this computation.

Fortunately, Mathematica is able to do this. We find that

Z \approx 10^{121,402,826,794,262,735,225,162,069.4418253767}

\approx 10^{0.4418253767} \times 10^{121,402,826,794,262,735,225,162,069}

\approx 2.765829324 \times 10^{121,402,826,794,262,735,225,162,069}

Here’s the Mathematica syntax to justify this calculation. In Mathematica, \hbox{Log} means natural logarithm:

bigexponent

Again, just how big is this number? As discussed yesterday, it would take about 12.14 quadrillion sheets of paper to print out all of the digits of this number, assuming that Z was printed in a microscopic font that uses 100,000 characters per line and 100,000 lines per page. Since 250 sheets of paper is about an inch thick, the volume of the 12.14 quadrillion sheets of paper would be

1.214 \times 10^{16} \times 8.5 \times 11 \times \displaystyle \frac{1}{250} \hbox{in}^3 \approx 1.129 \times 10^{17} \hbox{in}^3

By comparison, assuming that the Earth is a sphere with radius 4000 miles, the surface area of the world is

4 \pi (4000 \times 5280 \times 12) \hbox{in}^2 \approx 8.072 \times 10^{17} \hbox{in}^2.

Dividing, all of this paper would cover the entire world with a layer of paper about 0.14 inches thick, or about 35 sheets deep. In other words, the whole planet would look something like the top of my desk.

green lineWhat if we didn’t want to print out the answer but just store the answer in a computer’s memory? When written in binary, the number 2^{26!} requires…

26! bits of memory, or…

about 4.03 \times 10^{26} bits of memory, or…

about $latex 5.04 \times 10^{25} bytes of memory, or …

about 5.04 \times 10^{13} terabytes of memory, or…

about 50.4 trillion terabytes of memory.

Suppose that this information is stored on 3-terabyte external hard drives, so that about 50.4/3 = 16.8 trillion of them are required. The factory specs say that each hard drive measures 129 \hbox{mm} \times 42 \hbox{mm} \times 167 \hbox{mm}. So the total volume of the hard drives would be 1.52 \times 10^{19} \hbox{mm}^3, or 15.2 \hbox{km}^3.

By way of comparison, the most voluminous building in the world, the Boeing Everett Factory (used for making airplanes), has a volume of only 0.0133 \hbox{km}^3. So it would take about 1136 of these buildings to hold all of the necessary hard drives.

The cost of all of these hard drives, at $100 each, would be about $1.680 quadrillion. So it’d be considerably cheaper to print this out on paper, which would be about one-seventh the price at $242 trillion.

Of course, a lot of this storage space would be quite repetitive since 2^{26!}, in binary, would be a one followed by 26! zeroes.

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

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 surprisingly depth of mathematical knowledge.

Here’s a question I once received:

Suppose

A \times A = B

B \times B \times B = C

C \times C \times C \times C= D

If the pattern goes on, and if A = 2, what is Z?

I leave a thought bubble in case you’d like to think this. (This is significantly more complicated to do mentally than the question posed in yesterday’s post.) One way of answering this question appears after the bubble.

green_speech_bubble

Let’s calculate the first few terms to try to find a pattern:

B = 2 \times 2 = 2^2

C = 2^2 \times 2^2 \times 2^2 = 2^6

D = 2^6 \times 2^6 \times 2^6 \times 2^6 = 2^{24}

etc.

Written another way,

A = 2^1 = 2^{1!}

B = 2^{2!}

C = 2^{3!}

D = 2^{4!}

Naturally, elementary school students have no prior knowledge of the factorial function. That said, there’s absolutely no reason why a gifted elementary school student can’t know about the factorial function, as it only consists of repeated multiplication.

Continuing the pattern, we see that Z = 2^{26!}. Using a calculator, we find Z \approx 2^{4.032014611 \times 10^{26}}.

If you try plugging that number into your calculator, you’ll probably get an error. Fortunately, we can use logarithms to approximate the answer. Since 2 = 10^{\log_{10} 2}, we have

Z = \left( 10^{\log_{10} 2} \right)^{4.032014611 \times 10^{26}} = 10^{4.032014611 \times 10^{26} \log_{10} 2}

Plugging into a calculator, we find that

Z \approx 10^{1.214028268 \times 10^{26}} = 10^{121.4028628 \times 10^{24}}

We conclude that the answer has more than 121 septillion digits.

How big is this number? if Z were printed using a microscopic font that placed 100,000 digits on a single line and 100,000 lines on a page, it would take 12.14 quadrillion pieces of paper to write down the answer (6.07 quadrillion if printed double-sided). If a case with 2500 sheets of paper costs $100, the cost of the paper would be $484 trillion ($242 trillion if double-sided), dwarfing the size of the US national debt (at least for now). Indeed, the United States government takes in about $3 trillion in revenue per year. At that rate, it would take the country about 160 years to raise enough money to pay for the paper (80 years if double-sided).

And that doesn’t even count the cost of the ink or the printers that would be worn out by printing the answer!

Lessons from teaching gifted elementary school students (Part 2)

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 surprisingly depth of mathematical knowledge.

Here’s a question I once received:

Suppose

A \times A = B

B \times B = C

C \times C = D

If the pattern goes on, and if A = 2, what is Z?

I leave a thought bubble in case you’d like to think this. One way of answering this question appears after the bubble.

green_speech_bubble

Let’s calculate the first few terms to try to find a pattern:

B = 2 \times 2 = 2^2

C = 2^2 \times 2^2 = 2^4

D = 2^4 \times 2^4 = 2^8

etc.

Written another way,

A = 2^1 = 2^{2^0}

B = 2^{2^1}

C = 2^{2^2}

D = 2^{2^3}

Continuing the pattern, we see that Z = 2^{2^{25}}, or Z = 2^{33,554,432}.

If you try plugging that number into your calculator, you’ll probably get an error. Fortuniately, we can use logarithms to approximate the answer. Since 2 = 10^{\log_{10} 2}, we have

Z = \left( 10^{\log_{10} 2} \right)^{33,554,432} = 10^{33,554,432 \log_{10} 2}

Plugging into a calculator, we find that

Z \approx 10^{10,100,890.5195}

\approx 10^{0.5195} 10^{10,100,890}

\approx 3.307 \times 10^{10,100,890}

green line

When this actually happened to me, it took me about 10 seconds to answer — without a calculator — “I’m not sure, but I do know that the answer has about 10 million digits.” Naturally, my class was amazed. How did I do this so quickly? I saw that the answer was going to be Z = 2^{2^{25}}, so I used the approximation 2^{10} \approx 1000 to estimate

2^{25} = 2^5 \times 2^{10} \times 2^{10} \approx 32 \times 1000 \times 1000 = 32,000,000

Next, I had memorized the fact that that \log_{10} 2 \approx 0.301 \approx 1/3. So I multiplied 32,000,000 by 1/3 to get approximately 10 million. As it turned out, this approximation was a lot more accurate than I had any right to expect.

Inverse Functions: Logarithms and Complex Numbers (Part 30)

Ordinarily, there are no great difficulties with logarithms as we’ve seen with the inverse trigonometric functions. That’s because the graph of y = a^x satisfies the horizontal line test for any 0 < a < 1 or a > 1. For example,

e^x = 5 \Longrightarrow x = \ln 5,

and we don’t have to worry about “other” solutions.

However, this goes out the window if we consider logarithms with complex numbers. Recall that the trigonometric form of a complex number z = a+bi is

z = r(\cos \theta + i \sin \theta) = r e^{i \theta}

where r = |z| = \sqrt{a^2 + b^2} and \tan \theta = b/a, with \theta in the appropriate quadrant. This is analogous to converting from rectangular coordinates to polar coordinates.

Over the past few posts, we developed the following theorem for computing e^z in the case that z is a complex number.

Definition. Let z = r e^{i \theta} be a complex number so that -\pi < \theta \le \theta. Then we define

\log z = \ln r + i \theta.

Of course, this looks like what the definition ought to be if one formally applies the Laws of Logarithms to r e^{i \theta}. However, this complex logarithm doesn’t always work the way you’d think it work. For example,

\log \left(e^{2 \pi i} \right) = \log (\cos 2\pi + i \sin 2\pi) = \log 1 = \ln 1 = 0 \ne 2\pi i.

This is analogous to another situation when an inverse function is defined using a restricted domain, like

\sqrt{ (-3)^2 } = \sqrt{9} = 3 \ne -3

or

\sin^{-1} (\sin \pi) = \sin^{-1} 0 = 0 \ne \pi.

The Laws of Logarithms also may not work when nonpositive numbers are used. For example,

\log \left[ (-1) \cdot (-1) \right] = \log 1 = 0,

but

\log(-1) + \log(-1) = \log \left( e^{\pi i} \right) + \log \left( e^{\pi i} \right) = \pi i + \pi i = 2\pi i.

green line

This material appeared in my previous series concerning calculators and complex numbers: https://meangreenmath.com/2014/07/09/calculators-and-complex-numbers-part-21/

 

 

 

Exponential growth and decay: Index

I’m doing something that I should have done a long time ago: collect past series of posts into a single, easy-to-reference post. The following posts formed my recently completed series on various applications of exponential growth and decay.

Part 1: Introduction: continuous compound interest and the phrasing of homework questions

Paying off credit-card debt

Part 2: Solution using a differential equation.

Part 3: Teaching basic principles of financial literacy.

Part 4: More on financial literacy.

Part 5: Solution using a difference equation.

Part 6: Comparison of the two solutions (difference equation vs. differential equation).

Part 7: An alternative solution of the difference equation that can be derived by Precalculus students.

Part 8: Verifying the solution of the difference equation using a spreadsheet.

Part 9: Amortization tables.

Half-life

Part 10: Derivation of the formula for exponential decay using a differential equation.

Part 11: Rewriting the solution of the differential equation into the half-life formula.

Newton’s Law of Cooling

Part 12: Derivation of the formula using a differential equation.

Part 13: Classroom demonstrations of Newton’s Law of Cooling.

Logistic Growth Model

Part 14: A simple classroom demonstration of the logistic growth model.

Part 15: The governing differential equation for the logistic growth model.

Part 16: Tips on graphing the logistic growth function.

 

 

 

Exponential growth and decay (Part 11): Half-life

In this series of posts, I provide a deeper look at common applications of exponential functions that arise in an Algebra II or Precalculus class. In the previous posts in this series, I considered financial applications. In today’s post, I’ll discuss radioactive decay and the half-life formula.

One way of writing the formula for how a radioactive substance (carbon-14, uranium-235, brain cells) decays is

A(t) = A_0 e^{-kt}

In yesterday’s post, I showed how this formula is a natural consequence of a certain differential equation. Of course, students in Algebra II or Precalculus (or high school chemistry) are usually not ready to understand this derivation using calculus. Instead, they are typically given the final formula and are expected to use this formula to solve problems. Still, I think it’s important for the teacher of Algebra II or Precalculus to be aware of how the origins of this formula, as it only requires mathematics that’s only a year or two away in these students’ mathematical development.

There is another correct way to write this formula in terms of half-life. Sadly, my experience is that many students are familiar with these two different formulas but are not aware of how the two formulas are connected. As we’ll see, while yesterday’s post using differential equations is inaccessible to Algebra II and Precalculus students, the derivation below is entirely elementary and can be understood by good students in these courses.

Let h be the half-life of the substance. By definition, this means that

A(h) = \displaystyle \frac{1}{2} A_0

Substituting into the above formula, we find

\displaystyle \frac{1}{2} A_0 = A_0 e^{-kh}

Let’s now solve for the constant k in terms of h:

\displaystyle \frac{1}{2} = e^{-kh}

\displaystyle \ln \left( \frac{1}{2} \right) = - k h

\displaystyle -\frac{1}{h} \ln \left( \frac{1}{2} \right) = k

Let’s now substitute this back into the original formula:

A = A_0 e^{-kt}

A = A_0 e^{ -\left[ -\frac{1}{h} \ln \left( \frac{1}{2} \right) \right] t}

A = A_0 e^{\ln \left( \frac{1}{2} \right) \cdot \frac{t}{h}}

A = A_0 \left[e^{\ln \left( \frac{1}{2} \right)} \right]^{t/h}

A = A_0 \displaystyle \left( \frac{1}{2} \right)^{t/h}

This is the usual half-life formula, where the previous base of e has been replaced by a new base of \displaystyle \frac{1}{2} . For most applications, a base of e is preferred. However, for historical reasons, the base of \displaystyle \frac{1}{2} is preferred for problems involving radioactive decay. For example,

A(2h) = A_0 \displaystyle \left( \frac{1}{2} \right)^{2h/h}

A(2h) = A_0 \displaystyle \left( \frac{1}{2} \right)^{2}

A(2h) = \displaystyle \frac{1}{4} A_0

In other words, after two half-life periods, only one-fourth (half of a half) of the substance remains.

Exponential growth and decay (Part 6): Paying off credit-card debt via recurrence relations

The following problem in differential equations has a very practical application for anyone who has either (1) taken out a loan to buy a house or a car or (2) is trying to pay off credit card debt. To my surprise, most math majors haven’t thought through the obvious applications of exponential functions as a means of engaging their future students, even though it is directly pertinent to their lives (both the students’ and the teachers’).

You have a balance of $2,000 on your credit card. Interest is compounded continuously with a rate of growth of 25% per year. If you pay the minimum amount of $50 per month (or $600 per year), how long will it take for the balance to be paid?

In previous posts, I approached this problem using differential equations. There’s another way to approach this problem that avoids using calculus that, hypothetically, is within the grasp of talented Precalculus students. Instead of treating this problem as a differential equation, we instead treat it as a first-order difference equation (also called a recurrence relation):

A_{n+1} = r A_n - k

The idea is that the amount owed is multiplied by a factor r (which is greater than 1), and from this product the amount paid is deducted. With this approach — and unlike the approach using calculus — the payment period would be each month and not per year. Therefore, we can write

A_{n+1} = \displaystyle \left( 1 + \frac{0.25}{12} \right) A_n - 50

Notice that the meaning of the 25% has changed somewhat… it’s no longer the relative rate of growth, as the 25% has been equally divided for the 12 months.

green line

In yesterday’s post, I demonstrated that the solution of this recurrence relation is

A_n = r^n P - k \displaystyle \left( \frac{1 - r^n}{1-r} \right).

Let’s now study when the credit card debt will actually reach $0. To do this, we see A_n = 0 and solve for n:

0 = r^n P - k \displaystyle \left( \frac{1 - r^n}{1-r} \right)

0 = r^n \left(P + \displaystyle \frac{k}{1-r} \right) - \displaystyle \frac{k}{1-r}

0 = r^n \left( P[1-r] + k \right) - k

k = r^n \left( P[1-r] + k \right)

\displaystyle \frac{k}{P[1-r] + k} = r^n

\displaystyle \ln \left( \frac{k}{P[1-r]+k} \right) = n \ln r

\displaystyle \frac{ \displaystyle \ln \left( \frac{k}{P[1-r]+k} \right) }{ \ln r} = n

That’s certainly a mouthful. However, this calculation should be accessible to a talented student in Precalculus.

Let’s try it out for k = 50, P = 2000, and r = 1 + \displaystyle \frac{0.25}{12}:

recurrencecreditcard

Remembering that each compounding period is one month long, this corresponds to 86.897/12 \approx 7.24 years, which is nearly equal to the value of 4\ln 6 \approx 7.17 years when we solved this problem using differential equations under the assumption of continuous compound interest (as opposed to interest that’s compoounded monthly).

Exponential growth and decay (Part 4): Paying off credit-card debt

The following problem in differential equations has a very practical application for anyone who has either (1) taken out a loan to buy a house or a car or (2) is trying to pay off credit card debt. To my surprise, most math majors haven’t thought through the obvious applications of exponential functions as a means of engaging their future students, even though it is directly pertinent to their lives (both the students’ and the teachers’).

You have a balance of $2,000 on your credit card. Interest is compounded continuously with a relative rate of growth of 25% per year. If you pay the minimum amount of $50 per month (or $600 per year), how long will it take for the balance to be paid?

In the previous two posts, I presented the general formula

A = \displaystyle \frac{k}{r} - \left( \frac{k}{r} - P \right) e^{rt}

which can be obtained by solving a certain differential equation. So, if r = 0.25, k = 600, and P = 2000, the amount left on the credit card after t years is

A(t) = 2400 - 400 e^{0.25t}.

On the other hand, if the debtor pays $1200 per year, the equation becomes

A(t) = 4800 - 2800 e^{0.25t}

Today, I’ll give some pedagogical thoughts about how this problem, and other similar problems inspired by financial considerations, could fit into a Precalculus course… and hopefully improve the financial literacy of high school students.

green lineUnder the theory that a picture is worth a thousand words, let’s take a look at the graphs of both of these functions:

creditcardStudents should have no trouble distinguishing which curve is which. Clearly, by paying $1200 per year instead of $600 per year, the credit card debt is paid off considerably quicker.

There’s another immediate take-away from these graphs — especially the graph for k = 600, when the debt is being paid off over 7 years. Notice that the debt is being paid off very slowly in the initial years. Only in the latter years does the pace of paying off the loan pick up. So the moral of the story is: if you can afford to pay extra in the early years of a debt (credit card, mortgage, etc.), it’s much more important to pay off an extra amount in the early years than in the later years.

I believe this to be an important lesson for students to learn before they bury themselves deeply in debt as young adults… and Precalculus provides a natural vehicle for teaching this lesson.