The number of digits in n! (Part 1)

When I was in school, perhaps my favorite pet project was trying to find a formula for the number of digits in n!. For starters:

  • 0! = 1: 1 digit
  • 1! = 1: 1 digit
  • 2! = 2: 1 digit
  • 3! = 6: 1 digit
  • 4! = 24: 2 digits
  • 5! = 120: 3 digits
  • 6! =720: 3 digits
  • 7! = 5040: 4 digits
  • 8! = 40,320: 5 digits

I owned what was then a top-of-the-line scientific calculator (with approximately the same computational capability as a modern TI-30), and I distinctly remember making a graph like the following on graph paper. The above calculations contribute the points (0,1), (1,1), (2,1), (3,1), (4,2), (5,3), (6,3), (7,4), and (8,5).

factorialdigitsI had to stop (or, more accurately, I thought I had to stop) at 69! because my calculator couldn’t handle numbers larger than 10^{100}.

I stared at this graph for weeks, if not months, trying to figure out an equation that would fit these points. And I never could figure it out.

And, to this day, I’m somewhat annoyed at my adolescent self that I wasn’t able to figure out this puzzle for myself… since I had all the tools in my possession needed to solve the puzzle, though I didn’t know how to use the tools.

In this series of posts, I’ll answer this question with the clever application of some concepts from calculus and precalculus.

Too many significant digits (Part 2)

In yesterday’s post, I had a little fun with this claim that the Nike app could measure distance to the nearest trillionth of a mile. The more likely scenario is that the app just reported all of the digits of a double-precision floating point number, whether or not they were significant.

significantdigits

In real life, I’d expect that the first three decimal places are accurate, at most. According to Wikipedia, the official length of a marathon is 42.195 kilometers, but any particular marathon may be off by as many as 42 meters (0.1% of the total distance) to account for slight measurement errors when figuring out a course of that length.

A history about the Jones-Oerth Counter, the devise used to measure the distance of road running courses, can be found at the USA Track and Field website. And my friends who are serious runner swear that the Jones-Oerth Counter is much more accurate than GPS.

green line
The same story often appears in students’ homework. For example:

If a living room is 17 feet long and 14 feet wide, how long is the diagonal distance across the room?

Using the Pythagorean theorem, students will find that the answer is \sqrt{485} feet. Then they’ll plug into a calculator and write down the answer on their homework: 22.02271555 feet.

This answer, of course, is ridiculous because a standard ruler cannot possibly measure a distance that precisely. The answer follows from the false premise that the numbers 17 and 14 are somehow exact, without absolutely no measurement error. My guess is that at most two decimal places are significant (i.e., the numbers 17 and 14 can be measured accurately to within one-hundredth of a foot, or about one-eighth of an inch).

My experience is that no many students are comfortable with the concept of significant digits (or significant figures), even though this is a standard topic in introductory courses in chemistry and physics. An excellent write-up of the issues can be found here: http://www.angelfire.com/oh/cmulliss/

Other resources:

http://mathworld.wolfram.com/SignificantDigits.html

http://en.wikipedia.org/wiki/Significant_figures

http://en.wikipedia.org/wiki/Significance_arithmetic

 

Too many significant digits (Part 1)

The following appeared on my Facebook feed a while back:

significantdigits

Just look at that: the Nike app claimed to measure the length of my friend’s run with twelve decimal places of accuracy.

Let’s have some fun with this. Just suppose that the app was able to measure distance to the nearest trillionth of a mile. One trillionth of a mile is…

5.28 billionths of a foot,

or about 63.4 billionths of an inch,

or about 161 billionths of a centimeter,

or about 1.61 billionths of a meter,

or about 1.61 nanometers.

By way of comparison, the fingernails on the average adult grow about 3 millimeters a month. A world-class runner could run 6.25 miles in about 30 minutes; in those 30 minutes, his/her fingernails would grow about 2 microns, or about 2000 nanometers. (Of course, they’ll grow longer for less athletic runners covering the same distance at a slower speed.)

So if the Nike app can measure my distance to the nearest trillionth of a mile, it would have absolutely no difficulty measuring how much my fingernails grew while running.

Or, it could be that the Nike app really isn’t measuring the distance all that precisely. Probably the app used double-precision arithmetic, and whoever programmed the app didn’t tell it to truncate after a reasonable number of digits.

