← Back to Portal

Tutorial Sheet 3

Random Variables

13 Problems Solved

Q1

Classification of Random Variables

Classify the following random variables as discrete or continuous: (a) Number of items in a batch. (b) Weight of a cereal box. (c) Number of phone calls per hour. (d) Temperature in a room. (e) Time spent waiting for a bus.

💡 Hints

  • Discrete: Countable outcomes (0, 1, 2...).
  • Continuous: Measureable values on a range (10.5, 10.55...).
  • Can there be any value in an interval? If yes, it's likely continuous.

📝 What's Being Asked

Identify whether the random variable outcomes are countable or fall on a continuous scale.

📚 Concepts Used

Definitions
  • Discrete: Range is finite or countably infinite.
  • Continuous: Range is an interval.

✍️ Full Solution

(a) Number of items, (c) Number of calls

These are Discrete as they represent counts.

(b) Weight, (d) Temp, (e) Time

These are Continuous as they represent physical measurements.

🔄 Variations

Testing if the sum of two discrete variables is always discrete (Yes).

🎯 Exam Perspective

Commonly worth 1-2 marks. Don't waste time on long explanations.
Q2

CDF to PMF Conversion

Find the PMF from this CDF: \( F(x) = 0 \) for \( x < 0 \); \( 0.2 \) for \( 0 \le x < 1 \); \( 0.5 \) for \( 1 \le x < 2 \); \( 0.8 \) for \( 2 \le x < 3 \); \( 1 \) for \( x \ge 3 \).

💡 Hints

PMF at x is the jump size in CDF at x: \( P(X=x) = F(x) - F(x^-) \).

📚 Concepts Used

In a discrete distribution, the CDF is a step function. The probability at a point is the "height of the step" at that location.

✍️ Full Solution

  • \( P(X=0) = F(0) - F(0^-) = 0.2 - 0 = 0.2 \)
  • \( P(X=1) = F(1) - F(0) = 0.5 - 0.2 = 0.3 \)
  • \( P(X=2) = F(2) - F(1) = 0.8 - 0.5 = 0.3 \)
  • \( P(X=3) = F(3) - F(2) = 1.0 - 0.8 = 0.2 \)

Verification Check: \( 0.2 + 0.3 + 0.3 + 0.2 = 1.0 \). Valid PMF.

🎯 Exam Perspective

Label the PMF clearly as a set of pairs or a piecewise function.
Q3

Expectation and Variance

For a fair coin tossed twice, find \( E[X] \) and \( Var(X) \) where X is the number of heads.

💡 Hints

PMF: \( P(0)=0.25, P(1)=0.5, P(2)=0.25 \).

📚 Concepts Used

\( E[X] = \sum x P(x) \)

\( Var(X) = E[X^2] - (E[X])^2 \)

✍️ Full Solution

\( E[X] = 0(0.25) + 1(0.5) + 2(0.25) = 1.0 \)

\( E[X^2] = 0^2(0.25) + 1^2(0.5) + 2^2(0.25) = 1.5 \)

\( Var(X) = 1.5 - (1)^2 = 0.5 \)

Q4

Proof: E[X²] ≥ (E[X])²

Prove that for any random variable X, \( E[X^2] \ge (E[X])^2 \). When does equality hold?

💡 Hints

Think about the physical meaning of variance. Can it be negative?

📚 Concepts Used

The squared difference from the mean \( (X - \mu)^2 \) is always non-negative. Therefore, its average (Mean Squared Deviation) must be non-negative.

✍️ Full Solution

Let \( \mu = E[X] \). Consider the variance:

\( Var(X) = E[(X - \mu)^2] \)

Because \( (X - \mu)^2 \ge 0 \) for any real value of X, the expectation of this non-negative variable must be \( \ge 0 \).

\( E[X^2 - 2X\mu + \mu^2] \ge 0 \)

\( E[X^2] - 2\mu E[X] + \mu^2 \ge 0 \)

\( E[X^2] - 2\mu^2 + \mu^2 \ge 0 \implies E[X^2] - \mu^2 \ge 0 \)

\( E[X^2] \ge (E[X])^2 \)

Equality: Holds when \( Var(X) = 0 \), which implies X is a constant.

🎯 Exam Perspective

This is a special case of Jensen's Inequality for the convex function \( g(x) = x^2 \). Mentioning this gains bonus points in competitive exams.
Q5

Normalization & Probability

Find c such that \( f(x) = cx^2 \) for \( 0 < x < 3 \) is a PDF. Calculate \( P(X> 1) \).

