Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Advanced Engineering Mathematics

B.Tech. 2nd Year, III-Semester


Computer Science & Engineering
Lecture-3: Random Variables (Part-1)

Dr. Kamlesh Jangid


Department of HEAS (Mathematics)
Rajasthan Technical University, Kota-324010, India
E-mail: kjangid@rtu.ac.in

Dr. Kamlesh Jangid, UD, RTU, Kota 1


Outline

Random Variables

Probability Distribution Function of a Discrete Random Variable

Distribution Function for Discrete Random Variable


Probability Distribution Function of a Continuous Random
Variable

Distribution Function of a Continuous Random Variable

Dr. Kamlesh Jangid, UD, RTU, Kota 2


Random Variables
Random variable is a real valued function whose domain is
sample space. Thus if X is a random variable and S is sample
space then

X : S → R ⇒ X(xi ) = wi , where xi ∈ S and wi ∈ R.

Example (Ex-1:)
Suppose that a coin is tossed twice so that the sample space is
S = {HH, HT, TH, TT}. Let X represent the number of heads
that can come up. With each sample point we can associate a
number for X as shown below
Dr. Kamlesh Jangid, UD, RTU, Kota 3
Sample Point HH HT TH TT
X = Random Variable 2 1 1 0
There are two types of random variables follow as:
1. Discrete Random Variable: If a random variable assume
only a finite number or countably infinite numbers of values
of x, then X is called discrete random variable.
2. Continuous Random Variable: If a random variable takes an
infinite set of points in given interval or noncountably
infinite number of values of x, then X is called nondiscrete
or continuous random variable.

Remark
Random variable may be one-one or many one function.
Dr. Kamlesh Jangid, UD, RTU, Kota 4
Probability Distribution Function of a Discrete
Random Variable
Let X be a discrete random variable, and suppose that the
possible values that it can assume are given by x1 , x2 , x3 , ...,
arranged in some order. Suppose also that these values are
assumed with probabilities given by

P(X = xi ) = f (xi ) i = 1, 2, 3... (1)

The distribution obtained by taking the possible values of the


random variable together with their respective probabilities is
called probability distribution function or probability function.
Dr. Kamlesh Jangid, UD, RTU, Kota 5
In other words, the probability distribution of a discrete random
variable is the set of ordered pairs (xi , P(X = xi )) or (xi , f (xi ))
provided that
(i) f (x) ≥ 0
X
(ii) f (x) = 1 (sum is taken over all possible values of x)
x
A probability distribution function for a discrete random variable
is also known as probability mass function (PMF).

Example (Ex-2:)
Find the probability function corresponding to the random
variable X of Example-1.

Dr. Kamlesh Jangid, UD, RTU, Kota 6


Solution: Assuming that the coin is fair, we have
1 1 1 1
P(HH) = , P(HT) = , P(TH) = , P(TT) =
4 4 4 4
Then

1
P(X = 0) = P(TT) =
4
1 1 1
P(X = 1) = P(HT ∪ TH) = P(HT) + P(TH) = + =
4 4 2
1
P(X = 2) = P(HH) =
4
The probability function is thus given by

X=x 0 1 2
P(X = x) = f (x) 1/4 1/2 1/4

Dr. Kamlesh Jangid, UD, RTU, Kota 7


Distribution Functions for Random Variables
The cumulative distribution function, or briefly the distribution
function, for a random variable X is defined by

F(x) = P(X ≤ x), where x is any real number (2)

The distribution function F(x) has the following properties:


1. F(x) is non decreasing.
2. lim F(x) = 0; lim F(x) = 1.
x→−∞ x→∞

3. F(x) is continuous from the right (i.e., lim+ F(x + h) = F(x)


h→0
for all x)

Dr. Kamlesh Jangid, UD, RTU, Kota 8


Distribution Function for Discrete Random
Variable
The distribution function or cumulative distribution function for a
discrete random variable X can be obtained from its probability
function by noting that, for all x ∈ R,
X
F(x) = P(X ≤ x) = f (u) (3)
u≤x

where the sum is taken over all values u taken on by X for which
u ≤ x.
If X takes on only a finite number of values x1 , x2 , ..., xn , then the
distribution function is given by
Dr. Kamlesh Jangid, UD, RTU, Kota 9



 0 −∞ < x < x1

x1 ≤ x < x2

 f (x1 )



F(x) = f (x1 ) + f (x2 ) x2 ≤ x < x3
.. ..


. .






 f (x ) + · · · + f (x ) xn ≤ x < ∞
1 n

Example (Ex-3:)
Find the distribution function for the random variable X of
Example-2.



 0 −∞ < x < 0

0≤x<1

 1/4
Sol.: The distribution function is F(x) =


 3/4 1≤x<2


 1 2≤x<∞
