09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

112 NUMBER THEORY<br />

arrangements in all. Here are the first few values of the factorial function.<br />

n 01234 5 6 7 8 9 10<br />

n! 1 1 2 6 24 120 720 5040 40320 362880 3628800<br />

It’s useful to know a few factorial facts, like the first six or so values, and the<br />

fact that lo! is about 34 million plus change; another interesting fact is that<br />

the number of digits in n! exceeds n when n > 25.<br />

We can prove that n! is plenty big by using something like Gauss’s trick<br />

of Chapter 1:<br />

n!’ = (1 .2...:n)(n... :2.1) = fik(n+l-k).<br />

We have n 6 k(n + 1 - k) 6 $ (n + 1 )2, since the quadratic polynomial<br />

k(n+l -k) = a(r~+l)~- (k- $(n+ 1))2 has its smallest value at k = 1 and<br />

its largest value at k = i (n + 1). There<strong>for</strong>e<br />

that is,<br />

k=l k=l<br />

n n/2 6 n! <<br />

(n+ l)n<br />

2n .<br />

k=l<br />

(4.22)<br />

This relation tells us that the factorial function grows exponentially!!<br />

To approximate n! more accurately <strong>for</strong> large n we can use Stirling’s<br />

<strong>for</strong>mula, which we will derive in Chapter 9:<br />

n! N &Gi(:)n. (4.23)<br />

And a still more precise approximation tells us the asymptotic relative error:<br />

Stirling’s <strong>for</strong>mula undershoots n! by a factor of about 1 /( 12n). Even <strong>for</strong> fairly<br />

small n this more precise estimate is pretty good. For example, Stirling’s<br />

approximation (4.23) gives a value near 3598696 when n = 10, and this is<br />

about 0.83% x l/l20 too small. Good stuff, asymptotics.<br />

But let’s get back to primes. We’d like to determine, <strong>for</strong> any given<br />

prime p, the largest power of p that divides n!; that is, we want the exponent<br />

of p in n!‘s unique factorization. We denote this number by ep (n!), and we<br />

start our investigations with the small case p = 2 and n = 10. Since lo! is the<br />

product of ten numbers, e:2( lo!) can be found by summing the powers-of-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!