Professional Documents
Culture Documents
Lecturenotes6 10
Lecturenotes6 10
Properties of the joint (bivariate) continuous probability density function pdf f (x, y)
for continuous random variables X and Y , are:
• f (x, y) ≥ 0, −∞ < x < ∞, −∞ < y < ∞,
R∞ R∞
• −∞ −∞ f (x, y) dy dx = 1,
RR
• if S is a subset of two-dimensional plane, P [(X, Y ) ∈ S] = S
f (x, y) dy dx,
with marginal pdfs of X and of Y ,
Z ∞ Z ∞
fX (x) = f (x, y) dy, fY (y) = f (x, y) dx.
−∞ −∞
f(x, y)
0.60
0.40
0.20
ue
k
ac
bl
bl
0, b
0,
1, bla lue
1,
ck x, first draw
y, second draw
X 1·1 2·2
(f) P Y
= 1 = f (1, 1) + f (2, 2) = 18
+ 18
=
3 4 5 6
(i) 18
(ii) 18 (iii) 18 (iv) 18 .
3. Continuous pdf: weight and amount of salt in potato chips. Two machines fill
potato chip bags. Although each bag should weigh 50 grams each and contain 5
milligrams of salt, in fact, because of differing machines, weight, X, and amount
of salt, Y , placed in each bag varies according to two graphs below. Consider
amount
of
volume = 1
f(x ,y )
salt y
8
7
6
1/12 5
4
3
2
49 51 x
weight of bag
y
y
Y>X
volume = 1 y=x
1
1
x x
1 2 0 1 2
0
6 7 8
(i) 24
(ii) 24 (iii) 24 (iv) 1.
“horizontal” slices of dark region: as y ranges from 0 to 1, x ranges from 0 to y, the line y = x
where
(j) Find E [Y 2 ].
Z 8 Z 51 Z 8 Z 51 Z 8 Z 51
2 1 2 1 2
y f (x, y) dxdy = y dxdy = y 1 dx dy
2 49 2 49 12 12 2 49
Z 8 Z 8
1 2 x=51 1
= y (x)x=49 dy = (51 − 49) y 2 dy
12 2 12 2
Z 8 y=8
2 1 1 3
= y 2 dy = y =
12 2 6 3 y=2
90012
(i) 5 (ii) 28 (iii) 315 (iii) 36
.
(k) Find V ar(Y ) = σY2 .
V ar(Y ) = E(Y 2 ) − [E(Y )]2 = E(Y 2 ) − µ2Y = 28 − 52 =
(i) 13 (ii) 3 (iii) 315 (iii) 90012
36
.
(l) Find V ar(X + Y ). Since X and Y are independent,
2 1
V ar(X + Y ) = V ar(X) + V ar(Y ) = σX + σY2 = +3=
3
10 11 12 13
(i) 3
(ii) 3
(iii) 3
(iii) 3
.
2. Expected value for the sum of normal random variables.
2
Assume X is N (µX , σX ) = N (2, 22 ) and Y is N (−1, 42 ) and let W = 4X + 5Y .
(a) What is distribution of W ?
N (aµX + bµY , a2 σX
2
+ b2 σY2 ) = N (4(2) + 5(−1), 42 (22 ) + 52 (42 )) =
(i) N (2, 412) (ii) N (3, 464) (iii) N (4, 426) (iii) N (5, 428).
(b) So P (W < 4) ≈ (i) 0.4935 (ii) 0.5185 (iii) 0.5199 (iii) 0.6001
pnorm(4,3,sqrt(464)) # normal P(X < 4), m = 3, sd = sqrt(416)
[1] 0.5185138
(a) Since each person chooses any of the ten tickets with equal chance,
1 9 1 2 3
E[Xi ] = 1 × 10 + 0 × 10 = (i) 10 (ii) 10 (iii) 10 .
(b) So expected number of ten individuals to choose their own ticket is
8 9
1
E(X) = E(X1 ) + · · · + E(X10 ) = 10 × 10 = (i) 10 (ii) 10 (iii) 10
10
.
We would expect one of ten individuals to choose their own ticket.
(c) If n individuals played this game, then
we would expect
n−1
1
E(X) = E(X) + · · · + E(Yn ) = n n = (i) n (ii) n
n
(iii) n+1
n
.
Again, we would expect one of n individuals to choose their own ticket.
σ2
X̄n → N µ, ,
n
no matter what the distribution of the population. Often n ≥ 30 is “large enough” for
the CLT to apply.
(b) Temperatures.
Temperature, X, on any given day during winter in Laporte averages µX =
0 degrees with standard deviation of σX = 1 degree. Consider average
temperature over random n = 40 days during winter.
i. µX̄ = µX = (i) 0 (ii) 1 (iii) 2.
σX
ii. σX̄ = √n
= √140 = (i) 0.0900234 (ii) 0.15811388 (iii) 0.23198455.
iii. P X̄ > 0.2 ≈ (i) 0.03 (ii) 0.10 (iii) 0.15.
1 - pnorm(0.2,0,1/sqrt(40)) # normal P(X > 0.2) = 1 - P(X < 0.2)
[1] 0.1029516
iv. P X̄ > 0.3 ≈ (i) 0.03 (ii) 0.10 (iii) 0.15.
1 - pnorm(0.3,0,1/sqrt(40)) # normal P(X > 0.3) = 1 - P(X < 0.3)
[1] 0.02888979
Since P X̄ > 0.3 ≈ 0.03 < 0.05, 0.3o (i) is (ii) is not unusual.
(c) Another example.
Suppose X has distribution where µX = 1.7 and σX = 1.5.
i. µX̄ = µX = (i) 2.3 (ii) 1.7 (iii) 2.4.
σX
ii. σX̄ = √n
= √1.5
49
= (i) 0.0243892 (ii) 0.14444398 (iii) 0.21428572.
iii. If n = 49, P (−2 < X̄ < 2.75) ≈ (i) 0.58 (ii) 0.86 (iii) 0.999.
pnorm(2.75,1.7,1.5/sqrt(49)) - pnorm(-2,1.7,1.5/sqrt(49)) # P(X-bar < 2.75) - P(X-bar < -2)
[1] 0.9999995
1
+ · · · + 6 61 = (i) 2.3 (ii) 3.5 (iii) 4.3.
i. µX̄ = µX = 1 6
x <- 1:6 # values of die
px <- c(1/6,1/6,1/6,1/6,1/6,1/6) # probabilities: 1/6 repeated 6 times
EX <- sum(x*px); EX # E(X)
[1] 3.5
q
ii. σX = (1 − 3.5)2 61 + · · · + (6 − 3.5)2 61 =
0.40 0.40
σ = 0.75
0.20
(a)
_________
0.20
1 2 3 X1
= 1 2 3 X1
1
0.40 0.40
0.40
0.20 0.20
σ = 0.53
+
(b) _________
1 2 3 X1 1 2 3 X2
=
0.20
1 3/2 2 5/2 3 _ X + X2
2 X = _____
1
µ = 1.8
(c) _________ =
1 2 3 X1
+
1 2 3 X2
+
1 2 3 X3
0.20
1 4_ _
5 2 7_ 8_ 3
σ = 0.43
_ X + X2+ X3
3 3 3 3 3
X=
_____
1
[1] 0.8633392
[1] 0.8816382
(e) Chance average number of fish is less than 1.95 after 30 trips, P (X̄ <
1.95) ≈ 0.86, is smaller than / larger than chance average number of
fish is less than 1.95 after 35 trips, P (X̄ < 1.95) ≈ 0.88.
(f) The CLT is useful because (circle one or more):
114 Chapter 3. Continuous Random Variables (LECTURE NOTES 6)
1.95
average number of fish caught,
n = 35 trips,
chance = 0.88 mean 1.8, SD 0.13
• Gamma distribution.
Section 9. The Gamma and Related Distributions (LECTURE NOTES 6) 115
• Chi-square distribution.
◦ X has chi-square distribution with n > 0 degrees of freedom and with pdf
1 n x
f (x) = n
n x 2 −1 e− 2 , x > 0,
Γ 2
2 2
1
is a special case of the gamma distribution where λ = 2
and r = n2 ,
and is described “X is χ2 (n)”
n
◦ µ = E(X) = n, σ 2 = V ar(X) = 2n, M (t) = (1 − 2t)− 2 , t < 1
2
◦ if Z1 , . . . Zn each independent N (0, 1), X = Z12 + · · · + Zn2 is χ2 (n)
◦ critical value χ2p (n) is a positive number where
P (X ≥ χ2p (n)) = p, 0 ≤ p ≤ 1.
• Student-t distribution.
◦ T has Student-t distribution with n > 0 degrees of freedom and with pdf
Γ n+1
2
f (t) = √ n+1 , −∞ < t < ∞.
2
nπ Γ 2 1 + tn 2
n
n
◦ µ = E(T ) = 0, σ 2 = V ar(T ) = n−2
, M (t) is undefined.
◦ if Z and W are independent where Z is N (0, 1) and W is χ2 (n),
then T = √ZW is Student-t with n degrees of freedom.
n
116 Chapter 3. Continuous Random Variables (LECTURE NOTES 6)
P (T ≥ tp (n)) = p, 0 ≤ p ≤ 1.
• F distribution.
d 2d2 (n+d−2)
◦ µ= d−2
, d > 2, σ 2 = n(d−2)2 (d−4)
, d > 4, M (t) is undefined
◦ if U and V are independent where U is χ2 (n) and V is χ2 (d),
U
Ud
then F = n
V = Vn
has F distribution with n and d degrees of freedom.
d
ii. Γ(2.2) ≈
(i) 0.89 (ii) 1.11 (iii) 1.84 (iv) 2.27.
gamma(2.2) # gamma function
[1] 1.101802
Γ(n) = (n − 1)!
(1)
2.0
(2)
1.0
(3)
0.0
(4)
6
4
(5)
2
(6)
0
(iii) increases.
(c) Gamma distribution: area under gamma density.
i. If (r, λ) = (1, 3), P (X < 1.3) = F (1.3) ≈
(i) 0.59 (ii) 0.80 (iii) 0.81 (iv) 0.98.
pgamma(1.3,1,3) # gamma, P(X < 1.3), r = 1, lambda = 3
[1] 0.9797581
ii. If (r, λ) = (3, 3), P (X > 0.5) = 1 − P (X ≤ 0.5) = 1 − F (0.5) ≈
(i) 0.59 (ii) 0.80 (iii) 0.81 (iv) 0.98.
1 - pgamma(0.5,3,3) # gamma, P(X > 0.5), r = 3, lambda = 3
[1] 0.8088468
iii. If (r, λ) = (3, 10), P (0.5 < X < 0.1) = P (X ≤ 0.5) − P (X ≤ 0.1) ≈
(i) 0.59 (ii) 0.80 (iii) 0.81 (iv) 0.98.
pgamma(0.5,3,10) - pgamma(0.1,3,10) # gamma, P(0.1 < X < 0.5), r = 3, lambda = 10
[1] 0.7950466
(ii) (
xe−x
Γ(3)
, x > 0,
f (x) =
0, elsewhere,
(iii) (
x2 e−x/2
22 Γ(1)
, x > 0,
f (x) =
0, elsewhere.
[1] 0.9998766
[1] 0.002029431
(e) What is the 90th percentile waiting time; in other words, what is that time
such that 90% of waiting times are less than this time?
If P (X < x) = 0.90, then x ≈
(i) 0.002 (ii) 1.000 (iii) 0.870 (iv) 1.151.
qgamma(0.90,1,2) # 90th percentile, r = 1, lambda = 2
[1] 1.151293
(a) Probabilities.
f( Ξ2 ) f( Ξ2 )
2
P( Ξ < 3.9) = ? P(3.6 < Ξ2 < 7.0) = ?
0 2 4 6 8 X2 0 2 4 6 8 Ξ2
3.6 7.0
3. 9
(a) Chi-Square with 4 degrees of freedom (b) Chi-Square with 10 degrees of freedom
pchisq(3.9,4) # chi-square, n = 4
[1] 0.5802915
ii. If n = 10, P (3.6 < X < 7.0) ≈
(i) 0.24 (ii) 0.33 (iii) 0.42 (iv) 0.56.
pchisq(7,10) - pchisq(3.6,10) # chi-square, n = 10
[1] 0.2381484
φ(ψ) φ(ψ)
0.72
0.72
0.28 0.28
2 4 6 8 10 2 4 6 8 10
2 2
72nd percentile = 0.28 critical value χ0.28(n) 72nd percentile = 0.28 critical value χ0.28(n)
v. The 0.05 critical value (95th percentile) is that waiting time such that
95% of the waiting times are less than this waiting time and 5% are
more than this time. (i) True (ii) False
Section 9. The Gamma and Related Distributions (LECTURE NOTES 6) 121
0, elsewhere,
is given by
(i)
x
1 − 2Γ(2)
e , x > 0,
f (x) = 2
0, elsewhere,
(ii)
x
1
e− 2 ,
2Γ(2)
x > 0,
f (x) =
0, elsewhere,
(iii) ( 1 x
1
3 x 2 e− 2 , x > 0,
f (x) = Γ( 32 )2 2
0, elsewhere,
(b) If n = 3, µ = E(Y ) = n =
(i) 3 (ii) 4 (iii) 5 (iv) 6.
(c) If n = 3, σ 2 = V (Y ) = 2n =
(i) 3 (ii) 4 (iii) 5 (iv) 6.
(d) A chi–square with n = 3 degrees of freedom is a gamma with parameters
(r, λ) = n2 , 12 = (i) 20 , 2 (ii) 12 , 2 (iii) 22 , 2 (iv) 23 , 12 .
[1] 0.8856849
(b) P (T < −2.11) = (i) 0.021 (ii) 0.031 (iii) 0.041 (iv) 0.051
pt(-2.11,4) # Student-t, 4 df, P(T < -2.11)
[1] 0.05124523
(c) P (T > 0.54) = (i) 0.265 (ii) 0.295 (iii) 0.309 (iv) 0.351
1 - pt(0.54,4) # Student-t, 4 df, P(T > 0.54)
[1] 0.3089285
(d) P (−1.73 < T < 1.62) = (i) 0.830 (ii) 0.876 (iii) 0.910 (iv) 0.992
pt(1.62,4) - pt(-1.73,4) # Student-t, 4 df, P(-1.73 < T < 1.62)
122 Chapter 3. Continuous Random Variables (LECTURE NOTES 6)
1.42 -2.11
µ= 0 µ= 0 T
(a) (b)
(c) (d)
[1] 0.8303853
(e) Compare P (−1.73 < T < 1.62) for Student-t when degrees of freedom
= 4, 24, 124 and N (0, 1). Fill in the blanks.
t, df = 4 t, df = 24 t, df = 124 N (0, 1)
0.8304
The larger the degrees of freedom (implying larger sample size, n), the less
flat the Student-t distribution becomes, the more like the standard normal
it becomes.
pt(1.62,4) - pt(-1.73,4) # Student-t, 4 df, P(-1.73 < T < 1.62)
pt(1.62,24) - pt(-1.73,24) # Student-t, 24 df, P(-1.73 < T < 1.62)
pt(1.62,124) - pt(-1.73,124) # Student-t, 124 df, P(-1.73 < T < 1.62)
pnorm(1.62) - pnorm(-1.73) # N(0,1), P(-1.73 < T < 1.62)
[1] 0.8303853
[1] 0.8926144
[1] 0.9030545
[1] 0.9055687
5%
0 t t
0
23%
0 t 0 t
[1] 1.722933
[1] -2.131847
[1] 0.2153901
(d) The 23rd percentile (0.77 critical value t0.77 (4)) is (i) −2.01o (ii)
−1.32o (iii) −0.82o (iv) −0.56o
qt(0.23,4) # Student-t, 4 df, 23rd percentile
[1] -0.8165961
7. F distribution.
(a) assuming (n, d) = (2, 2) degrees of freedom
P (F < 3.9) = (i) 0.80 (ii) 0.84 (iii) 0.89 (iv) 0.92.
pf(3.9,2,2) # F, 2,2 df, P(F < 3.9)
124 Chapter 3. Continuous Random Variables (LECTURE NOTES 6)
f( F ) f( F )
0 2 4 6 8 F 0 2 4 6 8 F
3.6 7.0
3.9
(a) F with (2,2) degrees of freedom (b) F with (4,5) degrees of freedom
[1] 0.7959184
(b) assuming (n, d) = (4, 5) degrees of freedom
P (3.6 < F < 7) = (i) 0.05 (ii) 0.07 (iii) 0.09 (iv) 0.11.
pf(7,4,5) - pf(3.6,4,5) # F, 4,5 df, P(3.6 < T < 7)
[1] 0.06840958
P (a ≤ X ≤ b) ≈ P (a − 0.5 ≤ Y ≤ b + 0.5)
This essentially says the sample proportion, Xn , tends to the population proportion,
p for large n. De Moivre and Laplace’s limit theorem is “stronger” in the sense
it says not only Xn converges to p but also “how” it converges, it converges to a
normal distribution “around” p, but “weaker” in the sense X must be b(n, p) whereas
Bernoulli’s Law does not require a “starting” distribution.
0.20 0.20
P(X = x)
P(X >
_ 4.5)
0.15 0.15
0.10 0.10
0.05 0.05
0.00 0.00
0 1 2 3 4 5 6 7 8 9 10 µ=4
number of cases won, x number of cases won, x
conditions for approximation (i) have (ii) have not been satisfied (but they
are close enough to continue).
[1] 0.3668967
[1] 0.3734428
[1] 0.1662386
[1] 0.1664608
[1] 0.8337614
Section 10. Approximating the Binomial Distribution (LECTURE NOTES 6) 127
[1] 0.8335392
[1] 0.2006581
[1] 0.206982
Γ[ n+1
2 ] n
Student-t √ n+1 undefined 0 n−2
2 2
nπ Γ( 2 ) 1+ tn
n
n d n
Γ[ n+1
2 ]
n 2 d 2 x 2 −1 d 2d2 (n+d−2)
F n d
n+d undefined d−2 n(d−2)2 (d−4)
Γ( 2 )Γ( )
2
(d+nx) 2