Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Learn through experiments

Count how work grows

Does doubling input double the work of every algorithm?

Entering midway? An operation count is a defined measure of work. Growth describes how it changes as input size increases.

1 · Try

Start with a concrete question

Compare one scan, all ordered pairs and repeated halving on bounded integer input sizes.

Try the initial inputs, then write a prediction before changing one setting. All calculations run locally on your CPU.

Go directly to the experiment · Review prerequisite mathematics and return here

2 · Predict

What do you expect?

Predict before calculating: Does doubling input double the work of every algorithm?

3 · Experiment

Change one thing. Inspect what happens.

  1. Predict work for n=4 and n=8 in each pattern.
  2. Trace the halving sizes and distinguish floor rounding.
  3. Read the shared-scale plot and compare ratios.
  4. Write a small loop and count its work independently from timing.
Experiment inputs
Inputs
Your settings
Mechanism
Calculation below
Evidence
Compare outcomes
Counted work8 operations
Formula prediction8 operations

Work on integer sizes 1 through 16

Horizontal: input size n. Vertical: named operations.

00812816256linear scan: (1, 1)linear scan: (2, 2)linear scan: (3, 3)linear scan: (4, 4)linear scan: (5, 5)linear scan: (6, 6)linear scan: (7, 7)linear scan: (8, 8)linear scan: (9, 9)linear scan: (10, 10)linear scan: (11, 11)linear scan: (12, 12)linear scan: (13, 13)linear scan: (14, 14)linear scan: (15, 15)linear scan: (16, 16)all ordered pairs: (1, 1)all ordered pairs: (2, 4)all ordered pairs: (3, 9)all ordered pairs: (4, 16)all ordered pairs: (5, 25)all ordered pairs: (6, 36)all ordered pairs: (7, 49)all ordered pairs: (8, 64)all ordered pairs: (9, 81)all ordered pairs: (10, 100)all ordered pairs: (11, 121)all ordered pairs: (12, 144)all ordered pairs: (13, 169)all ordered pairs: (14, 196)all ordered pairs: (15, 225)all ordered pairs: (16, 256)halving probes: (1, 1)halving probes: (2, 2)halving probes: (3, 2)halving probes: (4, 3)halving probes: (5, 3)halving probes: (6, 3)halving probes: (7, 3)halving probes: (8, 4)halving probes: (9, 4)halving probes: (10, 4)halving probes: (11, 4)halving probes: (12, 4)halving probes: (13, 4)halving probes: (14, 4)halving probes: (15, 4)halving probes: (16, 5)
  • 1. linear scan (solid line)
  • 2. all ordered pairs (dashed line)
  • 3. halving probes (dashed line)

Axes use the displayed ranges.

Read plotted values as a table
Seriesinput size nnamed operations
linear scan11
linear scan22
linear scan33
linear scan44
linear scan55
linear scan66
linear scan77
linear scan88
linear scan99
linear scan1010
linear scan1111
linear scan1212
linear scan1313
linear scan1414
linear scan1515
linear scan1616
all ordered pairs11
all ordered pairs24
all ordered pairs39
all ordered pairs416
all ordered pairs525
all ordered pairs636
all ordered pairs749
all ordered pairs864
all ordered pairs981
all ordered pairs10100
all ordered pairs11121
all ordered pairs12144
all ordered pairs13169
all ordered pairs14196
all ordered pairs15225
all ordered pairs16256
halving probes11
halving probes22
halving probes32
halving probes43
halving probes53
halving probes63
halving probes73
halving probes84
halving probes94
halving probes104
halving probes114
halving probes124
halving probes134
halving probes144
halving probes154
halving probes165

Follow the calculation

  1. One scan reads each of 8 entries once.
  2. Operations are named teaching work units, not measured running time. Constants, implementation details and input-dependent behavior matter.

Growth classes compare how work changes with input size. A logarithmic probe count here assumes the problem can discard half of the candidates each time.

Trace a recursive odd-number sum

The named function recursively computes the sum of the first n odd numbers. Repair the base case, run small n up to 10, and compare its result with n². Inspect the call trace and explain why n decreases toward zero. This verifies examples; the induction workspace supplies the general argument.

181/8,000 characters. Drafts save locally and are included in backups. Importing or opening a draft never runs it.

Bounded JavaScript subset: variables, primitive arrays, conditions, loops, functions and print. No browser objects, network, imports or eval. Maximum 10,000 operations, 64 array items, call depth 16, strings of 256 characters, 40 output lines / 4,000 output characters and 160 trace frames.

Compare with my earlier draft
function oddSum(n) {
  if (n === 0) return 1;
  return oddSum(n - 1) + 2 * n - 1;
}
print(oddSum(0), "expected 0");
print(oddSum(4), "expected 16");
print(oddSum(7), "expected 49");

Explain what you changed and why in your observation notes. Text differences do not establish quality.

Inspect an example solution after your attempt
function oddSum(n) {
  if (n === 0) return 0;
  return oddSum(n - 1) + 2 * n - 1;
}
print(oddSum(0), "expected 0");
print(oddSum(4), "expected 16");
print(oddSum(7), "expected 49");

This is one worked example. Test another input and explain its limitations.

Captures keep your inputs, prediction and observation. Results are recalculated from those inputs. Resetting inputs keeps your captures and challenge history.

4 · Understand

Explain the mechanism

Count how work grows

Compare one scan, all ordered pairs and repeated halving on bounded integer input sizes.

Concepts to recall

An operation count is a defined measure of work. Growth describes how it changes as input size increases.

Understand the mechanism

A single scan uses n reads. Two full nested loops use n² pair inspections.

Repeated halving includes the initial probe and ends after the remaining size reaches zero: floor(log₂n)+1 probes.

Big-O describes an asymptotic upper growth bound, not a measured runtime or a guarantee that one implementation is faster at small n.

Symbols and calculation

Linear n; quadratic n²; halving floor(log₂n)+1. log₂n is the exponent giving 2 raised to that power equal to n.

Worked example

One scan reads each of 8 entries once.

Operations are named teaching work units, not measured running time. Constants, implementation details and input-dependent behavior matter.

Your investigation

  1. Predict work for n=4 and n=8 in each pattern.

  2. Trace the halving sizes and distinguish floor rounding.

  3. Read the shared-scale plot and compare ratios.

  4. Write a small loop and count its work independently from timing.

Limits and interpretation

  • These are bounded teaching models with explicit assumptions, not evidence of a real-world intervention.
5 · Apply

Try a fresh case

Two full nested loops each iterate 12 times. How many ordered pairs do they inspect?

This is a public practice check. Retries support learning; matching a number does not certify independent proficiency.

Take the investigation further

Choose any extension. These are project prompts for you to carry out; they are not automatically assessed.

School investigation

Explain a fresh small numerical case with a diagram or table and an argument.

College investigation

Implement the method, test a boundary or counterexample, and justify its assumptions.

Workplace investigation

Use a small decision scenario, state units and constraints, and test how the recommendation changes.

6 · Continue

Keep the evidence, choose your next step

Completion records your own decision that you have worked through this investigation. Practice checks and independent project evidence are separate.