Dr. Kamlesh Jangid, UD, RTU, Kota 10
Probability Distribution Function of a Continuous
Random Variable
The probability distribution function or probability density
function (PDF) is the probability of the continuous random
variable falling within a particular range of values and defined as:
Z b
P(a < X < b) = f (x) dx (4)
a

The density function f (x) satisfy the following:


[1.] f (x) ≥ 0 for all x ∈ R
R∞
[2.] −∞ f (x)dx = 1.

Dr. Kamlesh Jangid, UD, RTU, Kota 11


Distribution Function of a Continuous Random
Variable

The distribution function or cumulative distribution function of a


continuous random variable is defined as
Z x
F(x) = P(X ≤ x) = f (u)du (−∞ < x < ∞) (5)
−∞

where the function f (x) has the following properties:


1. f (x) ≥ 0 for all x ∈ R
R∞
2. −∞ f (x)dx = 1.

Dr. Kamlesh Jangid, UD, RTU, Kota 12


Example (Ex-4:)
(a) Findthe constant c such that the function
 cx2 , 0 < x < 3
f (x) =
 0, otherwise
is a density function, and (b) compute P(1 < X < 2).

Solution
R∞
(a) Since −∞
f (x)dx = 1 as f (x) is a density function. Thus
Z ∞ Z 3
1
f (x)dx = 1 ⇒ cx2 dx = 1 ⇒ c = .
−∞ 0 9
R2 R21 2 7
(b) P(1 < X < 2) = 1
f (x)dx = 1 9
x dx = 27
.

Dr. Kamlesh Jangid, UD, RTU, Kota 13


Exercise
Example (Ex-5:)
A lot of 10 items contains 3 defective from which a sample of 4
times is drawn without replacement. Let X be the random
variable being the number of defective item in the sample. Find
(i) probability distribution of X, (ii)P(X < 1), (iii)P(0 < X < 2).

Solution
Here, X takes the values 0, 1, 2 and 3. First we find the
probability
7
C4 1
P(X = 0) = P(no defective) = 10 C
=
4 6
Dr. Kamlesh Jangid, UD, RTU, Kota 14
3
C1 ×7 C3 1
P(X = 1) = P(one defective) = 10 C
=
4 2
3 7
C2 × C2 3
P(X = 2) = P(two defective) = 10 C
=
4 10
3 7
C3 × C1 1
and P(X = 3) = P(three defective) = 10 C
=
4 30
(i) Hence, the probability distribution of X is given by

X 0 1 2 3
P(X) 1/6 1/2 3/10 1/30
1
(ii) P(X < 1) = P(X = 0) =
6
1
(iii) P(0 < X < 2) = P(X = 1) = .
2
Dr. Kamlesh Jangid, UD, RTU, Kota 15
Example (Ex-6:)
If a random variable X takes the values 1, 2, 3 and 4 such that

2P(X = 1) = 3P(X = 2) = P(X = 3) = 5P(X = 4)

Find the probability distribution of X.

Solution
Let P(X = 3) = k, then from given relation, we get

k k k
P(X = 1) = , P(X = 2) = , and P(X = 4) = .
2 3 5

Since the total probability is always 1, we have

Dr. Kamlesh Jangid, UD, RTU, Kota 16


P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4) = 1
k k k 61k 30
⇒+ +k+ =1⇒ =1⇒k=
2 3 5 30 61
Hence, the distribution is
X=x 1 2 3 4
P(x) 15/61 10/61 30/61 6/61

Example (Ex-7:)
A random variable X has the following probability distribution

X=x 0 1 2 3 4 5 6 7
P(x) 0 k 2k 2k 3k k2 2k2 7k2 + k

Dr. Kamlesh Jangid, UD, RTU, Kota 17


Find (i) The value of k, (ii)P(1.5 < X < 4.5), (iii) The smallest
1
value of λ for which P(X ≤ λ) > .
2
Solution
(i) For probability distribution function

X 7
X
P(x) = 1 ⇒ P(X = x) = 1
x x=0

⇒ 0 + k + 2k + 2k + 3k + k2 + 2k2 + 7k2 + k = 1
1
⇒ 10k2 + 9k − 1 = 0 ⇒ k = or − 1
10
1
the value k = −1 is not possible, therefore k = .
10

Dr. Kamlesh Jangid, UD, RTU, Kota 18


(ii) P(1.5 < X < 4.5) = P(X = 2) + P(X = 3) + P(X = 4)
1 1 1 7
= 2. + 2. + 3. =
10 10 10 10
(iii) The distribution function of X is easily obtained as

 0 ;0 ≤ x < 1

 1 ;1 ≤ x < 2
 10
 3
 110 ; 2 ≤ x < 3


;3 ≤ x < 4
F(x) = 42 ; 4 ≤ x < 5
 5

 81 ;5 ≤ x < 6
 100
 83
 ;6 ≤ x < 7

 100
1 ;x ≥ 7

