Random Variables
Random Variables
- Definition: A random variable is a variable whose value is a numerical outcome of a random phenomenon.
Discrete Random Variables
- Examples:
- The outcome of throwing a die.
- The number of heads when tossing 'n' coins.
- The number of customers arriving at a bookstore.
- The position of participants in a running race.
Continuous Random Variables
- Examples:
- Heights of randomly selected persons (age > 16).
- Weights of randomly selected persons (age > 16).
- The time one has to wait in a queue.
- The service time in a public service system.
- The lifetime distribution of electric bulbs.
Probability Distribution
Discrete Example: A random variable X with probability distribution:
- X: -2, -1, 0, 1, 2, 3
- f(X): 0.1, K, 0.2, 2K, 0.3, 3K
Continuous Example: X is a continuous random variable with PDF:
Probability Mass Function (PMF)
- Sketching: If the probability distribution of X is given:
- X: 1, 2, 3, 4
- f(X): 0.4, 0.3, 0.2, 0.1
Independence
- An assembly consists of three mechanical components with meeting specifications probabilities: 0.95, 0.98, and 0.99 respectively. Assuming independence, determine the probability mass function of the number of components meeting specifications.
Probability Density Function (PDF)
- Let X denote the current in a thin copper wire in milliamperes, with a range of [0, 20mA] and a probability density function f(x) = 0.05 for .
- Sketch the PDF
- Probability that current is less than 10 amperes.
- Probability that current is greater than 5 amperes.
- Probability that current is between 10 and 15 amperes.
- P(X=12) = 0 (for continuous RVs)
Important Note on Continuous Random Variables
- For continuous random variables, for every x.
- The probability is obtained by integrating the PDF.
- A PDF can be greater than 1.
- A PDF can be unbounded.
- Example: If for 0 < x < 1, then even though f is not bounded.
Cumulative Distribution Function (CDF)
- Definition: Cumulative Distribution Function (CDF) for discrete and continuous random variables.
PMF and CMF
- If the random variable X takes values 1, 2, 3, and 4, such that , find the PMF and cumulative distribution function (CMF) for X. Also, sketch the PMF and CMF of X.
CDF for Continuous Random Variables
If is the PDF of continuous RV X, then CDF of X is defined.
Examples:
Properties of CDF for Continuous Random Variables
- Let F be the CDF for a random variable X. Then:
- P(x < X \leq y) = F(y) - F(x)
- P(X > x) = 1 - F(x)
- P(a < X \leq b) = P(a \leq X < b) = F(b) - F(a)
- P(a < x <b) = P(a \leq X \leq b)
Cumulative Density Function - Problems
Given CDF for a random variable X, , find:
- The probability mass function
- P(1<x<3)
- P(1 \le x<5)
- P(2 < x \le 5)
Given the PDF of X, , find the cumulative density function (CDF) for X and evaluate the following probabilities using CDF.
- P(0.5 < x \le 2.5)
Mean and Variance of Discrete and Continuous Random Variables
Definition
The expected value, or mean, or first moment of X is defined to be
If X is a random variable with pmf/pdf and if g(x) is a function of X. Then,
Discrete Random Variables
Find the mean and variance of the number of heads obtained while tossing three coins.
Let X equal the number of bits in error in the next four bits transmitted. The possible values of X are {0, 1, 2, 3, 4} and corresponding probabilities are P(X=0)=0.6561; P(X=1)=0.2916; P(X=2)=0.0486; P(X=3)=0.0036 and P(X=4)=0.0001. Find the mean, variance, and standard deviation of X.
Continuous Random Variables
Find the mean and variance of X if the probability density function of X is f(x) = 0.125x, 0 < x < 4.
Given the pdf of X is .
- Find ‘a’.
- Find the value of ‘k’ if P(X \leq k) = P(X > k).
- Find the mean and standard deviation of X.
Rules of Expectation as an Operator
- Let X and Y be two Random variables
- Example: E(5) = 5
- If X is a random variable with pmf/pdf and if g(x) is a function of X. Then,
Central Moments and Row Moments
- nth central moment:
- nth row moment:
- Central moments are used.
- If skewness > 0 ⇒ skewed towards the left.
- If kurtosis = 3 ⇒ Normal(=0, =1)
- Logistic(=0, =0.55153) kurtosis = 4.2
Uniform Row Moments
- Uniform ∼ (0,1)
- Generate (Draw) N Random values from X. Find average . This will tend to when .
- Generate(Draw) N Random values from X. Compute . Find average: . This will tend to when .
Variance - Second Central Moment
Variance of Z = X + Y
- Let X and Y be two RVs, Let Z = X + Y; Var(Z) = ?.
- If X and Y are independent, Cov(X,Y) = 0
- Therefore,
- Definition: Let X and Y be random variables with means and and standard deviations and . Define the covariance between X and Y by
Variance of Z = X - Y
- Let X and Y be two RVs,
- If X and Y are independent
Rules of Variance as an Operator
- Let X and Y be two independent RVs,
- If are random variables, then
Variance and Co-variance of Multivariate Distribution
Variance Co-Variance Matrix
It is a symmetric Positive definite matrix.
Exercises
Find the first 4 row moments of the variable with pmf, f(x) = 0.2, x = -2, -1, 0, 1, 2.
Find the first two row moments of a continuous random variable with probability density function, , .
Find the first 4 central moments of the discrete random variable, the cumulative mass function for which is given by, .
Given the mean of two independent random variables X and Y are 12, -50 and the standard deviation of X and Y are respectively 2 and 5, then find:
- Average and Variance of 3X - 5Y
- Mean and Standard deviation of 5X + 2Y + 100.
Find the mean and variance of X.
Let X be a random variable with the following probability distribution: Find E(X) and E() and then, using these values, evaluate .
Moments and Moment Generating Function of X (MGF)
- The moments uniquely characterize a distribution
- If all moments of two distributions are the same, then the distributions are also the same.
- The functional form of the moment generating function gives a clue regarding the resulting distribution.
- Definition: The moment−generating function (MGF) of the random variable is the function of a real parameter t defined by , for all
Why is called a Moment Generating Function of X (MGF)
- The k−th row moment of a random variable with the moment−generating function is given by
Moments and Moment Generating Function of X (MGF) - Examples
Find the MGF of X, the outcome while throwing a die, and hence find the mean and variance.
If the random variable X has the MGF . Find the mean and variance of X.
If the density function of a continuous random variable X is given by: f(x) = \frac{1}{2} e^{-|x|}, -\infty < x < \infty. Find the moment generating function of X, the mean of X and the variance of X.
If the rth row moment of a continuous random variable X about the origin is r!, find the MGF of X.
Chebyshev's Theorem
The probability that any random variable X will assume a value within k standard deviations of the mean is at least . That is,
- P(\mu - k\sigma < X < \mu + k\sigma) \ge 1 - \frac{1}{k^2}.
Example: A random variable X has a mean , a variance , and an unknown probability distribution. Find
- P(-4 < X < 20)
- P(|X - 8| 6).
Chebyshev’s Theorem – Exercise
A random variable X has a mean and a variance . Using Chebyshev’s theorem, find:
- (a) ;
- (b) P(|X − 10| < 3);
- (c) P(5 < X < 15);
- (d) the value of the constant c such that, .
Compute P(μ − 2σ < X < μ + 2σ), where X has the density function given below, and compare with the result given in Chebyshev’s theorem:
Important Distributions
Discrete
- Discrete Uniform Distribution
- Binomial Distribution
- Poisson Distribution
Continuous
- Continuous Uniform Distribution
- Exponential Distribution
- Gaussian/Normal Distribution