Course No: MTH F113: Probability and Statistics
Course No: MTH F113: Probability and Statistics
Course No: MTH F113: Probability and Statistics
Pilani Campus
https://www.youtube.com/watch?v=Qfs_mvpA-vQ&t=112s
2. Probability
• Probability axioms and rules
• Important probability distributions
• Joint distributions; moments, correlation
3. Statistics
• Sample statistics
any change?
• Parameter estimation
• Testing of hypothesis
Gambler’s fallacy…
Poop by a bird…
Discrete Continuous
Discrete Continuous
8 BITS Pilani, Pilani Campus
Joint Distributions
When two or more random variables are involved in a random experiment
Toss a coin twice; S = {HH, HT, TH, TT};
• Let X and Y be random variables associated with the first and second tossing. If ‘head’
appears, then associated RV is 1, otherwise 0. Events are {(X=0, Y=0), (X=0, Y=1), (X=1,
Y=0), (X=1, Y=1)} . Can you find out what is P(X=i, Y=j), i=0,1, j= 0,1?
• Let X denote the number of ‘heads’ and Y denote the number of ‘tails’. Notice that
X+Y=2. Then possible events are {(X=0, Y=2), (X=1, Y=1), (X=2, Y=0)} . Can you find out
what is P(X=1, Y=1)? Note that in this example, events like (X=0, Y=0), (X=0, Y=1), (X=1,
Y=0), (X=1, Y=2), (X=2, Y=1), (X=2, Y=2) are impossible events, as X +Y =2.
Two balls are selected at random from a box that contains 3 blue balls, 2 red balls and 3
green balls. If X is the number of blue balls and Y is the number of red balls selected, find
P(X=1, Y=1), P(X+Y≤1).
Similarly, let X and Y be random variables associated with the height and weight of a
group of students. Find P(150≤X≤180, 50≤Y≤80).
(ii) f
all x all y
XY ( x, y ) 1
• From a known joint density f(x,y) for discrete RVs (X,Y), it is easy to find out their
respective density functions.
(i) The marginal density for X , denoted by f X x , is given by
f X x P X x f XY ( x, y )
all y
Ex.5.2. Two balls are selected at random from a box that contains 3 blue balls, 2 red
balls and 3 green balls. If X is the number of blue balls and Y is the number of red balls
selected, find pdf for (X,Y) and marginal pdfs. What is P(X+Y≤1)?
X=x 0 1 2 marginal Y
Y=y f(y) Formula used here:
0 3/28 9/28 3/28 15/28 3 2 3
1 6/28 6/28 0 12/28
f x, y
x y 2 - x - y
2 1/28 0 0 1/28 8
marginal X 10/28 15/28 3/28 Total Sum
2
f(x) 1.0
b d
The probability is computed as (i) P a X b, c Y d f XY ( x, y )dydx
y y a c
d (ii) D 2
, P( A) f ( x, y )dA
D D D
c x
x
a b 15 BITS Pilani, Pilani Campus
Joint Density for Continuous RVs
Note: In one dimensional continuous case, the probabilities
correspond to areas under density curve while in the case of
2-D, they corresponds to volumes under density surfaces.
Z
z f XY ( x, y )
Probability of
The event R
Y (in XY-plane)
is this volume.
R
X
P[ R] f XY ( x, y )dA
R 16 BITS Pilani, Pilani Campus
Marginal Density of Continuous RVs
• From a known joint density f(x,y) for continuous RVs (X,Y), it is easy to find out
their respective density functions.
Remarks:
(i) The marginal densities are also density functions (Verify!)
(ii) Thus, f X x and fY y will follow the properties of density functions
17 BITS Pilani, Pilani Campus
For n-dimensional RV
18
BITS Pilani, Pilani Campus
Independent Random Variables
Sol:
1
for n 0, f XY ( x, y ) 2 0, x 1,..., n
n
and y 1,..., n; and equals 0 elsewhere.
also,
n n n
1 1
x 1 y 1 n
2
x 1 n
2
n 1
22 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 3)
n
1
(b) f X ( x) 2 1/ n, x 1, 2,...n
y 1 n
0 e.w.
n
1
fY ( y ) 2 1/ n, y 1, 2,...n
x 1 n
0 e.w.
(c) The random variables X, Y are independent:
1 1
f X ( x ) fY ( y )
n n
1
2 f XY ( x , y )
n
for 1 x n,1 y n while
f XY ( x , y ) 0 f X ( x ) fY ( y )
elsewhere.
24 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 4)
Sol: for 1 y x n
2
Since f ( x, y ) 0,
n( n 1)
as n is a +ve integer
and f ( x, y ) 0 elsewhere.
n n
2
also,
all ( x , y )
f ( x, y )
y 1 x y n( n 1)
n
2
n( n 1)
(n y 1)
y 1
27 BITS Pilani, Pilani Campus
Exercise 5.1 (Q. 4)
2
{n (n 1) (n 2) ... 1} 1
n(n 1)
x
b) f X ( x ) 2
n ( n 1)
y 1
2x
, x 1, 2,...n
n( n 1)
n
2( n y 1)
fY ( y )
x y
2
n ( n 1)
n( n 1)
, y 1, 2,..n
2 1 2(n 2 1)
f X (1) fY (2)
n(n 1) n(n 1)
0 f XY (1,2)
d) when n 5,
2 3
2
P[X 3 and Y 2]
y 1 x y 5(6)
2 2
30 y1
(3 y 1) 1 / 3
3
2x 2 (2 4 6)
P[X 3] 2/5
x 1 5(6) 30 2
2 2
30 y1
(3 y 1) 1 / 3
P[Y 2]
2
2(5 y 1) 2
(5 4) 3 / 5
y 1 5(6) 30
0 0
x 0
2 xy
x ; 0 x 1, 0 y 2
Ex.5.3. Let f x, y 3
0 ; e.w.
1
(i) Find P X (ii) P Y X
2
1 2 xy
1 2 1 2
Sol. (i) P X f x, y dydx x dydx
2 12 0 12 0
3
y 2 x 1
1
2 xy 2
2 2x
1
2 3 x 5 2
x y dx 2 x dx x
1 2
12
6 y 0 3 3 3 x 1 2 6
2 xy
1 x 1 x
(ii) P Y X f x, y dydx x dydx
0 0
0 0
3
yx 1
1
2 xy
2
3 x 1
7x
3
7 4
x y dx x dx
0
6 y 0 0
6 24 0 24
k 6 x y ; 0 x 2, 2 y 4
HW5.3. Let f x, y
0 ; e.w.
(i) Find k
(ii) Find f X x , fY y
(iii) P Y 3
(iv) P X 1 Y 3
(v) P X 1 Y 3
2 4
Hint. (i) f x, y dydx 1 k 1 8
0 2 y
4
(ii) f X x f x, y dy where 0 x 2; d
D
2
2 c
fY y f x, y dx where 2 y 4 x
0 a b
3
5
(iii) P Y 3 fY y dy ,
2
8
1 3
3
(iv) P X 1 Y 3 f x, y dydx
0 2
8
P X 1 Y 3
(v) P X 1 Y 3
3
P Y 3 5
39 BITS Pilani, Pilani Campus
Examples: Continuous Joint Densities
kx 2 y; 0 x 1, 0 y 1
HW5.4. If f x, y is a pdf,
0 ; e.w.
(i) Find k Sol. k 6
(ii) Find f X x , fY y
1 1
(iii) P X Y (iv) P X Y
2 2
k 3x y ; 1 x 3, 0 y 2
HW5.5. If f x, y is a pdf,
0 ; e.w.
(i) Find k Sol. k 1 28
(ii) Find f X x , fY y
(iii) Are X and Y independent?
k ; 0 x 1, 0 y x
HW5.6. If f x, y is a pdf,
0 ; e.w.
(i) Find k Sol. k 2
(ii) Find f X x , fY y .
HW.5.7. For the following pdfs, check whether X and Y are independent
x 1 3 y 2
; 0 x 2, 0 y 1
(i) f x, y 4
0 ; e.w.
2; 0 x 1, 0 y x
(ii) f x, y
0 ; e.w.
6 x 2 y; 0 x 1, 0 y 1
(iii) f x, y
0 ; e.w.
1
6 x y ; 0 x 2, 2 y 4
(iv) f x, y 8
0 ; e.w.
43 BITS Pilani, Pilani Campus
Problem Solving
xy
x , 0 x 1,0 y 2
2
f ( x , y) 3
0, elsewhere
44 BITS Pilani, Pilani Campus
Sol.
Check that
f ( x, y )
2 1
xy
(x 2
) dxdy
0 0
3
1 45 BITS Pilani, Pilani Campus
Sol.
0 0
3 72
P[B]= 1-P(B), where
y
2
B = (X+Y<1}, Hence
x
1
46 BITS Pilani, Pilani Campus
Cumulative distribution function
Def: Let (X,Y) be a two dimensional random
variable. The cdf F of the two dimensional
random variable (X,Y) is defined by:
(a) FX ( x ) F( x , ) and FY ( y ) F( , y )
(b) X and Y are independent
F( x , y ) FX ( x )FY ( y )
48 BITS Pilani, Pilani Campus
Multinomial Law
Ex 5.5: A die is rolled 10 times in succession. Find the
probability of the occurrence of six 4 times, five twice,
10
10! 1
and all other faces once each. Ans:
4! 2! 1!1!1! 1! 6
Ex 5.6:
An urn contains N N 1 N 2 N m balls; N i : i th color
With replacement, n i1 i2 im balls are picked.
Find P X1 i1 , X 2 i2 , , X m im
i1 i2 im
n! N1 N2 Nm
N
i1 ! i 2 ! i m ! N N
49 BITS Pilani, Pilani Campus
Book Exercise 5.1 (Q. 12)
(a)Find P[X1=15,X2=3,X3=2].
(b)Find the general formula for joint density of
(X1, X2, X3).
20!
Soln : ( a) 0.90 0.08 0.02
15 3 2
provided | H ( x, y ) | f
all x all y
XY ( x, y ) exists.
E H X , Y H x, y f XY ( x, y )dydx, if X , Y is continuous RV
provided | H ( x, y ) | f XY ( x, y ) dy dx exists
52 BITS Pilani, Pilani Campus
Expectation: Properties
(a) E c c; c constant
(b) E aX bY c aE X bE Y c
(c)E[a0 a1 X 1 ... an X n ]
a0 a1 E[ X 1 ] ... an E[ X n ]
x
f X ( x)
yf Y ( y ) dy dx x
f X ( x) E[Y ] dx
E[Y ] x f X ( x) dx E[ X ] E[Y ]
54 BITS Pilani, Pilani Campus
Mean and Variance
Let X , Y be a two-dimensional RV with joint density f XY and marginal densities
f X , fY , respectively.
X E X xf XY ( x, y ) xf X ( x), if X , Y is discrete RV.
all x all y x
Similarly,
X2 E X x x X f XY ( x, y ) x X f X ( x); X , Y discrete
2 2 2
all x all y x
X2 E X x x X x X f X ( x)dx; X , Y continuous
2 2 2
f XY ( x, y )dydx
HW5.9. Two balls are selected at random from a box that contains
3 blue balls, 2 red balls and 3 green balls. If X is the number of blue
balls and Y is the number of red balls selected, then
Find (i) f x, y (ii) f X x , fY y , (iii) E X , E X 2 , E Y , E Y 2
, E XY (iv) Var 2 X , Var 2Y 5
k ; 0 y x 1
HW5.10. f x, y
0 ; e.w.
Find (i) k (ii) f X x , fY y ,
(iii) E X , E X 2
, E Y , E Y , E XY
2
E X X Y Y
2
E X X Y Y 2 X X Y Y
2 2
E X X E Y Y 2 E X X Y Y
2 2
Var X Var Y .
Here E X X Y Y is called the covariance.
58 BITS Pilani, Pilani Campus
Covariance
• It is a measure (absolute) of how much two variables
change together; e.g., height and weight, income-
expenditure, age-blood pressure, advertisement-sales,
demand-supply, fertilizer-yield.
• If two variables tend to show similar behaviour, then the
covariance is positive, otherwise negative.
• The sign of the covariance shows the tendency in the linear
relationship between the variables.
• The magnitude of covariance does not really produce a
fruitful meaning.
i 1 i 1 i j
n
n 2
(viii)Var a0 ai X i ai Var[ X i ],if X 1 ,..., X n are independent
i 1 i 1
61 BITS Pilani, Pilani Campus
Remark on Covariance
If X and Y are independent, then Cov X , Y 0,
but the converse is NOT true.
Let X be uniformly distributed in 1,1
and let Y X . 2
Now Cov X , Y E XY E X E Y
EX 3
E X E X
2
0
62 BITS Pilani, Pilani Campus
Problem Solving
Ex.5.8. Let X , Y be independent RVs with means 1, 3, and variances
4, 5, respectively. Then, find E 5 X 3Y 9 ,Var 2 X 4Y 5 , Var X 2
Hint. E 5 X 3Y 9 5 E X 3E Y 9 5 15 9 19
Var 2 X 4Y 5 22 Var X 42 Var Y , as X , Y are independent
Var X 2 Var X 4
kxy; 0 x 1, 0 y x
HW5.11. Let f x, y
0 ; e.w.
(i) Find k , E X 2 , E Y 2 , E XY (ii) Var X , Var Y (iii) Cov X , Y
x 1 3 y 2
Ex.5.9 f x, y 4
; 0 x 2, 0 y 1
0 ; e.w.
(i) Find f X x , fY y , f X y , fY x
(ii) Evaluate P 1 4 X 1 2 Y 1 3 .
(ii) P 1 4 X 1 2 Y 1 3
x 3
f X Y 1 3 x dx dx
14 14
2 64
69 BITS Pilani, Pilani Campus
Examples: Conditional Density
2; 0 x 1,0 y x
HW5.14. Let f x, y is a pdf,
0 ; e.w.
(i) Find f X x , fY y , f X y , fY x and
(ii) evaluate P 1 4 X 3 4 Y 1 2 .
P 1 4 X 3 4 Y 1 2
1
f X Y 1 2 x dx 2dx
14 12
2
f XY ( x, y) 8 xy , 0 y x 1
1 xy
ye , 0 x , 0 y 2
f ( x, y ) 2
0 , elsewhere
(1) Find E[X|Y=1]. (also denoted by X|y=1)
(this is the conditional mean of f X | 1)
(2) Find P[X>2|Y=1].
BITS Pilani, Pilani Campus
Solution
1 xy 1
fY ( y )
f ( x, y )dx ye dx ; 0 y 2
0
2 2
f ( x,1) x
e ; 0 x
Hence f X |Y 1 ( x) fY (1)
0;
elsewhere
E[ X | Y 1] xf
X |Y 1 ( x)dx (Evaluate)