# What Is the Law of Large Numbers?

The law of large numbers helps us make predictions about the long-term behavior of a random variable based on a large number of experiments. Here’s how it works.

Written by Erdem İŞBİLEN
Published on Jan. 12, 2023
Image: Shutterstock / Built In

The law of large numbers is a fundamental concept in probability theory. It states that, as the number of trials or experiments increases, the average of the results of those experiments will converge to the expected value. In other words, as the sample size increases, the average of the observed results will become more and more representative of the true value.

## Why Do We Use the Law of Large Numbers?

The law of large numbers allows us to make predictions about the long-term behavior of random variables based on the results of a large number of experiments assuming all of the trials or observations are independent of each other.

## How Does the Law of Large Numbers Work?

To understand how the law of large numbers works consider the following example: Suppose you flip a fair coin 100 times and you observe that it comes up heads 55 times and tails 45 times. The expected value of this random variable (heads or tails) is 0.5 because each outcome has an equal probability of occurring. However, the observed average of the results (55/100 = 0.55) is not exactly equal to the expected value. This is because the observed average is based on a limited sample of experiments and is subject to random variation.

However, if you were to flip the coin a large number of times, say 10,000, the observed average would be much closer to the expected value. This is because the law of large numbers predicts that, as the sample size increases, the observed average will approach the expected value more and more closely.

More From Built In’s Tech DictionaryWhat Is the Turing Test?

## How Do We Use the Law of Large Numbers?

We use the law of large numbers in a variety of fields including statistics, insurance, finance and engineering

Let’s say that you want to estimate the average height of all the students in your school. If you measure the heights of just a few students (e.g. two percent), it is possible that the average height you calculate may not be very accurate. However, if you measure the heights of a larger group of students (let’s say 35 percent), the average height you calculate is likely to be more representative of the true average height of all students in the school.

Another example of the law of large numbers is in gambling. If you flip a coin a few times, it is possible that you may get a string of heads or tails. However, if you flip the coin a large number of times, the proportion of heads and tails will tend to approach a ratio of 1:1, as the law of large numbers predicts.

## Why Is the Law of Large Numbers Important?

The law of large numbers allows us to make predictions and decisions with a higher degree of confidence because it helps us guarantee stable long-term results for the averages of some events, like the flip of a coin or even the outcome of an election.

As the number of trials or observations increases, the average of the results will tend to converge on the expected value. This means that, over the long term, the average won’t vary greatly from the expected value. This is why the law of large numbers is important in many different fields, including finance, polling and gambling.

Find out who's hiring.
See all Data + Analytics jobs at top tech companies & startups

## What Are the Types of the Law of Large Numbers?

There are two main types of the law of large numbers: the weak law of large numbers and the strong law of large numbers.

### The Weak Law of Large Numbers

The weak law of large numbers states that, as the number of trials or observations increases, the average of the results will tend to converge on the expected value. In other words, the more trials or observations you make, the more accurate the average will be in predicting the actual value.

### The Strong Law of Large Numbers

The strong law of large numbers states that, with probability one, the average of the results of a large number of trials or observations will converge on the expected value. In other words, the average will be exactly equal to the expected value with probability one as the number of trials or observations increases.

The difference between the two laws is that the weak law only states that the average will tend to be close to the expected value, while the strong law states that the average will be exactly equal to the expected value. The strong law is a more rigorous version of the weak law.

More From Erdem IsbilenPython Tuples vs. Lists: When to Use Tuples Instead of Lists

## Law of Large Numbers Examples

Here are some examples of how we use the law of large numbers in different fields.

### Statistics

We can use the law of large numbers to estimate the average height of a population based on a sample of individuals. Suppose you measure the height of 100 people and find that the average height is 170 cm (or about 5.5 feet). The law of large numbers predicts that if you were to measure the height of a larger sample of people, say 100,000 people, the average height would be even closer to the true average height of the population.

### Gambling

Casino owners can use the law of large numbers to make predictions about the long-term performance of their games and to set their house edge accordingly. This allows casinos to ensure their games are profitable over the long term while offering gamblers the experience they’re seeking.

### Insurance

Actuaries and statisticians use the law of large numbers to make predictions about future claims based on policyholders’ past claims history. This helps insurance companies to set premiums low enough to keep customers with the company, but also high enough to maintain stable profit margins.

### Finance

We can use the law of large numbers to make predictions about the future performance of investments based on their past performance. Suppose you have data on the historical returns of a stock and you observe that the average annual return has been 15 percent. The law of large numbers predicts that if you were to extend the time period over which you observe the stock’s returns, the average annual return will approach the true expected return of the stock more closely.

### Engineering

We can use the law of large numbers to make predictions about the reliability of systems based on the results of a large number of tests. For example, suppose you conduct a series of stress tests on a component and you observe that it fails five percent of the time. The law of large numbers predicts that if you were to conduct more stress tests, the failure rate will approach the true expected failure rate of the component more closely.

In all of these examples, we can use the law of large numbers to make predictions about the long-term behavior of a random variable based on the results of a large number of experiments. As the sample size increases, the observed average approaches the true expected value, thereby providing a more reliable estimate of the variable’s behavior.

Related Reading From Built In StatisticiansStatistics: Are You Bayesian or Frequentist?

## A Brief History of the Law of Large Numbers

The concept of the law of large numbers has its roots in the work of 17th century mathematician Jacob Bernoulli. In his book Ars Conjectandi, Bernoulli proved a version of the law of large numbers known as the Bernoulli theorem, which states that the average of the results of a large number of independent trials will tend to be close to the expected value.