0% found this document useful (0 votes)
32 views

BCS301 Notes Module1

Uploaded by

mayuramin17
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

BCS301 Notes Module1

Uploaded by

mayuramin17
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

MODULE-I
Random variable: A real variable associated with every outcome of a random experiment is called
random variable. Therefore a random variable is a function 𝑋: 𝑆 → 𝑅 .
Discrete Random Variable: If a random variable X takes finite or countable number of values then X
is called discrete random variable.
Continuous Random Variable: If a random variable X takes uncountable number of values then X
is called continuous random variable.
Probability function of discrete Random Variable: 𝑓(𝑥) is called probability function for a discrete random
variable 𝑋, If (i) 𝑓(𝑥) ≥ 0 and (ii) ∑𝑥 𝑓(𝑥) = 1 iii) 𝑃(𝑋 = 𝑥) = 𝑓(𝑥).

Collection [𝑥, 𝑓(𝑥)] is called discrete probability distribution of 𝑿.


Example: A shipment of 8 similar microcomputers 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.
Solution: Let 𝑋 be a random variable whose values 𝑥 are the possible numbers of defective computers
purchased by the school. Then 𝑥 may takes the value 0, 1, or 2.

3 5
( )( ) 10
0 2
𝑓(0) = 𝑃(𝑋 = 0) = 8 = 28 ,
( )
2
3 5
( )( ) 15
1 1
𝑓(1) = 𝑃(𝑋 = 1) = 8 = 28
( )
2
3 5
( )( ) 3
𝑓(2) = 𝑃(𝑋 = 2) = 2 8 0 = 28
( )
2

Thus the probability distribution of 𝑋 is 𝑥 0 1 2


10 15 3
𝑓(𝑥) 28 28 28

Note: 1. Mean= 𝜇 = ∑𝑥 𝑥𝑓(𝑥) .


2. Variance = 𝑉 = ∑𝑥 𝑥 2 𝑓(𝑥) − 𝜇 2 .
3. Standard deviation= 𝜎 = √𝑉 .
4. Cumulative distributive function: 𝐹(𝑥) = 𝑃(𝑋 ≤ 𝑥)
∴ 𝐹(𝑥) = ∑𝑡≤𝑥 𝑓(𝑡). (c.d.f. is defined for all real values of 𝑥)
5. Expectation of ℎ(𝑋) = 𝐸[ℎ(𝑋)] = ∑𝑥 ℎ(𝑥)𝑓(𝑥) .
Therefore 𝜇 = 𝐸[𝑋] and 𝑉 = 𝐸[𝑋 2 ] − {𝐸[𝑋]}2 .

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


1
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

Examples:

1. The probability density function of a discrete random variable 𝑋 is given below:

𝑥 0 1 2 3 4 5 6
𝑓(𝑥) k 3k 5k 7k 9k 11k 13k

Find (i) 𝑘; (ii) 𝐹(4); (iii) 𝑃(𝑋 ≤ 5); (iv) 𝑃(2 ≤ 𝑋 < 5); (v) 𝐸(𝑋) and (vi) 𝑉𝑎𝑟 (𝑋).
1
Solution: (i) Since ∑𝑥∈𝑋 𝑓(𝑥) = 1 ⟹ 49𝑘 = 1 , ∴ 𝑘 = 49 .

25
(ii) 𝐹(4) = ∑𝑥∈𝑋 𝑃(𝑥 ≤ 4) = 25𝑘 = .
49

36
(iii) 𝑃(𝑋 ≤ 5) = 36𝑘 = 49 .

21
(iv) 𝑃(2 ≤ 𝑋 < 5) = 𝑓(2) + 𝑓(3) + 𝑓(4) = 21𝑘 = 49 .

29
(v) 𝐸(𝑋) = 𝜇 = ∑ 𝑥𝑓(𝑥) = 203𝑘 = = 4.1429 .
7

973 29 2 132
(vi) 𝑉(𝑋) = ∑𝑥∈𝑋 𝑥 2 𝑓(𝑥) − 𝜇 2 = −(7) = = 2.6939.
49 49

2. A random variable 𝑋 has the following probability distribution.

𝑥 −2 −1 0 1 2 3
𝑓(𝑥) 0.1 𝑘 0.2 2𝑘 0.3 𝑘

Find (i) 𝑘; (ii) 𝐹(2); (iii)𝑃(−2 < 𝑋 < 2); (iv) 𝑃(−1 < 𝑋 ≤ 2); (v) 𝐸(𝑋) and (vi) 𝑉𝑎𝑟 (𝑋).

Solution: (i) Since ∑𝑥∈𝑋 𝑃(𝑥) = 1 ⟹ 4𝑘 + 0.6 = 1 , ∴ 𝑘 = 0.1 .

Therefore probability distribution is


𝑥 −2 −1 0 1 2 3

𝑓(𝑥) 0.1 0.1 0.2 0.2 0.3 0.1

