Why does the ratio between one operation count and the next reveal more than the counts themselves — and what can counting still not settle?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
The counting wrapper ran mysum and recorded 3004 operations for this input and 304 operations for the input before it. Work out the x more value the wrapper would print for this row, rounded to 5 decimal places, and assign it to multiplier.
The counting wrapper and its multiplier column
Write what count_wrapper prints for each input, the total operations and the ratio to the previous row, and note the first row's hard-coded 1.0 multiplier.
Constant and linear counts: c_to_f and mysum
Record c_to_f holding at 3 operations for every input, and mysum's 304, 3004, 30004 matching with multipliers climbing toward 10 from below.
square's two runs and growth
Write both runs: doubling the input gives about the operations, multiplying the input by 10 gives about , and state the resulting relationship.
Counting versus timing, and counting's weakness
State what counting fixes, the same totals on any machine or in any language and never a bare 0, then record its weakness, the undefined choice of which operations count.