💡 Hints

  • Integrate \( f(x) \) from 0 to 3 and set the result equal to 1.
  • The probability \( P(X > 1) \) is the integral of the PDF from 1 to 3.
  • Remember that \( f(x) = 0 \) outside the range (0, 3).

📝 What's Being Asked

This problem asks for two things:

  1. The value of the constant \( c \) that makes the function a valid Probability Density Function (PDF).
  2. The probability that the random variable \( X \) takes a value greater than 1.

📚 Concepts Used

PDF Normalization Property

For any valid PDF \( f(x) \):

\( \int_{-\infty}^{\infty} f(x) dx = 1 \)
Probability as Integral

The probability that \( X \) falls in an interval [a, b] is:

\( P(a \le X \le b) = \int_{a}^{b} f(x) dx \)

✍️ Full Solution

Step 1: Finding the constant \( c \)

We set the total area under the curve to 1:

\( \int_{0}^{3} cx^2 dx = 1 \)

\( c [x^3/3]_0^3 = 1 \)

\( c [27/3 - 0] = 1 \implies 9c = 1 \implies c = 1/9 \).

Step 2: Calculating \( P(X > 1) \)

Since the variable only exists up to 3:

\( P(X > 1) = \int_1^3 \frac{1}{9}x^2 dx \)

\( = \frac{1}{9} [x^3/3]_1^3 = \frac{1}{27}(3^3 - 1^3) = \frac{1}{27}(27-1) = 26/27 \).

Result: \( 26/27 \approx 0.963 \).

🔄 Variations

  • Find the CDF: \( F(x) = \int_0^x (1/9)t^2 dt = x^3/27 \) for \( 0 \le x \le 3 \).
  • Find Expectation: \( E[X] = \int_0^3 x(x^2/9) dx = [x^4/36]_0^3 = 81/36 = 2.25 \).

🎯 Exam Perspective

Always check if the final probability is between 0 and 1. If you get something like 1.2, you likely made an integration error or used wrong limits.
Q6

Exponential Waiting Time

The time between arrivals at a service desk follows an exponential distribution with mean 10 minutes. Find the probability that the next arrival takes more than 15 minutes.

💡 Hints

  • For Exponential distribution, \( \text{Mean} = 1/\lambda \).
  • Parameter \( \lambda \) represents the "rate" of arrivals.
  • Use the survival function formula: \( P(X > x) = e^{-\lambda x} \).

📝 What's Being Asked

Given the average (mean) waiting time is 10 minutes, what is the likelihood that you'll have to wait longer than 15 minutes for the next person to arrive?

📚 Concepts Used

Exponential Distribution

PDF: \( f(x) = \lambda e^{-\lambda x} \) for \( x \ge 0 \)

Relationship: \( E[X] = 1/\lambda \)

Survival Function

Instead of integrating the PDF repeatedly, remember that the probability of "more than x" is:

\( P(X > x) = 1 - F(x) = e^{-\lambda x} \)

✍️ Full Solution

Step 1: Determine the rate parameter \( \lambda \)

Given Mean (\( \mu \)) = 10 minutes.

Since \( \mu = 1/\lambda \), we have \( 10 = 1/\lambda \implies \lambda = 0.1 \) per minute.

Step 2: Calculate the probability \( P(X > 15) \)

Using the survival function:

\( P(X > 15) = e^{-\lambda \cdot 15} \)

\( = e^{-0.1 \times 15} = e^{-1.5} \)

Calculating the value: \( e^{-1.5} \approx 0.2231 \).

Result: Roughly 22.3% chance of waiting over 15 minutes.

🔄 Variations

  • Probability of waiting less than 5 minutes: \( P(X \le 5) = 1 - e^{-0.1 \times 5} = 1 - e^{-0.5} \approx 0.393 \).
  • Conditional Probability (Memoryless): What is \( P(X > 25 | X > 10) \)? It is simply \( P(X > 15) = 0.223 \).

🎯 Exam Perspective

Calculators are usually allowed. If not, leaving the answer as \( e^{-1.5} \) is perfectly acceptable and often preferred for full marks.
Q7

Mean of Poisson Distribution

Show that the expected value of a Poisson random variable with parameter \( \lambda \) is \( \lambda \).

💡 Hints

  • Definition of Expectation: \( E[X] = \sum x P(x) \).
  • For Poisson, the sum starts at \( x = 0 \), but the first term is zero.
  • Factor out \( \lambda e^{-\lambda} \) from the sum.

