For a nonnegative counting quantity , an FPRAS is a randomized algorithm with the displayed guarantee, running in time polynomial in encoded input length, and . The usual constant-success definition is equivalent by independent repetition and a median. This counting notion differs from a deterministic fully polynomial-time approximation scheme for optimization.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 124 4 i Solution Created 2026-09-24 Updated 2026-09-25
A language belongs to RP when a polynomial-time randomized algorithm rejects every and accepts every with probability at least .
Amplify the algorithm on length- inputs with independent repetitions, accepting if any repetition accepts. Its error on each positive input is at most , while it still never accepts a negative input. Choose all random bits for all repetitions in advance. By the union bound, the probability that this one fixed choice fails on at least one of the at most positive strings is at mostThus some random string works simultaneously for every input of length . Hardwire that string into the polynomial-time computation and compile it into a Boolean circuit. The resulting polynomial-size circuit family decides , proving
Semicoloring Created 2026-10-05 Updated 2026-10-14
A -semicoloring of a finite graph assigns one of colors to every vertex and is a proper graph colouring on an induced subgraph containing at least half the vertices. This is weaker than a proper coloring of the whole graph, and is useful as an intermediate step in a randomized algorithm.
Universal hash family 2026-10-13
A universal hash family is a finite collection of hash functions into an output set of size such that, for any fixed distinct inputs ,The choice of uses the uniform distribution on a finite set. The keys are fixed before that choice: the randomness belongs to the hash function, so the guarantee does not assume naturally random keys. Choose one member and keep it while using the table; changing it requires redistributing the stored records. The bound holds separately for every distinct pair, without requiring uniform individual outputs or independent random variables. A strongly universal hash family supplies those stronger properties.
The practical payoff follows from linearity of expectation. If stored keys are distinct from a fixed query, let count how many share its bucket. Then : each key contributes at most to the expected value. With stored keys and buckets, an unsuccessful search encounters at most one record on average over the random choice of hash function. This is an expected value, not a limit on every search; one unlucky choice can still create a long chain.
This calculation needs no independence between the collision events: linearity of expectation adds their individual probabilities. The fixed-query condition matters, since deliberately choosing keys after inspecting the selected hash function can target a crowded bucket.
Carter and Wegman introduced this way of analyzing storage and retrieval in their 1977 paper: average over a chosen class of hash functions while allowing any fixed sequence of inputs. Their 1979 journal version develops the same universal-pair collision condition and constructions. The insight is useful because a randomized algorithm can obtain a performance guarantee through its own choices, even when its inputs have inconvenient patterns.[ref]
https://dl.acm.org/doi/10.1145/800105.803400. Carter and Wegman, Universal classes of hash functions, STOC 1977
[ref]https://www.cs.princeton.edu/courses/archive/fall09/cos521/Handouts/universalclasses.pdf. Carter and Wegman, Universal Classes of Hash Functions, 1979
Wald's equation Created 2026-10-03 Updated 2026-10-14
Wald's equation turns a random sum into a product of two expected values: the average contribution per step and the average number of steps. Its surprising feature is that the number of steps may depend on what has already happened. A procedure can stop on its first successful Bernoulli trial, for example, while the identity still accounts for its total cost. The crucial restriction is that the decision to take the next step cannot use that step's unobserved outcome.
Let be real independent and identically distributed random variables with , let , and put and . Suppose is a nonnegative integer-valued stopping time for the natural filtration , with . Then is an integrable random variable andThese hypotheses allow statistical dependence between and the increments; they do not allow access to future increments. The finite-expected value requirement is stronger than stopping almost surely.[ref]
For the proof idea, count step only on . This event is determined by the first observations, so its indicator function is independent of . The Proof of Wald's equation by stopping indicators combines this observation with the tail-sum formula for expectation. The same calculation with gives , which justifies interchanging the expected value and the infinite series. This is why the result survives a data-dependent end point without assuming an independent count.
The identity is useful in randomized algorithms and repeated sampling: one can translate an average amount of work into an average number of attempts, or conversely, without first finding the full probability distribution of the total. The examples below separate a permissible stopping rule from a rule that peeks ahead and from a valid rule whose average waiting time is infinite.