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.

Mathematics · unit version 1

Algorithm reasoning: invariants, termination and cost

Specify state transitions, discover sufficient invariants, prove total correctness and derive operation costs with integer rounding. Compare finite traces with proofs that cover every allowed input.

Open any lesson. Completion records participation; automatic practice checks and human judgment of written arguments are separate. This unit retains its own versioned requirements.

Readiness and preparation

Check your starting point

Try these short questions on paper, then compare your reasoning. They are optional self-checks, not a placement score or a navigation requirement. Use a targeted review when useful and return with your browser’s Back control.

Does an invariant imply that a process stops?

Safety and progress are separate proof obligations.

Compare reasoning and find a refresher

No. A transition that leaves the entire state unchanged preserves every state invariant but can repeat forever. Termination needs a separate argument such as strict descent in a well-founded order.

Review invariants and termination

What does a big-O bound measure?

Operation counts require an explicit cost model and fixed constants.

Compare reasoning and find a refresher

For nonnegative costs, f(n)=O(g(n)) means f(n)≤C g(n) for all n≥n₀ with fixed C and n₀. It does not state elapsed seconds, exact equality or a lower bound.

Review asymptotic bounds and operation counts

Loading saved mathematics work…

Correctness and cost on changed processes

The mixed assessment has separate response history and review criteria; it does not change lesson participation records.

Lesson sequence

Each linked lesson opens on its own page. Expand its details here when you want to check the objectives before choosing.

  1. State models and invariant discovery

    Lesson details and objectives

    Specify a nondeterministic process, repair a weak invariant and prove safety for every permitted transition.

    • Specify states, initial conditions, enabled transitions and rejected operations without hiding a safety assumption in an example.
    • Discover and prove a strengthened inductive invariant across every branch of a nondeterministic process.
    • Distinguish reachable states, invariant states, exit postconditions and termination claims.

    8 practice tasks.

  2. Prove progress with lexicographic descent and an exact work count

    Lesson details and objectives

    Separate safety from termination, prove a two-counter process stops, and derive a rank that counts its remaining transitions exactly.

    • Prove well-founded descent of natural-number pairs even when their sum increases.
    • Derive an exact remaining-transition rank and connect it to total correctness under an explicit execution rule.
    • Diagnose stuttering, faulty resets and non-well-founded numeric domains with counterexamples.

    6 practice tasks.

  3. Rounded recurrences and the operations they count

    Lesson details and objectives

    Derive a divide-and-conquer cost from a real partition, prove all-integer bounds and contrast balanced splitting with a quadratic alternative.

    • Translate a disjoint rounded split and a precisely stated local operation into a recurrence with base cases.
    • Prove all-integer bounds by recursion levels, including partial final levels.
    • Distinguish changed algorithms, loose bounds and measured runtime from the specified deterministic operation count.

    6 practice tasks.