PE2-2.2 Probability Theory & Random Processes in Simulation
Standard communication theory, taught through simulation — written September 2026
What this is and why it exists
A distribution you can sample is a distribution you can experiment on. That is the whole point of this topic.
Simulate ten thousand trials and the answer appears before you have finished the algebra. Better still, the simulation and the algebra check each other, and when they disagree one of them is wrong in a way you can find.
The vocabulary
- Bayes' theorem — the rule for updating a probability after seeing evidence.
- Random variable — a quantity whose value is decided by a random outcome.
- Distribution — the description of how likely each value is.
- Pseudorandom generator — a deterministic algorithm producing numbers that behave as if random.
- Seed — the starting value that fixes the whole sequence a generator produces.
- Histogram — a count of how many samples fall in each of a set of bins.
- Inverse transform method — generating a wanted distribution by transforming uniform samples.
- Law of large numbers — the result that averages settle towards the true mean.
- Stationarity — the statistics of a process not changing with time.
- Ergodicity — one long realisation revealing the same statistics as many short ones.
- Power spectrum — how a random signal's power is distributed across frequency.
The mental model
Bayes' theorem is the tool for reasoning backwards. You know how likely the evidence is under each explanation, and you want to know how likely each explanation is given the evidence. The theorem converts one into the other, using how likely each explanation was beforehand. It comes back directly in the detection topic later in this course.
Randomness in a computer is not random. A pseudorandom generator is a deterministic algorithm whose output passes statistical tests for randomness. That has a practical consequence worth valuing rather than regretting. Record the seed and the whole run repeats exactly, so a result can be reproduced and a bug can be chased. A simulation whose seed was not recorded cannot be debugged.
Histograms come with a warning that is a good early lesson. A histogram is an estimate, not the distribution. Choose wide bins and real structure is smoothed away. Choose narrow bins and noise looks like structure. The same data produces different-looking pictures, so a plot is evidence rather than proof. Try more than one bin width before believing what you see.
Generating a wanted distribution is the enabling trick of the whole course, and one method is worth understanding properly. Take the cumulative distribution of the target, which rises from zero to one. Draw a uniform number between zero and one, and ask which value of the target has that cumulative probability. Those answers are distributed exactly as the target. That is the inverse transform method, and it explains why a single uniform generator is enough for everything.
Functions of random variables sit underneath that. Transform a random variable and the distribution transforms too, though not in the obvious way, because the transformation stretches some regions and compresses others.
The law of large numbers is the theoretical backing for every simulation here. Averages settle towards the true mean as the number of trials grows. It also tells you how many runs you need, because the spread of the estimate falls with the square root of the count. Wanting ten times the accuracy costs a hundred times the runs, and that is worth knowing before starting a long simulation.
Random processes extend the ideas from a single random value to one that evolves in time. Two assumptions make them tractable and both are relied on everywhere afterwards. Stationarity says the statistics do not change with time, so a measurement made now describes the process later. Ergodicity says one long recording reveals the same statistics as many separate short ones, which is what lets you estimate anything from a single run.
Power spectrum closes the topic and connects it to the communication half. A random signal has no Fourier transform in the ordinary sense, but its power does have a distribution over frequency. That description is what noise is specified by, and white noise is precisely the case where the power is spread evenly across all frequencies.
What you should now be able to explain or do
Apply Bayes' theorem to reason from evidence to explanation. Explain why recording a seed matters. Say why a histogram's appearance depends on bin width. Use the inverse transform method to generate a wanted distribution. State stationarity and ergodicity and say what each permits, and describe noise by its power spectrum.
Check yourself
Why record the seed of a simulation?
The generator is deterministic. With the seed the run repeats exactly, so results are reproducible and bugs can be chased.
Why is a histogram evidence rather than proof?
Its appearance depends on the bin width. Wide bins hide structure and narrow bins make noise look like structure.
How does the inverse transform method work?
Draw a uniform number between zero and one and find the value whose cumulative probability equals it. Those values follow the target distribution.
You want ten times the accuracy from a simulation. What does it cost?
A hundred times the runs. The spread of the estimate falls with the square root of the number of trials.
What does ergodicity permit?
Estimating a process's statistics from one long recording, instead of needing many separate realisations.
Go deeper
We haven't checked most of these for screen reader use yet.
Back to Probability Theory & Random Processes in Simulation: work through the checklist