E ExamMaster

Engineering Mathematics · Probability & Statistics

Random Variables and Distributions

In Engineering Mathematics because uncertainty only becomes analyzable after outcomes are packaged into variables and distributions.

Probability becomes useful in engineering when uncertainty is encoded as a random variable with a distribution. This topic turns outcomes into numerical variables, reads probability mass tables, and uses Bernoulli and Binomial models for small-count data.

  • Engineering Mathematics
  • Medium level
  • 4 concepts

1A random variable turns outcomes into numbers

An experiment starts with outcomes, but a model usually needs numbers. A random variable is the rule that converts each outcome into a value, such as fail/pass, count of clicks, or number of defective units.

The rule must be named before the distribution can mean anything. The same raw experiment can create different variables, so write what the variable measures before reading a probability statement like P(X=x).

The mapping table shows raw outcomes becoming values of X before any probability is attached.

Build the variable

  1. ExperimentName the uncertain process, such as testing three sensors.
  2. MappingDefine the number recorded from each outcome.
  3. ValueRead one realized outcome through that mapping.
Outcome mapping
OutcomeX = number of failed sensors
PPP0
FPP1
FPF2
FFF3

Map a batch outcome to a variable

Three sensors are checked and P means pass, F means fail. Define X as the number of failed sensors. Read X for outcomes FPP, PFP, and FFF.

  • FPPone F, so X=1
  • PFPone F, so X=1
  • FFFthree F values, so X=3
  • Same variable, different outcomesFPP and PFP both map to X=1

Pro tip. A random variable can merge different raw outcomes into the same numerical value; the distribution works over those values.

A device test records outcomes PPF, FPF, and FFF. If X counts failed devices, what are the three values of X?
  1. 1, 2, 3
  2. 2, 2, 3
  3. 1, 1, 3
  4. 0, 1, 3

Count the F marks in each raw outcome: PPF has 1, FPF has 2, and FFF has 3. The variable is the count, not the string itself.

2A distribution allocates total probability mass

For a discrete random variable, the distribution is a probability ledger over all possible values. Each row says how much mass sits on one value, and the whole table must add to 1.

This mass table is the object later summaries use. Expectation, variance, and event probabilities are all computed by reading this distribution, not by guessing from one observed sample.

Figure. A discrete distribution is probability mass allocated across possible values. The bar lengths are the probabilities and sum to one.

Audit a mass table

  1. List valuesWrite every possible value of the random variable.
  2. Attach massPut the probability beside each value.
  3. NormalizeCheck that the probabilities sum to 1.
Tiny defect-count distribution
xP(X=x)
00.50
10.30
20.15
30.05

Check and query a defect distribution

A small production batch has P(X=0)=0.50, P(X=1)=0.30, P(X=2)=0.15, P(X=3)=0.05, where X is the number of defects.

  • Mass check0.50+0.30+0.15+0.05=1.00
  • Event X\ge2P(X=2)+P(X=3)
  • 0.15+0.050.20

Pro tip. The event probability is a row sum over the distribution, not a new formula.

A mass table has probabilities 0.25, 0.35, 0.25, 0.15. Which statement is correct?
  1. It is normalized because the sum is 1.00
  2. It is invalid because no row is above 0.50
  3. It sums to 0.90
  4. It describes a sample, not a distribution

0.25+0.35+0.25+0.15=1.00, so the table can be a discrete distribution. Individual rows need not exceed any threshold.

3Bernoulli models one trial; Binomial counts successes

A Bernoulli random variable records one yes/no trial as 1 for success and 0 for failure. A Binomial random variable counts how many successes occur in a fixed number of independent Bernoulli trials with the same success probability.

This is the first small-count model behind click/no-click, pass/fail, default/no-default, and many evaluation samples. The count probability combines a sequence probability with the number of sequences that have the same count.

Figure. For three fair Bernoulli trials, the Binomial distribution counts how many successes occurred. The middle counts are more likely because they have more arrangements.

Use a Binomial count

  1. One sequenceFor k successes and n-k failures, compute p^k(1-p)^{n-k}.
  2. Count arrangementsMultiply by \binom{n}{k} because the successes can sit in different positions.
  3. InterpretThe result is a probability for the count, not for one particular order.

Exactly two successful requests out of three

