100% FREE
Updated: Mar 2026 Probability Theory Random Variables and Distributions
Random Variables
Comprehensive study notes on Random Variables for CMI M.Sc. and Ph.D. Computer Science preparation.
This chapter covers key concepts, formulas, and examples needed for your exam.
This chapter introduces the fundamental concept of random variables, transforming experimental outcomes into numerical values for rigorous analysis. Mastery of this topic is crucial for comprehending subsequent advanced probability concepts and is frequently assessed in examinations through problems involving their definitions, distributions, and transformations.
---
Chapter Contents
|
| Topic |
|---|-------|
| 1 | Discrete Random Variables |
---
We begin with Discrete Random Variables.
Part 1: Discrete Random Variables
This section introduces discrete random variables, their distributions, and fundamental properties essential for analyzing probabilistic systems in computer science. We focus on applying these concepts to solve problems.
---
Core Concepts
1. Random Variable (RV)
A random variable is a function that maps outcomes from a sample space to real numbers. We denote random variables by capital letters, e.g., X.
πRandom Variable
A random variable X is a function X:SβR, where S is the sample space of a probability experiment.
Worked Example:
Consider tossing a fair coin three times. Let X be the number of heads. We define the sample space and the value of X for each outcome.
Step 1: Define the sample space S.
>
S={HHH,HHT,HTH,THH,HTT,THT,TTH,TTT}
Step 2: Map each outcome to a real number representing the number of heads.
Answer: The set of possible values for X is {0,1,2,3}.
:::question type="MCQ" question="A fair six-sided die is rolled twice. Let X be the sum of the two rolls. What is the range of X?" options=["{1,2,β¦,6}","{2,3,β¦,12}","{1,2,β¦,12}","{0,1,β¦,6}"] answer="{2,3,β¦,12}" hint="Consider the minimum and maximum possible sums." solution="The minimum sum occurs when both rolls are 1, so 1+1=2. The maximum sum occurs when both rolls are 6, so 6+6=12. All integer values between 2 and 12 are possible. Therefore, the range of X is {2,3,β¦,12}." :::
---
2. Discrete Random Variable
A random variable is discrete if its range (the set of possible values it can take) is finite or countably infinite.
πDiscrete Random Variable
A random variable X is discrete if the set of its possible values, RXβ={xβRβ£X(s)=xΒ forΒ someΒ sβS}, is countable.
Worked Example:
Determine if the following random variables are discrete.
Step 1: Define X1β as the number of heads in 10 coin tosses.
> The possible values for X1β are {0,1,2,β¦,10}. This set is finite. Thus, X1β is a discrete random variable.
Step 2: Define X2β as the time (in minutes) until the first customer arrives at a store.
> The possible values for X2β are any non-negative real number, e.g., [0,β). This set is uncountable. Thus, X2β is not a discrete random variable; it is continuous.
Answer:X1β is discrete, X2β is continuous.
:::question type="MCQ" question="Which of the following describes a discrete random variable?" options=["The exact height of a randomly selected student.","The temperature of a room in Celsius.","The number of cars passing a certain point on a road in an hour.","The time it takes for a computer program to execute."] answer="The number of cars passing a certain point on a road in an hour." hint="A discrete random variable takes on a finite or countably infinite number of values." solution="The number of cars is a count, which can only be integer values (0, 1, 2, ...). This is a countably infinite set. Heights, temperatures, and execution times can take on any real value within a range, making them continuous." :::
---
3. Probability Mass Function (PMF)
The PMF of a discrete random variable X gives the probability that X takes on a specific value x.
πProbability Mass Function (PMF)
For a discrete random variable X, its PMF, denoted pXβ(x) or P(X=x), satisfies:
pXβ(x)β₯0 for all xβRXβ.
βxβRXββpXβ(x)=1.
Worked Example:
A biased coin has P(H)=0.6. It is flipped twice. Let X be the number of heads. Find the PMF of X.
Step 1: List all possible outcomes and their probabilities.
Step 2: Determine the values X can take and their corresponding probabilities.
> X=0: occurs for TT. pXβ(0)=P(X=0)=P(TT)=0.16 > X=1: occurs for HT,TH. pXβ(1)=P(X=1)=P(HT)+P(TH)=0.24+0.24=0.48 > X=2: occurs for HH. pXβ(2)=P(X=2)=P(HH)=0.36
Step 3: Verify the PMF properties.
> All pXβ(x)β₯0. > βpXβ(x)=0.16+0.48+0.36=1.00.
Answer: The PMF is pXβ(0)=0.16, pXβ(1)=0.48, pXβ(2)=0.36.
:::question type="NAT" question="A box contains 3 red balls and 2 blue balls. Two balls are drawn without replacement. Let X be the number of red balls drawn. What is P(X=1)?" answer="0.6" hint="Calculate the total number of ways to draw 2 balls and the number of ways to draw 1 red and 1 blue ball." solution="Step 1: Calculate the total number of ways to draw 2 balls from 5. >
(25β)=2Γ15Γ4β=10
Step 2: Calculate the number of ways to draw 1 red ball from 3 and 1 blue ball from 2. >
:::question type="MCQ" question="A discrete random variable Y has the following PMF: P(Y=1)=0.2, P(Y=2)=0.6, P(Y=3)=0.2. What is FYβ(2.5)?" options=["0.2","0.6","0.8","1.0"] answer="0.8" hint="The CDF FYβ(x) is the sum of probabilities for all values less than or equal to x." solution="Step 1: Recall the definition of CDF. >
FYβ(2.5)=P(Yβ€2.5)
Step 2: Sum the probabilities for Y values less than or equal to 2.5. The possible values of Y that are less than or equal to 2.5 are Y=1 and Y=2. >
FYβ(2.5)=P(Y=1)+P(Y=2)
>
FYβ(2.5)=0.2+0.6=0.8
Answer: 0.8" :::
---
5. Expected Value (Mean)
The expected value, or mean, of a discrete random variable X is the weighted average of its possible values, with weights given by their probabilities. It represents the long-run average value of the variable.
πExpected Value
For a discrete random variable X with PMF pXβ(x), the expected value E[X] is:
E[X]=xβRXβββxβ pXβ(x)
Linearity of Expectation: For any constants a,b and random variables X,Y:
E[aX+b]=aE[X]+b
E[X+Y]=E[X]+E[Y] (holds even if X,Y are not independent)
Worked Example:
A fair six-sided die is rolled. Let X be the outcome. Calculate E[X].
Step 1: Define the PMF of X.
> The possible outcomes are RXβ={1,2,3,4,5,6}. > For a fair die, pXβ(x)=61β for each xβRXβ.
:::question type="NAT" question="A game involves rolling a fair four-sided die. If the roll is 1, you lose 5.Ifitβ²s2or3,youwin2. If it's 4, you win 10.Let X beyournetwinnings.Whatis E[X]?"answer="2.25"hint="First,determinethePMFof X .Thenapplytheexpectedvalueformula."solution="ββStep1:ββDeterminethepossiblevaluesof X $ and their probabilities (PMF). > X=β5 if roll is 1. P(X=β5)=1/4=0.25 > X=2 if roll is 2 or 3. P(X=2)=2/4=0.50 > X=10 if roll is 4. P(X=10)=1/4=0.25 Step 2: Calculate E[X] using the PMF. >
E[X]=(β5)(0.25)+(2)(0.50)+(10)(0.25)
>
E[X]=β1.25+1.00+2.50
>
E[X]=2.25
Answer: 2.25" :::
---
6. Variance
The variance of a discrete random variable X measures the spread or dispersion of its values around the mean. A higher variance indicates greater variability.
πVariance
For a discrete random variable X with mean E[X]=ΞΌ, the variance Var(X) is:
An equivalent and often more convenient formula is:
Var(X)=E[X2]β(E[X])2
Properties: For any constants a,b:
Var(aX+b)=a2Var(X)
Var(b)=0
Worked Example:
Using the biased coin example where X is the number of heads in two flips, with PMF pXβ(0)=0.16,pXβ(1)=0.48,pXβ(2)=0.36. We previously found E[X]=0β 0.16+1β 0.48+2β 0.36=0+0.48+0.72=1.2. Calculate Var(X).
Step 1: Calculate E[X2].
>
E[X2]=xβRXβββx2β pXβ(x)
>
E[X2]=(02)(0.16)+(12)(0.48)+(22)(0.36)
>
E[X2]=0β 0.16+1β 0.48+4β 0.36
>
E[X2]=0+0.48+1.44=1.92
Step 2: Apply the variance formula Var(X)=E[X2]β(E[X])2.
> We know E[X]=1.2. >
Var(X)=1.92β(1.2)2
>
Var(X)=1.92β1.44
>
Var(X)=0.48
Answer:Var(X)=0.48.
:::question type="MCQ" question="Let X be a discrete random variable with PMF P(X=1)=0.5 and P(X=2)=0.5. What is Var(X)?" options=["0.125","0.25","0.5","1.0"] answer="0.25" hint="First calculate E[X] and E[X2]." solution="Step 1: Calculate E[X]. >
The standard deviation is the square root of the variance. It provides a measure of spread in the same units as the random variable itself, making it easier to interpret than variance.
πStandard Deviation
For a discrete random variable X, the standard deviation ΟXβ is:
ΟXβ=Var(X)β
Worked Example:
Using the previous example where Var(X)=0.48, calculate the standard deviation ΟXβ.
Step 1: Apply the standard deviation formula.
>
ΟXβ=Var(X)β
>
ΟXβ=0.48β
>
ΟXββ0.6928
Answer:ΟXββ0.6928.
:::question type="NAT" question="A random variable X has E[X]=5 and E[X2]=29. What is the standard deviation of X?" answer="2" hint="First calculate the variance using the given values." solution="Step 1: Calculate the variance Var(X). >
Var(X)=E[X2]β(E[X])2
>
Var(X)=29β(5)2
>
Var(X)=29β25=4
Step 2: Calculate the standard deviation ΟXβ. >
ΟXβ=Var(X)β
>
ΟXβ=4β=2
Answer: 2" :::
---
8. Functions of a Random Variable
If X is a discrete random variable and g(X) is a function of X, then Y=g(X) is also a discrete random variable. We can find its PMF, expected value, and variance.
πExpected Value of a Function of X
For a discrete random variable X with PMF pXβ(x), the expected value of Y=g(X) is:
E[g(X)]=xβRXβββg(x)β pXβ(x)
Worked Example:
Let X be the number of heads in two fair coin tosses. The PMF is pXβ(0)=0.25,pXβ(1)=0.5,pXβ(2)=0.25. Let Y=X2. Find E[Y].
Step 1: Define the PMF of X.
> pXβ(0)=0.25 > pXβ(1)=0.50 > pXβ(2)=0.25
Step 2: Apply the formula for E[g(X)]. Here g(X)=X2.
>
E[Y]=E[X2]=xβRXβββx2β pXβ(x)
>
E[Y]=(02)(0.25)+(12)(0.50)+(22)(0.25)
>
E[Y]=0β 0.25+1β 0.50+4β 0.25
>
E[Y]=0+0.50+1.00=1.50
Answer:E[Y]=1.50.
:::question type="MCQ" question="A random variable X has PMF P(X=0)=0.3, P(X=1)=0.4, P(X=2)=0.3. Let Y=2X+1. What is E[Y]?" options=["1.0","2.0","3.0","4.0"] answer="3.0" hint="Use the linearity of expectation, or first find the PMF of Y." solution="Method 1: Using Linearity of Expectation Step 1: Calculate E[X]. >
E[X]=(0)(0.3)+(1)(0.4)+(2)(0.3)=0+0.4+0.6=1.0
Step 2: Apply linearity of expectation for Y=2X+1. >
E[Y]=E[2X+1]=2E[X]+1
>
E[Y]=2(1.0)+1=2.0+1=3.0
Method 2: Finding PMF of Y (for verification) Step 1: Determine the possible values of Y=2X+1 and their probabilities. > If X=0, Y=2(0)+1=1. P(Y=1)=P(X=0)=0.3. > If X=1, Y=2(1)+1=3. P(Y=3)=P(X=1)=0.4. > If X=2, Y=2(2)+1=5. P(Y=5)=P(X=2)=0.3. Step 2: Calculate E[Y]. >
E[Y]=(1)(0.3)+(3)(0.4)+(5)(0.3)
>
E[Y]=0.3+1.2+1.5
>
E[Y]=3.0
Answer: 3.0" :::
---
Common Discrete Distributions
9. Bernoulli Distribution
A Bernoulli random variable models a single trial with two possible outcomes: success (1) or failure (0).
πBernoulli Distribution
A random variable X follows a Bernoulli distribution with parameter pβ[0,1], denoted XβΌBernoulli(p), if its PMF is:
pXβ(x)={p1βpβifΒ x=1ifΒ x=0β
Mean:E[X]=p Variance:Var(X)=p(1βp)
Worked Example:
A component has a probability of 0.9 of functioning correctly. Let X=1 if the component functions correctly and X=0 otherwise. Find the variance of X.
Step 1: Identify the distribution and its parameter.
> XβΌBernoulli(p) with p=0.9.
Step 2: Apply the variance formula for Bernoulli distribution.
>
Var(X)=p(1βp)
>
Var(X)=0.9(1β0.9)
>
Var(X)=0.9(0.1)
>
Var(X)=0.09
Answer:Var(X)=0.09.
:::question type="NAT" question="A single experiment has a 70% chance of success. Let X be a Bernoulli random variable representing the outcome (1 for success, 0 for failure). What is E[X]?" answer="0.7" hint="Recall the mean of a Bernoulli distribution." solution="Step 1: Identify the parameter p. > The probability of success is p=0.7. Step 2: Apply the formula for the expected value of a Bernoulli random variable. >
E[X]=p
>
E[X]=0.7
Answer: 0.7" :::
---
10. Binomial Distribution
The binomial distribution models the number of successes in a fixed number of independent Bernoulli trials.
πBinomial Distribution
A random variable X follows a Binomial distribution with parameters n (number of trials) and p (probability of success), denoted XβΌBinomial(n,p), if its PMF is:
A fair coin is flipped 5 times. Let X be the number of heads. Find the probability of getting exactly 3 heads.
Step 1: Identify the distribution and its parameters.
> This is a Binomial distribution with n=5 (number of flips) and p=0.5 (probability of heads for a fair coin). > So, XβΌBinomial(5,0.5). We want to find P(X=3).
Step 2: Apply the Binomial PMF formula.
>
P(X=3)=(35β)(0.5)3(1β0.5)5β3
>
P(X=3)=(35β)(0.5)3(0.5)2
>
P(X=3)=3!2!5!β(0.5)5
>
P(X=3)=2Γ15Γ4βΓ0.03125
>
P(X=3)=10Γ0.03125
>
P(X=3)=0.3125
Answer: The probability of exactly 3 heads is 0.3125.
:::question type="MCQ" question="An online server has a 0.8 probability of successfully processing a request. If 10 independent requests are made, what is the expected number of successful requests?" options=["2","4","8","10"] answer="8" hint="Identify the distribution and use its mean formula." solution="Step 1: Identify the distribution and parameters. > This scenario fits a Binomial distribution, where n=10 (number of trials/requests) and p=0.8 (probability of success). > So, XβΌBinomial(10,0.8). Step 2: Use the formula for the mean of a Binomial distribution. >
E[X]=np
>
E[X]=10Γ0.8
>
E[X]=8
Answer: 8" :::
---
11. Geometric Distribution
The geometric distribution models the number of Bernoulli trials required to get the first success.
πGeometric Distribution
A random variable X follows a Geometric distribution with parameter pβ(0,1] (probability of success), denoted XβΌGeometric(p), if its PMF is:
pXβ(x)=(1βp)xβ1pforΒ xβ{1,2,3,β¦}
Mean:E[X]=p1β Variance:Var(X)=p21βpβ
Worked Example:
A quality control process involves testing items until a defective one is found. The probability of an item being defective is 0.05. What is the probability that the first defective item is found on the 5th test?
Step 1: Identify the distribution and its parameter.
> This is a Geometric distribution, as we are looking for the number of trials until the first success (defective item). > The probability of success (finding a defective item) is p=0.05. > So, XβΌGeometric(0.05). We want to find P(X=5).
Step 2: Apply the Geometric PMF formula.
>
P(X=5)=(1βp)5β1p
>
P(X=5)=(1β0.05)4β 0.05
>
P(X=5)=(0.95)4β 0.05
>
P(X=5)β0.8145β 0.05
>
P(X=5)β0.0407
Answer: The probability is approximately 0.0407.
:::question type="MCQ" question="A biased coin with P(H)=0.2 is flipped repeatedly until the first head appears. Let X be the number of flips required. What is the expected number of flips?" options=["2","5","10","20"] answer="5" hint="Identify the distribution and use its mean formula." solution="Step 1: Identify the distribution and parameters. > This scenario fits a Geometric distribution, where p=0.2 (probability of success, i.e., getting a head). > So, XβΌGeometric(0.2). Step 2: Use the formula for the mean of a Geometric distribution. >
E[X]=p1β
>
E[X]=0.21β
>
E[X]=5
Answer: 5" :::
---
12. Poisson Distribution
The Poisson distribution models the number of events occurring in a fixed interval of time or space, given a known average rate of occurrence, and events are independent.
πPoisson Distribution
A random variable X follows a Poisson distribution with parameter Ξ»>0 (average rate of events), denoted XβΌPoisson(Ξ»), if its PMF is:
pXβ(x)=x!eβλλxβforΒ xβ{0,1,2,β¦}
Mean:E[X]=Ξ» Variance:Var(X)=Ξ»
Worked Example:
On average, 3 customers arrive at a service desk per hour. Assuming a Poisson process, what is the probability that exactly 2 customers arrive in the next hour?
Step 1: Identify the distribution and its parameter.
> This is a Poisson distribution, as we are counting events (customer arrivals) over a fixed interval (1 hour) with a known average rate. > The average rate Ξ»=3 customers per hour. > So, XβΌPoisson(3). We want to find P(X=2).
Step 2: Apply the Poisson PMF formula.
>
P(X=2)=2!eβ332β
>
P(X=2)=2β 1eβ3β 9β
>
P(X=2)=4.5eβ3
>
P(X=2)β4.5Γ0.0498
>
P(X=2)β0.2241
Answer: The probability is approximately 0.2241.
:::question type="NAT" question="A website receives an average of 5 new sign-ups per day. Assuming the number of sign-ups follows a Poisson distribution, what is the variance of the number of sign-ups per day?" answer="5" hint="Recall the variance of a Poisson distribution." solution="Step 1: Identify the parameter Ξ». > The average rate of sign-ups is Ξ»=5 per day. Step 2: Apply the formula for the variance of a Poisson random variable. >
Var(X)=Ξ»
>
Var(X)=5
Answer: 5" :::
---
Advanced Applications
Worked Example:
An experiment involves N independent trials. Each trial i has a success probability piβ. Let X be the total number of successes. Find E[X].
Step 1: Define indicator random variables for each trial.
> Let Xiβ be an indicator random variable for the i-th trial: >
Step 2: Express X as a sum of indicator variables.
> The total number of successes X is the sum of these indicator variables: >
X=X1β+X2β+β―+XNβ
Step 3: Use linearity of expectation.
>
E[X]=E[X1β+X2β+β―+XNβ]
>
E[X]=E[X1β]+E[X2β]+β―+E[XNβ]
>
E[X]=p1β+p2β+β―+pNβ
>
E[X]=i=1βNβpiβ
Answer:E[X]=βi=1Nβpiβ. This demonstrates the power of linearity of expectation, as the trials do not need to be identically distributed or even independent for this result.
:::question type="MSQ" question="Consider an urn with 5 balls: 3 red and 2 blue. We draw 2 balls without replacement. Let X be the number of red balls drawn. Which of the following statements are true?" options=["The range of X is {0,1,2}.","P(X=0)=0.1.","E[X]=1.2.","This is a Binomial distribution."] answer="The range of X is {0,1,2},P(X=0)=0.1,E[X]=1.2" hint="Calculate probabilities for each X value. Remember that drawing without replacement implies dependence, ruling out Binomial." solution="Step 1: Determine the range of X. > We draw 2 balls. > X=0: (0R, 2B) (03β)(22β)=1Γ1=1 way. > X=1: (1R, 1B) (13β)(12β)=3Γ2=6 ways. > X=2: (2R, 0B) (23β)(02β)=3Γ1=3 ways. > Total ways to draw 2 balls from 5: (25β)=10 ways. > The range of X is {0,1,2}. Thus, 'The range of X is {0,1,2}.' is TRUE.
Step 3: Calculate E[X]. > First, find the full PMF: > P(X=0)=0.1 > P(X=1)=106β=0.6 > P(X=2)=103β=0.3 >
E[X]=(0)(0.1)+(1)(0.6)+(2)(0.3)
>
E[X]=0+0.6+0.6=1.2
> Thus, 'E[X]=1.2.' is TRUE.
Step 4: Evaluate 'This is a Binomial distribution.' > A Binomial distribution assumes independent trials. Drawing without replacement means the probability of drawing a red ball changes after each draw, so the trials are dependent. Therefore, this is NOT a Binomial distribution (it's a Hypergeometric distribution). Thus, 'This is a Binomial distribution.' is FALSE.
Answer: The range of X is {0,1,2},P(X=0)=0.1,E[X]=1.2" :::
---
Problem-Solving Strategies
π‘Recognizing Distribution Types
Bernoulli: Single trial, two outcomes (success/failure).
Binomial: Fixed number of independent trials, counting successes. Key phrases: 'out of n trials', 'number of successes'.
Geometric: Number of trials until the first success. Key phrases: 'first success', 'until'.
Poisson: Counting events in a fixed interval (time/space) with a known average rate. Key phrases: 'average rate', 'number of events per unit'.
Hypergeometric (implied by 'without replacement'): Drawing from a finite population without replacement, counting items of a specific type. If trials are dependent, it's not Binomial.
π‘Using Linearity of Expectation
For E[X+Y]=E[X]+E[Y], X and Y do not need to be independent. This is powerful for complex problems where X can be decomposed into simpler parts (e.g., indicator variables).
---
Common Mistakes
β οΈConfusing PMF and CDF
β Students often mix up P(X=x) (PMF, probability at a single point) and P(Xβ€x) (CDF, cumulative probability up to a point). β Always check if the question asks for an exact probability or a cumulative probability. Remember FXβ(x) is a step function for discrete RVs.
β οΈIncorrectly Applying Variance Properties
β Assuming Var(X+Y)=Var(X)+Var(Y) for dependent variables or Var(aX+b)=aVar(X)+b. β Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y). If X,Y are independent, Cov(X,Y)=0. β Var(aX+b)=a2Var(X). The constant b does not affect variance.
---
Practice Questions
:::question type="NAT" question="A discrete random variable X has the following PMF: P(X=1)=0.4, P(X=2)=0.3, P(X=3)=0.2, P(X=4)=0.1. Calculate E[X]." answer="1.9" hint="Apply the definition of expected value: βxβ pXβ(x)." solution="Step 1: Use the formula for expected value. >
E[X]=(1)(0.4)+(2)(0.3)+(3)(0.2)+(4)(0.1)
>
E[X]=0.4+0.6+0.6+0.4
>
E[X]=1.9
Answer: 1.9" :::
:::question type="MCQ" question="Let X be a discrete random variable with PMF given by P(X=k)=cβ k for k=1,2,3, and P(X=k)=0 otherwise. What is the value of c?" options=["1/3","1/6","1/10","1/12"] answer="1/6" hint="The sum of all probabilities in a PMF must equal 1." solution="Step 1: Use the property that the sum of all probabilities must be 1. >
k=1β3βP(X=k)=1
>
P(X=1)+P(X=2)+P(X=3)=1
>
cβ 1+cβ 2+cβ 3=1
>
c(1+2+3)=1
>
6c=1
>
c=61β
Answer: 1/6" :::
:::question type="MSQ" question="Which of the following statements are true regarding the CDF FXβ(x) of a discrete random variable X?" options=["FXβ(x) is always continuous.","FXβ(x) is non-decreasing.","limxβββFXβ(x)=1.","P(X=x)=FXβ(x)βFXβ(xβ1) for integer x (assuming FXβ(xβ1) is defined as the limit from the left at xβ1)."] answer="FXβ(x) is non-decreasing,limxβββFXβ(x)=1,P(X=x)=FXβ(x)βFXβ(xβ1) for integer x (assuming FXβ(xβ1) is defined as the limit from the left at xβ1)." hint="Recall the definition and properties of a CDF for discrete random variables. Pay attention to continuity and how PMF relates to CDF." solution="Step 1: Evaluate ' FXβ(x) is always continuous.' > For discrete random variables, the CDF is a step function, which is discontinuous at the values X can take. Thus, this statement is FALSE.
Step 2: Evaluate ' FXβ(x) is non-decreasing.' > This is a fundamental property of any CDF, discrete or continuous. As x increases, the cumulative probability can only stay the same or increase. Thus, this statement is TRUE.
Step 3: Evaluate ' limxβββFXβ(x)=1.' > This is another fundamental property of any CDF. As x approaches infinity, it covers all possible outcomes, so the cumulative probability must approach 1. Thus, this statement is TRUE.
Step 4: Evaluate ' P(X=x)=FXβ(x)βFXβ(xβ1) for integer x (assuming FXβ(xβ1) is defined as the limit from the left at xβ1).' > For a discrete random variable taking integer values, FXβ(x)=P(Xβ€x) and FXβ(xβ1) (more precisely, limyβxββFXβ(y) for step functions) is P(Xβ€xβ1). > So, P(X=x)=P(Xβ€x)βP(Xβ€xβ1)=FXβ(x)βFXβ(xβ1). This correctly relates the PMF to the CDF for integer-valued discrete RVs. Thus, this statement is TRUE.
Answer:FXβ(x) is non-decreasing,limxβββFXβ(x)=1,P(X=x)=FXβ(x)βFXβ(xβ1) for integer x (assuming FXβ(xβ1) is defined as the limit from the left at xβ1)." :::
:::question type="NAT" question="A coin is flipped until a head appears. The probability of getting a head on any flip is p=0.4. What is the variance of the number of flips required?" answer="3.75" hint="Identify the distribution and use its variance formula." solution="Step 1: Identify the distribution and parameters. > This scenario describes a Geometric distribution, as we are counting the number of trials until the first success (head). > The probability of success is p=0.4. > So, XβΌGeometric(0.4). Step 2: Use the formula for the variance of a Geometric distribution. >
Var(X)=p21βpβ
>
Var(X)=(0.4)21β0.4β
>
Var(X)=0.160.6β
>
Var(X)=3.75
Answer: 3.75" :::
:::question type="MCQ" question="The number of errors in a software program follows a Poisson distribution with an average of 2 errors per 1000 lines of code. What is the probability of finding exactly 0 errors in a 1000-line segment?" options=["eβ2","2eβ2","eβ1","2eβ1"] answer="eβ2" hint="Identify the Poisson parameter Ξ» and apply the PMF for X=0." solution="Step 1: Identify the Poisson parameter Ξ». > The average number of errors is given as Ξ»=2 per 1000 lines. Step 2: Apply the Poisson PMF formula for X=0. >
Continuous Random Variables: Understanding how concepts like PMF and summation transform into PDF and integration for continuous outcomes.
Joint Distributions: Extending the concept of a single random variable to multiple random variables and their relationships.
Stochastic Processes: Building sequences of random variables over time, crucial for modeling dynamic systems in computer science.
Chapter Summary
βRandom Variables β Key Points
A Discrete Random Variable (DRV) is a variable whose possible values are countable and often integer-valued, arising from a random experiment. The Probability Mass Function (PMF), pXβ(x)=P(X=x), assigns probabilities to each possible value x of a DRV X, satisfying pXβ(x)β₯0 and βxβpXβ(x)=1. The Cumulative Distribution Function (CDF), FXβ(x)=P(Xβ€x)=βtβ€xβpXβ(t), describes the probability that X takes a value less than or equal to x. The Expected Value (Mean) of a DRV X is E[X]=βxβxβ pXβ(x), representing the long-run average value of the variable. For a function g(X), E[g(X)]=βxβg(x)β pXβ(x). The Variance of a DRV X is Var(X)=E[(XβE[X])2]=E[X2]β(E[X])2, measuring the spread or dispersion of the distribution around its mean. Key properties of expectation and variance include E[aX+b]=aE[X]+b and Var(aX+b)=a2Var(X) for constants a,b. * Common discrete distributions (e.g., Bernoulli, Binomial, Poisson, Geometric, Hypergeometric) model specific types of random phenomena, each with distinct PMFs, means, and variances.
Chapter Review Questions
:::question type="MCQ" question="Let X be a discrete random variable with the following probability mass function: pXβ(x)={c(x+1)0βforΒ x=0,1,2otherwiseβ What is the value of the constant c?" options=["1/6","1/3","1/9","1/4"] answer="1/6" hint="Recall that the sum of all probabilities in a PMF must equal 1." solution="The sum of probabilities must be 1: pXβ(0)+pXβ(1)+pXβ(2)=1 c(0+1)+c(1+1)+c(2+1)=1 c(1)+c(2)+c(3)=1 c(1+2+3)=1 6c=1βΉc=1/6 Thus, the value of c is 1/6." :::
:::question type="NAT" question="A fair six-sided die is rolled. Let X be the number rolled. Calculate E[X2]." answer="15.166666666666666" hint="First, determine the PMF of X. Then use the formula for the expectation of a function of a random variable, E[g(X)]=βxβg(x)pXβ(x)." solution="For a fair six-sided die, the possible values for X are {1,2,3,4,5,6}, and the PMF is pXβ(x)=1/6 for each of these values. We need to calculate E[X2]. E[X2]=βx=16βx2β pXβ(x) E[X2]=(12β 1/6)+(22β 1/6)+(32β 1/6)+(42β 1/6)+(52β 1/6)+(62β 1/6) E[X2]=(1/6)β (1+4+9+16+25+36) E[X2]=(1/6)β 91 E[X2]=91/6β15.166666666666666" :::
:::question type="MCQ" question="In a factory, light bulbs are produced, and the probability that a bulb is defective is 0.05. A quality control inspector randomly selects bulbs one by one until a defective bulb is found. What is the most appropriate distribution to model the number of bulbs inspected until the first defective one is found?" options=["Binomial Distribution","Poisson Distribution","Geometric Distribution","Bernoulli Distribution"] answer="Geometric Distribution" hint="Consider what each distribution models. Which one describes the number of trials until the first success in a sequence of independent Bernoulli trials?" solution="The scenario describes a sequence of independent Bernoulli trials (each bulb is either defective or not), where we are interested in the number of trials until the first 'success' (finding a defective bulb). This is the definition of a Geometric Distribution.
Bernoulli Distribution: Models a single trial with two outcomes (success/failure).
Binomial Distribution: Models the number of successes in a fixed number of trials.
Poisson Distribution: Models the number of events occurring in a fixed interval of time or space.
Geometric Distribution: Models the number of trials needed to get the first success."
:::
:::question type="NAT" question="Let X be a discrete random variable with E[X]=3 and Var(X)=2. Calculate Var(5β2X)." answer="8" hint="Recall the properties of variance for linear transformations: Var(aX+b)=a2Var(X)." solution="We are given E[X]=3 and Var(X)=2. We need to calculate Var(5β2X). Using the property Var(aX+b)=a2Var(X), where a=β2 and b=5: Var(5β2X)=(β2)2Var(X) Var(5β2X)=4β Var(X) Substitute the given value for Var(X): Var(5β2X)=4β 2 Var(5β2X)=8 The expected value E[X] is not needed for this calculation." :::
What's Next?
π‘Continue Your CMI Journey
Having established a solid foundation in discrete random variables, their properties, and common distributions, your next steps in probability theory involve extending these concepts. You will delve into Continuous Random Variables, exploring their probability density functions (PDFs) and cumulative distribution functions (CDFs), along with their unique characteristics. Subsequently, you will learn about Joint Distributions for multiple random variables (both discrete and continuous), which are crucial for understanding relationships and dependencies between variables, and explore Transformations of Random Variables to derive distributions of new variables based on existing ones. These topics are fundamental for advanced statistical inference and stochastic processes.
π― Key Points to Remember
βMaster the core concepts in Random Variables before moving to advanced topics
βPractice with previous year questions to understand exam patterns
βReview short notes regularly for quick revision before exams