Lychrel Numbers

A friend of mine posted the following on Facebook (with names redacted):

So [my daughter] comes home with this assignment:

For each number from 10 – 99, carry out the following process.

  1.  If the number is a palindrome (e.g., 77), stop.
  2.  Else reverse the number and add that to the original. E.g.: 45+54 = 99.
  3.  If the result is not a palindrome, repeat step (2) with the result.
  4.  Record the final palindromic result and the number of steps taken.

Most are simple.

  • 56 + 65 = 110
  • 110 + 011 = 121
  • Stop. 2 steps taken.

The numbers 89 and 98 were given for extra credit, and they mysteriously explode, taking 24 steps. It made [my daughter] cry.

She wanted me to check her work, so I decided it was a good time to teach the wonders of Python, and we very quickly had a couple of simple functions to do the trick.

Well, you saw where this was going. How many steps does 887 take?

We’re up to 104000 steps so far, and Python is crying.

True or false: For a given n, the above algorithm completes in finite time?

I guess I’ve been living under a rock for the past 20 years, because I had never heard of this problem before. It turns out that numbers not known to lead to a palindrome are called Lychrel numbers. However, no number in base-10 has been proven to be a Lychrel number. The first few candidate Lychrel numbers (i.e., numbers that have not been proven to not be Lychrel numbers) are 196, 295, 394, 493, 592, 689, 691, 788, 790, 879, 887, 978, 986, 1495, 1497, 1585, 1587, 1675, 1677, 1765, 1767, 1855, 1857, 1945, 1947, 1997, 2494, 2496, 2584, 2586, 2674, 2676, 2764, 2766, 2854, 2856, 2944, 2946, 2996, 3493, 3495, 3583, 3585, 3673, 3675…

The above algorithm is called the 196-algorithm, after the smallest suspected Lychrel number.

For further reading, I suggest the following links and the references therein:

http://mathworld.wolfram.com/196-Algorithm.html

http://mathworld.wolfram.com/LychrelNumber.html

http://www.p196.org/

http://www.mathpages.com/home/kmath004/kmath004.htm (which contains a proof that 10110 is a Lychrel number in binary and that Lychrel numbers always exist in base 2^k)

http://en.wikipedia.org/wiki/Lychrel_number

Proof without words: The difference of consecutive cubes

Source: https://www.facebook.com/photo.php?fbid=451328078334029&set=a.416585131808324.1073741827.416199381846899&type=1&theater

For a more conventional algebraic proof, notice that

(n+1)^3 - n^3 = n^3 + 3n^2 + 3n + 1 - n^3 = 3n(n+1) + 1

The product n(n+1) is always an even number times an odd number: if n is even, then n+1 is odd, but if n is odd, then n(n+1). So n(n+1) is a multiple of 2, and so 3n(n+1) is a multiple of 6. Therefore, 3n(n+1)+1 is one more than a multiple of 6, proving the theorem.

An Evaluative Calculus Project: Applying Bloom’s Taxonomy to the Calculus Classroom

Every so often, I’ll publicize through this blog an interesting article that I’ve found in the mathematics or mathematics education literature that can be freely distributed to the general public. Today, I’d like to highlight Gizem Karaali (2011) An Evaluative Calculus Project: Applying Bloom’s Taxonomy to the Calculus Classroom, PRIMUS: Problems, Resources, and Issues in Mathematics Undergraduate Studies, 21:8, 719-731, DOI: 10.1080/10511971003663971

Here’s the abstract:

In education theory, Bloom’s taxonomy is a well-known paradigm to describe domains of learning and levels of competency. In this article I propose a calculus capstone project that is meant to utilize the sixth and arguably the highest level in the cognitive domain, according to Bloom et al.: evaluation. Although one may assume that mathematics is a value-free discipline, and thus the mathematics classroom should be exempt from focusing on the evaluative aspect of higher-level cognitive processing, I surmise that we as mathematics instructors should consider incorporating such components into our courses. The article also includes a brief summary of my observations and a discussion of my experience during the Fall 2008 semester, when I used the project described here in my Calculus I course.

The full article can be found here: http://dx.doi.org/10.1080/10511971003663971