Hence, it is clear that the smallest value of λ for which


1
P(X ≤ λ) > is λ = 4.
2
Dr. Kamlesh Jangid, UD, RTU, Kota 19
Example (Ex-8:)
Given the probability density function of a random variable X as
follows:

12.5x − 1.25 ; 0.1 ≤ x ≤ 0.5

f (x) =
0 ; elsewhere

Find P(0.2 ≤ X ≤ 0.3).

Solution
Given 
12.5x − 1.25 ; 0.1 ≤ x ≤ 0.5

f (x) =
0 ; elsewhere

Dr. Kamlesh Jangid, UD, RTU, Kota 20


Z 0.3 Z 0.3
∴ P(0.2 ≤ x ≤ 0.3) = f (x)dx = (12.5x − 1.25)dx
0.2 0.2
Z 0.3
0.3
(10x − 1)dx = 1.25 5x2 − x 0.2

= 1.25
0.2

= 1.25 [0.15 − 0] = 0.1875

Example (Ex-9:)
The diameter of an electric cable X is a continuous random
variable with

kx(1 − x) ; 0 ≤ x ≤ 1

f (x) =
0 ; elsewhere

Dr. Kamlesh Jangid, UD, RTU, Kota 21


Find (i) The value of k, (ii) The cumulative distribution function
of X, (iii)P(X ≤ 12 | 21 ≤ X ≤ 25 ).

Solution
(i) To find value of k, we use the property
Z ∞ Z 1
f (x)dx = 1 ⇒ kx(1 − x)dx = 1
−∞ 0
1
x2 x3
  
1 1
⇒k − =1⇒k − =1⇒k=6
2 3 0 2 3

Hence
f (x) = 6x(1 − x) ; 0 ≤ x ≤ 1.

Dr. Kamlesh Jangid, UD, RTU, Kota 22


(ii) The cumulative distribution function is given by
Z x
F(x) = f (x)dx
−∞

clearly, for x < 0; F(x) = 0.


Rx Rx
For 0 ≤ x < 1; F(x) = 0 f (x)dx = 6 0 x(1 − x)dx = 3x2 − 2x3
also, for x ≥ 1; F(x) = 1.
Hence, we have




 0 ;x < 0

F(x) = 3x2 − 2x3 ;0 ≤ x < 1



1 ;x ≥ 1

Dr. Kamlesh Jangid, UD, RTU, Kota 23


(iii) Let A = {X ≤ 12 } and B = { 21 ≤ X ≤ 52 }
∴ the required probability is

P(A ∩ B)
P(A|B) =
P(B)

since
  Z 2/5
1 2 2/5
P(B) = P <X< = 6x(1 − x)dx = (3x2 − 2x3 )1/2
2 5 1/2

and P (A ∩ B) = P (X = 1/2) = 0.
Thus
P (A|B) = 0.

Dr. Kamlesh Jangid, UD, RTU, Kota 24


Example (Ex-10:)
A continuous random variable X has a probability density
function
f (X) = 3x2 ; 0 ≤ x ≤ 1

Find a and b such that (i)P(X ≤ a) = P(X > a), and


(ii)P(X > b) = 0.05

Solution
(i) Since P(X > a) = 1 − P(X ≤ a)

∴ P(X ≤ a) = 1 − P(X ≤ a) (using P(X ≤ a) = P(X > a))


1
⇒ 2P(X ≤ a) = 1 ⇒ P(X ≤ a) = = 0.5
2
Dr. Kamlesh Jangid, UD, RTU, Kota 25
Therefore
Z a Z a
1
f (x)dx = 0.5 ⇒ 3x2 dx =
−∞ 0 2
  31
1 1
⇒ a3 = ⇒a= .
2 2

∞ Z
1
(ii) Given P(X > b) = 0.05 ⇒ f (x)dx =
b 20
Z 1
1 1
⇒ 3x2 dx = ⇒ 1 − b3 =
b 20 20
  31
19
⇒b=
20

Dr. Kamlesh Jangid, UD, RTU, Kota 26


Example (Ex-11:)
The distribution function for a random variable X is

 1 − e−2x , x ≥ 0
F(x) =
 0, x<0

Find (a) the density function, (b)P(X > 2), and


(c)P(−3 < X ≤ 4).

Solution 
d F(x)  2e−2x , x > 0
(a) The density function is f (x) = =
dx  0, x<0

Dr. Kamlesh Jangid, UD, RTU, Kota 27


(b) Z ∞
P(X > 2) = 2e−2u du = e−4 .
2
(c)
Z 4
P(−3 < X ≤ 4) = f (u)du
−3
Z 0 Z 4
= 0 du + 2e−2u du
−3 0

= 1 − e−8 .

Dr. Kamlesh Jangid, UD, RTU, Kota 28


THANK YOU

Dr. Kamlesh Jangid, UD, RTU, Kota 29

You might also like