Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

Random Variable - DRV

Uploaded by

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

Random Variable - DRV

Uploaded by

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

DISCRETE RANADOM VARIABLE

BANGALORE INSTITUTE OF TECHNOLOGY


Department of Mathematics

Mathematics for Computer Science (BCS301)

MODULE - I

Random variable (Stochastic variable):


A random variable is a real valued function X defined over the sample space of an experiment
i.e., random variable is a function which associates to each point of a sample space, to a unique
number. X : S  R
Random variables are denoted by X , Y or Z . More than one random variables can be defined
on the same sample space.
Eg: Tossing a coin twice.  S  HH , HT , TH , TT 

X : Number of heads in a sample point of a sample space S


X  HH   2 ; X  HT   1 ; X TH   1 ; X TT   0

X  0 , 1 , 2

Here X is called the random variable.

Types of random variable:


Discrete random variable
A random variable is called discrete if it assumes only a finite number of values or countably
infinite number of values.
Eg: i) Tossing a coin and observing the outcome
ii) The number of telephone calls received by a person.

Continuous random variable


A random variable which can take any value between two limits which may be finite or infinite
is called discrete is called continuous random variable.
 a  X  b ,    X  b ,  a  X   ,    X   
Eg: i) Height, weight, temperature
ii) Amount of rainfall on a rainy day.

DEPARTMENT OF MATHEMATICS, B.I.T 1


DISCRETE RANADOM VARIABLE

Probability distribution of random variable:


A distribution in which values of the random variable and their corresponding probabilities are
given is called probability distribution of the random variable.
Eg: Tossing a coin twice.  S  HH , HT , TH , TT 

X : Number of heads in a sample point of a sample space S


X  HH   2 ; X  HT   1 ; X TH   1 ; X TT   0

X  0 , 1 , 2

Let P  X   probability of number of heads

1
P  X  0   P  Random variable which has no head  
4
2 1
P  X  1  P  Random variable which has one head   
4 2

1
P  X  2   P  Random variable which has two head  
4 X 0 1 2

1 1 1 P X  1 1 1
P  X  0   P  X  1  P  X  2     1 4 2 4
4 2 4

Here each of the probability is a non-negative fraction (never greater than 1) and their sum is 1.

Definition:
Let us consider that a discrete random variable X assumes values x1 , x2 , x3 , x4 xn with
probabilities p1 , p2 , p3 , p4 pn respectively where

i) p1  p2  p3  p4   pn  1  p
n 1
i  1   P  xi   1

ii) 0  pi  1 for all i  1, 2,3 n i.e., P  xi   0

Cumulative distribution function:


x
The distribution function F  x   P  X  x    P  xi  , x being an integer
i 1

DEPARTMENT OF MATHEMATICS, B.I.T 2


DISCRETE RANADOM VARIABLE

Eg: i) F  0   P  X  0   P  X  0 

ii) F  2   P  X  2   P  X  0   P  X  1  P  X  2 

Note:
1) The probability of X taking the values > x i.e., F  x   P  X  x   1  P  X  x 
2) If  a, b  are the values of X with b  a then P  a  X  b   P  X  b   P  X  a 

Mean or Expectation:  or E  X 

The mean  of the probability distribution is defined as


x1 p1  x2 p2  x3 p3  x4 p4   xn pn

px i i
p 1
p1  p2  p3  p4   pn p
i
i

   pi xi

Variance: V or  2

In statistics, the variance is the measure of the speed or scatter in data. Likewise, the variability
or spread in the values of the random variable may be measured by variance.

x    p
2

V  2
 i i
p 1
p
i
i

V 2  x   p
2
i i

V 2    x    2 x   p 
2
i
2
i i

V  2
  x p    p  2  x p
2
i i
2
i i i

V 2   x p    p  2
2
i i
2
i

V  2
  x p   1  2 
2
i i
2 2

V 2 x p 
2
i i
2

Standard deviation: 

For the non-negative number  x  V ar  x  is the standard deviation of the random variable X
.

DEPARTMENT OF MATHEMATICS, B.I.T 3


DISCRETE RANADOM VARIABLE

Problems:
1. If X is a discrete random variable, where probability distribution is given by

X 2 3 11

P X  1 1 1
3 2 6

Solution:

Mean =    xi pi

  3    1    1 
  2     3     11  
        
2 2 6
4

Variance = V   2   xi2 pi   2

   3     1     1  
