Module 4
Module 4
Random Experiment
Examples:
(i) Tossing a coin, (ii) Throwing a dice, (iii) Drawing a card from pack of cards.
Sample space
Event
The null set is also an event. The sample space S is called sure event.
108 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
Examples:
Probability of an event
Axioms of Probability
Conditional Probability
Let A and B be any two events associated with the same sample space of
the random experiment then the conditional probability of an event A given that
B has occurred is denoted by P (A|B) and is given by
P A B
P A | B , provided P B 0 .
P B
P A B
P B | A , provided P A 0 .
P A
P A B P A B
P A | B and P B | A
P B P A
P A B P A | B P B and P A B P B | A P A
Independent Events
Let A and B be two events such that the probability of occurrence of one
of them is not affected by occurrence of the other. Such events are called
independent events. i.e., Two events A and B are said to be independent, if
Thus, using (2), the independence of two events is also defined as follows:
Let A and B be two events associated with the same random experiment,
then A and B are said to be independent if
P (A ∩ B) = P (A). P (B)
Note: Two events A and B are said to be dependent if they are not independent,
i.e. if P (A ∩ B) ≠ P (A). P (B)
P A| E PE
n
P(A) = P(E1) P(A|E1) + P(E2) P(A|E2) + ... + P(En) P(A|En) = j j
j 1
Mathematical Foundation for Computer Applications 111
--------------------------------------------------------------------------------------------------------------------------------
Bayes’ Theorem
P A | Ei P Ei
P Ei | A for any i 1, 2,3,..., n
P A| E PE
n
j j
j 1
The set of all real numbers of a random variable X is called the range of X.
For example, let us consider the experiment of tossing a coin two times in
succession. The sample space of the experiment is S = {HH, HT, TH, TT}.
If X denotes the number of heads obtained, then X is a random variable and for
each outcome, its value is as given below:
On the same sample space S, we can define more than one random variables.
For example, let Y denote the number of heads minus the number of tails for
each outcome of the above sample space S.
Thus, X and Y are two different random variables defined on the same sample
space S.
112 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
WORKED EXAMPLES
Example 4.2.1: A bag contains 2 white and 1 red balls. One ball is drawn at
random and then put back in the box after noting its color. The process is
repeated again. If X denotes the number of red balls recorded in the two
draws, describe X.
Solution:
Then the sample space is S = {w1 w1, w1 w2, w2 w2, w2 w1, w1 r, w2 r, r w1, r w2, r
r}
X ({w1 r}) = X ({w2 r}) = X ({r w1}) = X ({r w2}) = 1 and X ({r r}) = 2
Example 4.2.2: A person plays a game of tossing a coin thrice. For each
head, he is given Rs 2 by the organizer of the game and for each tail; he
has to give Rs 1.50 to the organizer. Let X denote the amount gained or
lost by the person. Show that X is a random variable and exhibit it as a
function on the sample space of the experiment.
Solution:
Now, sample space is S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}
Then, X (HHH) = Rs (2 × 3) = Rs 6,
where, minus sign shows the loss to the player. Thus, for each element of the
sample space, X takes a unique value, hence, X is a function on the sample
space whose range is {– 1, 2.50, – 4.50, 6}.
Mathematical Foundation for Computer Applications 113
--------------------------------------------------------------------------------------------------------------------------------
4.2.1 Discrete and Continuous Random variables
A description giving the values of the random variable X along with the
corresponding probabilities is called the probability distribution of the random
variable X.
X x1 x2 x3 … xn
P (X) p1 p2 p3 … pn
The function P (X) is called the probability density function (p.d.f) or the
probability mass function (p.m.f). The distribution function F(x) of the discrete
114 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
x
random variable X is defined by F x P X x p
i 1
i , where x is any integer.
values of X, each value being weighted by its probability with which it occurs.
The mean of a random variable X is also called the expectation of X, denoted by
E(X).
n
Thus, EX x pi 1
i i x1 p1 x2 p2 ... xn pn
n
V X x pi 2 E X 2 E X
2 2
i
i 1
WORKED EXAMPLES
X 0 1 2 3 4 5 6 7
P (X) 0 k 2k 2k 3k k2 2k2 7k2 + k
(i) Find k
(ii) Evaluate P (X < 6), P (X 6), P (3 < X 6)
1
(iii) Find the minimum value of x so that P X x .
2
p1 p2 ... p8 1
0 k 2k 2k 3k k 2 2k 2 7k 2 k 1
10k 2 9k 1 0
10k 1 k 1 0
1
k pi 0
10
(ii) P X 6 1 P X 6
1 P X 6 P X 7
1 2k 2 7 k 2 k
1 9k 2 k
9 1 81
1
100 10 100
P X 6 P X 6 P X 7
2k 2 7 k 2 k
9k 2 k
9 1 19
100 10 100
P (3 < X 6) P X 4 P X 5 P X 6
3k k 2 2k 2
3k 3k 2
3 3 33
10 100 100
(iii) P X 1 P X 0 P X 1
1 1
0k k
10 2
P X 2 P X 0 P X 1 P X 2
3 1
0 k 2k 3k
10 2
116 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
P X 3 P X 0 P X 1 P X 2 P X 3
5 1
0 k 2k 2k 5k
10 2
P X 4 P X 0 P X 1 P X 2 P X 3 P X 4
8 1
0 k 2k 2k 3k 8k
10 2
1
The minimum value of x so that P X x is 4.
2
X 0 1 2 3 4 5 6
P (X) k 3k 5k 7k 9k 11k 13k
(i) Find k
(ii) Evaluate P (X < 4), P (X 5), P (3 < X 6)
(iii) Find the minimum value of k so that P X 2 0.3
n
(i) We have, p
i 1
i 1
p1 p2 ... p8 1
k 3k 5k 7k 9k 11k 13k 1
49k 1
1
k
49
(ii) P X 4 1 P X 4
1 P X 4 P X 5 P X 6
1 9k 11k 13k
1 33k
33 16
1
49 49
P X 5 P X 5 P X 6
Mathematical Foundation for Computer Applications 117
--------------------------------------------------------------------------------------------------------------------------------
24
11k 13k 24k
49
P(3 X 6) P X 4 P X 5 P X 6
33
9k 11k 13k 33k
49
(iii) P X 2 P X 0 P X 1 P X 2
k 3k 5k 9k 0.3
0.3 1
k
9 30
1
The minimum value of k is .
30
X 3 2 1 0 1 2 3
P (X) k 2k 3k 4k 3k 2k k
(i) Find k
(ii) Evaluate P (X 1), P (X > 1), P (1 < X 2)
(iii) Find its mean and standard deviation.
n
(i) We have, p
i 1
i 1
p1 p2 ... p8 1
k 2k 3k 4k 3k 2k k 1
16k 1
1
k
16
(ii) P X 1 1 P X 1
1 P X 2 P X 3
1 2k k
1 3k
118 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
3 13
1
16 16
P X 1 P X 2 P X 3
3
2k k 3k
16
P (1 < X 2) P X 0 P X 1 P X 2
9
4k 3k 2k 9k
16
(iii) Mean x p i i
Variance V x i
2
pi 2
40 5
9k 8k 3k 3k 8k 9k 40k
16 2
5
Standard deviation V 1.581
2
X 2 1 0 1 2 3
P (X) 0.1 k 0.2 2k 0.3 k
(i) Find k
(ii) Evaluate P (X < 1), P (X > 1)
(iii) Find its mean and standard deviation.
n
(i) We have, p
i 1
i 1
p1 p2 ... p8 1
k 0.1
(ii) P X 1 1 P X 1
1 P X 1 P X 2 P X 3
1 2k 0.3 k
0.7 3k
0.7 3 0.1 0.4
P X 1 1 P X 1
1 P X 2 P X 1
1 0.1 k
(iii) Mean x p i i
Variance V x i
2
pi 2
Example 4.2.7 Let a pair of dice be thrown and the random variable X be
the sum of the numbers that appear on the two dice. Find the probability
distribution of X. Also find mean or expectation of X.
Solution:
P (X = 6) = P ({(1, 5), (2, 4), (3, 3), (4, 2), (5, 1)}) = 5/36
P (X = 7) = P ({(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)}) = 6/36
P (X = 8) = P ({(2, 6), (3, 5), (4, 4), (5, 3), (6, 2)}) = 5/36
X 2 3 4 5 6 7 8 9 10 11 12
P
1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36
(X)
x p 2 36 3 36 4 36 5 36 6 36 7 36
1 2 3 4 5 6
Mean i i
5 4 3 2 1
8 9 10 11 12
36 36 36 36 36
2 6 12 20 30 42 40 36 30 22 12
7
36
2 2 2 8
P X 0 P no success P all failures
3 3 3 27
1 2 2 12
P X 1 P one success and two failures 3C1
3 3 3 27
1 1 2 6
P X 2 P two successes and one failure 3C2
3 3 3 27
1 1 1 1
P X 2 P three successes 3C3
3 3 3 27
X 0 1 2 3
x p 0 1 27 2 27 3 27
12 6 1
Mean i i
12 12 3
1
27 27 27
1
x
2 12 6
Variance V i pi 2 0 12 22 32 12
27 27 27
12 24 9 5 2
1 1
27 27 27 3 3
EXERCISE 4.1
X 0 1 2 3 4 5
P (X) k 5k 10k 10k 5k k
(i) Find k
(ii) Find mean and standard and deviation
122 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
2. Find the standard deviation for the following probability
distribution:
X 8 12 16 20 24
P (X) 1/8 1/6 3/8 1/4 1/12
3. Obtain the distribution function of the total number of heads
occurring in three tosses of an unbiased coin.
4. Four coins are tossed. What is the expectation of the number of
heads?
5. From an urn containing 3 red and 2 white balls, a man is to
draw 2 balls at random without replacement, being promised
Rs.20 for each red ball he draws and Rs.10 for each white one.
Find his expectation.
ANSWERS
1
1. k , 2.5, 2.74 2. 25
32
3. X 0 1 2 3
P (X) 1/8 3/8 3/8 1/8
4. 2
(i) f x 0 and
(ii) f x dx 1
Mean x f x dx
x f x dx or V x f x dx
2
Variance V 2 2
Standard deviation V
WORKED EXAMPLES
kx 2 , 3 x 3
f x
0, otherwise
f x is (p.d.f) if
(i) f x 0 and (ii) f x dx 1
From (i), k 0
From (ii), f x dx 1
124 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
3
kx dx 1
2
3
3
x3
k 1
3 3
3 3 3 3
k 1
3
k 9 9 1
1
k
18
x
We have, P X x f x dx
2
P X 2 f x dx
2
1 x3
2
1 2
3
18
x dx
18 3 3
1 2 3 35
3 3
18 3 54
We have, P X x f x dx
x
P X 1 f x dx
1
3
1 x3
3
1 2
1
18
x dx
18 3 1
1 3 1 13
3 3
18 3 27
Mathematical Foundation for Computer Applications 125
--------------------------------------------------------------------------------------------------------------------------------
Example 4.2.10: Find the constant C such that
Cx , 0 x 3
2
f x
0, otherwise
f x is (p.d.f) if
(i) f x 0 and (ii) f x dx 1
From (i), k 0
From (ii), f x dx 1
3
Cx dx 1
2
3
x3
C 1
3 0
3 3 0
C 1
3
C 9 1
1
C
9
b
We have, P a x b f x dx
a
2
P 1 x 2 f x dx
1
2
1 x3
2
1 2
1
9
x dx
9 3 1
1 2 1 7
3 3
9 3 27
126 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
Example 4.2.11: The function f x is defined as
e x , x0
f x .
0, x0
Solution:
0
f x dx 0 dx e
x
(ii) dx
0
0 e x dx
0
e x
e e 0 1 1
0
1 0
b
We have, P a x b f x dx
a
2
P 1 x 2 f x dx
1
2
2
e x
x
e dx
1 1 1
e 2 e 1 0.233
x
Also we have, F x P X x f x dx
Mathematical Foundation for Computer Applications 127
--------------------------------------------------------------------------------------------------------------------------------
2
F 2 P X 2 f x dx
0 2
0 dx e x dx
0
0 e x dx
0
2
e x
e e 0.865
2
0
1 0
kx , 0 x 2
f x 2k , 2 x4
kx 6k , 4 x 6
Solution:
f x is (p.d.f) if
(i) f x 0 and (ii) f x dx 1
From (i), k 0
From (ii), f x dx 1
2 4 6
kx dx 2k dx kx 6k dx 1
0 2 4
2 6
x2 x2
k 2k x 2 k 6k x 4 1
4 6
2 0 2 4
8k 1
128 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
1
k
8
6
We have, Mean x f x dx
0
2 4 6
kx dx 2kx dx x kx 6k dx
2
0 2 4
2 4 6 6
x3 x2 x3 x2
k 2k k 6k
3 0 2 2 3 4 2 4
8 152
k k 12 k 3k 20
3 3
1
24k 24 3
8
k x 1 , 1 x 1
f x
0, otherwise
Solution:
f x is (p.d.f) if
(i) f x 0 and (ii) f x dx 1
From (i), k 0
From (ii), f x dx 1
1
k x 1 dx 1
1
1
x2
k x 1
2 1
Mathematical Foundation for Computer Applications 129
--------------------------------------------------------------------------------------------------------------------------------
12 12
k 1 1 1
2 2
2k 1
1
k
2
1
We have, Mean x f x dx
1
1
1
x x 1 dx
1
2
1
1 x3 x 2
1
1
x 2 x dx
2 1 2 3 2 1
1 1 1 1 1 1
2 3 2 3 2 3
x f x dx
2
We have, Variance V
1
1 2
1 1
x x 1 dx
1
3 2
1
1 2 2x 1
x x 1 dx
2 1 3 9
1 3 x2 5x 1
1
x
2 1 3
dx
9 9
1
1 x 4 x3 5 x 2 1
x
2 4 9 18 9 1
1 1 1 5 1 1 1 5 1 2
2 4 9 18 9 4 9 18 9 9
130 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
EXERCISE 4.2
x 1
, 2 x4
1. If a function f (x) defined by f x 8
0,
otherwise
(i) Prove that f (x) is a p.d.f
(ii) Find P (X < 3.5) and P (X 3.5)
x
k, 0 x 3
2. Find the value of k such that f x 6
0, otherwise
is a p.d.f. Also find P (1 X 2).
k x e , 0 x 1
x
3. Find the value of k such that f x
0, otherwise
is a p.d.f. Also find its mean.
k e 3 x , x0
4. Find the value of k such that f x
0, otherwise
is a p.d.f. Also find P (0.5 X 1) and P (2 X 1.5)
5. A function is defined as follows:
0, x2
1
f x 2 x 3 , 2 x 4
18
0, x4
Show that it is a density function. Find the probability that a variate
having this density will fall in the interval [2, 3].
6. If the function f x represents the density of a random variable X,
1
x 1 , 1 x 1
given by f x 2
0, otherwise
Find E (X) and V (X).
ANSWERS
1
1. (ii) 0.7031 and 0.2969 2. k , 1/3
12
e 2e 5
3. k , 4. k=3
e2 e2
5. 4/9 6. 1/3 and 2/9
Mathematical Foundation for Computer Applications 131
--------------------------------------------------------------------------------------------------------------------------------
4.3 Binomial Distribution
X 0 1 2 … r ... n
P (X) n
C0 q n C1 q n1 p
n n
C2 q n2 p 2 … n
Cr qnr pr n
Cn p n
Solution:
4 1
Let p = Probability of corrupted files =
20 5
1 4
Hence, q 1 p 1
5 5
We have, P r nC r q n r p r
12 r r
4 1
P r 12Cr 5
5
P r 10 P r 11 P r 12
1
10
4
2
4 1 1
2
66 12 1
5 5 5 5 5
= 0.000004526
12 3 3
4 1
C3
12
5 0.001074
5
Mathematical Foundation for Computer Applications 133
--------------------------------------------------------------------------------------------------------------------------------
(iii) P (all files are corrupted) P r 12
12 12 12 12
4 1 1
12C12 5 5
5
(iv) P (all files are safe) = 1 P (all files are corrupted)
12
1
1
5
(v) P (more than 2 files but not more than 5 are corrupted)
P 2 r 5
P r 3 P r 4 P r 5
12 3 3 12 4 4 12 5 5
4 1 12 4 1 12 4 1
12C3 5 C4 5 5 C5 5 5
5
= 0.42225
Solution:
20 1
Let p = Probability of defective =
100 5
1 4
Hence, q 1 p 1
5 5
We have, P r nC r q n r p r
10 r r
4 1
P r Cr
10
5
5
1 P r 1
1 P r 0
10 0 0 10
4 1 4
1 C0 5 1 1 5 1
10
5
10
4
1
5
P r 0 P r 1 P r 2 P r 3
10 0 0 10 1 1 10 2 2 10 3 3
4 1 10 4 1 10 4 1 10 4 1
C0
10
5 C1 5 5 C2 5 5 C3 5 5
5
10 9 8 2 7 3
4
1 10
4 1 4 1 4 1
1 45 120
5 5 5 5 5 5 5
4
7
4 3 2
4 4 9 1
3
2 120
5 5 5 5 5 5
7 7
4 64 32 36 120 4 524
5 125 25 25 125 5 125
P r 0 P r 1 P r 2
10C0 0.8 0.2 0 10C1 0.8 101 0.2 1 10C2 0.8 10 2 0.2 2
10 0
1
10C10 0.8 0.2 10 11 0.2 10
10 10
510
1
Let p = Probability of defective =
10
1 9
Hence, q 1 p 1
10 10
We have, P r nC r q n r p r
12 r r
9 1
P r 12Cr 10
10
136 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
(i) P (exactly two will be defective) P r 2
12 2 2
9 1
12C2 10
10
10 2
9 1
66
10 10
9
12 0
1 12 9 1
0 12 1 1
1 12C0 10 C1
10 10 10
9 12 9 1
11
1 1 1 12
10 10 10
11
9 21
1 0.3412
10 10
Example 4.3.5: Six dice are thrown 729 times. How many times do you
expect at least three dice to show five or six?
Solution:
2 1
Let p = Probability of showing 5 or 6 =
6 3
1 2
Hence, q 1 p 1
3 3
Mathematical Foundation for Computer Applications 137
--------------------------------------------------------------------------------------------------------------------------------
We have, P r nC r q n r p r
6 r r
2 1
P r 6Cr 3
3
1 P r 3
1 P r 0 P r 1 P r 2
60
2 1
0 6 1
2 1
1
2 1
62 2
1 6C0 6C1 6C2
3 3 3 3 3 3
2 6 5
2 1 2 1
4 2
1 1 1 6 15
3 3 3 3 3
4
2 4 4 15
1
3 9 3 9
16 31 496
1 1
81 9 729
0.3196 per dice
For 729 dice, P (at least 3 success) P r 3 729 0.3196 729 233
Example 4.3.6: Out of 800 families with 5 children each, how many would
you expect to have (i) 3 boys, (ii) 5 girls, (iii) either 2 or 3 boys? (Assume
equal probabilities for boys and girls)
Here n = 5 children
1
Let p = Probability =
2
1 1
Hence, q 1 p 1
2 2
We have, P r nC r q n r p r
5 r r
1 1
P r 5Cr 2
2
138 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
5
1
P r Cr
5
2
(i) P (3 boys) P r 3
5
1 5
5C3
2 16
5
800 250
16
1
800 25
32
1
25
C
5
2 5C3 5
8
Example 4.3.7: The probability that a man aged 60 will live upto 70 is
0.65. Out of 10 men, now at the age of 60, find the probability that (i) at
least 7 will live upto 70, (ii) exactly 9 will live upto 70, (iii) at most 9 will
live upto 70.
Here n = 10 men
P r 7 P r 8 P r 9 P r 10
= 0.5138
1 P r 9
1 P r 10
Here n = 5 students
We have, P r nC r q n r p r
1 P r 1
1 P r 0
1 0.0778 0.9222
1
Let p = Probability of head =
2
1 1
Hence, q 1 p 1
2 2
We have, P r nC r q n r p r
4 r r
1 1
P r 4Cr 2
2
4
1
P r 4Cr
2
1 P r 2
1 P r 0 P r 1
4 1 4 4 1 4 11
1 C0 C1
2 2 16
Example 4.3.10: Eight fair coins are thrown simultaneously. Find the
probability of getting (i) six heads, (ii) not more than 6 heads.
1
Let p = Probability of head =
2
1 1
Hence, q 1 p 1
2 2
We have, P r nC r q n r p r
8 r r
1 1
P r Cr
8
2
2
8
1
P r 8Cr
2
(i) P (6 heads) P r 6
8
1
8C6 0.1094
2
1 P r 6
1 P r 7 P r 8
142 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
1
8 8
1
1 8C7 8C8
2 2
= 0.9648
Example 4.3.11: In 256 sets of 12 tosses of a coin, in how many cases one
can expect 8 heads and 4 tails.
1
Let p = Probability of head =
2
1 1
Hence, q 1 p 1
2 2
We have, P r nC r q n r p r
12 r r
1 1
P r 12Cr 2
2
12
1
P r 12Cr
2
P (8 heads) P r 8
12
1
C8 0.1208
12
2
For 256 sets, P(8 heads and 4 tails) 256 0.1208 30.94
Solution:
Here n = 20
Given, Mean = 2
We have, Mean np
Mathematical Foundation for Computer Applications 143
--------------------------------------------------------------------------------------------------------------------------------
2
p 0.1
n 20
We have, P r nC r q n r p r
P r Cr 0.9 0.1r
20 r
20
1 P r 3
1 P r 0 P r 1 P r 2
1 20
C0 0.9
20 0
0.10 20C1 0.9 201 0.11 20C2 0.9 20 2 0.12
= 0.323
x 0 1 2 3 4 5
f 2 14 20 34 22 8
f i 2 14 20 34 22 8 100
x f i i 0 14 40 102 88 40 284
Mean
x f i i
284
2.84
f i 100
We have, Mean np
2.84
p 0.568
n 5
Now, F xi f P x
i i
x 0 1 2 3 4 5
f 1.505 9.89 26.01 34.199 22.483 5.912
EXERCISE 4.3
f 13 25 52 58 32 16 4
ANSWERS
1 1 15
1. n 4, p , q ; 2. 0.3456
2 2 16
3. 3/16 4. (i) 0.246, (ii) 0.345
5. (i) 0.5905, (ii) 0.3281, (iii)
6. 99.83
0.0815
19
19 1
7. 0.3585, 0.3773, 0.1887, 0.0596 8. (i) 20
C1
20 20
20 r r
19 1
5
(ii) r 0
20
Cr
20
20
9. 45927/50000 10. 600
r e
Pr , r 0, 1, 2, ...
r!
Standard deviation V
WORKED EXAMPLES
Here n = 2000
We have, np
2000 0.001 2
r e
We have, Pr , r 0, 1, 2, ...
r!
2r e2
Pr , r 0, 1, 2, ...
r!
1 P r 2
1 P r 0 P r 1 P r 2
2 e 21 e2 22 e2
0 2
1 0.32
0! 1! 2!
Mathematical Foundation for Computer Applications 147
--------------------------------------------------------------------------------------------------------------------------------
Example 4.4.2: Assume that the probability of an individual coalminer
1
being killed in a mine accident during a year is . Use Poisson
2400
distribution to calculate the probability that in a mine employing 200
miners there will be at least one fatal accident in a year.
Solution:
Here n = 200
1
Let p = Probability of killed =
2400
We have, np
1 1
200 0.0833
2400 12
r e
We have, Pr , r 0, 1, 2, ...
r!
Pr
0.0833r e0.0833 , r 0, 1, 2, ...
r!
1 P r 1
1 P r 0
1
0.08330 e0.0833 0.08
0!
Here n = 10
r e
We have, Pr , r 0, 1, 2, ...
r!
Pr
0.02 r e0.02 , r 0, 1, 2, ...
r!
0.02 0 e0.02
0.9802
0!
0.02 1 e0.02
0.0196
1!
0.02 2 e0.02
0.000196
2!
Here n = 200
We have, np
Mathematical Foundation for Computer Applications 149
--------------------------------------------------------------------------------------------------------------------------------
200 0.02 4
r e
We have, Pr , r 0, 1, 2, ...
r!
4 r e4
Pr , r 0, 1, 2, ...
r!
4 e 4
0
0.01832
0!
1 P r 3
1 P r 0 P r 1 P r 2
4 e 41 e 4 42 e 4
0 4
1 0.762
0! 1! 2!
1 P r 1
1 P r 0
40 e4
1 0.982
0!
Here n = 500
2
Let p = Probability of defective = 0.02
100
We have, np
150 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
500 0.02 10
r e
We have, Pr , r 0, 1, 2, ...
r!
10 r e10
Pr , r 0, 1, 2, ...
r!
(i) P (3 defectives) P r 3
10 e 10
3
0.00757
3!
1 P r 1
1 P r 0
100 e10
1 0.9999546 1
0!
P r 3
10 3 e10 0.00757
3!
Example 4.4.6: A car hire firm has 2 cars, which it hires out day by day.
The demand for a car on each day is distributed as a Poisson distribution
with mean 1.5. Calculate the probability that on a certain day (i) neither
car is used, (ii) some demand is refused.
Solution:
i.e., 1.5
r e
We have, Pr , r 0, 1, 2, ...
r!
Pr
1.5 e 1.5
r
, r 0, 1, 2, ...
r!
(i) P (neither car is used) P r 0
Mathematical Foundation for Computer Applications 151
--------------------------------------------------------------------------------------------------------------------------------
1.5 e 1.5
0
0.2231
0!
1 P r 2
1 P r 0 P r 1 P r 2
x 0 1 2 3 4
f 46 38 22 9 1
f i 46 38 22 9 1 116
x f i i 0 38 44 27 4 113
Mean
x f i i
113
0.9741
f i 116
We have, Mean
0.9741
r e
We have, Pr , r 0, 1, 2, ...
r!
Pr
0.9741 e 0.9741
r
, r 0, 1, 2, ...
r!
Now, F xi f P x
i i
152 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
0.97410 e0.9741
F 0 116 P 0 116 43.8
0!
0.97411 e0.9741
F 1 116 P 1 116 42.66
1!
0.97412 e 0.9741
F 2 116 P 2 116 20.78
2!
0.97413 e0.9741
F 3 116 P 3 116 6.75
3!
0.97414 e0.9741
F 4 116 P 4 116 1.64
4!
x 0 1 2 3 4
f 43.8 42.66 20.78 6.75 1.64
x 0 1 2 3 4
f 122 60 15 2 1
f i 122 60 15 2 1 200
x f i i 0 60 30 6 4 100
Mean
x f i i
100
0.5
f i 200
We have, Mean
0.5
Mathematical Foundation for Computer Applications 153
--------------------------------------------------------------------------------------------------------------------------------
r e
We have, Pr , r 0, 1, 2, ...
r!
0.5r e0.5
Pr , r 0, 1, 2, ...
r!
Now, F xi f P x
i i
0.50 e0.5
F 0 200 P 0 200 121.31
0!
0.5 1 e0.5
F 1 200 P 1 200 60.65
1!
0.5 2 e0.5
F 2 200 P 2 200 15.16
2!
0.5 3 e0.5
F 3 200 P 3 200 2.53
3!
0.5 4 e0.5
F 4 200 P 4 200 0.32
4!
x 0 1 2 3 4
f 121 61 15 2 0
EXERCISE 4.4
x 0 1 2 3 4
f 180 92 24 3 1
ANSWERS
2
1. (i) 2, (ii) 2. 0.0008
3e 2
3. P 0 0.2636, P 3 0.1041, P 3 0.1506 4. 0.865
5. 0.08 6. 0.6
7. (i) 0.0232, (ii) 0.8097, (iii) 0.1284 8. (i) 0.2584, (ii) 0.6866
9. 432 boxes
Mathematical Foundation for Computer Applications 155
--------------------------------------------------------------------------------------------------------------------------------
4.5 Exponential Distribution
e x , 0 x
f x
0, otherwise
It is easily verify that (i) f x 0 and (ii) f x dx 1
WORKED EXAMPLES
Solution:
e x , 0 x
The p.d.f of the exponential distribution is f x
0, otherwise
156 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
Given, Mean = 5
1
i.e., Mean 5
1
5
1 1
(i) P 0 x 1 f x dx e
x
dx
0 0
1
1 x
1 e 5
1 1
1 5 x
0
5
e dx
5 1
5 0
2
(ii) P x 2 1 P x 2 1 f x dx
0
2
1 e x dx
0
2
1 x
1 e 5
2 1
1 5 x
1
0
5 e dx 1
5 1
5 0
(iii) P x 10 P x 0 P 0 x 10
10 10
0 f x dx f x dx
0 0
10 10 1
1 x
0
e x dx e 5 dx
0
5
10
1 x
1 e 5
e e 0.8647
2
0
1
5
5 0
(iv) P x 0 or x 1 f x dx
1
1
1 x
1 1
5
e x dx e 5 dx
Mathematical Foundation for Computer Applications 157
--------------------------------------------------------------------------------------------------------------------------------
1 x
1 e 5
1
e e 5
5 1
5 1
0 e 0.2 0.8187
e x , 0 x
The p.d.f of the exponential distribution is f x
0, otherwise
Given, Mean = 5
1
i.e., Mean 5
1
5
(i) P (less than 10 minutes) P x 10
P x 10
P x 0 P 0 x 10
10 10
0 f x dx f x dx
0 0
10 10 1
1 x
0
0
5
e x dx e 5 dx
10
1 x
1 e 5
e e 0.8647
2
0
5 1
5 0
1 P x 10
1 0.8647 0.1353
158 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
Example 4.5.3: The length of a telephone conversation has an exponential
distribution with a mean of 3 minutes. Find the probability that a call
(i) ends in less than 3 minutes, (ii) takes between 3 and 5 minutes.
P x 3
P x 0 P 0 x 3
3 3
0 f x dx f x dx
0 0
3 3 1
1 x
0
0
3
e x dx e 3 dx
3
1 x
1 e 3
e e 0.6321
1
0
3 1
3 0
5 5 1
1 x
3
3
3
e x dx e 3 dx
5
1 x
1 e 3 5 1
e 3 e 0.179
3 1
3 3
Mathematical Foundation for Computer Applications 159
--------------------------------------------------------------------------------------------------------------------------------
Example 4.5.4: The sale per day in a shop is exponentially distributed with
the average sales amounting to Rs.100 and net profit is 8%. Find the
probability that the net profit exceeds Rs.30 on two consecutive days.
Solution:
e x , 0 x
The p.d.f of the exponential distribution is f x
0, otherwise
Given, Mean = 100
1
i.e., Mean 100
1
100
Let A be the amount for which profit is 8%
Given, profit = Rs.30
8% of A = 30
30 30
A= 375
8% 0.08
Now, P (profit exceeding Rs.30) = 1 P (profit Rs.30)
= 1 P (sales Rs.375)
375
1 f x dx
0
375
e
x
1 dx
0
375
0.01 e
0.01x
1 dx
0
375
e 0.01x
1 0.01
0.01 0
1 e3.75 e0 0.00055
160 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
EXERCISE 4.5
ANSWERS
2
where x , and 0.
Mean
Variance V 2
Standard deviation
The z-score tells you how many standard deviations the value x is above
(to the right of) or below (to the left of) the mean, μ. Values of x that are larger
than the mean have positive z-scores, and values of x that are smaller than the
mean have negative z-scores. If x equals the mean, then x has a z-score of zero.
162 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
Example: Suppose X ~ N (5, 6). This says that X is a normally distributed
random variable with mean μ = 5 and standard deviation σ = 6.
This means that x = 17 is two standard deviations (2σ) above or to the right of
the mean μ = 5.
This means that x = 1 is 0.67 standard deviations (–0.67σ) below or to the left of
the mean μ = 5.
The probability density function for the normal distribution in standard form is
given by
1 12 z 2
f z e
2
This helps us to compute areas under the normal probability curve by making
use of standard tables.
The mathematical tool needed to find the area under a curve is integral
calculus. The integral of the normal probability density function between the
two points x1 and x2 is the area under the curve between these two points and
is the probability between these two points.
Mathematical Foundation for Computer Applications 163
--------------------------------------------------------------------------------------------------------------------------------
Note:
(4) P z 0 P 0 z 0.5
(5) P z z1 P 0 z P 0 z z1
(6) P z1 z z2 P z1 z 0 P 0 z z2
(7) P z1 z 0 P 0 z z1 (since the normal curve is symmetric)
(8) P z1 z z1 2 P 0 z z1
(9) F z1 1 F z1
(10) The following table called normal probability table gives the area under
the standard normal curve from 0 to z > 0, for various values of z.
164 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
WORKED EXAMPLES
Example 4.6.1: If X is a normal variate with mean 30 and S.D. 5, find the
probabilities that (i) 26 X 40, (ii) X 45 and (iii) |X – 30| > 5.
Solution:
x
We have, z
x 30
z
5
26 30
(i) When x 26 z 0.8
5
40 30
When x 40 z 2
5
P 26 X 40 P 0.8 z 2
P 0.8 z 0 P 0 z 2
P 0 z 0.8 P 0 z 2
45 30
(ii) When x 45 z 3
5
P x 45 P z 3
P 0 z P 0 z 3
(iii) P X 30 5 P 25 X 35
25 30
When x 25 z 0.1
5
35 30
When x 35 z 1
5
166 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
P 25 X 35 P 1 z 1
2P 0 z 1
2 0.3413 0.6826
P X 30 5 1 P X 30 5
1 0.6826 0.3174
Example 4.6.2: In a test on 2000 electric bulbs, it was found that the life
of a particular make was normally distributed with an average life of 2040
hours and S.D. of 60 hours. Estimate the number of bulbs likely to burn for
(i) more than 2150 hours, (ii) less than 1950 hours, (iii) more than 1920
hours and less than 2160 hours.
x
We have, z
x 2040
z
60
2150 2040
(i) When x 2150 z 1.83
60
P x 2150 P z 1.83
P 0 z P 0 z 1.83
0.0336 2000 67
1950 2040
(ii) When x 1950 z 1.5
60
P x 1950 P z 1.5
P z 1.5
Mathematical Foundation for Computer Applications 167
--------------------------------------------------------------------------------------------------------------------------------
P 0 z P 0 z 1.5
1920 2040
(iii) When x 1920 z 2
60
2160 2040
When x 2160 z 2
60
P 1920 x 2160 P 2 z 2
2P 0 z 2
2 0.4772 0.9544
Example 4.6.3: A sample of 100 dry battery cells tested to find the length
of life produced the following results:
Solution:
x
We have, z
x 12
z
3
15 12
(i) When x 15 z 1
3
168 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
P x 15 P z 1
P 0 z P 0 z 1
6 12
(ii) When x 6 z 2
3
P x 6 P z 2
P z 2
P 0 z P 0 z 2
10 12 2
(iii) When x 10 z 0.67
3 3
14 12 2
When x 14 z 0.67
3 3
2P 0 z 0.67
Solution:
x
We have, z
x 70
z
5
65 70
(i) When x 65 z 1
5
Mathematical Foundation for Computer Applications 169
--------------------------------------------------------------------------------------------------------------------------------
P x 65 P z 1
P z 1
P 0 z P 0 z 1
75 70
(ii) When x 75 z 1
5
P x 75 P z 1
P 0 z P 0 z 1
(iii) When x 65 z 1
When x 75 z 1
P 65 x 75 P 1 z 1
2P 0 z 1
2 0.3413 0.6826
x
We have, z
x 40
z
10
50 40
(i) When x 50 z 1
10
P x 50 P z 1
P 0 z P 0 z 1
0.1587 500 79
60 40
(ii) When x 60 z 2
10
P x 60 P z 2
P 0 z P 0 z 2
0.0228 500 11
(iii) Let M% of marks is the minimum for passing if 350 candidates are
to pass. Then, we should have M < 40, and
P x M 500 350
350
P x M 0.7
500
x 40
We have, z
10
x 10 z 40
Mathematical Foundation for Computer Applications 171
--------------------------------------------------------------------------------------------------------------------------------
M 40
P x M P 10 z 40 M P z
10
M 40
P z z1 where z1
10
P z1 z 0 P 0 z
P 0 z z1 0.5
M 40
So, z1 0.55 M 34.5 35
10
From the normal probability table, the value of z corresponding to this area is
0.5.
i.e., z1 0.5 z1 0
When x = 64, let z z2
172 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
P 0 z z2 0.5 0.08 0.42
i.e., z2 1.4
x
Since, z
45 64
0.5 and 1.4
50 and 10
From the normal probability table, the value of z corresponding to this area is
1.48
i.e., z1 1.48 z1 0
When x = 60, let z z2
i.e., z2 1.23 z2 0
x
Since, z
35 60
1.48 and 1.23
x 2 4 6 8 10
f 1 4 6 4 1
f i 1 4 6 4 1 16
x f i i 2 16 36 32 10 96
x i
2
f i 4 64 216 256 100 640
Mean
x f i i
96
6
f i 16
Variance V
x f i
2
i
2
640
36 4
f i 16
S.D V 4 2
2
174 Random Variable and Probability Distributions
--------------------------------------------------------------------------------------------------------------------------------
2
1 x 6
1
e 2 2
2 2
F xi f f x
i
1 x 6
2
1 x 6
2
1 8
F xi 16 e 2 2 e 2 2
2 2 2
2
1 26
8
F 2 e 2 2
0.97
2
2
1 46
8
F 4 e 2 2
3.9
2
2
1 66
8
F 6 e 2 2
6.1
2
2
1 86
8
F 8 e 2 2
3.9
2
2
1 10 6
8
F 10 e 2 2
0.97
2
x 2 4 6 8 10
f 1 4 6 4 1
EXERCISE 4.6
x 0 1 2 3 4 5
f 13 23 34 15 11 4
ANSWERS
3. 294 4. 543
5. 36.4 6. 52
2
x2
100
7. (i) 16, (ii) 2 8. F xi e 3.4
3.4