Almost surely

[1] In other words, the set of outcomes on which the event does not occur has probability 0, even though the set might not be empty.

In probability experiments on a finite sample space with a non-zero probability for each outcome, there is no difference between almost surely and surely (since having a probability of 1 entails including all the sample points); however, this distinction becomes important when the sample space is an infinite set,[2] because an infinite set can have non-empty subsets of probability 0.

Some examples of the use of this concept include the strong and uniform versions of the law of large numbers, the continuity of the paths of Brownian motion, and the infinite monkey theorem.

is contained in a null set: a subset

[4] The notion of almost sureness depends on the probability measure

If it is necessary to emphasize this dependence, it is customary to say that the event

In general, an event can happen "almost surely", even if the probability space in question includes outcomes which do not belong to the event—as the following examples illustrate.

Imagine throwing a dart at a unit square (a square with an area of 1) so that the dart always hits an exact point in the square, in such a way that each point in the square is equally likely to be hit.

Since the square has area 1, the probability that the dart will hit any particular subregion of the square is equal to the area of that subregion.

For example, the probability that the dart will hit the right half of the square is 0.5, since the right half has area 0.5.

Next, consider the event that the dart hits exactly a point in the diagonals of the unit square.

Since the area of the diagonals of the square is 0, the probability that the dart will land exactly on a diagonal is 0.

That is, the dart will almost never land on a diagonal (equivalently, it will almost surely not land on a diagonal), even though the set of points on the diagonals is not empty, and a point on a diagonal is no less possible than any other point.

Consider the case where a (possibly biased) coin is tossed, corresponding to the probability space

occurs if a head is flipped, and

For this particular coin, it is assumed that the probability of flipping a head is

, from which it follows that the complement event, that of flipping a tail, has probability

Now, suppose an experiment were conducted where the coin is tossed repeatedly, with outcomes

Define the sequence of random variables on the coin toss space,

In this case, any infinite sequence of heads and tails is a possible outcome of the experiment.

However, any particular infinite sequence of heads and tails has probability 0 of being the exact outcome of the (infinite) experiment.

assumption implies that the probability of flipping all heads over

The result is the same no matter how much we bias the coin towards heads, so long as we constrain

In fact, the same result even holds in non-standard analysis—where infinitesimal probabilities are allowed.

[5] Moreover, the event "the sequence of tosses contains at least one

, would no longer be 0, while the probability of getting at least one tails,

if over a sequence of sets, the probability converges to 1.

For instance, in number theory, a large number is asymptotically almost surely composite, by the prime number theorem; and in random graph theory, the statement "

vertices with edge probability

Similarly, in graph theory, this is sometimes referred to as "almost surely".