V   2   4     9     121    42
   2     2     6  
V   2  10

Standard deviation = V  
SD    3.1622
2. The probability distribution of a finite random variable X is given by the following
table

X 2 1 0 1 2 3

P X  0.1 k 0.2 2k 0.3 k

i) Determine the value of k and find the mean, variance and standard deviation
ii) Find P  X  1 ; P  1  X  2  ; P  X  1

Solution:
i) wkt p i 1

DEPARTMENT OF MATHEMATICS, B.I.T 4


DISCRETE RANADOM VARIABLE

 0.1  k  0.2  2k  0.3  k  1


 0.6  4k  1
 4k  1  0.6
 4k  0.4
 k  0.1

Probability distribution is given by

X 2 1 0 1 2 3

P X  0.1 0.1 0.2 0.2 0.3 0.1

Mean =    xi pi

   2  0.1   1 0.1   0  0.2   1 0.2    2  0.3   3 0.1


   0.2    0.1   0    0.2    0.6    0.3
  0.8

Variance = V   2   xi2 pi   2

V   2   4  0.1  1 0.1   0  0.2   1 0.2    4  0.3   9  0.1   0.8 
2

V   2  0.4  0.1   0   0.2  1.2  0.9   0.8 


2

V   2  2.16

Standard deviation = V  
SD    1.4697
ii) P  X  1
P  X  1  1  P  X  1 P  X  1  P  X  2   P  X  1  P  X  0 
P  X  1  1  P  X  1  P  X  2   P  X  3 P  X  1   0.1   0.1   0.2 
P  X  1  1   0.2    0.3   0.1 or P  X  1  0.4
P  X  1  1  0.6
P  X  1  0.4

DEPARTMENT OF MATHEMATICS, B.I.T 5


DISCRETE RANADOM VARIABLE

P  1  X  2 
P  1  X  2   P  X  0   P  X  1  P  X  2 
P  1  X  2    0.2    0.2    0.3
P  1  X  2   0.7

P  X  1
P  X  1  1  P  X  1 P  X  1  P  X  0   P  X  1  P  X  2   P  X  3
P  X  1  1  P  X  2   P  X  1  P  X  1   0.2    0.2    0.3   0.1
P  X  1  1   0.1   0.1 or P  X  1  0.8
P  X  1  1  0.2
P  X  1  0.8

3. A random variable X has the following probability function values of X is given by


the following table

X 0 1 2 3 4 5 6 7

P X  0 k 2k 2k 3k k2 2k 2 7k 2  k

Find i )k ii ) P  X  6  iii ) P  X  6  iv) P  3  X  6 

Solution:
i) wkt p i 1

 0  k  2k  2k  3k  k 2  2k 2  7k 2  k  1
 10k 2  9k  1
 10k 2  9k  1  0
 10k  1 k  1  0
 k  0.1 & k  1 P X   0

Probability distribution is given by

X 0 1 2 3 4 5 6 7

P X  0 0.1 0.2 0.2 0.3 0.01 0.02 0.17

DEPARTMENT OF MATHEMATICS, B.I.T 6


DISCRETE RANADOM VARIABLE

P  X  6

P  X  6  1  P  X  6
P  X  6   1  P  X  6   P  X  7  
P  X  6   1   0.02    0.17 
P  X  6   1  0.19
P  X  6   0.81

P  X  6

P  X  6  P  X  6  P  X  7 
P  X  6    0.02    0.17 
P  X  6   0.19

P 3  X  6
P  3  X  6   P  X  4   P  X  5  P  X  6 
P  3  X  6    0.3   0.01   0.02 
P  3  X  6   0.33

4. A random variable X takes the values 1, 2, 3, 4 such that


2 P  X  1  3P  X  2   P  X  3  5P  X  4  find the probability distribution
function of X . Find the cumulative probability function of X
Solution: Let us consider the probability distribution as

X 1 2 3 4

P X  p1 p2 p3 p4

Given 2 P  X  1  3P  X  2   P  X  3  5P  X  4 

DEPARTMENT OF MATHEMATICS, B.I.T 7


DISCRETE RANADOM VARIABLE

2 p1  3 p2  p3  5 p4
2
2 p1  3 p2  p2  p1 i
3
2 p1  p3  p3  2 p1 ii
2
2 p1  5 p4  p4  p1 iii
5
wkt p i 1

 p1  p2  p3  p4  1
2 2
 p1  p1  2 p1  p1  1 Substituting i , ii & iii
