Stochastic Processes: Basics
Stochastic Processes, Martingales, and Markov Chains
A stochastic process is a way to describe a collection of random quantities that may be related to one another. When those quantities represent a system changing over time, two especially important ideas are martingales, which describe fair average changes, and Markov chains, which describe systems whose predictions depend on the present rather than the full past.
These ideas are related, but neither one implies the other. A process can be both, either one, or neither. Understanding why requires first being clear about what a stochastic process is and what information is available at each time.
What Is a Stochastic Process?
A stochastic process is a collection of random variables defined on the same probability space. In general, it can be written as
(Xi)i∈I,where each random variable takes values in a state space S. The index set I can be finite, countably infinite, or uncountable. It can also have more than one dimension.
The random variables all share one probability space, usually written as (Ω,F,P). This common space matters: it allows the variables in the process to describe different aspects or stages of the same random experiment.
Realizations, sample paths, and state spaces
The set Ω contains the possible outcomes of the underlying experiment. In the language of stochastic processes, an individual outcome ω∈Ω is often called a realization.
The state space S is the set of values the process can take. For example, a process tracking a particle’s position on the integers has state space Z, while a process recording whether a coin flip is heads or tails could use the state space {−1,+1}.
The process itself is the whole collection of random variables. But if one particular realization ω is fixed, then each random variable can be evaluated at that outcome:
i⟼Xi(ω).The resulting sequence or collection of values is called a sample path. A realization is an outcome in the underlying probability space; its sample path is the trajectory that the process produces for that outcome. These terms are closely connected, but they refer to different things.
This distinction is useful when interpreting computer simulations. A program does not display the abstract stochastic process itself. It displays sample paths generated by the process. Simulating many times produces many sample paths, which can reveal typical behavior, but each individual output is only one realization.
For a state space with a suitable topology, its Borel sigma-algebra is the sigma-algebra generated by its open sets. When the state space is a finite or countable subset of the real line, every subset of the state space is a Borel set.
Processes that do and do not evolve in time
An index set is often used to represent time, but not every stochastic process has a temporal interpretation. A random graph, for instance, can be a static random object described by a collection of random variables. It is still a stochastic process in the general mathematical sense, even if it does not evolve through time.
For time to have a meaningful past, present, and future, the indices need an order. In the most common settings, time is either discrete or continuous:
- In discrete time, the process is written (Xn)n≥0, where n takes nonnegative integer values.
- In continuous time, it is written (Xt)t≥0, where t can be any nonnegative real number.
The basic ideas of martingales and Markov processes also have continuous-time versions. The discrete-time case is often easier to introduce because each new step has a clear predecessor.
A stochastic process is the full family of random variables; a sample path is the sequence of values produced by one realization.
Think About It
If a simulation displays one trajectory of a random walk, is that the entire stochastic process or one sample path from it?
Information and Filtrations
To define martingales and Markov chains, it is essential to describe what is known at each time. In a time-indexed process, earlier observations are in the past, the current state is the present, and later states are not yet known.
A filtration is a nondecreasing sequence of sigma-algebras,
(Gn)n≥0,Gn⊆Gn+1⊆F.A sigma-algebra represents a collection of events that can be distinguished using the available information. The filtration is therefore a mathematical model of how information accumulates over time. The sigma-algebra Gn represents the information available at time n: what has been learned up to and including that time. Because knowledge accumulates, Gn+1 contains at least as much information as Gn.
Adapted processes and natural filtrations
A process (Xn) is adapted to a filtration (Gn) if each Xn is measurable with respect to Gn. Informally, this means that the state Xn can be known using the information available at time n. If the process represents the observed history of a system, its current state must be part of what is known by that time.
The natural filtration of (Xn) is the information generated by observing that process:
Fn=σ(X0,X1,…,Xn).It contains exactly the information available from the process’s observations from time 0 through time n. Since Xn is included in this list, the process is adapted to its natural filtration. The natural filtration is often the default choice when no other filtration is specified.
A larger filtration could include additional information from outside the process. For example, it could record observations of another system. When a statement is made about a process without naming a filtration, the natural filtration is commonly intended.
Think About It
If the information available at time n includes the entire observed history, why must the information available at time n+1 include that history too?
Martingales: Fairness in Conditional Expectation
A discrete-time process (Xn) is a martingale with respect to a filtration (Gn) when, for every n:
- Xn is integrable, meaning E[∣Xn∣]<∞.
- The process is adapted to (Gn).
- Its next-step conditional expectation equals its current value:
The first two conditions ensure that the expected value is well-defined and that Xn is known at time n. The third condition captures the central idea: given everything known so far, the expected value of the next state is the current state.
A useful intuition is a fair game. Suppose Xn represents a gambler’s fortune after n rounds. A fair game does not mean the fortune stays fixed, or that every outcome is equally likely. It means that, conditional on the gambler’s complete history, the expected fortune after one more round is the current fortune. The next change has conditional mean zero.
A martingale does not have to describe gambling. The fair-game picture is an intuition for its defining mathematical property: there is no expected upward or downward drift once the available information is taken into account.
Submartingales and supermartingales
A submartingale satisfies the same integrability and adaptedness conditions, but its conditional expectation can increase:
E[Xn+1∣Gn]≥Xn.It represents a process whose next value is, on average, at least as large as its current value, given the present information.
A supermartingale satisfies
E[Xn+1∣Gn]≤Xn.Its next value is, on average, no greater than its current value. In the gambling analogy, these correspond respectively to a favorable game and an unfavorable game.
The terms are also related to subharmonic and superharmonic functions, but the conditional-expectation inequalities give the direct meaning needed here.
A useful consequence—and a failed converse
For an integrable martingale, the law of total expectation implies that its ordinary expected value is constant over time:
E[Xn+1]=E[Xn].This follows by taking expectations of the martingale condition. However, the reverse implication is false: a process may have constant expected value at every time and still fail to be a martingale. The martingale condition is stronger because it requires the expected next value to equal the current value after conditioning on the information available so far.
Think About It
Why is knowing that E[Xn] is constant weaker than knowing that E[Xn+1∣Gn]=Xn?
Markov Chains: The Present Is Enough
A discrete-time Markov chain is a process with a finite or countable state space whose future transition probabilities depend on the past only through the current state.
Using the natural filtration (Fn), the defining condition is that for every subset B of the state space,
P(Xn+1∈B∣Fn)=P(Xn+1∈B∣Xn).The event Xn+1∈B describes a general possible event at the next time. The equality says that knowing the entire history through time n gives no additional information about this event beyond knowing Xn.
This is the Markov property, often described as memorylessness. The process does not necessarily have no history in a literal sense; rather, for predicting the next state, the history is summarized completely by the current state. Equivalently, given the present state, the past and the future are conditionally independent.
A process can be Markov without being a martingale. The Markov condition is about what information is needed to predict the future. The martingale condition is about the conditional average of the next value. Those are different questions.
Think About It
Two processes might both have a predictable next-step distribution. What additional feature would determine whether either one is also a martingale?
Four Examples
The following examples show all four possible combinations: a process may be both a martingale and a Markov chain, either one alone, or neither. The calculations rely on two basic facts about conditional expectation and probability:
- If a random variable is already measurable with respect to the information being conditioned on, it can be treated as known.
- If a random variable is independent of that information, conditioning on the information does not change its distribution or expectation.
1. Independent fair coin flips: Markov, but not a martingale
Let (Wn) record independent fair coin flips, using
Wn={+1,−1,for heads,for tails.Each value is equally likely, so E[Wn]=0. Let Fn=σ(W1,…,Wn). Since the next flip is independent of all earlier flips,
E[Wn+1∣Fn]=E[Wn+1]=0.But Wn is always either +1 or −1, never 0. Therefore this conditional expectation is not equal to Wn. It is not a martingale. It is also neither a submartingale nor a supermartingale: the value 0 is sometimes below Wn and sometimes above it.
The process is nevertheless a Markov chain. Independence means that the probability of the next flip is unchanged by the history. It is also unchanged by knowing the current flip, so the Markov condition holds. This is a particularly simple, or degenerate, Markov case: the next state does not depend on the present either.
This example also shows why constant expected value does not imply the martingale property. Every Wn has expected value zero, yet the process is not a martingale.
2. Symmetric random walk: both a martingale and a Markov chain
Now use the coin flips as increments of a particle’s position. Starting from a position X0, define
Xn=X0+k=1∑nWk.At each step, the particle moves one unit to the right or left with equal probability. Thus
Xn+1=Xn+Wn+1.The current position Xn is known from the history through time n, while Wn+1 is an independent fair increment. Therefore,
E[Xn+1∣Fn]=E[Xn+Wn+1∣Fn]=Xn+0=Xn.So the random walk is a martingale. The fair-game interpretation is direct: moving right gains one unit, moving left loses one, and both are equally likely.
It is also a Markov chain. From any current position x, the next position is x+1 or x−1, each with probability 21. The earlier route to x does not affect those probabilities. In particular,
P(Xn+1=x∣Fn)=211{∣Xn−x∣=1},where 1A equals 1 when event A occurs and 0 otherwise. The right-hand side depends on the history only through the current position Xn, which is the Markov property.
This example demonstrates that the martingale and Markov properties can hold together.
3. Betting random walk: a martingale that can fail to be Markov
Consider a gambler whose fortune after round n is Yn. The gambler bets an amount Bn on round n, and the game uses the fair-coin increment Wn. A win adds the bet; a loss subtracts it:
Yn=Y0+k=1∑nBkWk.The bet must be chosen before the corresponding coin flip is known. Mathematically, this is represented by requiring Bn to be measurable with respect to the information available before round n, such as Fn−1. This prevents the bet from being chosen after seeing whether the round was won or lost.
Assuming the bets and resulting fortunes are integrable, the next fortune is
Yn+1=Yn+Bn+1Wn+1.At time n, both Yn and the already chosen bet Bn+1 are known. The next fair-coin outcome Wn+1 is independent of the past and has mean zero. Hence
E[Yn+1∣Fn]=Yn+Bn+1E[Wn+1]=Yn.So the fortune is a martingale. A strategy may change the size of the bet using past information, but if the game remains fair and the bet is placed before the outcome, that strategy does not create a positive conditional expected gain.
Whether this process is Markov depends on how the bets are chosen. If the bets are fixed in advance, the distribution of the next fortune is determined by the current fortune and the known bet for that time. The process then has the Markov property, though its transition probabilities may vary with time.
A history-dependent betting rule can instead make the next-step distribution depend on more than the present fortune. For example, choose two positive amounts a>b and bet a after a win, but b after a loss. The next bet then depends on the previous result. In terms of the fortune, the rule can be written as
Bn+1={a,b,Yn>Yn−1,Yn<Yn−1.For instance, the chance of gaining exactly a on the next round is
P(Yn+1=Yn+a∣Fn)=211{Yn>Yn−1}.The next-step probability depends on whether the previous round was won, information represented by Yn−1 as well as Yn. When histories reaching the same current fortune can have different previous outcomes, they give different next-step probabilities. The current fortune alone then does not determine the transition probabilities, so the process is not Markov.
This example shows that a martingale need not be Markov: fair conditional average changes do not prevent the transition rule from retaining information about the past.
4. A two-coin process: neither a martingale nor a Markov chain
Now consider a process (Zn) that again takes values +1 and −1, but whose coin for the next flip depends on the previous two outcomes. Coin 1 lands heads with probability 31; coin 2 lands heads with probability 32. If the previous two results match, coin 1 is used next. If they differ, coin 2 is used. The first two flips can be set to use coin 1 to establish the initial condition.
When the previous outcomes match, the next value has mean
(+1)31+(−1)32=−31.When they differ, it has mean
(+1)32+(−1)31=31.Thus, with respect to the information Fn from the process’s history,
E[Zn+1∣Fn]=−311{Zn=Zn−1}+311{Zn=Zn−1}.The conditional expectation is always either −31 or 31, whereas Zn is always either −1 or +1. It cannot equal Zn, so the process is not a martingale. It is also neither a submartingale nor a supermartingale. When Zn=−1, the conditional expectation is greater than Zn; when Zn=+1, it is less than Zn. Neither required inequality holds in every state.
The process is not Markov either. Its next-flip probability is
P(Zn+1=+1∣Fn)=311{Zn=Zn−1}+321{Zn=Zn−1}.For a fixed current value Zn, this probability changes according to the previous value Zn−1. For example, if Zn=+1, then the probability of another +1 is 31 when Zn−1=+1, but 32 when Zn−1=−1. The present state alone is therefore insufficient to determine the next-step distribution.
This example is neither a martingale nor a Markov chain: the conditional mean is not the current state, and the future transition rule depends on more than the current state.
Comparing the four cases
| Process | Martingale? | Markov chain? | Main reason |
|---|---|---|---|
| Independent fair coin flips | No | Yes | The next flip is independent, but its conditional mean is 0, not the current value. |
| Symmetric random walk | Yes | Yes | Its next increment has mean 0, and its next-step distribution depends only on its position. |
| Betting random walk with a history-dependent bet | Yes | Not necessarily | A fair, predictable bet preserves the conditional mean, but the bet can retain information about earlier outcomes. |
| Two-coin process | No | No | Its next-step mean and transition probabilities depend on the previous outcomes. |
Think About It
Which property is being tested when a conditional expectation is compared with the current value, and which property is being tested when a conditional probability is compared with one conditioned only on the current state?
How These Ideas Connect to Broader Topics
Martingales are useful beyond gambling because their defining condition controls conditional averages over time. Further martingale theory includes results such as the optional stopping theorem, the upcrossing inequality, and the martingale convergence theorem. Together with related ideas such as reverse martingales, these results help explain when martingales converge and how they behave at stopping times. Martingale methods also contribute to proofs of laws of large numbers, including settings where random variables may have infinite variance.
One application is the Galton–Watson branching process, a model in which individuals produce offspring and the population changes from one generation to the next. It is used to study population dynamics in biology and can also represent broader models of spreading or invasion. Martingale results help analyze its long-term behavior.
Markov-chain theory develops the consequences of memorylessness. Important concepts include recurrence, when a process returns to a state; transience, when it may eventually leave a state without returning; irreducibility, when states communicate through possible transitions; positive recurrence, a form of recurrence with finite expected return time; aperiodicity, which rules out rigid cycles in return times; and stationary distributions, which remain unchanged under the transition rule. These ideas support convergence results for discrete-time Markov chains.
Random walks can also be studied on general connected graphs, not only on the integer line. Their behavior is related to recurrence and transience, and some random-walk questions can be connected to electrical networks in physics.
For processes that count random events over continuous time, Poisson processes provide a central model. Their important properties include superposition, which combines independent processes; thinning, which retains selected events according to a random rule; and conditioning, which describes event locations or counts once some information is known.
Under suitable conditions, a continuous-time Markov chain can be viewed as two ingredients working together: a discrete-time Markov chain describes the sequence of states visited, while Poisson processes describe the times at which jumps occur.
Review: What to Keep in Mind
A stochastic process is a family of random variables on one probability space. A realization selects one outcome, and that outcome produces a sample path. When the index represents time, a filtration describes how information accumulates, and adaptedness means the current state is known using the information available at that time.
A martingale is integrable, adapted, and has no conditional expected change from one step to the next. A submartingale has nonnegative conditional expected change; a supermartingale has nonpositive conditional expected change. These conditions concern conditional averages, not merely unconditional averages.
A Markov chain has a different defining feature: given the current state, the past adds no information about the next state. Its condition concerns conditional probabilities, not whether the expected next value equals the current one.
The four examples make the distinction concrete. Independent fair coin flips are Markov but not martingales. A symmetric random walk is both. A fair betting process can be a martingale yet fail to be Markov when its betting rule depends on earlier outcomes. A process that selects different biased coins using the previous two flips can be neither. The two properties describe different features of a stochastic process, so each must be checked separately.

Ask anything
We've read this whole study set, so questions about it get the best answers.