A random variable is a variable whose possible values are numerical outcomes of a random phenomenon. There are two main types of random variables:
- Discrete Random Variables: These can take on a countable number of distinct values. For example, the number of heads in a series of coin flips.
- Continuous Random Variables: These can take on an infinite number of values within a given range. For example, the height of students in a class.
Examples of Random Variables
- Discrete Random Variable: Consider rolling a six-sided die. The outcome (1, 2, 3, 4, 5, or 6) is a discrete random variable.
- Continuous Random Variable: Consider measuring the time it takes for a computer to complete a task. The time, which could be 1.1 seconds, 1.15 seconds, etc., is a continuous random variable.
Probability Distributions
A probability distribution describes how the values of a random variable are distributed. For discrete random variables, this is represented by a probability mass function (PMF), while for continuous random variables, it is represented by a probability density function (PDF).
Example of PMF
For a fair die, the PMF is:
Example of PDF
For a normal distribution (bell curve), the PDF is:
where μ is the mean and σ2 is the variance.
Expectation and Variance
- Expectation (Mean): The expected value of a random variable gives a measure of the center of the distribution of the variable.
- Variance: The variance measures the spread of the random variable around the mean.
Real-World Application
Consider predicting the stock market prices. The future price can be modelled as a continuous random variable with a certain distribution based on historical data.