3 5
 2 2
 p1 1   2    1
 3 5
 15  10  30  6 
 p1   1
 15 
 61 
 p1    1
 15 
15
 p1 
61
Substituting p1 in i , ii & iii
2 10
i  p2  p1  p2 
3 61
30
ii  p3  2 p1  p3 
61
2 6
iii  p4  p1  p3 
5 61

Probability distribution and cumulative probability distribution function is given by

X 1 2 3 4

P X  15 10 30 6
61 61 61 61

FX  15 25 55 61
61 61 61 61

DEPARTMENT OF MATHEMATICS, B.I.T 8


DISCRETE RANADOM VARIABLE

5. A random variable X takes the values -3, -2, -1, 0, 1, 2, 3, such that
P  X  3  P  X  2   P  X  1  P  X  1  P  X  2   P  X  3 and
P  X  0   P  X  0  . Find the probability distribution function of X .
Solution: Let us consider the probability distribution as

X 3 2 1 0 1 2 3

P X  p1 p2 p3 p4 p5 p6 p7

Given P  X  3  P  X  2   P  X  1  P  X  1  P  X  2   P  X  3

p1  p2  p3  p5  p6  p7  p 1

and P  X  0   P  X  0 
p4  p1  p2  p3  3 p 2
wkt p i 1

 p1  p2  p3  p4  p5  p6  p7  1
 p  p  p  3p  p  p  p 1
 9p 1
1 1
 p & p4  3 p 
9 3
Probability distribution of random variable is given by

X 3 2 1 0 1 2 3

P X  1 1 1 1 1 1 1
9 9 9 3 9 9 9

6. A coin is tossed three times. Let X denote the number of heads showing up. Find
the distribution of X . Also find its mean, variance and standard deviation.
Solution: Tossing a coin thrice.
S  HHH , HHT , HTH , HTT , THT , THH , TTH , TTT 

X : Number of heads in a sample point of a sample space S


X  0 , 1 , 2 ,3

Let P  X   probability of number of heads

DEPARTMENT OF MATHEMATICS, B.I.T 9


DISCRETE RANADOM VARIABLE

1
P  X  0   P  Random variable which has no head  
8
3
P  X  1  P  Random variable which has one head  
8
3
P  X  2   P  Random variable which has two head  
8
1
P  X  3  P  Random variable which has three head  
8
Probability distribution of random variable is given by

X 0 1 2 3

P X  1 3 3 1
8 8 8 8

Mean =    xi pi

           
   0  18  1 3 8   2  3 8   3 18

  3 2  1.5

Variance = V   2   xi2 pi   2

    1  38    4  38   9  18   1.5


V   2   0 1
8
2

V   2  0.75

Standard deviation = V  
SD    0.866

7. A box contains 12 items of which 4 are defective. A sample of 3 items is selected


from the box. Let X denotes the number of defective items in the sample. Find the
probability distribution of X . Determine the mean and standard deviation of the
distribution.
Solution: Total number of items = 12 (4 defective and 8 non-defective).
The number of ways of selecting 3 items out of 12 = o  S   12C3  55
X : Number of defective items selected out of 3 items.
X  0 , 1 , 2 ,3

DEPARTMENT OF MATHEMATICS, B.I.T 10


DISCRETE RANADOM VARIABLE

Let P  X   probability of selecting defective items selected out of 3 items.


8
C3 14
P  X  0   P  Random variable having no defective items   12

C3 55
4
C1 8C2 28
P  X  1  P  Random variable having one defective items   12 
C3 55
4
C2 8C1 12
P  X  2   P  Random variable having two defective items   12

C3 55
4
C3 1
P  X  3  P  Random variable having three defective items   12

C3 55
Probability distribution of random variable is given by

X 0 1 2 3

P X  14 28 12 1
55 55 55 55

Mean =    xi pi

       
   0  14 55  1 28 55   2  12 55   3 155    
 1

Variance = V   2   xi2 pi   2

V 2   0 14 55  1  28 55   4 12 55  9  155  1 2

V   2  30  0.54
55

Standard deviation = V  

SD    0.54
8. From the sealed box containing 3 white and 9 red balls, obtain the probability
distribution of the number of white balls when 2 balls are drawn at random. Also,
find the mean and standard deviation.
Solution: Total number of balls = 12 (3 white and 9 red balls).
The number of ways of selecting 2 items out of 12 = o  S   12C2  22
X : Number of 2 white balls selected out of 3.

