CL202: Introduction To Data Analysis
CL202: Introduction To Data Analysis
mbhushan,[email protected]
Spring 2015
Chapter 5 of Ross.
Some material also from Montgomery and Runger, Applied Probability and
Statistics for Engineers, John Wiley, 2003.
p(x) = p x (1 − p)1−x
E [X ] = 1 × p + 0 × (1 − p) = p
E [X 2 ] = 12 × p + 02 × (1 − p) = p which implies that
2
Var [X ] = E [X 2 ] − (E [X ]) = p − p 2
= p(1 − p)
Q (Montgomery and Runger, 2003) Each sample of water has a 10% chance of
containing a particular organic pollutant. Assume that samples are
independent with regards to presence or absence of pollutant. Find the
probability that in the next 18 samples: (i) exactly two contain the pollutant,
(ii) atleast four contain the pollutant.
A (i) P{X = 2} = 18 C2 (0.1)2 (0.9)16 = 0.284
P3
(ii) P{X ≥ 4} = 1 − P{X < 4} = 1 − i=0 18 Ci (0.1)i (0.9)(18−i)
= 1 − (0.15 + 0.3 + 0.284 + 0.168) = 0.098
Q (Montgomery and Runger, 2003) The probability that a silicon wafer contains
a large particle (contamination) is 0.01. If it is assumed that the wafers are
independent, what is the probability that exactly 125 wafers need to be
analyzed before a large particle is detected?
A X : number of samples analyzed until a large particle is detected.
X is a geometric RV with p = 0.01. Then,
Discrete Uniform law: Sample space had finite number of equally likely
outcomes. For discrete variables, we count the number of outcomes
concerned with an event.
For continuous variables we compute the length of a subset of the real line.
The PDF of a continuous uniform random variable is
c, α ≤ x ≤ β
fX (x) =
0, otherwise
For f to be a PDF,
Z β Z β
1
1= c dz = c dz = c(β − α) ⇒ c =
α α (β − α)
The mean is
Z ∞ Z b
1
E [X ] = xfX (x)dx = x dx
−∞ a b−a
b
1 1 1 b 2 − a2
× × x 2 =
= ×
b−a 2 a b−a 2
a+b
=
2
The PDF is symmetric around (a + b)/2
b b
x 3
Z
2 2 1 1
E [X ] = x dx = ×
a b−a b−a 3 a
b 3 − a3 a2 + ab + b 2
= =
3(b − a) 3
Var(X ) = E [X 2 ] − (E [X ])2
2
(a2 + ab + b 2 )
a+b
= −
3 2
(b − a)2
=
12
Is it a PDF?
Z ∞ Z ∞ ∞
fX (x)dx = λe −λx dx = −e −λx 0 = 1
−∞ 0
For any a ≥ 0
Z ∞ ∞
P(X ≥ a) = λe −λx dx = −e −λx a
a
−λa
= e
or
F (a) = 1 − e −λa
Mean
Z ∞ ∞
Z ∞
E [X ] = x(λe −λx )dx = −xe −λx 0 + e −λx dx
0 0
∞
e −λx 0 1
= 0− =
λ λ
Variance
Z ∞ ∞
Z ∞
E [X 2 ] = x 2 (λe −λx )dx = −x 2 e −λx 0 + 2xe −λx dx
0 0
2 2
= 0+ E [X ] = 2
λ λ
2
2 1 1
Var(X ) = − = 2
λ2 λ λ
Therefore
0 1
E [X ] = φ (0) =
λ
00 2 1 1
Var(X ) = φ (0) − (E [X ])2 = − 2 = 2
λ2 λ λ
Let
x −µ
z=
σ
Z ∞
σ2 2
Var(x) = √ z 2 e −z /2 dz
2π −∞
∞ Z ∞
σ2 −z 2 /2 σ2 2
e −z /2 dz
= √ × (−ze ) +√
2π −∞ 2π −∞
Z ∞
σ2 2
= √ e −z /2 dz
2π −∞
= σ2
Differentiation gives
σ2 t 2
0
φ (t) = (µ + tσ 2 ) exp µt +
2
2 2
00 σ t
φ (t) = σ 2 exp µt +
2
2 2
σ t
+ exp µt + (µ + tσ 2 )2
2
Therefore
0
E [X ] = φ (0) = µ
00
Var(X ) = φ (0) − (E [X ])2 = σ 2
X ∼ N (µ, σ 2 )
√
The maximum height of N (µ, σ) = 1/(σ 2π) and hence maximum height
∝ 1/σ.
Another important property of normal random variables:
If X is normal with mean µ and variance σ 2 , then for any constants a and
b, b 6= 0, the random variable Y = a + bX is also a normal random variable
with
E [Y ] = E [a + bX ] = a + bµ
Var(Y ) = b 2 σ 2
N (0, 1)
The CDF of Z is
Z z
1 2
Φ(z) = P{Z ≤ z} = P{Z < z} = √ e −t /2
dt
2π −∞
(X − µ)
Z=
σ
Then Z is also normal with
(E [X ] − µ)
E [Z ] = =0
σ
Var(X )
Var(Z ) = =1
σ2
⇒ Z ∼ N (0, 1) = standard normal.
Q. What is Φ(−0.5)?
A.
X −µ (X − 60)
Z= =
σ 20
So
80 − 60
P{X ≥ 80} = P Z≥
20
= P{Z ≥ 1} = 1 − Φ(1) = 1 − 0.8413
= 0.1587
X ∼ χ2n
(Without proof)
χ2n /n
Fn,m =
χ2m /m
F0.9,5,7 = 1/F0.1,7,5 .
From tables F0.1,7,5 = 3.37, thus F0.9,5,7 = 0.2967.