O'Reilly logo

Art of Computer Programming, The: Volume 1: Fundamental Algorithms by Donald E. Knuth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercises

1. [00] How many ways are there to shuffle a 52-card deck?

2. [10] In the notation of Eq. (2), show that pn(n−1) = pnn, and explain why this happens.

3. [10] What permutations of {1, 2, 3, 4, 5} would be constructed from the permutation 3 1 2 4 using Methods 1 and 2, respectively?

Image    4. [13] Given the fact that log10 1000! = 2567.60464 ..., determine exactly how many decimal digits are present in the number 1000!. What is the most significant digit? What is the least significant digit?

5. [15] Estimate 8! using the following more exact version of Stirling’s approximation:

    6. [17] Using Eq. (8), write 20! as a product of prime factors. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required