I would first collapse the duration noises as in part (c), then use self-normalized importance sampling on the two shared parameters. Draw independent , give each the importance weight , and returnThis is likelihood weighting: the observations affect the weights rather than forcing repeated simulation of twenty latent inequalities. Integrating out both the constraints' auxiliary randomness and the future Boolean query is Rao-Blackwellization; at fixed parameters it removes randomness without changing the relevant conditional expectations.
The weights and weighted queries lie in , and the evidence is positive. The strong law of large numbers therefore makes the numerator and denominator averages converge to their corresponding integrals, proving almost sure convergence of their ratio to part (d). The finite- ratio is generally biased; the assertion concerns consistency rather than a finite-sample unbiased estimator. Use logarithms of importance weights to avoid numerical underflow:
def weighted_answer(n, rng):
if n <= 0:
raise ValueError("n must be positive")
samples = []
for _ in range(n):
mu = rng.uniform(0.0, 60.0)
sigma = rng.uniform(1.0, 20.0)
samples.append((journey_loglik(mu, sigma),
math.exp(5.0 * normal_logcdf((mu - 30.0) / sigma))))
offset = max(logw for logw, h in samples)
if not math.isfinite(offset):
raise ArithmeticError("all weights underflowed")
scaled = [(math.exp(logw - offset), h) for logw, h in samples]
den = math.fsum(w for w, h in scaled)
answer = math.fsum(w * h for w, h in scaled) / den
ess = den * den / math.fsum(w * w for w, h in scaled)
return answer, essThe returned effective sample size of importance sampling is a concentration diagnostic, not a proof of accuracy. Repeat runs and inspect the weights. If the prior is much broader than the posterior, improve the proposal with the corresponding importance sampling density correction, or use the Metropolis–Hastings algorithm targeting . Because this particular collapsed problem is only two-dimensional, deterministic numerical integration is also an excellent independent accuracy check; it was used for the figure and numerical illustration. Straight rejection of the original traces is correct but wastes most proposals here.
The strong law of large numbers says that, for real independent and identically distributed random variables with ,The assertion is almost sure convergence of the entire sequence of sample means. Finite first absolute moment suffices; a finite variance is not required.
For , the target is reached at time zero, so . For , the preceding almost sure convergence gives with probability one. A sample path with unit upward and downward steps must visit every intermediate integer when it crosses from a negative value to a positive value. It must therefore visit zero at a finite time. ThusThe unit-step property matters: positive long-run displacement alone would not force a walk with larger upward jumps to land exactly on zero.
Work on the single event of probability one where . On every sample path in that event, and the unit-step property ensures that every positive integer is reached, so . Starting from zero requires at least steps to reach , hence and .
The convergent numerical sequence on this fixed sample path also converges along its possibly random subsequence . Since ,Taking the reciprocal is valid because . We obtainThis is a first-passage law of large numbers for an upward skip-free random walk. No independence between the hitting times and the path is needed: almost sure convergence already supplies convergence along every diverging subsequence on the same event.
The precise conclusion isTo prove it, observe that the maximum rises exactly when the new height difference is positive:A block landing in a shorter column produces and no rise; every other case raises the maximum and leaves . Starting from , telescoping givesThe difference chain is irreducible and positive recurrent by part (i). Apply the countable-state Markov chain ergodic theorem to the bounded indicator function . Its stationary mean is , giving the asserted almost sure convergence. No aperiodicity assumption is needed for this time average. This establishes the growth rate of two-column sticky deposition.
If , then almost surely. Intersecting these events over all still gives an event of probability one. On it, , so the products have a finite nonnegative limit .
For every , the inclusion and part (c)(i) imply . Taking for positive integers proves almost surely. ThusThe monotonicity is the extra ingredient that upgrades convergence in probability to almost sure convergence here.
Taking logarithms of the product givesBy part (d)(i), in probability distribution, where has the exponential distribution of rate one. Thus and . The strong law of large numbers givesIf , choose . Eventually , so . If , choose ; eventually . ThereforeIn particular, the second range cannot have almost sure convergence to zero. This is the almost-sure growth rate of independent products. At the logarithmic limit is zero, which by itself decides neither behavior; that boundary case is not requested.
First take integers . For independent copies of , defineThe two blocks involve disjoint families of independent random variables, so and are independent. The assumed strictly stable distribution gives , , andTherefore, on any fixed probability space carrying and an independent copy , their joint probability distribution givesNow fix an arbitrary and choose rationals tending to . Continuity of the real powers gives, on that fixed probability space,The left sides all have the probability distribution of . Since almost sure convergence implies convergence in distribution, their limit has that same probability distribution. HenceThis proves strict stability implies self-decomposability. The limit argument uses no moment-generating function or finite moments, which is essential for general stable distributions.
The L2-bounded martingale convergence theorem states that a martingale with converges both almost surely and with convergence in L2 to a square-integrable random variable. Its hypotheses hold because . Thus there is almost surely with both kinds of convergence. Alternatively, the martingale convergence theorem gives the almost sure convergence, and the bound gives convergence in L2 by the dominated convergence theorem.[ref]
Probability: Theory and Examples (fifth edition) by Rick Durrett. §4.4, Theorem 4.4.6, printed p. 237: the Lp martingale convergence theorem
The calculation of the conditional expectation of the square is especially informative. The martingale property makes the cross term vanish in the square expansion, soSubtracting this from givesTaking expected values and iterating provesBy bounded convergence theorem, . The random variable inside this expected value is nonnegative, so it is zero almost surely; on this forces . Again by bounded convergence theorem, . HenceThis is the Bernoulli polarization martingale with update size . It also has an exact mean squared error: the terminal representation and the equality case for conditional second moments give
The floor function gives the deterministic boundfor every outcome, including . Thus all three convergence assertions hold: there is pointwise, and hence almost sure convergence, as well as convergence in probability and convergence in L2. In detail, for the probability is zero as soon as ; alsoThe uniform distribution even gives the exact second moment of the error by integrating over the dyadic partition:
For a simple symmetric random walk, the infinite mean first passage of a simple symmetric random walk gives a finite almost sure first passage to . The stopped martingale is nonnegative and eventually zero almost surely. Nevertheless for every , so it has almost sure convergence but no convergence in L1. It is therefore not uniformly integrable. Before absorption the nearest-neighbour walk is at most zero, ensuring nonnegativity.
Strong law of large numbers Created 2026-09-24 Updated 2026-10-14
Let be real independent and identically distributed random variables with , and let be their expected value. Their sample mean satisfiesThis is almost sure convergence: with probability one, an entire infinite sequence of observations has averages that eventually stay within every prescribed positive tolerance of . The variance need not be finite. The strong law of large numbers implies the weak law of large numbers, which asserts convergence in probability at each increasing sample size.
For independent trials with a Bernoulli distribution of parameter , is one for success and zero for failure. Then is the observed success proportion, and the strong law of large numbers says almost surely. This turns a theoretical probability into a quantity one can estimate by repetition. It does not say that each new trial improves the estimate: a long string of failures can move the proportion away from before later observations bring it back.
The strong law of large numbers gives the limiting location of the sample mean, while the central limit theorem describes its fluctuations when the variance is finite and positive. The two assertions can hold together:The first error shrinks to zero; the second has been enlarged enough to retain a nontrivial probability distribution. The second assertion is convergence in distribution, not a claim that the enlarged error along one sequence approaches a particular normal random variable.
The assumptions make a practical difference. If every observation repeats the same nonconstant Bernoulli random variable, , then for all : identical probability distributions alone do not make repeated observations informative. For independent observations with a Standard Cauchy distribution, the Cauchy sample mean has an unchanged distribution, so it does not concentrate around a constant. Its expected value is undefined, and ; neither example contradicts the stated strong law of large numbers.
A brief proof outline in the case of finite variance uses the Kolmogorov maximal inequality for the centered partial sums. The probability that their maximum up to exceeds is at most . These bounds are summable, so the Borel-Cantelli lemma controls all sufficiently large such blocks and hence every intermediate sample size. The general case requires truncation to control large observations; the argument using finite variance alone does not prove that full version.
Suppose is integrable and adapted, and is finite and adapted. Use the stopped predictable budget for adapted increments with an integer budget . The process is an integrable nonnegative supermartingale, because its budget decrement cancels the localized drift. It has a finite almost-sure limit. On the event that the total drift is smaller than , the stopping time is infinite, so itself converges. Taking the countable union over integer budgets proves finite almost sure convergence. No expectation of the total drift is needed.
An -bounded supermartingale has an almost sure convergence limit in . The conditional-expectation martingale has uniform integrability and converges to both almost surely and in . To identify its limit, test against every event in every finite-time sigma-algebra and use uniqueness on their generated sigma-algebra. Then is a supermartingale tending to zero almost surely. There is no general nonnegativity conclusion for , nor general convergence in L1 to zero: the negative of the fair-coin doubling martingale is a counterexample to both stronger assertions.
A uniformly integrable martingale has almost sure convergence and convergence in L1 to an integrable random variable , and .
Weak law of large numbers Created 2026-09-24 Updated 2026-10-14
Let be real independent and identically distributed random variables with and expected value . The weak law of large numbers states that their sample mean has convergence in probability to : for every fixed ,Thus a large sample is unlikely to give an average with a specified fixed-size error. The strong law of large numbers makes the stronger statement of almost sure convergence along an entire sequence. Under the displayed assumptions both laws apply; their names distinguish the conclusions, not two competing predictions.
When the variance is finite, variance additivity for independent random variables gives . The Chebyshev inequality immediately supplies a useful quantitative form and a brief proof:For independent trials with a Bernoulli distribution of parameter , the expected value is and the variance is . At , the chance of an error of at least is therefore at most . The exact binomial distribution gives a much smaller probability, as the figure under the strong law of large numbers shows. The bound is conservative, but it is valid for every sample size under these assumptions and does not require a normal approximation.
The weak law of large numbers addresses a fixed tolerance . The central limit theorem instead resolves errors on the shrinking scale and gives their approximate normal distribution. In particular, the weak law of large numbers alone supplies neither a bell-shaped error law nor a universal rate of approach. For example, a Pareto distribution with minimum one and shape has expected value three but infinite variance: both the weak law of large numbers and strong law of large numbers apply, while the finite-variance statement of the central limit theorem does not.
