Somewhat more generally, a sequence *Y*_{1}, *Y*_{2}, *Y*_{3}, ... is said to be a **martingale with respect to** another sequence *X*_{1}, *X*_{2}, *X*_{3}, ... if

Table of contents |

2 Examples of martingales 3 Convergence of martingales 4 Martingales and stopping times 5 Submartingales and supermartingales |

Originally, *martingale* referred to a class of betting strategies popular in 18th century France. The simplest of these strategies was designed for a game in which the gambler wins his stake if a coin comes up heads and loses it if the coin comes up tails. The strategy had the gambler double his bet after every loss, so that the first win would recover all previous losses plus win a profit equal to the original stake. Since a gambler with infinite wealth is guaranteed to eventually flip heads, the martingale betting strategy was seen as a sure thing by those who practiced it. Unfortunately, none of these practitioners in fact possessed infinite wealth, and the exponential growth of the bets would quickly bankrupt those foolish enough to use the martingale after even a moderately long run of bad luck.

Martingales in the probability-theory sense were invented by Lévy, and much of the original development of the theory was done by Doob. Part of the motivation for that work was to show the impossibility of successful betting strategies.

- Suppose
*X*_{n}is a gambler's fortune after*n*tosses of a "fair" coin, where the gambler wins $1 if the coin comes up heads and loses $1 if the coin comes up tails. The gambler's conditional expected fortune after the next trial, given the history, is equal to his present fortune, so this sequence is a martingale. - Let
*Y*_{n}=*X*_{n}^{2}−*n*where*X*_{n}is the gambler's fortune from the preceding example. Then the sequence {*Y*_{n}:*n*= 1, 2, 3, ... } is a martingale. This can be used to show that the gambler's total gain or loss grows roughly as the square root of the number of steps. - (de Moivre's martingale) Now suppose an "unfair" or "biased" coin, with probability
*p*of "heads" and probability*q*= 1 −*p*of "tails". Let

- Let
*Y*_{n}= P(*A*|*X*_{1}, ... ,*X*_{n}). Then {*Y*_{n}:*n*= 1, 2, 3, ... } is a martingale with respect to {*X*_{n}:*n*= 1, 2, 3, ... }. - (Polya's urn) An urn initially contains
*r*red and*b*blue marbles. One is chosen randomly. If it is red, it is replaced and a new red marble put into the urn. If it is blue, it is replaced and a new blue marble put into the urn. Let*X*_{n}be the number of red marbles in the urn after*n*iterations of this procedure, and let*Y*_{n}=*X*_{n}/(n+r+b). Then the sequence {*Y*_{n}:*n*= 1, 2, 3, ... } is a martingale. - (Likelihood-ratio testing in statistics) A population is thought to be distributed according either to a probability density
*f*or another probability density*g*. A random sample is taken, the data being*X*_{1}, ... ,*X*_{n}. Let*Y*_{n}be the "likelihood ratio"

- Suppose each ameba either splits into two amebas, with probability
*p*, or eventually dies, with probability 1 −*p*. Let*X*_{n}be the number of amebas surviving in the*n*th generation (in particular*X*_{n}= 0 if the population has become extinct by that time). Let*r*be the probability of*eventual*extinction. (Finding*r*as function of*p*is an instructive exercise. Hint: The probability that the descendants of an ameba eventually die out is equal to the probability that either of its immediate offspring dies out, given that the original ameba has split.) Then

[*This section should state a martingale convergence theorem and perhaps some applications, and give at least one example of a non-convergent martingale.*]

- We can use it to prove the impossibility of successful betting strategies for a gambler with a finite lifetime (which gives conditions (a) and (b)) and a house limit on bets (condition (c)). Suppose that the gambler can wager up to
*c*dollars on a fair coin flip at times 1, 2, 3, etc., winning his wager if the coin comes up heads and losing it if the coin comes up tails. Suppose further that he can quit whenever he likes, but cannot predict the outcome of gambles that haven't happened yet. Then the gambler's fortune over time is a martingale, and the time τ at which he decides to quit (or goes broke and is forced to quit) is a stopping time. So the theorem says that E[*X*_{τ}] = E[*X*_{1}]. In other words, the gambler leaves with the same amount of money*on average*as when he started. - Suppose we have a random walk that goes up or down by one with equal probability on each step. Suppose further that the walk stops if it reaches 0 or
*m*; the time at which this first occurs is a stopping time. If we happen to know that the expected time that the walk ends is finite (say, from Markov chain theory), the optional stopping theorem tells us that the expected position when we stop is equal to the initial position*a*. Solving*a*=*pm*+ (1−*p*)0 for the probability*p*that we reach*m*before 0 gives*p*=*a*/*m*. - Now consider a random walk that starts at 0 and stops if we reach
*−m*or +*m*, and use the*Y*_{n}=*X*_{n}²−*n*martingale from the examples section. If τ is the time at which we first reach ±*m*, then 1 = E[*Y*_{1}] = E[*Y*_{τ}] = m² - E[τ]. We immediately get E[τ] =*m*²+1.

A **submartingale** is like a martingale, except that the current value of the random variable is always less than or equal to the expected future value. Formally, this means

- Every martingale is also a submartingale and a supermartingale. Conversely, any stochastic process that is
*both*a submartingale and a supermartingale is a martingale. - Consider again the gambler who wins $1 when a coin comes up heads and loses $1 when the coin comes up tails. Suppose now that the coin may be biased, so that it comes up heads with probability
*p*.- If
*p*is equal to 1/2, the gambler on average neither wins nor loses money, and the gambler's fortune over time is a martingale. - If
*p*is less than 1/2, the gambler loses money on average, and the gambler's fortune over time is a supermartingale. - If
*p*is greater than 1/2, the gambler wins money on average, and the gambler's fortune over time is a submartingale.

- If
- A convex function of a martingale is a submartingale, by Jensen's inequality. For example, the square of the gambler's fortune in the fair coin game is a submartingale (which also follows from the fact that
*X*^{2}_{n}−*n*is a martingale). Similarly, a concave function of a martingale is a supermartingale.