Week 64 of 145 ยท TAOCP Vol 2: Seminumerical Algorithms

TAOCP 3.1 Introduction

3 tasks, 6 steps. Open a task's steps to see exactly what to do; each guide has the detail.

Sign up or sign in to tick these off and give this week a due date.

By the end of this week you can

  • Explain why a complicated procedure need not produce random numbers.
  • Trace the middle-square method on a four-digit seed.
  • Recognize why any generator with finite state must eventually cycle.

Week 64 ยท Self-check

Three quick questions

Ungraded, and it never holds anything up. Pick an answer to see why.

  1. With four-digit middle-square, the seed 1234 squares to 01522756. What is the next number?
  2. Four-digit middle-square starting at 2500: 2500 squared is 06250000. What happens next?
  3. A generator computes X(n+1) = f(X(n)) using 32-bit numbers. Why must its output eventually repeat in a cycle?

Nothing is saved while signed out.

Discussion

0 posts

Stuck on week 64, or finished early? Say what you tried and what happened. Hints over answers: full solutions go in a spoiler.

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

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

Spot a mistake? Report it