Skip to content

Average-case complexity

The expected computational resource usage of an algorithm or problem under an explicitly specified probability distribution over inputs of each size.

Core Idea

Average-case complexity measures expected resource cost over a declared distribution of inputs, usually conditioned on input size. Each input's cost is weighted by its occurrence probability; asymptotic analysis tracks the resulting expectation and, in stronger treatments, tail behavior across sizes. The abstraction is therefore identified by a declared carrier, a transformation or constraint over that carrier, and an invariant that tells an analyst whether the named structure is genuinely present.

The load-bearing residual is not the broad topic of computational complexity. It is distribution-relative expected complexity distinct from worst-case upper bounds. That residual remains recognizable when examples, notation, scale, or implementation change, but it disappears if the carrier is mistyped, the condition that the input ensemble and resource model are fixed and the reported average is probability-weighted rather than an unqualified mean over convenient examples fails, a neighboring object is substituted, or notation and topical resemblance replace the constitutive test.

How would you explain it like I'm…

The Usual Waiting Time

Some puzzles are quick to solve and some are slow. Average-case complexity asks how long a computer usually takes, counting how often each kind of puzzle really shows up, not just the hardest one and not just a few easy ones you happened to try.

How Long It Usually Takes

Computer scientists like to know how much time or memory a program needs. One way is to look at the very worst input it could get. Average-case complexity instead asks: if inputs show up with certain chances, how much work does the program need on average? Each input's cost is counted according to how likely it is. You have to say up front which inputs you expect and how often — just averaging over a few handy examples doesn't count. A program can be slow in the worst case but fast on average.

Expected-Cost Complexity

Average-case complexity measures the expected amount of a resource, like time, an algorithm uses over a declared probability distribution of inputs, usually for each input size. Each input's cost is weighted by its probability, and asymptotic analysis tracks how that expectation grows with size; stronger analyses also study how likely very bad cases are (tail behavior). It is distinct from worst-case complexity, which bounds the cost of the single hardest input. The result is only meaningful relative to the chosen distribution and resource model: change the distribution and the average can change completely. An unweighted average over a few convenient test examples is not average-case complexity.

 

Average-case complexity is the expected resource cost of an algorithm or problem over a declared distribution of inputs, typically conditioned on input size n. Formally, the cost of each input is weighted by its probability under the ensemble for size n, and asymptotic analysis describes how this expectation grows; stronger treatments also bound tail behavior, since a small expectation can hide rare but very expensive inputs. It is distribution-relative and must be distinguished from worst-case upper bounds: an algorithm can have a poor worst case yet a good expected cost under a given ensemble. The notion is well-defined only when the input ensemble and the resource model are fixed and the reported average is genuinely probability-weighted, rather than a mean over hand-picked or convenient examples. Conclusions transfer only to settings where the assumed distribution actually holds.

Scope of Application

Average-case complexity belongs to computational complexity and is useful where the analyst can specify an algorithm or distributional problem, input length, a probability distribution over inputs, time or space cost, expectation and asymptotic bounds, then evaluate the input ensemble and resource model are fixed and the reported average is probability-weighted rather than an unqualified mean over convenient examples. The scope is broad within that domain but bounded by the need for the input ensemble and resource model are fixed and the reported average is probability-weighted rather than an unqualified mean over convenient examples. The entry records a descriptive analytical identity; practical use requires the governing domain's evidence, standards, and safety obligations.

Clarity

The abstraction clarifies a crowded vocabulary by making the input ensemble and resource model are fixed and the reported average is probability-weighted rather than an unqualified mean over convenient examples the center of the account. A claim should name the carrier, the governing operation or relation, the applicable assumptions, and the recognition test. A bare label is insufficient because the name Average-case complexity can be used for a formal identity, an implementation, or a neighboring result unless carrier and convention are stated.

Manages Complexity

Without the abstraction, an analyst must reason directly over many local details: the carrier roles, admissibility assumptions, competing conventions, derived invariants, boundary cases, and proof or validation obligations specific to Average-case complexity. Average-case complexity compresses them into the roles in the structural signature. That compression permits comparison across instances without erasing the variables that determine validity. It also exposes which details may be varied safely and which are constitutive.

Abstract Reasoning

  1. Identify the carrier. State what the elements, states, objects, or observations are: an algorithm or distributional problem, input length, a probability distribution over inputs, time or space cost, expectation and asymptotic bounds. Reject examples whose alleged carrier belongs to a different problem.
  2. Lock the constitutive rule. Express the input ensemble and resource model are fixed and the reported average is probability-weighted rather than an unqualified mean over convenient examples independently of one notation or implementation.

Knowledge Transfer

Knowledge transfers strongly among subfields of computational complexity because they reuse an algorithm or distributional problem, input length, a probability distribution over inputs, time or space cost, expectation and asymptotic bounds, Each input's cost is weighted by its occurrence probability; asymptotic analysis tracks the resulting expectation and, in stronger treatments, tail behavior across sizes., and type the carrier, state every parameter and convention in the definition, test that the input ensemble and resource model are fixed and the reported average is probability-weighted rather than an unqualified mean over convenient examples, compare the nearest accepted identity, and report counterexamples, uncertainty, and limiting cases.

Relationships to Other Abstractions

Local relationship map for Average-case complexityParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Average-casecomplexityDOMAINPrime abstraction: Measurement — is a kind ofMeasurementPRIME

Current abstraction Average-case complexity Domain-specific

Parents (1) — outgoing typed relations

  • Average-case complexity is a kind of Measurement Prime

    It measures computational resource consumption through a probability-weighted aggregate.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Average-case complexity sits in a crowded region of the domain-specific corpus (24th percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Sampling, Monte Carlo & Estimation (23 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-25