What is a random variable?
A random variable assigns a number to each outcome. It can describe the number of defaults, an investment return, a recovery proportion or a project’s completion time. Its distribution specifies how probability spreads across possible values.
Counts and measurements
| Feature | Discrete | Continuous |
|---|---|---|
| Possible values | A finite or countably infinite set | An interval or collection of intervals |
| Example | Number of defaults among 10 loans | Time until default, measured continuously |
| Probability description | Probability mass function (PMF) | Probability density function (PDF) |
| At one point | P(X = x) can be positive | P(X = x) = 0 for an absolutely continuous model |
| Probability over a range | Add probability masses | Integrate the density over the range |
Worked discrete example: two independent loans
Assume each loan defaults with probability 10% over one year, independently. Let X be the number of defaults.
| X | Calculation | Probability |
|---|---|---|
| 0 | 0.9 × 0.9 | 81% |
| 1 | 2 × 0.1 × 0.9 | 18% |
| 2 | 0.1 × 0.1 | 1% |
The probability masses add to 100%. Expected defaults equal 0 × 0.81 + 1 × 0.18 + 2 × 0.01 = 0.20. The expectation can be fractional even though an observed count must be an integer.
Worked continuous example: a waiting time
Assume a service time X is uniformly distributed from 0 to 10 minutes. Its density is 1/10 per minute throughout that interval.
A width of 3 minutes multiplied by density 0.1 per minute gives probability 0.30. At exactly 4 minutes, the probability is zero in the idealised continuous model. A recorded value of 4 minutes usually represents a rounded interval.
A density can exceed one
A uniform variable between 0 and 0.20 has density 5. This is valid: total area is 5 × 0.20 = 1. Density has units reciprocal to the variable’s units. Probability has no units and cannot exceed 1.
A distribution can contain both types
A loss model may place positive probability at zero loss and spread the remaining probability over positive losses. Such a mixed distribution has a point mass plus a continuous component. A single ordinary density does not capture the point mass.
Excel and financial modelling
For the two-loan example, =BINOM.DIST(1,2,0.1,FALSE) returns the probability of exactly one default. For the continuous example, use =(5-2)/(10-0).
Choose the distribution by the variable’s support and the economic mechanism. A count cannot be negative or fractional. A recovery proportion usually lies between 0 and 1. A positive price has a different support from an unrestricted normal return model.
Check your understanding
Does every variable with decimal observations have a continuous distribution?
No. Coupon rates quoted in a fixed set of increments may have discrete support. Measurement precision and the underlying modelling assumption are different issues.
Do the endpoints of a continuous interval matter?
For an absolutely continuous variable, P(a < X < b) = P(a ≤ X ≤ b). For a discrete variable, including an endpoint can add a positive probability mass.
Interactive distribution laboratory
Change the parameters and threshold, then switch between cumulative probability and density or mass. Values are numerical approximations for learning.
Horizontal axis: the variable’s value. Vertical axis: density, probability mass, or cumulative probability as labelled. Shading highlights values at or below the threshold. The plot shows a finite viewing window.
Sources and further reading
- National Institute of Standards and Technology: Gallery of Distributions
- Distribution definition and properties
- Microsoft: Statistical functions reference
All numerical finance and project examples are hypothetical teaching illustrations. Probability assumptions require validation before practical use.