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.
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
What do you expect?
Predict before calculating: Does doubling input double the work of every algorithm?
Change one thing. Inspect what happens.
- Predict work for n=4 and n=8 in each pattern.
- Trace the halving sizes and distinguish floor rounding.
- Read the shared-scale plot and compare ratios.
- Write a small loop and count its work independently from timing.
Your settingsMechanism
Calculation belowEvidence
Compare outcomes
Work on integer sizes 1 through 16
Horizontal: input size n. Vertical: named operations.
- 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
| Series | input size n | named operations |
|---|---|---|
| linear 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 |
Follow the calculation
- 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.
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.
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
Predict work for n=4 and n=8 in each pattern.
Trace the halving sizes and distinguish floor rounding.
Read the shared-scale plot and compare ratios.
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.
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.
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.