TAOCP Vol 2: Seminumerical Algorithms · Week 89

TAOCP Vol 2 review

Updated

About 5 hours918 exercises, rated 00 to HM50

Summary

TAOCP Vol 2 review: A review week for Volume 2: random numbers and arithmetic. Budget about 5 hours; do exercises 3.1-23, 3.2.2-16 and 3.4.1-16.

Flashcards 14 cards for Anki and AnkiMobile · all decks

Anki deck.tsv

This week's steps

3 steps
  1. Read §Vol 2 review

    Tidy up the code you wrote: PRNGs, tests, bignums, gcd, factoring.

  2. Work the exercises (8 picked)

    Start with Ex 3.1-23, Ex 3.2.2-16, Ex 3.4.1-16; log what you solve below.

  3. Write down one thing you'd explain to someone

    A few sentences in your own words in Your notes: the idea, why it works, an example. 30 words ticks this.

Sign in to track this: tick each step off and it counts toward your week.

Exercises

Vol 2 has 918 exercises in all, rated 00 to HM50, and about 240 of them carry Knuth's triangle for recommended. Use the week to finish ones you skipped, or try this mixed set, which you have not seen in the weekly picks: one or two from each part of the volume, referenced as section-number.

Worth your time

  • Exercise 3.1-23M26▶ Recommended

    Encode every mapping as a sequence with a bijection. Combinatorial review.

    Discuss

  • Exercise 3.2.2-16M28▶ Recommended

    Show that the shift-register method produces a linear recurrence mod 2.

    Discuss

  • Exercise 3.4.1-16HM22▶ Recommended

    Design a rejection sampler for gamma deviates of small order.

    Discuss

  • Exercise 4.2.2-30M30▶ Recommended

    Explain wildly wrong calculator results on a harmless-looking function. Floating-point review.

    Discuss

  • Exercise 4.3.1-21M23▶ Recommended

    How rarely the corrected trial quotient is still wrong.

    Discuss

  • Exercise 4.5.2-38M32▶ Recommended

    Make the binary gcd fast for big numbers, Lehmer-style.

    Discuss

  • Exercise 4.5.4-41M28▶ Recommended

    Count primes faster than finding them all.

    Discuss

  • Exercise 4.6.4-38HM32▶ Recommended

    Prove that Horner's rule is optimal when coefficients are not preprocessed.

    Discuss

Your log

Sign in to log the exercises you work: number, rating, how far you got.

Your notes

Only you

Sign in to keep private notes on this guide, in Markdown. They stay yours: never on your profile, and you can export them all.

Discussion

0 posts

Questions about the reading go here; each exercise has its own thread below. Hints over answers.

No posts yet. Ask a question or share a tip.

Sign in to postAnyone can read. Posting needs an account with a confirmed email.

Exercise threads

One thread per exercise. Open one to ask for a nudge or check your thinking.

  • Exercise 3.1-23M26No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 3.2.2-16M28No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 3.4.1-16HM22No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 4.2.2-30M30No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 4.3.1-21M23No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 4.5.2-38M32No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 4.5.4-41M28No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

  • Exercise 4.6.4-38HM32No posts yet

    Hints over answers. Say what you tried; put an answer or a full solution inside a spoiler: ||like this|| or a ```spoiler block.

    Sign in to postAnyone can read. Posting needs an account with a confirmed email.

Reference

Why it matters

Vol 3 leans on probability (from chapter 3) and on the analysis style you practiced. A quick review makes the switch smoother.

Before you start
  • All of Vol 2
How to approach it

Tidy up the code you wrote: PRNGs, tests, bignums, gcd, factoring. Put it in one repo with tests. Write a one-page summary of what to use in practice for random numbers and for big arithmetic.

Common traps
  • Skipping review. This is the halfway point of the whole path.

Spot a mistake? Report it

Back to week 89