Random Variable Illustration
Random Variable Illustration
Random Variable Illustration
Example 1
If two unbiased coins are tossed then find the random variable associated with that event.
Solution:
Suppose Two (unbiased) coins are tossed
X = number of heads. [X is a random variable or function]
Here, the sample space S = {HH, HT, TH, TT}
Example 2
Suppose a random variable X takes m different values i.e. sample space
X = {x1, x2, x3………xm} with probabilities
P(X = xi) = pi
where 1 ≤ i ≤ m
The probabilities must satisfy the following conditions :
0 ≤ pi ≤ 1; where 1 ≤ i ≤ m
p1 + p2 + p3 + ……. + pm = 1 Or we can say 0 ≤ pi ≤ 1 and ∑pi = 1
Hence possible values for random variable X are 0, 1, 2.
X = {0, 1, 2} where m = 3
P(X = 0) = (Probability that number of heads is 0) = P(TT) = 1/2×1/2 = 1/4
P(X = 1) = (Probability that number of heads is 1) = P(HT | TH) = 1/2×1/2 + 1/2×1/2 =
1/2
P(X = 2) = (Probability that number of heads is 2) = P(HH) = 1/2×1/2 = 1/4
Here, you can observe that, (0 ≤ p1, p2, p3 ≤ 1/2)
p1 + p2 + p3 = 1/4 + 2/4 + 1/4 = 1
For example,
Suppose a dice is thrown (X = outcome of the dice). Here, the sample space S = {1, 2, 3, 4,
5, 6}. The output of the function will be:
P(X=1) = 1/6
P(X=2) = 1/6
P(X=3) = 1/6
P(X=4) = 1/6
P(X=5) = 1/6
P(X=6) = 1/6
Random Variable Example with Solutions
Here are some of the solved examples on Random variable. Learn random variables by
practicing these solved examples.
1. Find the mean value for the continuous random variable, f(x) = x2, 1 ≤ x ≤ 3
Solution:
Given,
f(x) = x2
1≤x≤3
E(x) = ∫31 x.f(x)dx
E(x) = ∫31 x.x2.dx
E(x) = ∫31 x3.dx
E(x) = [x4/4]31
E(x) = 1/4{34– 14} = 1/4{81 – 1}
E(x) = 1/4{80} = 20
2. Find the mean value for the continuous random variable, f(x) = ex, 1 ≤ x ≤ 3
Solution:
Given,
f(x) = ex
1≤x≤3
E(x) = ∫31 x.f(x)dx
E(x) = ∫31 x.ex.dx
E(x) = [x.ex – ex]31
E(x) = [ex(x – 1)]31
E(x) = e3(2) – e(0)
3. Find the mean value for the continuous random variable, f(x) = x2, 1 ≤ x ≤ 3
Solution :
f(x) = x^2, 1 ≤ x ≤ 3
Mean = ∫(x^3)dx / ∫(x^2)dx from 1 to 3
= [(1/4)x^4] ₁ ³ / [(1/3)x^3] ₁ ³
= (81/4 – 1/4) / (27/3 – 1/3)
= 20 / 26/3
= 20 * 3/26 = 60/26 ≈ 2.31
4. Find the mean value for the continuous random variable, f(x) = 2x + 1, 0 ≤ x ≤ 4
Solution :
f(x) = 2x + 1, 0 ≤ x ≤ 4
Mean = ∫(x(2x+1))dx / ∫(2x+1)dx from 0 to 4
= [(2/3)x^3 + (1/2)x^2] ₀⁴ / [x^2 + x] ₀⁴
= (170/3) / 20
= 17/6 ≈ 2.83
5. Find the mean value for the continuous random variable, f(x) = x3, -1 ≤ x ≤ 2
Solution :
f(x) = x3, -1 ≤ x ≤ 2
Mean = ∫(x^4)dx / ∫(x^3)dx from -1 to 2
= [(1/5)x^5] ₋₁² / [(1/4)x^4] ₋₁ ²
= (32/5 + 1/5) / (16/4 + 1/4)
= 33/5 / 17/4
= 334 / (517) ≈ 1.55
6. Find the mean value for the continuous random variable, f(x) = √x, 1 ≤ x ≤ 9
Solution :
f(x) = √x, 1 ≤ x ≤ 9
Mean = ∫(x√x)dx / ∫(√x)dx from 1 to 9
= [(2/5)x^(5/2)] ₁⁹ / [(2/3)x^(3/2)] ₁⁹
= (486 – 2/5) / (18 – 2/3)
≈ 5.2
7. Find the mean value for the continuous random variable, f(x) = 3x2 – 2x, 0 ≤ x ≤ 3
Solution :
f(x) = 3x^2 – 2x, 0 ≤ x ≤ 3
Mean = ∫(x(3x^2-2x))dx / ∫(3x^2-2x)dx from 0 to 3
= [(3/4)x^4 – (2/3)x^3] ₀ ³ / [x^3 – x^2] ₀³
= (81/4 – 18) / (27 – 9)
= 27/4 / 18 = = 27/72 = 3/8 ≈ 0.375
8. Find the mean value for the continuous random variable, f(x) = sin(x), 0 ≤ x ≤ π
Solution :
f(x) = sin(x), 0 ≤ x ≤ π
Mean = ∫(x sin(x))dx / ∫(sin(x))dx from 0 to π
= [-x cos(x) + sin(x)] ₀ᵖ ⁱ / [-cos(x)] ₀ ᵖ ⁱ
= (π + 1) / 2
≈ 2.07
9. Find the mean value for the continuous random variable, f(x) = ex, 0 ≤ x ≤ 2
Solution :
f(x) = e^x, 0 ≤ x ≤ 2
Mean = ∫(x e^x)dx / ∫(e^x)dx from 0 to 2
= [x e^x – e^x] ₀ ² / [e^x] ₀ ²
= (2e^2 – e^2 + 1) / (e^2 – 1)
≈ 1.54
10. Find the mean value for the continuous random variable, f(x) = ln(x), 1 ≤ x ≤ e
Solution :
f(x) = ln(x), 1 ≤ x ≤ e
Mean = ∫(x ln(x))dx / ∫(ln(x))dx from 1 to e
= [(1/4)x^2(2ln(x)-1)] ₁ᵉ / [x ln(x) – x] ₁ᵉ
= (e^2/2 – 1/4) / (e – 1)
≈ 1.95
Practice Problems on Random Variable
1. A coin is flipped 5 times. Define the random variable as the number of heads. Find
the probability distribution.
2. A bag contains 6 red and 4 blue balls. A ball is drawn. Define the random variable
as the color of the ball. Find the probability distribution.
3. Roll two dice. Define the random variable as the sum of the outcomes. Find the
probability distribution.
4. A box contains 10 defective items out of 50. Define the random variable as the
number of defective items in a random sample of 5. Find the expected value.
5. Flip a coin until you get a head. Define the random variable as the numbe r of flips.
Find the probability distribution.
6. A dice is rolled twice. Define the random variable as the difference between the
numbers rolled. Find the expected value.
7. A survey finds the heights of 100 students. Define the random variable as the height
of a student. Find the variance.
8. Draw a card from a deck of 52 cards. Define the random variable as the card drawn
(numbe red). Find the expected value.
9. A spinner has numbers 1 through 8. Define the random variable as the number
spun. Find the probability of getting a number greater than 5.
10. A lottery has 100 tickets. Define the random variable as the winning ticket
number. Find the probability of drawing a specific number.