📝 What's Being Asked

Prove mathematically that if \( X \sim \text{Poisson}(\lambda) \), then its mean (average value) is exactly the parameter \( \lambda \).

📚 Concepts Used

Poisson PMF
\( P(X=x) = \frac{e^{-\lambda} \lambda^x}{x!} \) for \( x=0, 1, 2, \dots \)
Taylor Series Expansion

The exponential function can be written as a series:

\( e^\lambda = \sum_{k=0}^{\infty} \frac{\lambda^k}{k!} \)

✍️ Full Solution

Step 1: Write the definition

\( E[X] = \sum_{x=0}^{\infty} x \frac{e^{-\lambda} \lambda^x}{x!} \)

The \( x=0 \) term is 0, so we start the sum at \( x=1 \).

Step 2: Simplify the factorial

Note that \( x/x! = 1/(x-1)! \)

\( E[X] = e^{-\lambda} \sum_{x=1}^{\infty} \frac{\lambda^x}{(x-1)!} \)

Step 3: Factor out the parameter

Let \( k = x-1 \). As \( x \) goes from 1 to \( \infty \), \( k \) goes from 0 to \( \infty \).

\( E[X] = \lambda e^{-\lambda} \sum_{k=0}^{\infty} \frac{\lambda^{k}}{k!} \)

The sum is exactly \( e^\lambda \).

Therefore, \( E[X] = \lambda e^{-\lambda} (e^\lambda) = \lambda \cdot e^0 = \lambda \).

🔄 Variations

  • Variance of Poisson: Show that \( Var(X) = \lambda \). Requires finding \( E[X(X-1)] \) first.
  • Poisson Approximation: Realize that Binomial(\( n, p \)) approaches Poisson(\( np \)) as \( n \to \infty \) and \( p \to 0 \).

🎯 Exam Perspective

This proof is a "bread and butter" question for 5 marks. Practice writing it cleanly without skipping the factorial simplification step.
Q8

Memoryless Property

If X is exponentially distributed with parameter \( \lambda \), prove that \( P(X > s+t | X > s) = P(X > t) \).

💡 Hints

  • Use the definition of conditional probability: \( P(A|B) = \frac{P(A \cap B)}{P(B)} \).
  • Note that the event \( X > s+t \) is a subset of \( X > s \) because \( t > 0 \).
  • The survival function is \( P(X > x) = e^{-\lambda x} \).

📝 What's Being Asked

This is a formal proof of the "Memoryless Property." It asks you to show that given a process has already lasted \( s \) units of time, the probability it lasts for at least \( t \) more units is the same as the probability it would last \( t \) units starting from scratch.

📚 Concepts Used

Survival Function

For the exponential distribution:

\( P(X > x) = e^{-\lambda x} \)
Conditional Probability
\( P(X > s+t | X > s) = \frac{P(X > s+t \cap X > s)}{P(X > s)} \)

✍️ Full Solution

Step 1: Simplify the intersection

If \( X > s+t \), then \( X \) is surely greater than \( s \) (since \( t > 0 \)).

Therefore, \( (X > s+t) \cap (X > s) \) is simply the event \( X > s+t \).

Step 2: Apply the formula

\( P(X > s+t | X > s) = \frac{P(X > s+t)}{P(X > s)} \)

Step 3: Substitute the survival functions

\( = \frac{e^{-\lambda(s+t)}}{e^{-\lambda s}} \)

\( = \frac{e^{-\lambda s} \cdot e^{-\lambda t}}{e^{-\lambda s}} \)

\( = e^{-\lambda t} \)

This is exactly \( P(X > t) \). Proof complete.

🔄 Variations

  • Discrete Memoryless: The Geometric distribution is the only discrete distribution with this property.
  • Application: If a lightbulb has been working for 100 hours, and its failure follows an exponential distribution, the probability it lasts another 50 hours is the same as it lasting 50 hours when brand new.

🎯 Exam Perspective

This property is often used to simplify complex reliability problems. If you see "Exponential" and "Conditional Probability" together, look for a way to apply this property.
Q9

Bernoulli to Binomial

Explain the relationship between Bernoulli and Binomial random variables. How do their expectations relate?

💡 Hints

  • A Bernoulli trial is a single "yes/no" experiment.
  • A Binomial variable counts total "yes" outcomes in \( n \) trials.
  • Expectation follows the rule of linearity: \( E[A+B] = E[A] + E[B] \).

