Events and random variables
Sample spaces, conditioning, independence, discrete probability masses and area under a density.
A recorded delay is an observation. “The next delay exceeds a threshold” is an event whose probability depends on a model. Probability assigns weights to possible outcomes; a random variable translates those outcomes into a quantity we can analyse. Keeping these objects separate prevents a measured frequency, a density height or a convenient assumption from becoming an unsupported reliability claim.
Start with Mean, Variance and Standard Deviation if observations and populations are new to you. This lesson needs fractions and simple sets. The final example uses an integral as an area; its constant height lets us check the result with a rectangle.
Outcomes, Events and a Sample Space
An outcome is one possible result of the experiment as defined. The sample space, written , collects all possible outcomes. An event is a set of outcomes meeting a stated condition. These definitions follow MIT’s introduction to sample spaces and events.
Suppose a test-pattern source selects one of four two-bit strings. For this teaching model, explicitly assign probability to each:
The strings are ordered labels: 01 and 10 are different outcomes. Equal probabilities are an assumption about this source, not a consequence of writing down four possibilities. A real data stream need not follow this model.
Define event A as “the first bit is 1” and event B as “at least one bit is 1”. The last column also counts the ones; we will use it shortly:
| Pattern | In A? | In B? | Ones |
|---|---|---|---|
| 00 | No | No | 0 |
| 01 | No | Yes | 1 |
| 10 | Yes | Yes | 1 |
| 11 | Yes | Yes | 2 |
Thus and . Adding the weights in each event gives and . Counting favourable outcomes and dividing by the total works here because the elementary outcomes are equiprobable. With unequal weights, sum their probabilities instead.
Choosing outcomes
For two components, outcomes can record each component’s state or only the number of failed components. A failure count loses the identity of the failed component. A continuous space, such as a set of possible delays, also needs a family of measurable events closed under complements and countable unions. Intervals are examples of measurable events. Kolmogorov’s axioms explain the family on which probability is defined.
Complement, Intersection and Union
Probabilities are dimensionless numbers between zero and one. The entire sample space has probability one; the empty event has probability zero. In this finite model, the four elementary weights sum to one.
The complement means “A does not occur”. The intersection means “both A and B occur”. The union means “A or B or both occur”. The probability rules derived from the axioms give:
Here , so its probability is . Every outcome in A is also in B: the intersection is A and the union is B. Therefore:
Simply adding would count 10 and 11 twice and produce an impossible probability of 1.25. For mutually exclusive events, the intersection is empty, so there is no overlap to subtract.
Conditional Probability Restricts the Outcomes
Now suppose we are told that B occurred: the selected pattern contains at least one 1. The remaining possibilities are 01, 10 and 11. Two of these have first bit 1, so the conditional probability of A given B is .
The vertical bar means “given”. For any event B with positive probability, conditional probability is:
In this example the ratio is . Conditioning preserves the relative weights inside B and rescales their total to one. It does not generally make unequal outcomes equally likely. The elementary ratio is undefined when .
Reversing the condition changes the question. If the first bit is 1, at least one bit must be 1, so . It is not the same as . This distinction matters when reversing a statement about a test result and a fault.
The worked example in Bayes’ theorem and diagnostic evidence applies this distinction to an industrial inspection: it calculates the probability of a defective joint after a positive result, accounting for the defect rate and false alarms.
Independence Is Different from Mutual Exclusivity
Two events are independent when their joint probability is the product of their probabilities. For A and a new event C, “the second bit is 1”, the independence condition is:
Only 11 belongs to both A and C. Its probability is , equal to , so A and C are independent in this model. They can occur together. By contrast, A and B are dependent: differs from .
Let D mean “the first bit is 0”. A and D are mutually exclusive, each with probability . Their intersection has probability zero, whereas the product is . They are therefore dependent: knowing A occurred rules out D. In general, mutually exclusive events with positive probabilities cannot be independent.
Physical separation, different names or individually balanced bit counts do not establish independence. The four-outcome model supplies the joint weights here; real equipment may share power, timing, environment or failure causes.
A Random Variable Maps Outcomes to Numbers
A random variable is a numerical function of the outcome. Define X to be the number of ones in the selected pattern. Its rule is fixed even though the selected pattern is uncertain:
Uppercase X denotes the variable; lowercase x denotes a possible numerical value or an observed value in context. The event consists of two outcomes, 01 and 10. Distinct outcomes can therefore give the same value of X.
X is discrete: its possible values form a finite or countable set. Its probability mass function, or PMF, assigns probability to each value, . For this count:
The masses are nonnegative and sum to one; all other values have mass zero. Four equally likely patterns produce three values that are not equally likely. To find , add the masses at 1 and 2: , agreeing with event B. This mapping and aggregation are the basis of discrete random variables.
Observed Frequency Is Not the Model Probability
Consider ten illustrative selections with replacement from the same source, recorded in order: 00, 10, 01, 00, 11, 01, 10, 11, 11, 10. Event A occurs six times. Its empirical relative frequency is , while the declared model gives .
The frequency describes those ten records. The probability describes the model for a selection. Their difference alone neither proves that the source is biased nor establishes that it is uniform. Under independent repetitions of an unchanged model, longer-run frequencies tend towards the probabilities, but finite runs fluctuate and need not approach them monotonically. Assessing evidence for the model belongs to statistical inference.
Retain the outcome sequence, not just a percentage. Repeated records, changing operating conditions or selective logging can make an apparent frequency misleading. A probability estimate based on observed frequency needs its sampling basis and uncertainty stated.
A Continuous Density Gives Probability by Area
For a separate teaching example, let T be an ideal delay uniformly distributed between 0 and 0.5 s. Equal-length intervals within that range have equal probabilities. This is a declared model, not a fit to measured network delays. Its support is the interval from 0 to 0.5 s, and its density is:
The density is zero outside that interval. The complete rectangle has area . Let E be the event that T lies between 0.1 and 0.3 s:
The units cancel: probability is dimensionless. The height 2 is valid because it is a density in inverse seconds, not a probability. NIST’s distinction between probability mass and density makes this normalization and interval-area interpretation explicit.
For a continuous variable with a density, a single exact point has zero probability: . That does not make an individual delay impossible; a point has zero width, whereas any interval of positive width inside the support has positive probability. Including or excluding an interval’s endpoints makes no difference for this density model.
An instrument displaying 0.200 s to the nearest millisecond reports a bin, not an exact mathematical point. With ideal rounding and no other measurement error, that display represents delays from 0.1995 up to 0.2005 s, apart from the endpoint tie convention. The model probability is . Real resolution and measurement error must be accounted for separately.
Changing the time unit changes the density height. In milliseconds the support is 0 to 500 ms and the density is . The interval 100 to 300 ms still has probability . The uniform distribution is useful for this calculation because its area is transparent; boundedness alone does not justify choosing it for a real process.
Continue to Probability Density Function for cumulative probabilities, density transformations and model-validation limits. Discrete masses, continuous densities and mixtures require different representations; a counter or an explicit point mass must not be treated as an ordinary smooth density.
From Uniform Areas to the Normal Model
The uniform delay example makes interval area visible as a rectangle. Next, use a normal density and standardized bounds to find areas under a curved model with a CDF. The lesson connects mean, standard deviation, physical units and dimensionless z, then compares a normal and a uniform model with the same mean and spread. Their different tail probabilities show why choosing a distribution is a modeling decision, separate from the arithmetic of standardization.
From One Variable to a Joint Distribution
Use joint, marginal and conditional distributions to describe two variables together. Its worked table and triangular density show how to sum or integrate out one variable, normalize a conditional law and test independence across the full support.
From Independence to Covariance
For two numerical random variables, continue to Covariance and Correlation. It connects joint variation to centred products and gives a finite model with zero correlation but explicit dependence. The independence condition concerns the joint probabilities; a single coefficient cannot generally replace it.
Engineering Meaning
Write the event before calculating its probability: one pattern contains a 1, a delay lies in a stated interval, or a threshold is exceeded during a defined operating period. Record what one trial means, the population and conditions, the outcome weights or density, and the units. A correct sum or integral answers the stated model question; it cannot supply missing evidence about the source or process.
The four-pattern example exposes two practical failure modes. Adding overlapping events can overstate a combined alarm probability. Multiplying probabilities without justified independence can understate a shared failure mechanism. Keep the joint outcomes or a defensible dependence model when a decision needs their intersection; separate component percentages are insufficient. Verify complementary events sum to one and explain every denominator used in conditioning.
The delay example shows why a density peak or a rounded display cannot be used as an exact-point probability. For a timeout decision, calculate the probability over the relevant delay range, then challenge the support and tail using representative measurements. A convenient uniform model makes calculations simple but assigns zero probability beyond its upper limit. If real delays exceed that limit, extra decimal places cannot repair the model and a timeout based on it may fail under load.
Retain raw outcomes, sampling and logging rules, operating states, resolution and model versions. Check interval predictions against observations under the intended conditions, while allowing for sampling uncertainty; do not treat ten synthetic records as validation. The next step for choosing distributions, estimating their parameters and evaluating reliability claims is Engineering Statistics.
Bayes’ theorem and the strength of evidence
The two factorizations of give when and the conditional probability on the right is defined. With two complementary hypotheses, the denominator is . Suppose a clue occurs in 8 of 10 samples from one stratum and 1 of 10 samples from elsewhere. If 20% of samples come from the stratum, the expected counts per 100 are 16 clues from the stratum and 8 from elsewhere. Given the clue, the probability of the stratum is therefore . With a prior of 5%, the same conditional rates give .
In odds form, multiply by the likelihood ratio . To multiply ratios computed for two clues separately, the clues must be conditionally independent within both groups, unless the second ratio is already conditioned on the first observation. Two readings of the same feature may share a source of error. The updated probability quantifies uncertainty under the model. Choosing an action also requires its consequences and costs.
Partitions and total probability
A partition divides into nonempty, disjoint blocks whose union is . If they form a finite or countable family of events , the events are disjoint and have union . Thus , or over the positive-probability blocks. A finite example is the stratum from which a sample comes. Overlapping events form a cover instead: summing their contributions can count outcomes twice. Two overlapping causes can be split into the four presence-or-absence combinations, omitting empty blocks.
Pairwise and joint independence
Two events are independent when . Disjoint events of positive probability are not independent. For a family of events the factorization must hold for every subfamily. In two independent fair tosses, “first heads”, “second heads” and “equal outcomes” are pairwise independent. Their joint intersection is heads-heads with probability , whereas the product of the three probabilities is .
Two random variables are independent if joint probabilities factor for every choice of events defined by their values. With finite second moments, independence implies zero covariance. The reverse implication fails in general: if is uniform on , then and are dependent despite zero covariance. Conditioning can change independence, as when we learn that at least one of the coins landed heads.
Support, units and transformations of a density
A density is nonnegative and has total integral 1. Its CDF is . For , area between and is . A point has probability zero in a density model even when it belongs to the support. A uniform density on has height 2: the height can exceed 1 because probability is area. If the variable is measured in seconds, density has units of inverse seconds.
For with , . Converting seconds to milliseconds multiplies the coordinates by 1000 and divides the height by 1000. Area over the same physical interval is preserved. For a monotone differentiable transformation with a regular inverse, the factor is . The support and tails are part of the choice of model. Densities with the same mean and variance can give different tail probabilities.
Distribution function, support and mass points
A random variable is a measurable function of outcomes. Its law assigns probability to values and distribution function is nondecreasing and right-continuous, ranging from zero to one. At a jump . For , . If is an atom, including it adds its mass. A mixed example assigns probability 1/4 to zero and 3/4 to a uniform on : and . The support describes where the measure concentrates and can include individual zero-probability points if all their neighborhoods have positive mass.
Conditional mean and updating
A conditional mean given discrete is computed on each cell with and gives a new variable . Averaging returns the original mean. With information represented by a σ-algebra , is -measurable and has the same integral as over each event in . With a finite second moment it gives the best squared-error prediction among -measurable variables. In Bayesian inference a prior describes the parameter before observing data. Conditional on observed data, normalize prior times likelihood to obtain the posterior. Uniformity in one parameterization need not remain under a transformation.
Sources
- MIT: sample spaces and events.
- probability rules derived from the axioms.
- conditional probability.
- independence condition.
- discrete random variables.
- NIST: probability mass and density.
- continuous variable with a density.
- uniform distribution.
MIT OpenCourseWare, Conditional Probability and Bayes’ Theorem.
Carnegie Mellon University, Probability Spaces and Random Variables · Carnegie Mellon University, Expectations.