(ii) 𝐹(2) = ∑𝑥∈𝑋 𝑃(𝑥 ≤ 2) = 0.9 .

(iii) 𝑃(−2 < 𝑋 < 2) = 𝑓(−1) + 𝑓(0)𝑓𝑃(1) = 0.5 .

(iv) 𝑃(−1 < 𝑋 ≤ 2) = 𝑓(0) + 𝑓(1) + 𝑓(2) = 0.7 .

(v) 𝐸(𝑋) = 𝜇 = ∑ 𝑥𝑓(𝑥) = −0.2 − 0.1 + 0 + 0.2 + 0.6 + 0.3 = 0.8 .

(vi) 𝑉(𝑋) = ∑𝑥∈𝑋 𝑥 2 𝑓(𝑥) − 𝜇 2 = 0.4 + 0.1 + 0 + 0.2 + 1.2 + 0.9 − 0.82 = 2.16 .

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


2
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

Continuous Random Variable: A real valued function 𝑓(𝑥) is called probability density function (p.d.f.) for a
∞ 𝑏
continuous random variable 𝑋, If (i) 𝑓(𝑥) ≥ 0 (ii) ∫−∞ 𝑓(𝑥)𝑑𝑥 = 1 and iii) 𝑃(𝑎 < 𝑋 < 𝑏) = ∫𝑎 𝑓(𝑥) 𝑑𝑥 .
Cumulative distribution function (c.d.f.):
𝑥 𝑑
𝐹(𝑥) = 𝑃(𝑋 ≤ 𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡 . Therefore p.d.f. 𝑓(𝑥) = 𝑑𝑥 [𝐹(𝑥)] .

Note: 1. Mean= 𝜇 = ∫−∞ 𝑥𝑓(𝑥)𝑑𝑥 .


2. Variance = 𝑉 = ∫−∞ 𝑥 2 𝑓(𝑥)𝑑𝑥 − 𝜇 2 .

3. Standard deviation= 𝜎 = √𝑉

4. Expectation of ℎ(𝑥) = 𝐸[ℎ(𝑥)] = ∫−∞ ℎ(𝑥)𝑓(𝑥)𝑑𝑥 .

𝑏
5. 𝑃(𝑎 < 𝑋 < 𝑏) = ∫𝑎 𝑓(𝑥)𝑑𝑥 = 𝐹(𝑏) − 𝐹(𝑎).

𝑘𝑥 2 , 0≤𝑥≤3
1. A random variable X has density function 𝑓(𝑥) = { .
0, elsewhere

Evaluate 𝑘 , and find (i) 𝑃(𝑥 ≤ 1) (ii) 𝑃(1 ≤ 𝑥 ≤ 2) (iii) 𝑃(𝑥 ≤ 3) (iv) 𝑃(𝑥 > 1) (v) 𝑃(𝑥 > 2) .

3
∞ 3 𝑘𝑥 3 1
Solution: Since ∫−∞ 𝑓(𝑥)𝑑𝑥 =1 ⟹ ∫0 𝑘𝑥 2 𝑑𝑥 =1 ⟹ 3
| =1 ⟹𝑘=9 .
0
1
1 1 1 𝑥3 1
(i) 𝑃(𝑥 ≤ 1) = ∫−∞ 𝑓(𝑥)𝑑𝑥 = 9 ∫0 𝑥 2 𝑑𝑥 = 27| = 27 .
0
2
𝑥3 7
(ii) 𝑃(1 ≤ 𝑥 ≤ 2) = 27| = 27 .
1
3
𝑥3
(iii) 𝑃(𝑥 ≤ 3) = 27| =1.
0
3
𝑥3 26
(iv) 𝑃(𝑥 > 1) = | = 27 .
27
1
3
𝑥3 19
(v) 𝑃(𝑥 > 2) = | = 27 .
27
2

2. Suppose that the error in the reaction, for a controlled laboratory experiment is a continuous random

𝑥2
, −1≤𝑥 ≤2
variable having the p.d.f 𝑓(𝑥) = { 3
0, elsewhere

Find (i) c.d.f. 𝐹(𝑥) and (ii) use it to evaluate 𝑃 (0 < 𝑋 ≤ 1).
DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.
3
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

Solution: If 𝑥 < −1 , then c.d.f. 𝐹(𝑥) = 0 .


𝑥
𝑥 𝑥 𝑥2 𝑥3 𝑥 3 +1
If −1 ≤ 𝑥 < 2, then 𝐹(𝑥) = ∫−∞ 𝑓(𝑥)𝑑𝑥 = ∫−1 3 𝑑𝑥 = | = .
9 9
−1

And if 2 ≤ 𝑥 then 𝐹(𝑥) = 1 .

0, 𝑓𝑜𝑟 𝑥 ≤ −1
𝑥 3 +1
Therefore 𝐹(𝑥) = { , 𝑓𝑜𝑟 − 1 < 𝑥 < 2 .
9
1, 𝑓𝑜𝑟 2 ≤ 𝑥
2 1 1
And 𝑃 (0 < 𝑋 ≤ 1) = 𝐹(1) − 𝐹(0) = 9 − 9 = 9 .

3. The trouble shooting of an I.C. is a R.V. X whose cumulative distribution function is given by

0, for 𝑥 ≤ 3
𝐹(𝑥) = { 9
1 − 𝑥2 , for 𝑥 > 3

If X denotes the number of years, find the probability that the I.C. will work properly
(a) less than 8 years, (b) beyond 8 years, (c) from 5 to 7 years, (d) from 2 to 5 years.
9 55
Solution: (a) 𝑃(𝑋 < 8) = 𝐹(8) = 1 − 64 = 64 .

9
(b) 𝑃(𝑋 ≥ 8) = 1 − 𝐹(8) = 64 .

9 9 216
(c) 𝑃(5 ≤ 𝑋 ≤ 7) = 𝐹(7) − 𝐹(5) = [1 − 49 ] − [1 − 25 ] = 1225 = 0.1763 .

9 16
(d) 𝑃(2 ≤ 𝑋 ≤ 5) = 𝐹(5) − 𝐹(2) = [1 − 25 ] − 0 = 25 = 0.64 .

Bernoulli’s trail: A trial having only two outcomes say success and failure is called Bernoulli’s trail.
Let 𝑝 be the probability of success and 𝑞 be the probability of failure in each trail. Then 𝑝 + 𝑞 = 1.

Binomial Distribution: If a Bernoulli’s trail is conducted 𝑛 times,


Probability of 𝑥 successes in 𝑛 trail is given by
𝑛
𝑏(𝑥; 𝑛, 𝑝) = 𝑃(𝑋 = 𝑥) = 𝑓(𝑥) = ( ) 𝑝 𝑥 𝑞 𝑛−𝑥 .
𝑥
The distribution [𝑥, 𝑏(𝑥; 𝑛, 𝑝) ] is called binomial distribution.
Mean and variance of the binomial distribution:
𝑛
Mean= 𝜇 = ∑𝑥∈𝑋 𝑥𝑓(𝑥) = ∑𝑛𝑥=0 𝑥 ( ) 𝑝 𝑥 𝑞 𝑛−𝑥
𝑥
𝑛 𝑛−1 𝑛 𝑛 𝑛−1
= ∑𝑛𝑥=0 𝑥. 𝑥 . ( ) 𝑝 𝑥 𝑞 𝑛−𝑥 ∵ ( ) = 𝑥.( )
𝑥−1 𝑥 𝑥−1

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


4
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

𝑛 − 1 𝑥−1 (𝑛−1)−(𝑥−1)
= 𝑛𝑝 ∑𝑛𝑥=1 ( )𝑝 𝑞 . by Binomial theorem
𝑥−1
= 𝑛𝑝(𝑝 + 𝑞)𝑛−1 = 𝑛𝑝 . ∵ 𝑝 + 𝑞 = 1.

Variance = 𝑉 = ∑𝑥∈𝑋 𝑥 2 𝑓(𝑥) − 𝜇 2 = ∑𝑥∈𝑋[𝑥(𝑥 − 1) + 𝑥]𝑓(𝑥) − 𝜇 2


= ∑𝑥∈𝑋[𝑥(𝑥 − 1)]𝑓(𝑥) + 𝜇 − 𝜇 2
𝑛
= ∑𝑛𝑥=0[𝑥(𝑥 − 1)] ( ) 𝑝 𝑥 𝑞 𝑛−𝑥 + 𝑛𝑝 − 𝑛2 𝑝2
𝑥
𝑛(𝑛−1) 𝑛 − 2 𝑛(𝑛−1) 𝑛−2
= ∑𝑛𝑥=0[𝑥(𝑥 − 1)] 𝑥(𝑥−1) . ( ) 𝑝 𝑥 𝑞 𝑛−𝑥 + 𝑛𝑝 − 𝑛2 𝑝2 ∵ 𝑛𝑐𝑥 = .( )
𝑥−2 𝑥(𝑥−1) 𝑥−2
𝑛 − 2 𝑥−2 (𝑛−2)−(𝑥−2)
= 𝑛(𝑛 − 1)𝑝2 ∑𝑛𝑥=2 ( )𝑝 𝑞 + 𝑛𝑝 − 𝑛2 𝑝2
𝑥−2
= 𝑛(𝑛 − 1)𝑝2 (𝑝 + 𝑞)𝑛−2 + 𝑛𝑝 − 𝑛2 𝑝2 = 𝑛2 𝑝2 − 𝑛𝑝2 + 𝑛𝑝 − 𝑛2 𝑝2
= −𝑛𝑝2 + 𝑛𝑝 = 𝑛𝑝(1 − 𝑝) = 𝑛𝑝𝑞. ∵ 𝑞 = 1 − 𝑝.

∴ 𝐒𝐭𝐚𝐧𝐝𝐚𝐫𝐝 𝐝𝐞𝐯𝐢𝐚𝐭𝐢𝐨𝐧 = σ = √𝑉 = √𝑛𝑝𝑞 .

Problems:

1. It is known that among the 10 telephone lines available in an office, the chance that any telephone is busy
at an instant of time is 0.2. Find the probability that (i) exactly 3 lines are busy, (ii) What is the most
probable number of busy lines and compute its probability, and (iii) What is the probability that all the
telephones are busy?
Solution: Let 𝑝 be the probability that any telephone is busy at an instant of time.
Then, 𝑝 = 0.2, 𝑞 = 0.8 . Since 10 telephone lines available in an office, 𝑛 = 10.
Therefore probability that 𝑥 telephone lines are busy at an instant of time is
10
𝑓(𝑥) = 𝐶𝑥 0.2𝑥 0.8(10−𝑥) .
10
(i) The probability that exactly 3 lines are busy𝑃(𝑋 = 3) = 𝑓(3) = 𝐶3 0.23 0.87 = 0.2013 .

(ii) The most probable number of busy lines is 𝜇 = 𝑛𝑝 = 2.


10
And 𝑓(2) = 𝐶2 0.22 0.88 = 0.3020
10
(iii) The probability that all the telephones are busy= 𝑓(10) = 𝐶10 0.210 = 0.000000102 ≈ 0 .

2. The chance that a bomb dropped from an airplane will strike a target is 0.4. 6 bombs are dropped from
the airplane. Find the probability that (i) exactly 2 bombs strike the target? (ii) At least 1 strikes the
target. (iii) None of the bombs hits the target?
Solution: Clearly 𝑝 = 0.4, 𝑞 = 0.6 . 𝑛 = 6.

Therefore probability that 𝑥 bombs strike the target is 𝑓(𝑥) = 6𝐶𝑥 0.4𝑥 0.6(6−𝑥) .

(i) The probability that exactly 2 bombs strike the target𝑃(𝑋 = 2) = 𝑓(2) = 6𝐶2 0.42 0.64 = 0.3110 .

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


5
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

(ii) The probability that at least one bomb strike the target= 𝑃(𝑋 ≥ 1) .

𝑃(𝑋 ≥ 1) = 1 − 𝑓(0) = 1 − 6𝐶0 0.66 = 0.9533.

(iii) The probability that none of the bombs strike the target= 𝑓(0) = 6𝐶0 0.66 = 0.0467 .

3. If 10% of the rivets produced by a machine are defective, find the probability that out of 12 randomly
chosen rivets (i) exactly 2 will be defective (ii) at least 2 will be defective (iii) none will be defective.

Solution: Let 𝑝 be the probability that a rivet is defective. Then, 𝑝 = 0.1, 𝑞 = 0.9 . 𝑛 = 12 .
12
Therefore probability that 𝑥 rivets are defective is 𝑓(𝑥) = 𝐶𝑥 0.1𝑥 0.9(12−𝑥) .
12
(i) The probability that exactly 2 will be defective= 𝑓(2) = 𝐶2 0.12 0.910 = 0.2301 .

(ii) The probability that at least 2 will be defective= 𝑃(𝑋 ≥ 2)

𝑃(𝑋 ≥ 2) = 1 − [𝑓(0) + 𝑓(1)] = 1 − [0.2824 + 0.3766] = 0.3410.

(iii) The probability that none will be defective= 𝑓(0) = 0.2824 .

4. A die is thrown 8 times. Find the probability that 3 falls,


(i) Exactly 2 times (ii) at least once (iii) at the most 7 times.
1 5
Solution: In each throw chance of 3 falls is 1 out of 6. Therefore 𝑝 = 6 , 𝑞 = 6 , 𝑛 = 8.

1 𝑥 5 (8−𝑥) 8
𝐶𝑥 5(8−𝑥)
The probability that 3 falls 𝑥 times in 8 throw is 𝑓(𝑥) = 8𝐶𝑥 (6) (6) = .
68

8
𝐶2 56
(i) The probability that 3 falls exactly 2 times= 𝑓(2) = = 0.2605.
68

8
𝐶0 58
(ii) The probability that 3 falls at least once= 𝑃(𝑋 ≥ 1) = 1 − 𝑓(0) = 1 − = 0.7674.
68

(iii) The probability that 3 falls at the most 7 times= 𝑃(𝑋 ≤ 7) = 1 − 𝑓(8)
8
𝐶8
= 1− = 0.999999405 ≈ 1.
68

5. Fit a binomial distribution for the following data and obtain the expected frequencies.
𝑥 0 1 2 3 4 5 6 7 8 9 10
𝑓 6 20 28 12 8 6 0 0 0 0 0

∑ 𝑓×𝑥 20+2×28+3×12++4×8+5×6 174


Solution: 𝜇=𝑥= ∑𝑓
= = = 2.175.
6+20+28+12+8+6 80

In binomial distribution 𝜇 = 𝑛𝑝 = 2.175 , Since 𝑥 takes the values 0 to 10 , 𝑛 = 10.


10
And hence 𝑝 = 0.2175, 𝑞 = 0.7825. 𝑓(𝑥) = 𝐶𝑥 0.2175𝑥 0.7825(10−𝑥) .
DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.
6
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

Therefore binomial distribution and the expected frequencies are given below.

𝑥 0 1 2 3 4 5 6 7 8 9 10
𝑓(𝑥) 0.0861 0.2392 0.2992 0.2218 0.1079 0.0360 0.0083 0.0013 0.0001 0 0
𝑓 7 19 24 18 9 3 0 0 0 0 0

Poisson distribution: The limiting case of the binomial distribution by making 𝑛 very large and 𝑝 very small,
and keeping 𝑛𝑝 fixed (𝑛𝑝 = 𝑚) is Poisson distribution.
𝑚𝑥 𝑒 −𝑚
Probability function is 𝑝(𝑥; 𝑚) = 𝑓(𝑥) = .
𝑥!

Proof: In binomial distribution, if 𝑛 → ∞, 𝑝 → 0 𝑎𝑛𝑑 𝑛𝑝 = 𝑚


𝑛
𝑓(𝑥) = ( ) 𝑝 𝑥 𝑞 𝑛−𝑥
𝑥
𝑛(𝑛−1)(𝑛−2)⋯⋯(𝑛−𝑥+1)𝑝𝑥 𝑞𝑛−𝑥
=
𝑥!
1 2 𝑥−1
(𝑛𝑝)𝑥 (1− )(1− )⋯⋯(1− )𝑞𝑛−𝑥
𝑛 𝑛 𝑛
=
𝑥!
𝑚𝑥 𝑞 𝑛−𝑥 𝑚𝑥 𝑒 −𝑚
= = .
𝑥! 𝑥!
𝑚
𝑛 − (𝑛−𝑥)
𝑚 −𝑚
𝑛
𝑚 𝑛−𝑥
∵ 𝑞 𝑛−𝑥 = (1 − 𝑝)𝑛−𝑥 = (1 − 𝑛 ) = {(1 + − ) } = 𝑒 −𝑚 , as 𝑛 → ∞.
𝑛

Mean and variance of the Poisson distribution:


𝑚𝑥 𝑒−𝑚
Mean= 𝜇 = ∑𝑥∈𝑋 𝑥𝑓(𝑥) = ∑∞
𝑥=0 𝑥 𝑥!
𝑚𝑥−1
= 𝑚𝑒−𝑚 ∑∞
𝑥=1 (𝑥−1)!

𝑚2
= 𝑚𝑒 −𝑚 {1 + 𝑚 + + ⋯ ⋯ } = 𝑚𝑒 −𝑚 𝑒 𝑚 = 𝑚.
2!

Variance = 𝑉 = ∑𝑥∈𝑋 𝑥 2 𝑓(𝑥) − 𝜇 2 = ∑𝑥∈𝑋[𝑥(𝑥 − 1) + 𝑥]𝑓(𝑥) − 𝜇 2


= ∑𝑥∈𝑋[𝑥(𝑥 − 1)]𝑓(𝑥) + 𝜇 − 𝜇 2
𝑚𝑥 𝑒−𝑚
= ∑∞
𝑥=0[𝑥(𝑥 − 1)] + 𝑚 − 𝑚2
𝑥!
𝑚𝑥−2
= 𝑚2 𝑒−𝑚 ∑∞
𝑥=2 (𝑥−2)! + 𝑚 − 𝑚
2

𝑚2
= 𝑚2 𝑒−𝑚 {1 + 𝑚 + + ⋯ ⋯ } + 𝑚 − 𝑚2 = 𝑚2 𝑒−𝑚 𝑒𝑚 + 𝑚 − 𝑚2 = 𝑚.
2!

∴ 𝐒𝐭𝐚𝐧𝐝𝐚𝐫𝐝 𝐝𝐞𝐯𝐢𝐚𝐭𝐢𝐨𝐧 = σ = √𝑉 = √𝑚 .
And hence mean and variance of a Poisson distribution are same.

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


7
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

1. The probability that an individual suffers a bad reaction from a certain injection is 0.001. Determine the
probability that out of 2000 individuals (i) exactly 3 (ii) more than 2 will suffer a bad reaction.

Solution: Given that 𝑝 = 0.001, 𝑛 = 2000. Since 𝑝 is very small, consider Poisson distribution,
2𝑥 𝑒 −2
𝑚 = 𝑛𝑝 = 2. ∴ 𝑓(𝑥) = .
𝑥!

(i) The probability that out of 2000 individuals exactly 3 will suffer a bad reaction= 𝑃(𝑋 = 3)
23 𝑒 −2
= 𝑓(3) = = 0.1804.
3!

(ii) The probability that out of 2000 individuals more than 2 will suffer a bad reaction= 𝑃(𝑋 ≥ 3)
𝑃(𝑋 ≥ 3) = 1 − [𝑓(0) + 𝑓(1) + 𝑓(2)] = 1 − [𝑒 −2 + 2𝑒 −2 + 2𝑒 −2 ] = 1 − 5𝑒 −2 = 0.3233.

2. It is known that the chance of an error in the transmission of a message through a communication channel
is 0.002. 2000 messages are sent through the channel; find the probability that at least 3 messages will be
received incorrectly.

Solution: Given that 𝑝 = 0.002, 𝑛 = 2000. Since 𝑝 is very small, consider Poisson distribution,
4𝑥 𝑒 −4
𝑚 = 𝑛𝑝 = 4. ∴ 𝑓(𝑥) = .
𝑥!

The probability that at least 3 messages will be received incorrectly = 𝑃(𝑋 ≥ 3)


𝑃(𝑋 ≥ 3) = 1 − [𝑓(0) + 𝑓(1) + 𝑓(2)] = 1 − [𝑒 −4 + 4𝑒 −4 + 8𝑒 −4 ] = 1 − 13𝑒 −4 = 0.7619.

3. A car hire –firm has two cars which it hires out on a day to day basis. The number of demands for a car is
known to be Poisson distribution with mean 1.5. Find the probability of day on which (i) There is no
demand for the car and (ii) The demand is rejected.
1.5𝑥 𝑒 −1.5
Solution: Given that, 𝑚 = 1.5. ∴ 𝑓(𝑥) = .
𝑥!

(i) The probability of day on which there is no demand for the car = 𝑃(0) = 𝑒 −1.5 = 0.2231.
(ii) The probability of day on which the demand is rejected= 𝑃(𝑋 ≥ 3)
𝑃(𝑋 ≥ 3) = 1 − [𝑓(0) + 𝑓(1) + 𝑓(2)] = 1 − [𝑒 −1.5 + 1.5𝑒 −1.5 + 1.125𝑒 −1.5 ] = 0.1912 .
4. Fit a Poisson distribution for the following data and calculate the theoretical frequencies.
𝑥 0 1 2 3 4
𝑓 122 60 15 2 1

∑ 𝑓𝑥 100
Solution : 𝜇=𝑥= ∑𝑓
= 200 = 0.5.

0.5𝑥 𝑒 −0.5
In Poisson distribution 𝜇 = 𝑚 = 0.5 , 𝑃(𝑥) = .
𝑥!

The Poisson distribution and the theoretical frequencies are given below.

𝑥 0 1 2 3 4
𝑃(𝑥) 0.6065 0.3033 0.0758 0.0126 0.0016
𝑓 121 61 15 3 0

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


8
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

∝ 𝑒 −∝𝑥 , 𝑓𝑜𝑟 𝑥 ≥ 0
Exponential distribution: Probability density function is 𝑓(𝑥) = { .
0, 𝑓𝑜𝑟 𝑥 < 0

Mean and variance of the Exponential distribution:


∞ ∞
Mean= 𝜇 = ∫−∞ 𝑥𝑓(𝑥)𝑑𝑥 =∝ ∫0 𝑥𝑒 −∝𝑥 𝑑𝑥

𝑥𝑒 −∝𝑥 𝑒 −∝𝑥 ∞ 1 𝟏
=∝ [ − ] =∝ [0 + ]= .
−∝ ∝2 0 ∝2 ∝

∞ ∞ 1
Variance = 𝑉 = ∫−∞ 𝑥 2 𝑓(𝑥)𝑑𝑥 − 𝜇 2 =∝ ∫0 𝑥 2 𝑒 −∝𝑥 𝑑𝑥 −
∝2

𝑥 2 𝑒 −∝𝑥 2𝑥𝑒 −∝𝑥 2𝑒 −∝𝑥 ∞ 2 1 𝟏


=∝ [ − + ] − 12 =∝ [0 + 3 ] − 2 = 𝟐 .
−∝ ∝2 −∝3 0 ∝ ∝ ∝ ∝

𝟏
Standard deviation= 𝜎 = √𝑉 = .

Hence, mean and standard deviation of an exponential distribution are same.

Problems:
1. The duration of telephone conservation has been found to have an exponential distribution with mean 2
minutes. Find the probabilities that the conservation may last (i) more than 3 minutes, (ii) less than 4
minutes and (iii) between 3 and 5 minutes.
1 1
Solution: In exponential distribution 𝜇 = ∝ = 2, ∴ ∝= 2

𝑥
1
𝑒 − 2 , 𝑓𝑜𝑟 𝑥 ≥ 0
Probability density function is 𝑓(𝑥) = { 2 .
0, 𝑓𝑜𝑟 𝑥 < 0

(i) The probability that the conservation may last for more than 3 minutes = 𝑃(𝑋 > 3)
𝑥
∞ 3

𝑃(𝑋 > 3) = ∫3 𝑓(𝑥)𝑑𝑥 = −𝑒 2 | = 𝑒 − 2 = 0.2231.

3
(ii) The probability that the conservation may last for less than 4 minutes= 𝑃(𝑋 < 4)
𝑥 𝑥 4
4 41
𝑃(𝑋 < 4) = ∫−∞ 𝑓(𝑥)𝑑𝑥 = ∫0 2 𝑒 − 2 𝑑𝑥 = −𝑒 − 2 | = 1 − 𝑒 − 2 = 0.8647.
0
(ii) The probability that the conservation may last between 3 and 5 minutes= 𝑃(3 < 𝑋 < 5)
𝑥 5 3 5
5
𝑃(3 < 𝑋 < 5) = ∫3 𝑓(𝑥)𝑑𝑥 = −𝑒 − 2 | = 𝑒 − 2 − 𝑒 − 2 = 0.1410.
3

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


9
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

2. In a town, the duration of a rain is exponentially distributed with mean equal to 5 minutes. What is the
probability that (i) the rain will last not more than 10 minutes (ii) between 4 and 7 minutes and
(iii) between 5 and 8 minutes?
1 1
Solution: In exponential distribution 𝜇 = ∝ = 5, ∴ ∝= 5
𝑥
1
𝑒 − 5 , 𝑓𝑜𝑟 𝑥 ≥ 0
Probability density function is 𝑓(𝑥) = { 5 .
0, 𝑓𝑜𝑟 𝑥 < 0
(i) The probability that the rain will last not more than 10 minutes = 𝑃(𝑋 ≤ 10)
𝑥 10
10 −
𝑃(𝑋 ≤ 10) = ∫0 𝑓(𝑥)𝑑𝑥 = −𝑒 5 | = 1 − 𝑒 − 2 = 0.8647.
0
(ii) The probability the rain will last between 4 and 7 minutes = 𝑃(4 ≤ 𝑋 ≤ 7)
𝑥 7 4 7
7 −
𝑃(4 ≤ 𝑋 ≤ 7) = ∫4 𝑓(𝑥)𝑑𝑥 = −𝑒 5 | = 𝑒 − 5 − 𝑒 − 5 = 0.2027.
4
(iii) The probability the rain will last between 5 and 8 minutes = 𝑃(5 ≤ 𝑋 ≤ 8)
𝑥 8 8
8
𝑃(4 ≤ 𝑋 ≤ 7) = ∫5 𝑓(𝑥)𝑑𝑥 = −𝑒 − 5 | = 𝑒 − 1 − 𝑒 − 5 = 0.1660.
5
Normal distribution (Gaussian distribution N (𝝁, 𝝈𝟐 )): A continuous random variable 𝑋 from −∞ to ∞ is said
to have normal distribution with parameters, 𝜇 and 𝜎 2 , if its p.d.f. is
1 1 𝑥−𝜇 2
𝑓(𝑥) = √ 𝑒−2( 𝜎 ) for −∞ < 𝑥 < ∞ , where −∞ < 𝜇 < ∞, and 𝜎 > 0.
𝜎 2𝜋
Clearly mean= 𝐸(𝑋) = 𝜇, 𝑎𝑛𝑑 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 = 𝑉(𝑋) = 𝜎 2 .

If 𝜇 = 0 𝑎𝑛𝑑 𝜎 = 1 then the normal distribution is called standard normal distribution.


𝑧2
1 −
Standard normal variable: Probability density function is 𝑓(𝑧) = 𝑒 2 .
√2𝜋

Area under the standard normal curve

𝑓(𝑧)

𝐴(𝒛𝟎 )

0 𝒛𝟎

2
1 𝒛𝟎 −𝑧
𝑷(𝟎 ≤ 𝒛 ≤ 𝒛𝟎 ) = 𝐴(𝒛𝟎 ) = ∫ 𝑒 2
√2𝜋 𝟎
𝒅𝒛

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


10
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

𝑥−𝜇
Let 𝑥 be a normal variable with mean 𝜇 and standard deviation 𝜎 , then 𝑧 = .
𝜎

Problems:
1. 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 standard deviation of 60 hours. Estimate the number of bulbs
likely to burn for (a) more than 2150 hours, (b) less than 1940 hours and (c) more than 1920 hours and
but less than 2160 hours.
Solution: Let 𝑥 be the life of a bulb in hours. Given that 𝜇 = 2040 hours, 𝜎 = 60 hours .
𝑥−2040
If 𝑧 is the standard normal variant, then 𝑧 = .
60
(a) Probability that a bulb burn for more than 2150 hours= 𝑃(𝑥 > 2150)
𝑃(𝑥 > 2150) = 𝑃(𝑧 > 1.83)
= 0.5 − 𝐴(1.83) 𝐴(1.83)

= 0.5 − 0.4664 = 0.0336

0 1.83
0.0336 × 2000 = 67.2 ≈ 67
Therefore out of 2000 bulbs 67 bulbs are likely to burn for more than 2150 hours.
(b) Probability that a bulb burn for less than 1940 hours= 𝑃(𝑥 < 1940)
𝑃(𝑥 < 1940) = 𝑃(𝑧 < −1.67) 𝐴(1.67)

= 0.5 − 𝐴(1.67)
= 0.5 − 0.4525 = 0.0475

−1.67 0

0.0475 × 2000 = 95.


Therefore out of 2000 bulbs 95 bulbs are likely to burn for less than 1940 hours.

(c) Probability that a bulb burn for more than 1920 hours and but less than 2160 hours
= 𝑃(1920 < 𝑥 < 2160)
= 𝑃(−2 < 𝑧 < 2) 𝐴(2) 𝐴(2)

= 2𝐴(2)
= 2 × 0.4772 = 0.9544

−2 0 2

0.9544 × 2000 = 1908.8 ≈ 1909.


Therefore out of 2000 bulbs 1909 bulbs are likely to burn between 1920 hours and 2160 hours.

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


11
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

2. An analog signal received at a detector (measured in micro volts) may be modeled as a Gaussian random
variable N (200, 256) at a fixed point in time. What is the probability that the signal will exceed 240 micro
volts? What is the probability that the signal is less than 240 micro volts, given that it is larger than 210
micro volts? (N (200, 256) means 𝜇 = 200, 𝜎 2 = 256 .
Solution: Let 𝑥 be the signal voltage. Given that 𝜇 = 200, 𝜎 = 16 .
𝑥−200
If 𝑧 is the standard normal variant, then 𝑧 = .
16
(a) Probability that the signal will exceed 240 micro volts = 𝑃(𝑥 > 240)
= 𝑃(𝑧 > 2.5)
= 0.5 − 𝐴(2.5) 𝐴(2.5)

= 0.5 − 0.4938 = 0.0062.

0 2.5
(b) Probability that the signal is between 210 micro volts and 240 micro volts = 𝑃(210 < 𝑥 < 240)
= 𝑃(0.63 < 𝑧 < 2.5)
= 𝐴(2.5) − 𝐴(0.63)
= 0.4938 − 0.2357 = 0.2581.

0 0.63 2.5

3. In a normal distribution, 31% of the items are under 45 and 8% are over 64. Find the mean and
Standard deviation given that 𝐴(0.5) = 0.19, and 𝐴(1.4) = 0.42.
Solution: Given that 𝑃(𝑥 < 45) = 0.31 and 𝑃(𝑥 > 64) = 0.08
𝜇−45
𝐴( )
𝜎

45−𝜇 64−𝜇
⟹ 𝑃 (𝑧 < ) = 0.31 and 𝑃 (𝑧 > ) = 0.08
𝜎 𝜎
𝜇−45 64−𝜇 45−𝜇
⟹ 0.5 − 𝐴 ( ) = 0.31 and 0.5 − 𝐴 ( ) = 0.08 𝜎
0
𝜎 𝜎

𝜇−45 64−𝜇 64−𝜇


⟹ 𝐴( ) = 0.19 and 𝐴(
𝜎
) = 0.42 𝐴(
𝜎
)
𝜎

𝜇−45 64−𝜇
∴ = 0.5 𝑎𝑛𝑑 = 1.4
𝜎 𝜎

On solving we get, 𝜇 = 50, 𝑎𝑛𝑑 𝜎 = 10.


64−𝜇
0
𝜎

4) The marks of 1000 students in an examination follow a normal distribution with mean 70 and
standard deviation 5. Find the number of students whose marks will be i) less than 65 ii) more than
75 iii) between 65 and 75 given that 𝐴(1) = 0.3413.

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


12
MATHEMATICS FOR COMPUTER SCIENCE (BCS301) 2023

Solution: Let 𝑥 be the marks of a student. Given that 𝜇 = 70, 𝜎 = 5 .


𝑥−70
If 𝑧 is the standard normal variant, then 𝑧 = .
5
(i) Probability that a student with marks less than 65= 𝑃(𝑥 < 65)
𝑃(𝑥 < 65) = 𝑃(𝑧 < −1) 𝐴(1)

= 0.5 − 𝐴(1)
= 0.5 − 0.3413 = 0.1687

−1 0

0.1687 × 1000 ≈ 169.


Therefore 169 students are with marks less than 65.
(ii) Probability that a student with marks more than 75= 𝑃(𝑥 > 75)
𝑃(𝑥 > 75) = 𝑃(𝑧 > 1)
= 0.5 − 𝐴(1) 𝐴(1)

= 0.5 − 0.3413 = 0.1687

0 1
0.1687 × 1000 ≈ 169.
Therefore 169 students are with marks more than 75.
(iii) Probability that a student with marks between 65 and 75
= 𝑃(65 < 𝑥 < 75)
= 𝑃(−1 < 𝑧 < 1) = 2𝐴(1) 𝐴(1) 𝐴(1)

= 2 × 0.3413 = 0.6826

0.6826 × 1000 ≈ 683.


683 students are with marks between 65 and 75. −1 0 1

DEPARTMENT OF SCIENCE & HUMANITIES /C.E.C.


13

You might also like