DEPARTMENT OF MATHEMATICS, B.I.T 11


DISCRETE RANADOM VARIABLE

X  0 , 1 , 2 

Let P  X   probability of selecting zero white balls out of 3.


3
C0 9C2 12
P  X  0   P  Random variable having no white balls   12

C2 22
3
C1 9C1 9
P  X  1  P  Random variable having one white balls   12

C2 22
3
C2 9C0 1
P  X  2   P  Random variable having two white balls   12 
C2 22

Probability distribution of random variable is given by

X 0 1 2

P X  12 9 1
22 22 22

Mean =    xi pi

        
   0  12 22  1 9 22   2  1 22

  1 2  0.5

Variance = V   2   xi2 pi   2

V 2   0 12 22  1  9 22   4  122   0.5 2

V   2  15  0.6812
22
9. A pair of dice is rolled once. Let X be the random variable whose value for any
outcome is the sum of the two numbers on the dice.
i) Find the probability distribution of X
ii) Find the probability that X is an odd number
iii) Find P  5  X  8  .

Solution: A pair of dice is rolled = o  S   62  36

1  x  6 is 1st die
Let  x, y  where
1  y  6 is 2nd die

DEPARTMENT OF MATHEMATICS, B.I.T 12


DISCRETE RANADOM VARIABLE

X : Outcome is the sum of the two numbers on the dice


X   2,3, 4,5, 6, 7,8,9,10,11,12 

Let P  X   probability of getting the outcome as the sum of the two numbers on the dice

X Sum of 2 numbers No. of times happening

2 1,1 1

3 1, 2  ,  2,1 2

4 1,3 ,  3,1 ,  2, 2  3

5 1, 4  ,  4,1 ,  2,3 ,  3, 2  4

6 1,5 ,  5,1 ,  2, 4  ,  4, 2  ,  3,3 5

7 1, 6  ,  6,1 ,  2,5 ,  5, 2  , 3, 4  ,  4,3 6

8  2, 6  ,  6, 2  ,  3,5 ,  5,3 ,  4, 4  5

9  3, 6  ,  6,3 ,  4,5  , 5, 4  4

10  4, 6  ,  6, 4  ,  5,5  3

11  5, 6  ,  6,5 2

12  6, 6  1

Probability distribution of random variable is given by

X 2 3 4 5 6 7 8 9 10 11 12

P X  1 2 3 4 5 6 5 4 3 2 1
36 36 36 36 36 36 36 36 36 36 36

ii) Probability that X is an odd number

DEPARTMENT OF MATHEMATICS, B.I.T 13


DISCRETE RANADOM VARIABLE

  P  X  3  P  X  5   P  X  7   P  X  9   P  X  11
2  4 6 4 2
36 36 36 36 36
 18
36
iii) P  5  X  8 

P  5  X  8  P  X  5  P  X  6   P  X  7   P  X  8
P  5  X  8  4 5 6 5
36 36 36 36
P  5  X  8   20  5
36 9
10. A die is tossed thrice. A success is getting ‘1 or 6’ on a toss. Find the mean and
variance of the number of successes.
Solution: Number of ways of tossing a die thrice = o  S   63
X : Number of success (Success is getting 1 or 6 in all three trials)
X  0 , 1 , 2, 3 

Let P  X   Probability of getting success as 1 or 6.

P  X  0   P  Random variable having no successs   P  r.v not getting1or 6 in each trial 


444 8
P  X  0  
6 6 6 27

P  X  1  P  Random variable having one success 


 P  r.v getting1or 6 in 1st trial  or P  r.v getting1or 6 in 2nd trial  or P  r.v getting1or 6 in 3rd trial 
2 4 4 4 2 4 4 4 2 12
P  X  1    
6 6 6 6 6 6 6 6 6 27

P  X  2   P  Random variable having two success 


 P  r.v getting1or 6 in 1st trial  or P  r.v getting1or 6 in 2nd trial  or P  r.v getting1or 6 in 3rd trial 
224 242 422 6
P  X  2    
6 6 6 6 6 6 6 6 6 27

DEPARTMENT OF MATHEMATICS, B.I.T 14


DISCRETE RANADOM VARIABLE

P  X  3  P  Random variable having 3 successs   P  r.v getting1or 6 in all 3times 


222 1
P  X  3  
6 6 6 27

Probability distribution of random variable is given by