📝 What's Being Asked

The problem asks for an explanation of how these two distributions are connected and a derivation of the Binomial mean using Bernoulli trials.

📚 Concepts Used

Bernoulli(p)

Outcomes: 1 (success) with prob \( p \), 0 (failure) with prob \( 1-p \).

\( E[X_i] = 1(p) + 0(1-p) = p \).

Binomial(n, p)

Definition: The sum of \( n \) independent and identically distributed (i.i.d.) Bernoulli(p) trials.

\( X = \sum_{i=1}^n X_i \)

✍️ Full Solution

Relationship

A Binomial distribution models the number of successes in a fixed number of independent Bernoulli trials, each with the same probability of success \( p \).

Expectation Derivation

Let \( X_1, X_2, \dots, X_n \) be Bernoulli trials.

The total number of successes is \( X = X_1 + X_2 + \dots + X_n \).

By the Linearity of Expectation:

\( E[X] = E[X_1 + X_2 + \dots + X_n] \)

\( = E[X_1] + E[X_2] + \dots + E[X_n] \)

\( = p + p + \dots + p \) (total of \( n \) terms)

\( = np \).

🔄 Variations

  • Variance Relationship: Since trials are independent, \( Var(X) = \sum Var(X_i) = n(p(1-p)) = npq \).
  • Multinomial: Extension to trials with more than two possible outcomes.

🎯 Exam Perspective

Avoid trying to derive the mean of a Binomial variable using the factorial-sum method (\( \sum x \cdot C(n,x) \dots \)) unless specifically asked. The sum-of-Bernoulli method shown here is much faster and less prone to errors.
Q10

Discrete Uniform Distribution

Let X follow a discrete uniform distribution on the set {1, 2, ..., n}. Find its mean.

💡 Hints

  • In a uniform distribution, every outcome is equally likely.
  • Probability of each outcome is \( 1/n \).
  • The sum of first \( n \) integers is \( n(n+1)/2 \).

📝 What's Being Asked

Find the average value (mathematical expectation) of a random variable that can take any integer from 1 to \( n \) with equal probability.

📚 Concepts Used

Uniform PMF
\( P(X=x) = 1/n \) for \( x \in \{1, 2, \dots, n\} \)
Arithmetic Progression

Sum of sequence: \( \sum_{i=1}^n i = \frac{n(n+1)}{2} \)

✍️ Full Solution

Expectation Formula

\( E[X] = \sum_{x=1}^n x \cdot P(X=x) \)

Calculation

\( E[X] = \sum_{x=1}^n x \cdot \frac{1}{n} \)

Factor out the constant \( 1/n \):

\( E[X] = \frac{1}{n} \sum_{x=1}^n x \)

Substitute the sum formula:

\( E[X] = \frac{1}{n} \cdot \frac{n(n+1)}{2} \)

\( E[X] = \frac{n+1}{2} \).

🔄 Variations

  • Set {0, 1, ..., n}: If the set includes 0, mean becomes \( n/2 \).
  • Variance: The variance is \( \frac{n^2-1}{12} \).

🎯 Exam Perspective

This result is simply the arithmetic mean of the first and last values. For a set {a, b}, the mean is \( (a+b)/2 \). Remember this for quick multiple-choice checks!
Q11

Geometric Mean (First Success)

A hunter has a probability of 0.4 of hitting a bird. He shoots until he hits it. Find the expected number of shots.

💡 Hints

  • The process stops at the first "success."
  • This is a classic application of the Geometric distribution.
  • Success probability \( p = 0.4 \).

📝 What's Being Asked

The problem asks for the average (expected) number of trials needed to achieve the first success, given each trial is independent and has a 40% success rate.

📚 Concepts Used

Geometric Distribution (Trials)

Models the number of trials \( X \) until the first success.

PMF: \( P(X=x) = q^{x-1}p \) for \( x = 1, 2, \dots \)

\( E[X] = 1/p \)

✍️ Full Solution

Identify Parameters

Success probability \( p = 0.4 \).

Failure probability \( q = 1 - 0.4 = 0.6 \).

Apply Expectation Formula

For trials until first success:

\( E[X] = 1/p \)

\( E[X] = 1/0.4 = 2.5 \).

On average, the hunter will need 2.5 shots to hit the bird.

🔄 Variations

  • Number of Failures: If asked for the number of *failures* before the first success, the mean would be \( E[Y] = E[X] - 1 = q/p = 0.6/0.4 = 1.5 \).
  • Probability Check: Probability that he hits it on the 3rd shot: \( P(X=3) = (0.6)^2(0.4) = 0.144 \).

