4-Random Variables - Introduction and Motivation-06-01-2025
4-Random Variables - Introduction and Motivation-06-01-2025
BMAT202L
Module: 2, Random Variable
January 6, 2025 1 / 26
Random variable
Random variable
A random variable (RV) is a function (X : S → R) that associates a real
number with each element in the sample space(S).
Example 1
For example, in a random experiment of tossing two coins, the sample
space be S = {HH, HT , TH, TT }. If is a RV denoting the “number of
heads”, then we have the followings.
X (HH) = 2, X (HT ) = 1, X (TH) = 1, and X (TT ) = 0.
Example 2
Two balls are drawn in succession without replacement from an urn
containing 4 red balls(R) and 3 black balls(B). The possible outcomes
S = {RR, RB, BR, BB}. Then we define a function X from S to real
number R, where X represent the number of red balls for every sample of S
January 6, 2025 2 / 26
Random variable
January 6, 2025 3 / 26
Random variable
January 6, 2025 4 / 26
Random variable
Thus the random variable X and the values of x with the probability
values of x is given below table.
X 0 1 2
1 1 1
P(x)=P(X=x) 4 2 4
The set of ordered pairs (x, P(x)) is called the probability mass function,
probability function, or probability distribution of the discrete random
variable X .
January 6, 2025 5 / 26
Random variable
January 6, 2025 6 / 26
Random variable
Problem 3
A shipment of 20 similar laptop computers to a retail outlet contains 3
that are defective. If a school makes a random purchase of 2 of these
computers, find the probability distribution for the number of defectives.
3C0 × 17C2 68
P(X = 0) = =
20C2 95
3C1 × 17C1 51
P(X = 1) = =
20C2 190
3C2 × 17C0 3
P(X = 2) = =
20C2 190
January 6, 2025 7 / 26
Random variable
X 0 1 2
68 51 3
P(x)=P(X=x) 95 190 190
January 6, 2025 8 / 26
Random variable
January 6, 2025 9 / 26
Random variable
January 6, 2025 10 / 26
Random variable
January 6, 2025 11 / 26
Random variable
January 6, 2025 12 / 26
Random variable
January 6, 2025 13 / 26
Random variable
The function f (x) is a probability density function (pdf) for the continuous
random variable X , defined over the set of real numbers, if
Z ∞
f (x) ≥ 0, for all x ∈ R, and f (x)dx = 1.
−∞
Problem 4
Suppose that the error in the reaction temperature, in C, for a controlled
laboratory experiment is a continuous random variable X having the
probability function
x 2 , −1 < x < 2
f (x) = 3
0, otherwise.
Verify that f (x) is a density function and find P(0 < X ≤ 1).
January 6, 2025 14 / 26
Random variable
Solution
R∞
Clearly f (x) ≥ 0. To verify −∞ f (x)dx = 1,
Z ∞ Z −1 Z 2 Z ∞
f (x)dx = f (x)dx + f (x)dx + f (x)dx
−∞ −∞ −1 2
Z 2
= 0+ f (x)dx + 0
−1
3 2
x
=
9 −1
8 (−1)
= −
9 9
8 1
= + = 1.
9 9
January 6, 2025 15 / 26
Random variable
Next,
Z 1
P(0 < X ≤ 1) = f (x)dx
0
Z 1
= f (x)dx
0
1
x3
=
9 0
1
= .
9
January 6, 2025 16 / 26
Random variable
January 6, 2025 17 / 26
Random variable
Problem 5
January 6, 2025 18 / 26
Random variable
Solution
P
For (1), since P(x) is p.m.f, and x P(x) = 1, it follows that
X
P(x) = 1
x
0.1 + k + 0.2 + 2k + 0.3 + k = 1
0.6 + 4k = 1
4k = 0.4
k = 0.1.
January 6, 2025 19 / 26
Random variable
Solution Cont...
January 6, 2025 20 / 26
Random variable
Solution Cont...
January 6, 2025 21 / 26
Random variable
Solution Cont...
January 6, 2025 22 / 26
Random variable
Problem 6
January 6, 2025 23 / 26
Random variable
Problem 7
January 6, 2025 24 / 26
Random variable
Solution:
R 0.4 0.4
For (1), P(X ≤ 0.4) = 0 f (x)dx = x 2 0 = 0.16.
January 6, 2025 25 / 26
Random variable
Problem 8
January 6, 2025 26 / 26