A service request succeeds independently with probability p=0.6. Let X be successes in n=3 requests. Compute P(X=2).

  • Arrangements\binom{3}{2}=3
  • One arrangement mass0.6^2(1-0.6)=0.36\cdot0.4=0.144
  • Count probability3\cdot0.144=0.432
  • Check against sequencesSS-F, S-F-S, F-SS each contribute 0.144

Pro tip. Small n makes the combinatorics visible: the probability 0.432 is three equal sequence masses added together.

Coding lab. Plot a Binomial probability mass function runs in the app, with checks on your output.

A request succeeds with probability 0.7. For 4 independent requests, what is P(X=3)?
  1. 4(0.7)^3(0.3)=0.4116
  2. (0.7)^3=0.343
  3. 3(0.7)(0.3)=0.63
  4. 4(0.7)(0.3)^3=0.0756

Exactly 3 successes can occur in 4 positions, so multiply one sequence mass 0.7^3(0.3) by 4.

4Choose the distribution from the data-generating story

A distribution is a modeling claim about how the data are generated. Bernoulli fits one binary event, Binomial fits a fixed count of repeated binary events, and a general mass table fits a custom discrete variable.

In ML work this choice happens before fitting. A label that is 0/1, a count of correct predictions in a validation slice, and a calibrated probability score are different probability objects even when they appear in the same dashboard.

The distribution-choice table separates one trial, fixed repeated trials, and custom discrete values.

Match story to model

  1. One binary labelUse Bernoulli when there is one yes/no outcome.
  2. Fixed repeated trialsUse Binomial when counting successes across n independent equal-probability trials.
  3. Custom valuesUse a probability mass table when values do not follow that repeated-trial story.
Distribution choice
StoryObject
one clicked / not clicked labelBernoulli
correct count in 5 fixed casesBinomial
support tickets per hour: 0,1,2,3+custom mass table

Validation successes as a Binomial model

A model has independent probability 0.8 of being correct on each of 4 fixed validation examples. Let X count correct predictions. Compute P(X=4) and P(X\ge3).

  • P(X=4)\binom{4}{4}0.8^4(0.2)^0=0.4096
  • P(X=3)\binom{4}{3}0.8^3(0.2)=4\cdot0.512\cdot0.2=0.4096
  • P(X\ge3)0.4096+0.4096=0.8192

Pro tip. The fixed four-case validation story is what justifies Binomial arithmetic; without that story, the formula is only pattern matching.

A dashboard counts how many of 8 fixed sensors alert in an hour, assuming independent equal alert probability. Which model fits the count story?
  1. Binomial
  2. Bernoulli
  3. Custom mass table only
  4. Normal density

The number of trials is fixed at 8, each trial is binary, and the success probability is shared, so this is a Binomial count.

Notes

  • A random variable maps outcomes of an experiment to numbers so that uncertainty can be analyzed algebraically.
  • A distribution tells how probability mass or density is allocated across the possible values.
  • Bernoulli variables model one yes/no trial; Binomial variables count successes across a fixed number of independent equal-probability trials.

Formulas

  • For a discrete random variable X, sum_x P(X = x) = 1.
  • For X ~ Bernoulli(p), P(X=1)=p and P(X=0)=1-p.
  • For X ~ Binomial(n,p), P(X=k)=C(n,k)p^k(1-p)^(n-k).

Exam traps & shortcuts

  • Keep the event, the variable, and the realized value separate; they answer different questions.
  • Use Binomial only when the number of trials is fixed, trials are independent, and the same success probability applies each time.

Recap

A random variable plus a distribution is the basic package of uncertainty.

Variable
A random variable names the numerical value extracted from uncertain outcomes.
Distribution
A distribution allocates probability mass or density over possible values.
Binomial
For small fixed counts, multiply one sequence mass by the number of arrangements.
Model choice
Choose Bernoulli, Binomial, or a custom mass table from the data-generating story.

Practise Random Variables and Distributions

Reading is free and needs no account. Practice, mocks and progress live in the app.

  • A 5-question practice set that ends the chapter
  • 4 quick checks with worked explanations
  • Timed mocks scored with the real marking scheme
  • Readiness tracked per topic, kept on your device
Continue with Google — freeNo card, no trial. Works offline once installed.