🎯 Exam Perspective

Be very careful to check if the question defines \( X \) as the "total trials" or the "total failures." The formulas for mean and PMF differ by exactly 1 trial. This is a favorite trick of examiners.
Q12

Moment Generating Function (Exponential)

Derive the MGF of an exponential random variable with parameter \( \lambda \).

💡 Hints

  • Definition: \( M_X(t) = E[e^{tX}] \).
  • Substitute the PDF: \( f(x) = \lambda e^{-\lambda x} \).
  • Combine the exponents: \( e^{tx} \cdot e^{-\lambda x} = e^{(t-\lambda)x} \).

📝 What's Being Asked

Mathematically derive the Moment Generating Function (MGF) for the exponential distribution from first principles (integration).

📚 Concepts Used

MGF Definition
\( M_X(t) = \int_{-\infty}^{\infty} e^{tx} f(x) dx \)
Convergence Condition

The MGF only exists if the expected value is finite. For exponential, this requires the damping factor in the integral to be negative.

✍️ Full Solution

Step 1: Setup the Integral

\( M_X(t) = \int_0^{\infty} e^{tx} \left( \lambda e^{-\lambda x} \right) dx \)

\( M_X(t) = \lambda \int_0^{\infty} e^{(t-\lambda)x} dx \)

Step 2: Integration

This integral converges if and only if \( t < \lambda \).

\( M_X(t) = \lambda \left[ \frac{e^{(t-\lambda)x}}{t-\lambda} \right]_0^{\infty} \)

Step 3: Evaluate Limits

Evaluated at \( \infty \): Since \( t-\lambda < 0 \), the term goes to 0.

Evaluated at \( 0 \): \( e^0 / (t-\lambda) = 1/(t-\lambda) \).

\( M_X(t) = \lambda \left[ 0 - \frac{1}{t-\lambda} \right] = -\frac{\lambda}{t-\lambda} = \frac{\lambda}{\lambda - t} \).

🔄 Variations

  • Mean from MGF: \( E[X] = M'_X(0) = \frac{\lambda}{(\lambda-0)^2} = 1/\lambda \).
  • MGF of Gamma: A sum of \( k \) independent exponentials has MGF \( \left( \frac{\lambda}{\lambda-t} \right)^k \).

🎯 Exam Perspective

Always explicitly state "for \( t < \lambda \)" in your final answer. Forgetting this domain condition can cost you 1-2 marks in a competitive exam or formal proof.
Q13

Chebyshev's Lower Bound

Find a lower bound for \( P(|X-\mu| < 3\sigma) \) using Chebyshev's inequality.

💡 Hints

  • Chebyshev's gives a bound on "tail" probabilities (outliers).
  • The question asks for the "inner" probability (complement).
  • Formula: \( P(|X-\mu| \ge k\sigma) \le 1/k^2 \).

📝 What's Being Asked

Regardless of the distribution, find the minimum probability that a random variable falls within 3 standard deviations of its mean.

📚 Concepts Used

Chebyshev's Inequality
\( P(|X-\mu| \ge k\sigma) \le \frac{1}{k^2} \)

This holds for ANY random variable with finite mean and variance.

Complement Rule
\( P(|X-\mu| < k\sigma) \ge 1 - \frac{1}{k^2} \)

✍️ Full Solution

Step 1: Identify k

The question asks for the bound within \( 3\sigma \). So, \( k = 3 \).

Step 2: Apply the inequality

Lower bound = \( 1 - 1/k^2 \)

\( = 1 - 1/3^2 \)

\( = 1 - 1/9 = 8/9 \).

Step 3: Final Result

\( 8/9 \approx 0.8889 \).

Conclusion: At least 88.89% of outcomes fall within 3 standard deviations of the mean.

🔄 Variations

  • Compare with Normal: For a Normal distribution, the probability is ~99.7%. Chebyshev gives a much looser bound because it must work for *any* distribution.
  • Finding k: What value of k ensures at least 95% of data is within \( k\sigma \)? \( 1 - 1/k^2 = 0.95 \implies 1/k^2 = 0.05 \implies k^2 = 20 \implies k \approx 4.47 \).

🎯 Exam Perspective

Chebyshev is a "distribution-free" result. If an exam question asks for a bound and *doesn't* tell you the distribution (Normal, Poisson, etc.), Chebyshev is almost certainly what you need.