Part of a series on statistics 
Probability theory 

In probability theory, the law of large numbers (LLN) is a theorem that describes the result of performing the same experiment a large number of times. According to the law, the average of the results obtained from a large number of trials should be close to the expected value and tends to become closer to the expected value as more trials are performed.^{[1]}
The LLN is important because it guarantees stable longterm results for the averages of some random events.^{[1]}^{[2]} For example, while a casino may lose money in a single spin of the roulette wheel, its earnings will tend towards a predictable percentage over a large number of spins. Any winning streak by a player will eventually be overcome by the parameters of the game. Importantly, the law applies (as the name indicates) only when a large number of observations are considered. There is no principle that a small number of observations will coincide with the expected value or that a streak of one value will immediately be "balanced" by the others (see the gambler's fallacy).
The LLN only applies to the average. Therefore, while
other formulas that look similar are not verified, such as the raw deviation from "theoretical results":
not only does it not converge toward zero as n increases, but it tends to increase in absolute value as n increases.
For example, a single roll of a fair, sixsided dice produces one of the numbers 1, 2, 3, 4, 5, or 6, each with equal probability. Therefore, the expected value of the average of the rolls is:
According to the law of large numbers, if a large number of sixsided dice are rolled, the average of their values (sometimes called the sample mean) will approach 3.5, with the precision increasing as more dice are rolled.
It follows from the law of large numbers that the empirical probability of success in a series of Bernoulli trials will converge to the theoretical probability. For a Bernoulli random variable, the expected value is the theoretical probability of success, and the average of n such variables (assuming they are independent and identically distributed (i.i.d.)) is precisely the relative frequency.
For example, a fair coin toss is a Bernoulli trial. When a fair coin is flipped once, the theoretical probability that the outcome will be heads is equal to 1⁄2. Therefore, according to the law of large numbers, the proportion of heads in a "large" number of coin flips "should be" roughly 1⁄2. In particular, the proportion of heads after n flips will almost surely converge to 1⁄2 as n approaches infinity.
Although the proportion of heads (and tails) approaches 1⁄2, almost surely the absolute difference in the number of heads and tails will become large as the number of flips becomes large. That is, the probability that the absolute difference is a small number approaches zero as the number of flips becomes large. Also, almost surely the ratio of the absolute difference to the number of flips will approach zero. Intuitively, the expected difference grows, but at a slower rate than the number of flips.
Another good example of the LLN is the Monte Carlo method. These methods are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. The larger the number of repetitions, the better the approximation tends to be. The reason that this method is important is mainly that, sometimes, it is difficult or impossible to use other approaches.^{[3]}
The average of the results obtained from a large number of trials may fail to converge in some cases. For instance, the average of n results taken from the Cauchy distribution or some Pareto distributions (α<1) will not converge as n becomes larger; the reason is heavy tails. The Cauchy distribution and the Pareto distribution represent two cases: the Cauchy distribution does not have an expectation,^{[4]} whereas the expectation of the Pareto distribution (α<1) is infinite.^{[5]} One way to generate the Cauchydistributed example is where the random numbers equal the tangent of an angle uniformly distributed between −90° and +90°. The median is zero, but the expected value does not exist, and indeed the average of n such variables have the same distribution as one such variable. It does not converge in probability toward zero (or any other value) as n goes to infinity.
And if the trials embed a selection bias, typical in human economic/rational behaviour, the law of large numbers does not help in solving the bias. Even if the number of trials is increased the selection bias remains.
The Italian mathematician Gerolamo Cardano (1501–1576) stated without proof that the accuracies of empirical statistics tend to improve with the number of trials.^{[6]} This was then formalized as a law of large numbers. A special form of the LLN (for a binary random variable) was first proved by Jacob Bernoulli.^{[7]} It took him over 20 years to develop a sufficiently rigorous mathematical proof which was published in his Ars Conjectandi (The Art of Conjecturing) in 1713. He named this his "Golden Theorem" but it became generally known as "Bernoulli's theorem". This should not be confused with Bernoulli's principle, named after Jacob Bernoulli's nephew Daniel Bernoulli. In 1837, S. D. Poisson further described it under the name "la loi des grands nombres" ("the law of large numbers").^{[8]}^{[9]} Thereafter, it was known under both names, but the "law of large numbers" is most frequently used.
After Bernoulli and Poisson published their efforts, other mathematicians also contributed to refinement of the law, including Chebyshev,^{[10]} Markov, Borel, Cantelli, Kolmogorov and Khinchin. Markov showed that the law can apply to a random variable that does not have a finite variance under some other weaker assumption, and Khinchin showed in 1929 that if the series consists of independent identically distributed random variables, it suffices that the expected value exists for the weak law of large numbers to be true.^{[11]}^{[12]} These further studies have given rise to two prominent forms of the LLN. One is called the "weak" law and the other the "strong" law, in reference to two different modes of convergence of the cumulative sample means to the expected value; in particular, as explained below, the strong form implies the weak.^{[11]}
There are two different versions of the law of large numbers that are described below. They are called the strong law of large numbers and the weak law of large numbers.^{[13]}^{[1]} Stated for the case where X_{1}, X_{2}, ... is an infinite sequence of independent and identically distributed (i.i.d.) Lebesgue integrable random variables with expected value E(X_{1}) = E(X_{2}) = ... = µ, both versions of the law state that the sample average
converges to the expected value:

(1) 
(Lebesgue integrability of X_{j} means that the expected value E(X_{j}) exists according to Lebesgue integration and is finite. It does not mean that the associated probability measure is absolutely continuous with respect to Lebesgue measure.)
Introductory probability texts often additionally assume identical finite variance (for all ) and no correlation between random variables. In that case, the variance of the average of n random variables is
which can be used to shorten and simplify the proofs. This assumption of finite variance is not necessary. Large or infinite variance will make the convergence slower, but the LLN holds anyway.^{[14]}
Mutual independence of the random variables can be replaced by pairwise independence^{[15]} or exchangeability^{[16]} in both versions of the law.
The difference between the strong and the weak version is concerned with the mode of convergence being asserted. For interpretation of these modes, see Convergence of random variables.
The weak law of large numbers (also called Khinchin's law) states that the sample average converges in probability towards the expected value^{[17]}

(2) 
That is, for any positive number ε,
Interpreting this result, the weak law states that for any nonzero margin specified (ε), no matter how small, with a sufficiently large sample there will be a very high probability that the average of the observations will be close to the expected value; that is, within the margin.
As mentioned earlier, the weak law applies in the case of i.i.d. random variables, but it also applies in some other cases. For example, the variance may be different for each random variable in the series, keeping the expected value constant. If the variances are bounded, then the law applies, as shown by Chebyshev as early as 1867. (If the expected values change during the series, then we can simply apply the law to the average deviation from the respective expected values. The law then states that this converges in probability to zero.) In fact, Chebyshev's proof works so long as the variance of the average of the first n values goes to zero as n goes to infinity.^{[12]} As an example, assume that each random variable in the series follows a Gaussian distribution with mean zero, but with variance equal to , which is not bounded. At each stage, the average will be normally distributed (as the average of a set of normally distributed variables). The variance of the sum is equal to the sum of the variances, which is asymptotic to . The variance of the average is therefore asymptotic to and goes to zero.
There are also examples of the weak law applying even though the expected value does not exist.
The strong law of large numbers (also called Kolmogorov's law) states that the sample average converges almost surely to the expected value^{[18]}

(3) 
That is,
What this means is that the probability that, as the number of trials n goes to infinity, the average of the observations converges to the expected value, is equal to one. The modern proof of the strong law is more complex than that of the weak law, and relies on passing to an appropriate subsequence.^{[14]}
The strong law of large numbers can itself be seen as a special case of the pointwise ergodic theorem. This view justifies the intuitive interpretation of the expected value (for Lebesgue integration only) of a random variable when sampled repeatedly as the "longterm average".
Law 3 is called the strong law because random variables which converge strongly (almost surely) are guaranteed to converge weakly (in probability). However the weak law is known to hold in certain conditions where the strong law does not hold and then the convergence is only weak (in probability). See differences between the weak law and the strong law.
The strong law applies to independent identically distributed random variables having an expected value (like the weak law). This was proved by Kolmogorov in 1930. It can also apply in other cases. Kolmogorov also showed, in 1933, that if the variables are independent and identically distributed, then for the average to converge almost surely on something (this can be considered another statement of the strong law), it is necessary that they have an expected value (and then of course the average will converge almost surely on that).^{[19]}
If the summands are independent but not identically distributed, then

(2) 
provided that each X_{k} has a finite second moment and
This statement is known as Kolmogorov's strong law, see e.g. Sen & Singer (1993, Theorem 2.3.10).
The weak law states that for a specified large n, the average is likely to be near μ. Thus, it leaves open the possibility that happens an infinite number of times, although at infrequent intervals. (Not necessarily for all n).
The strong law shows that this almost surely will not occur. It does not imply that with probability 1, we have that for any ε > 0 the inequality holds for all large enough n, since the convergence is not necessarily uniform on the set where it holds.^{[20]}
The strong law does not hold in the following cases, but the weak law does.^{[21]}^{[22]}
Suppose f(x,θ) is some function defined for θ ∈ Θ, and continuous in θ. Then for any fixed θ, the sequence {f(X_{1},θ), f(X_{2},θ), ...} will be a sequence of independent and identically distributed random variables, such that the sample mean of this sequence converges in probability to E[f(X,θ)]. This is the pointwise (in θ) convergence.
The uniform law of large numbers states the conditions under which the convergence happens uniformly in θ. If^{[25]}^{[26]}
Then E[f(X,θ)] is continuous in θ, and
This result is useful to derive consistency of a large class of estimators (see Extremum estimator).
Borel's law of large numbers, named after Émile Borel, states that if an experiment is repeated a large number of times, independently under identical conditions, then the proportion of times that any specified event occurs approximately equals the probability of the event's occurrence on any particular trial; the larger the number of repetitions, the better the approximation tends to be. More precisely, if E denotes the event in question, p its probability of occurrence, and N_{n}(E) the number of times E occurs in the first n trials, then with probability one,^{[27]}
This theorem makes rigorous the intuitive notion of probability as the longrun relative frequency of an event's occurrence. It is a special case of any of several more general laws of large numbers in probability theory.
Chebyshev's inequality. Let X be a random variable with finite expected value μ and finite nonzero variance σ^{2}. Then for any real number k > 0,
Given X_{1}, X_{2}, ... an infinite sequence of i.i.d. random variables with finite expected value , we are interested in the convergence of the sample average
The weak law of large numbers states:

(2) 
This proof uses the assumption of finite variance (for all ). The independence of the random variables implies no correlation between them, and we have that
The common mean μ of the sequence is the mean of the sample average:
Using Chebyshev's inequality on results in
This may be used to obtain the following:
As n approaches infinity, the expression approaches 1. And by definition of convergence in probability, we have obtained

(2) 
By Taylor's theorem for complex functions, the characteristic function of any random variable, X, with finite mean μ, can be written as
All X_{1}, X_{2}, ... have the same characteristic function, so we will simply denote this φ_{X}.
Among the basic properties of characteristic functions there are
These rules can be used to calculate the characteristic function of in terms of φ_{X}:
The limit e^{itμ} is the characteristic function of the constant random variable μ, and hence by the Lévy continuity theorem, converges in distribution to μ:
μ is a constant, which implies that convergence in distribution to μ and convergence in probability to μ are equivalent (see Convergence of random variables.) Therefore,

(2) 
This shows that the sample mean converges in probability to the derivative of the characteristic function at the origin, as long as the latter exists.
The law of large numbers provides an expectation of an unknown distribution from a realization of the sequence, but also any feature of the probability distribution.^{[1]} By applying Borel's law of large numbers, one could easily obtain the probability mass function. For each event in the objective probability mass function, one could approximate the probability of the event's occurrence with the proportion of times that any specified event occurs. The larger the number of repetitions, the better the approximation. As for the continuous case: , for small positive h. Thus, for large n:
With this method, one can cover the whole xaxis with a grid (with grid size 2h) and obtain a bar graph which is called a histogram.