Module-2 (Correction and Regression)
Module-2 (Correction and Regression)
. Module-2 . 2 / 122
One is naturally concerned with the number of defectives that occur.
Thus, each point in the sample space will be assigned a numerical value of
0, 1, 2, or 3. These values are, of course, random quantities determined by
the outcome of the experiment. They may be viewed as values assumed by
the random variable X , the number of defective items when three
electronic components are tested.
. Module-2 . 3 / 122
Example
. Module-2 . 4 / 122
The variable X , representing the number of red balls in a sample of S.
Define X : S −→ R by
X (s1 ) = 2
X (s2 ) = 1
X (s3 ) = 1
X (s4 ) = 0
where si ∈ S, i = 1, 2, 3, 4.
Thus the variable X is called a random variable with the values x is 0, 1, 2.
. Module-2 . 5 / 122
If a sample space contains a finite number of possibilities or an unending
sequence with as many elements as there are whole numbers, it is called a
discrete sample space.
. Module-2 . 6 / 122
Discrete Probability Distributions
X (s1 ) = 2
X (s2 ) = 1
X (s3 ) = 1
X (s4 ) = 0.
. Module-2 . 7 / 122
Thus the random variable X and the values of x with the probability
values of x is given below table.
X 0 1 2
1 1 1
P(x)=P(X=x) 4 2 4
The set of ordered pairs (x, P(x)) is called the probability mass function,
probability function, or probability distribution of the discrete random
variable X .
. Module-2 . 8 / 122
Probability mass function
P(x) ≥ 0
P
P(x) = 1.
x
. Module-2 . 9 / 122
Example
. Module-2 . 10 / 122
Thus, the probability distribution of X is given below table.
X 0 1 2
68 51 3
P(x)=P(X=x) 95 190 190
. Module-2 . 11 / 122
Continuous Probability Distributions
Let us discuss a random variable whose values are the heights of all people
over 21 years of age.
Between any two values, say 163.5 and 164.5 centimeters, or even 163.99
and 164.01 centimeters, there are an infinite number of heights, one of
which is 164 centimeters.
. Module-2 . 12 / 122
The probability of selecting a person at random who is exactly 164
centimeters tall and not one of the infinitely large set of heights so close to
164 centimeters that you cannot humanly measure the difference is
remote, and thus we assign a probability of 0 to the event.
This is not the case, however, if we talk about the probability of selecting
a person who is at least 163 centimeters but not more than 165
centimeters tall.
Now we are dealing with an interval rather than a point value of our
random variable.
. Module-2 . 13 / 122
We shall concern ourselves with computing probabilities for various
intervals of continuous random variables such as
P(a < X < b), P(W ≥ c), and so forth. Note that when X is continuous,
P(a < X ≤ b) = P(a < X < b) + P(X = b) = P(a < X < b). That is, it
does not matter whether we include an endpoint of the interval or not.
This is not true, though, when X is discrete.
. Module-2 . 14 / 122
Should this range of X be a finite interval, it is always possible to extend
the interval to include the entire set of real numbers by defining f (x) to be
zero at all points in the extended portions of the interval.
. Module-2 . 15 / 122
. Module-2 . 16 / 122
Probability density function
The function f (x) is a probability density function (pdf) for the continuous
random variable X , defined over the set of real numbers, if
fZ(x) ≥ 0, for all x ∈ R,
∞
f (x)dx = 1.
−∞
Example
Suppose that the error in the reaction temperature, in C, for a controlled
laboratory experiment is a continuous random variable X having the
probability density function
x 2 , −1 < x < 2
3
f (x) =
0.
elsewhere.
. Module-2 . 17 / 122
Example Cont...
Solution
For(1),
Obviously, f (x) ≥ 0. To verify condition
Z ∞
f (x)dx = 1.
−∞
. Module-2 . 18 / 122
Example Cont...
Now,
Z ∞ Z −∞ Z 2 Z ∞
f (x)dx = f (x)dx + f (x)dx + f (x)dx
−∞ −1 −1 2
2
x2
Z
=0+ dx + 0
−1 3
2
x3
=
3×3 −1
8 (−1)
= −
9 9
8 (1)
= +
9 9
= 1.
. Module-2 . 19 / 122
Example Cont...
For(2),
Z 1
P(0 < X ≤ 1) = f (x)dx
0
1
x2
Z
= dx
0 3
3 1
x
=
3×3 0
1
= −0
9
1
= .
9
. Module-2 . 20 / 122
Cumulative distribution function
. Module-2 . 21 / 122
Problem
X -2 -1 0 1 2 3
P(X) 0.1 k 0.2 2k 0.3 k
1 Find k.
2 Evaluate P(X ≤ 2) and P(−1 ≤ X ≤ 2).
3 Find the cumulative distribution function.
. Module-2 . 22 / 122
Solution
P
For(1), since P(x) is p.m.f, and P(x) = 1. , it follows that we get
x
X
P(x) = 1
x
0.6 + 4k = 1
4k = 0.4
0.4
k=
4
k = 0.1
. Module-2 . 23 / 122
Solution Cont...
X -2 -1 0 1 2 3
P(X) 0.1 0.1 0.2 0.2 0.3 0.1
For(2),
= 0.9
OR
. Module-2 . 24 / 122
Solution Cont...
= 1 − P(X = 3)
= 1 − 0.1
= 0.9
Now,
= 0.8
. Module-2 . 25 / 122
Solution Cont...
P
F (x) = P(X ≤ x) = P(X = t).
t≤x
P(X ≤ −2) = 0.1, If x = −2
P(X ≤ −1) = 0.2, If x = −1
P(X ≤ 0) = 0.4,
If x = 0
F (x) =
P(X ≤ 1) = 0.6, If x = 1
P(X ≤ 2) = 0.9, If x = 2
P(X ≤ 3) = 1,
If x = 3.
. Module-2 . 26 / 122
Problem
X 0 1 2 3 4 5 6 7
P(X) 0 k 2k 2k 3k k2 2k 2 7k 2 +k
1 Find k.
2 Evaluate P(X ≤ 6), P(X ≥ 6) and P((1.5 < X < 4.5)/(X > 2))
3 Find the cumulative distribution function.
. Module-2 . 27 / 122
Problem
. Module-2 . 28 / 122
Solution
. Module-2 . 29 / 122
Problem
The Department of Energy (DOE) puts projects out on bid and generally
estimates what a reasonable bid should be. Call the estimate b. The DOE
has determined that the density function of the winning (low) bid is
5 2
8b , 5b ≤ y ≤ 2b
f (y ) =
0.
elsewhere.
Find F (y ) and use it to determine the probability that the winning bid is
less than the DOE’s preliminary estimate b.
. Module-2 . 30 / 122
Solution
Z y
To find F (y ),F (y ) = P(Y ≤ y ) = f (y )dy .
−∞
Z 2b h i2b
5y 5y
For 25 b ≤ y ≤ 2b, then P(Y ≤ y ) = 5
8b dy = 8b 2
= 8b − 14 .
2
b 5
b
5
Thus,
0, y ≤ 25 b
F (y ) = 5y 1 2
8b − 4 , 5b ≤ y ≤ 2b
y ≥ 2b.
1.
. Module-2 . 31 / 122
Two dimensional random Variables
. Module-2 . 33 / 122
Joint probability distribution
Definition
The function p(x, y ) is a joint probability distribution or probability mass
function of the discrete random variables X and Y if
1 p(x, y ) ≥ 0, for all (x, y ),
PP
2 p(x, y ) = 1,
x y
where p(x, y ) = P(X = x, Y = y ).
. Module-2 . 34 / 122
Problem
Two ballpoint pens are selected at random from a box that contains 3 blue
pens, 2 red pens, and 3 green pens. If X is the number of blue pens
selected and Y is the number of red pens selected, find
1 the joint probability function p(x, y ).
2 P (X + Y ≤ 1).
. Module-2 . 35 / 122
Solution
For(1),
The possible pairs of values (x, y ) are (0, 0), (0, 1), (1, 0), (1, 1), (0, 2), and
(2, 0).
Now, p(0, 1), for example, represents the probability that a red and a
green pen are selected. The total number of equally likely ways of
selecting any 2 pens from the 8 is 82 = 28
The number of ways of selecting 1 red from 2 red pens and 1 green from 3
green pens is 21 31 = 6.
6 3
Hence, p(0, 1) = 28 = 14 .
Similar calculations yield the probabilities for the other cases, which are
presented in following table.
. Module-2 . 36 / 122
Solution Cont...
x
p(x, y ) Row Totals
0 1 2
3 9 3 15
0 28 28 28 28
3 3 3
y 1 14 14 0 7
1 1
2 28 0 0 28
5 15 3
Column Totals 14 28 28 1
Definition
The function f (x, y ) is a joint probability density function of the
continuous random variables X and Y if
1 f (x, y ) ≥ 0, for all (x, y ),
Z ∞Z ∞
2 f (x, y )dxdy = 1.
−∞ −∞
. Module-2 . 38 / 122
Problem
. Module-2 . 39 / 122
Solution
Z ∞ Z ∞
For(1), f (x, y )dxdy = 1.
−∞ −∞
Z ∞ Z ∞ Z 1Z 1
2
f (x, y )dxdy = (2x + 3y )dxdy
−∞ −∞ 0 0 5
Z 1 2 x=1
2x 6xy
= + dy
0 5 5 x=0
Z 1
2 6y
= + dy
0 5 5
y =1
3y 2
2y
= +
5 5 y =0
2 3
= +
5 5
= 1.
. Module-2 . 40 / 122
Solution Cont...
Z 1 Z 1
1 1 1 2 2 2
P 0<X < , <Y < = (2x + 3y )dxdy
2 4 2 1
0 5
4
Z 1 2 x= 12
2 2x 6xy
= + dy
1 5 5 x=0
4
Z 1
2 1 3y
= + dy
1 10 5
4
y = 21
3y 2
y
= +
10 10 y = 1
4
1 1 3 1 3 13
= + − + = .
10 2 4 4 16 160
. Module-2 . 41 / 122
The marginal distributions
Z ∞ Z ∞
fX (x) = f (x, y )dy and fY (y ) = f (x, y )dx,if (X , Y ) continuous
−∞ −∞
case.
. Module-2 . 42 / 122
The conditional distributions for discrete case
. Module-2 . 43 / 122
The conditional distributions for continuous case
. Module-2 . 44 / 122
Remark
If we wish to find the probability that the discrete random variable X falls
between a and b when it is known that the discrete variable Y = y , we
evaluate
P
P(a < X < b|Y = y ) = P(X |Y ),
a<x<b
where the summation extends over all values of X between a and b.
When X and Y are continuous,
Z b we evaluate
P(a < X < b|Y = y ) = f (x|y )dx. Similarlly,
aP
P(a < Y < b|X = x) = P(Y |X ), for (X , Y ) is discrete case
a<y <b
Z b
P(a < Y < b|X = x) = f (y |x)dy , for (X , Y ) is continuous case
a
. Module-2 . 45 / 122
Problem
x
p(x, y )
0 1 2
3 9 3
0 28 28 28
3 3
y 1 14 14 0
1
2 28 0 0
. Module-2 . 46 / 122
Solution
x
p(x, y ) PY (y )
0 1 2
3 9 3 15
0 28 28 28 28
3 3 3
y 1 14 14 0 7
1 1
2 28 0 0 28
5 15 3
PX (x) 14 28 28 1
5
, x =0
14
The marginal distributions functions of X is PX (x) = 15 , x =1
28
3,
x = 2.
28
. Module-2 . 47 / 122
Solution Cont...
15
28
, y =0
The marginal distributions functions of Y is PY (y ) = 3 , y =1
7
1,
y = 2.
28
p(x, 1)
Now,P(X /1) = = 37 p(x, 1), x = 0, 1, 2
PY (1)
Therefore,
p(0, 1) 7 7 3 1
P(0/1) = = p(0, 1) = =
PY (1) 3 3 14 2
p(1, 1) 7 7 3 1
P(1/1) = = p(1, 1) = =
PY (1) 3 3 14 2
p(2, 1) 7 7
P(2/1) = = p(2, 1) = (0) = 0.
PY (1) 3 3
. Module-2 . 49 / 122
Solution Cont...
. Module-2 . 50 / 122
Problem
For(1),
y
p(x, y ) PX (x)
1 2 3 4
4 2 5 1 12
1 36 36 36 36 36
1 3 2 1 7
2 36 36 36 36 36
x 3 3 1 1 8
3 36 36 36 36 36
2 1 1 5 9
4 36 36 36 36 36
10 9 9 8
PY (y ) 36 36 36 36 1
. Module-2 . 52 / 122
Solution Cont...
. Module-2 . 53 / 122
Solution Cont...
. Module-2 . 54 / 122
Problem
x
p(x, y )
-1 0 1
1 2 1
0 15 15 15
3 2 1
y 1 15 15 15
2 1 2
2 15 15 15
1 Find k.
2 Find the marginal distributions functions of X and Y
3 Find the conditional distribution function of X given Y = y
4 Find the conditional distribution function of Y given X = x.
5 Find P(X + Y > 3).
. Module-2 . 56 / 122
Problem
. Module-2 . 57 / 122
Problem
. Module-2 . 60 / 122
Solution Cont...
f (x, y )
f (y |x) =
fX (x)
10xy 2
= 10x(1−x 3 )
3
3y 2
= , 0 < x < y < 1.
1 − x3
f (x, y )
f (x|y ) =
fY (y )
10xy 2 2x
= = 2 , 0 < x < y < 1.
5y 4 y
. Module-2 . 61 / 122
Solution Cont...
For(2),
Z 1
1
P Y > |X = 0.25 = f (y |x = 0.25)dy
2 1
2
Z 1
3y 2
= dy
1 1 − (0.25)3
2
1
3y 3
=
3(1 − 0.016) 1
2
3 1
y
=
0.98 1
2
1 1 7
= 1− = = 0.89
0.98 8 7.84
. Module-2 . 62 / 122
Problem
. Module-2 . 63 / 122
Problem
. Module-2 . 64 / 122
Problem
1 Compute P(X > 1), P(Y < 12 ), P(X > 1|Y < 12 ) and
P(Y < 21 |X > 1)
2 Evaluate P(X < Y ) and P(X + Y ≤ 1).
. Module-2 . 65 / 122
Solution
Z 1Z 2
P(X > 1) = f (x, y )dxdy
0 1
Z 1Z 2
x2
= xy 2 + dxdy
0 1 8
Z 1 2 2 2
x y x3
= + dy
0 2 24 1
Z 1 2
2 1 y 1
= 2y + − + dy
0 3 2 24
19
=
24
. Module-2 . 66 / 122
Solution Cont...
1
Z Z 2
1 2
P(Y < ) = f (x, y )dxdy
2 0 0
1
2
x2
Z Z
2
= xy 2 +
dxdy
0 0 8
Z 1 2 2 2
2 x y x3
= + dy
0 2 24 0
Z 1
2
2 1
= 2y + dy
0 3
3 1
2y y 2 1
= + =
3 3 0 4
. Module-2 . 67 / 122
Solution Cont...
P(X >1,Y < 12 )
We know that P(X > 1|Y < 21 ) = P(Y < 21 )
.
1
Z Z 2
1 2
P(X > 1, Y < ) = f (x, y )dxdy
2 0 1
1
2
x2
Z Z
2
2
= xy + dxdy
0 1 8
Z 1 2 2 2
2 x y x3
= + dy
0 2 24 1
Z 1 2
2 1 y 1
= 2y 2 + − + dy
0 3 2 24
5
=
24
. Module-2 . 68 / 122
Solution Cont...
For(2),
Z 1Z y
P(X < Y ) = f (x, y )dxdy
0 0
Z 1Z y
x2
2
= xy + dxdy
0 0 8
Z 1 2 2 y
x y x3
= + dy
0 2 24 0
Z 1 4
y3
y
= + dy
0 2 24
5 1
y y4 53
= + =
10 96 0 480
. Module-2 . 70 / 122
Solution Cont...
Z 1 Z 1−y
P(X + Y ≤ 1) = f (x, y )dxdy
0 0
Z 1 Z 1−y
x2
= xy 2 + dxdy
0 0 8
Z 1 2 2 1−y
x y x3
= + dy
0 2 24 0
Z 1
(1 − y )2 y 2 (1 − y )3
= + dy
0 2 24
13
=
480
. Module-2 . 71 / 122
Problem
. Module-2 . 72 / 122
Statistical Independence
. Module-2 . 73 / 122
Problem
. Module-2 . 74 / 122
Problem
x
p(x, y )
0 1 2
3 9 3
0 28 28 28
3 3
y 1 14 14 0
1
2 28 0 0
. Module-2 . 75 / 122
Mean of a Random Variable (Mathematical Expectation)
Assuming that one fair coin was tossed twice, we find that the sample
space for our experiment is S = {HH, HT , TH, TT }.
Denote by X the number of heads. Since the 4 sample points are all
equally likely, it follows that
P(X = 0) = P(TT ) = 41 , P(X = 1) = P(TH) + P(HT ) = 12 , and
P(X = 2) = P(HH) = 41 , where a typical element, say TH, indicates that
the first toss resulted in a tail followed by a head on the second toss. Now,
these probabilities are just the relative frequencies for the given events in
the long run. Therefore, Mean = (0) 41 + (1) 12 + (2) 14 = 1.
. Module-2 . 76 / 122
This result means that a person who tosses 2 coins over and over again
will, on the average, get 1 head per toss.
Definition:
Let X be a random variable with probability distribution. The mean, or
P
expectedZvalue, of X is E (X ) = xp(x) if X is discrete, and
∞
E (X ) = xf (x)dx if X is continuous.
−∞
. Module-2 . 77 / 122
Problem
Let X be the random variable that denotes the life in hours of a certain
electronic device. The probability density function is
20,000
3 , x > 100
x
f (x) =
0,
elsewhere.
. Module-2 . 79 / 122
Let X be a random variable with probability distribution.
Then E (X 2 ) is
E (X 2 ) = x 2 p(x),
P
if X is discrete, and
Z ∞
E (X 2 ) = x 2 f (x)dx, if X is continuous.
−∞
. Module-2 . 80 / 122
Expected Value of a new random variable Y = g (X )
. Module-2 . 81 / 122
Problem
Suppose that the number of cars X that pass through a car wash between
4:00 P.M. and 5:00 P.M. on any sunny Friday has the following probability
distribution:
X 4 5 6 7 8 9
1 1 1 1 1 1
P(X=x) 12 12 4 4 6 6
. Module-2 . 82 / 122
Solution
x=9
X
E (Y = 2X − 1) = (2x − 1)P(X = x)
x=4
1 1 1 1
= (7) + (9) + (11) + (13)
12 12 4 4
1 1
+ (15) + (17)
6 6
= Rs.12.67
. Module-2 . 83 / 122
Problem
2 2
(4x + 3)(x 2 )
Z Z
1
E (Y = 4X + 3) = dx = (4x 3 + 3x 2 )dx = 8.
−1 3 −1 3
. Module-2 . 84 / 122
Mathematical Expectation Properties
Cov (X , Y ) = E (XY ) − E (X )E (Y )
Cov (X ,Y )
Correlation between X and Y is ρ(X , Y ) = σx σy , where σx is a
standard deviation of X and σy is a standard deviation of Y .
−1 ≤ ρ(X , Y ) ≤ 1.
. Module-2 . 85 / 122
Definition
. Module-2 . 86 / 122
Note-1
. Module-2 . 88 / 122
The expectation of X 2 is
P P 2 P 2
x p(x, y ) = x Px (x), discrete case,
X =x Y =y X =x
E (X 2 ) =
Z ∞Z ∞ Z ∞
x 2 f (x, y )dydx = x 2 fX (x)dx, continuous case.
−∞ −∞ −∞
. Module-2 . 89 / 122
Problem
x
p(x, y )
0 1 2
3 9 3
0 28 28 28
3 3
y 1 14 14 0
1
2 28 0 0
. Module-2 . 90 / 122
Solution
x
p(x, y ) PY (y )
0 1 2
3 9 3 15
0 28 28 28 28
3 3 3
y 1 14 14 0 7
1 1
2 28 0 0 28
5 15 3
PX (x) 14 28 28 1
. Module-2 . 91 / 122
Solution Cont...
y =2
x=2 X
X
E (XY ) = xyp(x, y )
x=0 y =0
Solution:We have
Z 2Z 1
Y y
E = f (x, y )dxdy
X 0 0 x
Z 1Z 2
y (1 + 3y 2 )
= dxdy
0 0 4
Z 1
y + 3y 3
5
= dy = .
0 2 8
. Module-2 . 93 / 122
Problem
. Module-2 . 94 / 122
Solution
y
p(x, y )
1 2
2 3
1 21 21
3 4
x 2 21 21
4 5
3 21 21
. Module-2 . 95 / 122
Solution Cont...
3 X
X 2
For (1), E (X ) = xp(x, y )
x=1 y =1
+ (3)p(3, 1) + (3)p(3, 2)
2 3 3 4
= (1) + (1) + (2) + (2)
21 21 21 21
4 5
+ (3) + (3)
21 21
46
= .
21
. Module-2 . 96 / 122
Solution Cont...
3 X
X 2
E (Y ) = yp(x, y )
x=1 y =1
. Module-2 . 97 / 122
Solution Cont...
3 X
X 2
For (2), E (X 2 ) = x 2 p(x, y )
x=1 y =1
. Module-2 . 98 / 122
Solution Cont...
3 X
X 2
E (Y 2 ) = y 2 p(x, y )
x=1 y =1
. Module-2 . 99 / 122
Solution Cont...
r
p 278
For (3), σx = Var (X ) = = 0.794
441
r
p 108
σy = Var (Y ) = = 0.495
441
3 X
X 2
E (XY ) = xyp(x, y )
x=1 y =1
+ (3)(1)p(3, 1) + (3)(2)p(3, 2)
+ (3)p(3, 1) + (6)p(3, 2)
2 3 3 4
= (1) + (2) + (2) + (4)
21 21 21 21
4 5 72
+ (3) + (6) = .
21 21 21
. Module-2 . 102 / 122
Solution Cont...
Cov(X,Y)
For (5), ρ(X , Y ) =
(σx )(σy )
−0.0136
=
(0.794)(0.495)
−0.0136
=
0.393
= −0.035
x
p(x, y )
0 1 2
3 9 3
0 28 28 28
3 3
y 1 14 14 0
1
2 28 0 0
The fraction X of male runners and the fraction Y of female runners who
compete in marathon races are described by the joint density function
8xy , 0≤y ≤x ≤1
f (x, y ) =
0,
elesewhere.
From these
Z 1marginal density functions, we compute
E (X ) = x4x 3 dx = 45 and
Z0 1
8
E (Y ) = y 4y (1 − y 2 )dy = 15 .
0
and E (Y 2 ) = 4y 3 (1 − y 2 )dy = 13 .
0
Cov(X,Y)
Therefore, ρ(X , Y ) = q
(σx2 )(σy2 )
4
225
=q
2 11
75 225
4
=√ .
66
0
mean = E (X ) = µ1 and
0
Variance = σ 2 = E (X 2 ) − (E (X ))2 = µ2 0 − (µ1 )2 .
0 tr
The r th moment µr is the coefficient of r! in the expansion of MX (t)
in series of powers of t.
(tx)2 (tx)r
tx tx
MX (t) = E (e ) = E 1 + + + ··· + + ...
1! 2! r!
t2 tr
= 1 + tE (x) + E (x 2 ) + · · · + E (x r ) + . . .
2! r!
0 t2 0 tr 0
= 1 + tµ1 + µ2 + · · · + µr + . . .
2! r!
0 tr
Therefore, µr is the coefficient of r! in the expansion of MX (t) in
series of powers of t.
dr
0 r
µr = E (X ) = (MX (t)) .
dt r t=0
0
h i
In particular, if r = 1 then µ1 = d(MdtX (t)) is the mean of X .
t=0
0 i r tr
µr = E (X r )=the coefficient of r! in the expansion of φX (t) in series
of ascending powers of it.
dr
0 r 1
µr = E (X ) = r (φX (t)) .
i dt r t=0
0
h i
In particular, if r = 1 then µ1 = 1i d(φdtX (t))
is the mean of X .
t=0
φaX +b (t) = e ibt φ(at)
et
Answer: MX (t) = 2−e t and mean is 2.
q q
Answer: φX (t) = p(1 − qe it )−1 , mean is p and variance is p2
.