X 0 1 2 3

P X  8 12 6 1
27 27 27 27

Mean =    xi pi

           
   0  8 27  1 12 27   2  6 27   3 1 27

 1

Variance = V   2   xi2 pi   2

DEPARTMENT OF MATHEMATICS, B.I.T 15


DISCRETE RANADOM VARIABLE

DISCRETE PROBABILITY DISTRIBUTION


Question Bank

1 Define random variable and classify them with an example.


2 The probability distribution of a random variable X is given by the following data:
X -2 -1 0 1 2 3
P(X) 0.1 k 0.2 2k 0.3 k

i) Find the value of k and calculate the mean and variance


ii) Find P X  1, PX  1 .
3 Find the men and variance of the probability distribution given by the following table
X 0 1 2 3 4
P(X) 0.2 0.35 0.25 0.15 0.05
4 The probability density function of a variate X is
X 0 1 2 3 4 5 6
P(X) k 3k 5k 7k 9k 11k 13k

For what value of k this represents a valid probability distribution and find
P X  4, P X  5, P3  X  6 . Determine the minimum value of k so that P X  2   0.3
, also find mean and variance of the distribution.
5 A random variable X has the following probability function:
X 0 1 2 3 4 5 6 7
P(X) 0 k 2k 2k 3k k2 2k2 7k2 +k

i) Find the value of k


ii) Evaluate P X  6, P X  6, P0  X  5 .
6 Suppose a random variable X takes the values -3, -1, 2 and 5 with respective probabilities
2k  3 k  2 k  1 k  1
, , , . Find the value of k and also find P 3  X  4 and P X  2 .
10 10 10 10
7 If a random variable X takes the value 1, 2, 3, 4 such that
2 P X  1  3P X  2  P X  3  5P X  4 . Find the probability distribution. And
find cumulative probability of X

DEPARTMENT OF MATHEMATICS, B.I.T 16


DISCRETE RANADOM VARIABLE

8 A random variable X takes the value -3, -2, -1, 0, 1, 2, 3 such that
P X  3  P X  2  P X  1  P X  1  P X  2  P X  3 and
P X  0  P X  0. Find the probability distribution
9 Find the value of k such that the following represents a finite probability distribution
X -3 -2 -1 0 1 2 3
P(X) k 2k 3k 4k 3k 2k k

Find mean and standard deviation and also find P X  1, P X  1, P 1  X  2 .
10
A random variable X has the following probability mass function
X 0 1 2 3 4 5 6 7 8
P(X) a 3a 5a 7a 9a 11a 13a 15a 17a

i) Determine the value of a


ii) Find P X  3, P X  3, P0  X  5
iii)Find the cumulative distribution function of X
iv) What is the smallest value of X for which P X  x   0.5 .
11 A coin is tossed thrice. A random variable X represents the number of heads turning up.
Find the discrete probability distribution for X. Also find mean and variance of the
distribution.
12 A die is tossed thrice. A success is getting ‘1 or 6’ on a toss. Find the mean and variance of
the number of successes.
13 A random variable X has the following probability mass function

X 0 1 2 3 4 5
P(X) k 3k 5k 7k 9k 11k

Find k, P X  3, P3  X  5, P X  3 and P X  3 .

DEPARTMENT OF MATHEMATICS, B.I.T 17


DISCRETE RANADOM VARIABLE

14 A probability of random variable X is given in the following table

X 0 1 2 3 4 5
P X  k 5k 10k 10k 5k k

Find k, P  X  1 , P  0  X  3 .

15 A pair of dice is rolled once. Let X be the random variable whose value for any outcome is
the sum of the two numbers on the dice.
i) Find the probability distribution of X
ii) Find the probability that X is an odd number
iii) Find P  5  X  8  .

16 A box contains 12 items of which 4 are defective. A sample of 3 items is selected from the
box. Let X denotes the number of defective items in the sample. Find the probability
distribution of X. Determine the mean and standard deviation of the distribution.
17 Five defective bulbs are accidently mixed with twenty good bulbs. It is not possible to just
look at a bulb and tell whether or not it is defective. Find the probability distribution of the
number of defective bulbs, if four bulbs are drawn at random.
18 From the sealed box containing 3 white and 9 red balls, obtain the probability distribution
of the number of white balls when 2 balls are drawn at random. Also, find the mean and
standard deviation.

DEPARTMENT OF MATHEMATICS, B.I.T 18

You might also like