Exercises — Amdahl's Law and Gustafson's Law
This page is a self-test. Each problem is stated cleanly, then hidden inside a collapsible
solution. Try it on paper first, then open the [!recall]- block to check every step. Problems
climb from L1 (just recognise the pieces) to L5 (mastery — combine everything).
Before you start, keep the two master formulas from the parent note Amdahl's Law and Gustafson's Law in front of you.
Every symbol above was built in the parent note; if or "serial fraction" is fuzzy, re-read the [!mistake] on counting time vs. lines before continuing.
Level 1 — Recognition
Goal: identify , , and which formula the wording asks for. No hard algebra yet.
Exercise 1.1
A program runs in seconds on one core. Of that, seconds is serial (cannot be split) and the rest is perfectly parallel. State and if we now run on cores, and say which law applies when the question is "how fast can I finish the same 80-second job?"
Recall Solution 1.1
What we do: is serial time over total time. . The job is fixed size ("the same 80-second job"), so we use Amdahl's Law. The parallel fraction is .
Exercise 1.2
Match each phrase to Amdahl or Gustafson: (a) "How much bigger a simulation can I run in the same hour with more nodes?" (b) "My batch job is fixed; will 16 cores finish it 16× faster?" (c) "Problem grows to keep every processor busy."
Recall Solution 1.2
(a) Gustafson — the workload scales with resources. (b) Amdahl — fixed workload, asking for finish-speed. (c) Gustafson — the defining assumption (problem grows with ).
Exercise 1.3
A code is measured as parallel by runtime. Write , then write the Amdahl formula for without simplifying (just substitute).
Recall Solution 1.3
Parallel is , so serial is . (Numerically this is — computed in L2.)
Level 2 — Application
Goal: turn the substitution into a clean number, including the finished runtime.
Exercise 2.1
Using , from Exercise 1.3, compute to two decimals and the new runtime if the one-core time was ms.
Recall Solution 2.1
Step 1 — denominator: . Step 2 — speedup: . Step 3 — runtime: ms. Why: speedup is , so . Eight cores, but only — the serial tax bites.
Exercise 2.2
A rendering job is serial. Compute Amdahl speedup at . Look at figure below to see why the curve flattens.

Recall Solution 2.2
.
- The curve in the figure rises fast then hugs the ceiling . Serial fraction, not core count, sets the ceiling.
Exercise 2.3 (Gustafson)
A climate run uses nodes; of the wall-clock is serial setup. Using Gustafson, find the scaled speedup.
Recall Solution 2.3
, . Meaning: on nodes we do more grid work per hour than one node could.
Level 3 — Analysis
Goal: reason about why numbers behave as they do; invert the formula; compare the two laws.
Exercise 3.1 (Back-calculate )
You measure a real speedup of on cores. What is the effective serial fraction?
Recall Solution 3.1
Invert Amdahl. Start from , so . Multiply by : . Solve: . Plug : , minus , over : So of runtime is effectively serial — much larger than most people's algorithmic guess, because real overhead (sync, cache) hides inside it.
Exercise 3.2 (Same , both laws)
For and , compute both Amdahl and Gustafson speedups and explain the gap.
Recall Solution 3.2
Amdahl: . Gustafson: . Why the gap: Amdahl holds the problem fixed, so the serial part becomes a bigger and bigger slice as cores speed up the rest — capping near . Gustafson lets the parallel work grow with , so the serial part stays a thin, near-constant slice — speedup stays close to linear ( of ). Same , opposite mood. See the figure.

Exercise 3.3 (Crossover thinking)
For Amdahl with , what is the smallest giving ? (You may need first.)
Recall Solution 3.3
First check the ceiling: . So is reachable (). Good. Set . Then . , so . Smallest integer with is (exactly ).
Level 4 — Synthesis
Goal: build yourself from messy data, then feed it through a law. Watch out for weighted time.
Exercise 4.1 (Weighted serial time)
A loop has iterations. are parallelisable and each costs unit. The other are serial and each costs units (they do disk I/O). Find , then Amdahl .
Recall Solution 4.1
Build from time, not counts. Serial time . Parallel time . Total . Amdahl at : parallel term . Denominator . . Trap avoided: counting iterations would give and an over-optimistic .
Exercise 4.2 (Amdahl → back to time budget)
A s job is serial. Management wants it done in s. (a) Is that possible with Amdahl and enough cores? (b) If not, what serial fraction would make s reachable in the limit?
Recall Solution 4.2
(a) Best case is , giving best time s at . Wait — that's better than s, so s is reachable. Find the : need (since ). cores. Achievable. (b) Not needed here since (a) succeeds; but the general rule: s needs , and the ceiling is , so any keeps s reachable in the limit. Our is well inside that.
Exercise 4.3 (Gustafson from wall-clock breakdown)
A training run on GPUs takes hours: minutes are synchronisation (serial), the rest is gradient work. Find and Gustafson speedup.
Recall Solution 4.3
Total min, serial min, so . We train a model larger in the same wall-clock than one GPU could.
Level 5 — Mastery
Goal: combine inversion, both laws, and a limiting/degenerate case in one chain of reasoning.
Exercise 5.1 (Reconcile the two laws)
On processors you observe Gustafson speedup . (a) Recover . (b) Using that same , what fixed-problem Amdahl speedup would cores give? (c) In one sentence, why are they so different?
Recall Solution 5.1
(a) Invert Gustafson: . (b) Amdahl: denominator . . (c) Same serial fraction: Amdahl (fixed problem) caps near because the serial slice grows in relative weight; Gustafson (scaled problem) stays near because the parallel work grows with the cores.
Exercise 5.2 (Degenerate / limiting cases)
Evaluate carefully: (a) Amdahl with at any . (b) Amdahl with at any . (c) Gustafson with ; with . (d) Amdahl at .
Recall Solution 5.2
(a) (fully parallel): . Perfect linear speedup — the ideal. (b) (fully serial): . No speedup ever; extra cores idle. (c) Gustafson : (linear). : (no speedup). Both laws agree at the two extremes and — they only diverge in between, where the "fixed vs. scaled" assumption actually matters. (d) (Amdahl): . Sanity check: one core can't beat itself — speedup must be exactly . ✓
Exercise 5.3 (Design decision)
Your Amdahl-limited job has . You can either (A) double the cores from to , or (B) halve the serial fraction to while keeping cores. Which wins?
Recall Solution 5.3
Baseline (): . (A) : . (B) : . Winner: (B). Attacking the serial fraction beats throwing hardware at the wall, because the ceiling rose from to . This is the whole moral of Amdahl.
Recall Quick self-check (reveal answers)
Amdahl when ::: Which law is optimistic for scaled problems ::: Gustafson Invert Amdahl for given ::: Invert Gustafson for given ::: Both laws agree at which values ::: and
Related vault topics to push further: Scalability Analysis, Performance Metrics, Load Balancing, Thread Synchronization, Parallel Architectures, GPU Computing, Cache Coherence.