questions for math 230 probability: week 1: revisionwhittake/math230/wkall230.qu.txt.pdf · is...

33
Questions for Math 230 Probability: Week 1: Revision Q 1.1 WSwk01: Poisson accidents. Suppose that the number of accidents occurring on a highway each day is a Poisson random variable with expected number (parameter) 3. (a) Find the probability that 3 or more accidents will occur today. (b) Repeat part (a) if you know that at least one accident occurred today. Q 1.2 WSwk01: Pregnancy. An ectopic pregnancy is twice as likely to develop when a pregnant woman is a smoker as it is when she is a non smoker. If 32% of women of childbearing age are smokers, what is the probability that a woman having an ectopic pregnancy is a smoker? Q 1.3 WSwk01: Poisson moments. The probability mass function of a Poisson random variable R is P(R = r)= λ r exp(λ) r! for r =0, 1, 2,... where λ> 0. Work out E(R), E[R(R 1)] and var(R). Q 1.4 QZwk01: Concepts. X is a discrete random variable, x is a specific value that X may take, E is expectation, P is a probability, p is a probability mass function. Decide which of the following is mathematically well formed (meaningful). E(X ), P(X ), p(X ). (A) TTT, (B) TFT, (C) TTF, (D) FTT. Q 1.5 QZwk01: Concepts continued. Again indicate which of the following is mathe- matically well formed (meaningful). E(x), P(x), p(x). (A) TTT, (B) TFT, (C) TTF, (D) FTT. Q 1.6 QZwk01: Discrete rv. For the discrete random variable R, express P(5 <R< 10) in terms of the pmf, p(r); and the cumulative distribution function, F (r). Which of the following statements are correct: (i) P[5 <R< 10] = p(6) + p(7) + p(8) + p(9) (ii) P[5 <R< 10] = P[5 <R 9] (iii) P[5 <R< 10] = F (9) F (5) (iv) P[5 <R< 10] = F (10) F (5). (A) TTTT, (B) FTTT, (C) TTTF, (D) TFTT. Q 1.7 QZwk01: Poisson lightbulbs. The expected number of failing lightbulbs in a large building is 2 per week. Assuming this is a rare event find the probability that are (i) no failures in the next week; (ii) no more than 2 failures in the next week. 1

Upload: vuongphuc

Post on 03-Jul-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Questions for Math 230 Probability: Week 1: Revision

Q 1.1 WSwk01: Poisson accidents. Suppose that the number of accidents occurringon a highway each day is a Poisson random variable with expected number (parameter)3.

(a) Find the probability that 3 or more accidents will occur today.

(b) Repeat part (a) if you know that at least one accident occurred today.

Q 1.2 WSwk01: Pregnancy. An ectopic pregnancy is twice as likely to develop whena pregnant woman is a smoker as it is when she is a non smoker. If 32% of women ofchildbearing age are smokers, what is the probability that a woman having an ectopicpregnancy is a smoker?

Q 1.3 WSwk01: Poisson moments. The probability mass function of a Poisson randomvariable R is

P(R = r) =λr exp(−λ)

r!for r = 0, 1, 2, . . . where λ > 0.

Work out E(R), E[R(R − 1)] and var(R).

Q 1.4 QZwk01: Concepts. X is a discrete random variable, x is a specific value thatX may take, E is expectation, P is a probability, p is a probability mass function.

Decide which of the following is mathematically well formed (meaningful).E(X), P(X), p(X).

(A) TTT, (B) TFT, (C) TTF, (D) FTT.

Q 1.5 QZwk01: Concepts continued. Again indicate which of the following is mathe-matically well formed (meaningful).

E(x), P(x), p(x).

(A) TTT, (B) TFT, (C) TTF, (D) FTT.

Q 1.6 QZwk01: Discrete rv. For the discrete random variable R, express P(5 < R < 10)in terms of the pmf, p(r); and the cumulative distribution function, F (r). Which ofthe following statements are correct:

(i) P[5 < R < 10] = p(6) + p(7) + p(8) + p(9)

(ii) P[5 < R < 10] = P[5 < R ≤ 9]

(iii) P[5 < R < 10] = F (9) − F (5)

(iv) P[5 < R < 10] = F (10) − F (5).

(A) TTTT, (B) FTTT, (C) TTTF, (D) TFTT.

Q 1.7 QZwk01: Poisson lightbulbs. The expected number of failing lightbulbs in alarge building is 2 per week. Assuming this is a rare event find the probability that are

(i) no failures in the next week;(ii) no more than 2 failures in the next week.

1

Decide which pair is nearest to the truth

(A) (0.1,0.7), (B) (0.2,0.5), (C) (0.1,0.6), (D) (0.2,0.7).

Q 1.8 QZwk01: Axioms. Recall the axioms of probability. Indicate the status of thestatement

P(A) ≤ 1 for any set A.

(A) axiom, (B) theorem, (C) definition, (D) calculation, (E) false.

Q 1.9 CWwk01: Colds. The number of times that an individual contracts a cold in agiven year follows a Poisson distribution with the expected number per year being 5. Anew drug has been introduced which changes the distribution to Poisson with expectednumber 3 per year for 75% of the population. For the other 25% of the population thedrug has no appreciable effect on colds. Let N be the number of colds in year and Bbe the event that the drug is beneficial for you.

(a) The random variable that counts the number of colds when the drug is not beneficialis represented by(A) B|N , (B) N |B, (C) N |BC , (D) N, BC .

(b) The distribution of the random variable in (a) is(A) Poisson(3), (B) Poisson(0.25), (C) Poisson(0.75), (D) Poisson(5).

(c) You try the drug for a year and have 2 colds. The probability that the drug isbeneficial for you is approximately(A) 0.75, (B) 0.224, (C) 0.051, (D) 0.889. [7]

Q 1.10 CWwk01: Multiple choice. A student takes a multiple choice test of 20questions where each question has 5 possible options for the answers. Suppose thestudent answers each question at random. Let R be the random variable denoting thenumber of correct answers, and let the pass mark for the test be 8 or more correctanswers.

(a) Give the pmf of R.

(b) Work out P(R = 0), P(R = 1), P(R = 20).

(c) Find numerically the probability that the student fails the test.

Please avoid nCr type notation for Binomial coefficients. [6]

Q 1.11 CWwk01: cdf. Obtain the cumulative distribution function of the followingdiscrete random variables (a) Geometric(θ), (b) Binomial(3, θ), (c) Uniform(0, m).Hint: First calculate F at the jump points (integers), and distinguish the index ofsummation from the upper limit of summation. Secondly extend from the integers tothe real line. [7]

Questions for Math 230 Probability: Week 2: cdf and pdf

2

Q 2.1 WSwk02: cdf. Let the cdf of a continuous random variable X be

FX(x) =

{

0 if x < 01 − exp(−x) if x > 0.

(a) Find the pdf of X, (b) Sketch the cdf and the pdf of X.

Q 2.2 WSwk02: Integrate pdf. The random variable X has pdf

fX(x) =

{

2x if 0 < x < 10 otherwise.

Find (a) P(X < 12) and (b) P(X > 3

4| X > 1

2).

Q 2.3 WSwk02: pdfcdf. The random variable X has probability density function

fX(x) =

{

332

(4 − x2) if − 2 < x < 20 otherwise.

Find the cumulative distribution function of X and, hence or otherwise, evaluateP(−1 < X < 0).

Q 2.4 QZwk02: Normalising constant. If X has pdf

fX(x) =

{

c(1 − x2) if − 1 < x < 10 otherwise,

work out the value of c required to make this a valid pdf and obtain E(X). The valueof (c, E(X)) is nearest to

(A) (1/2, 1), (B) (3/4, 0), (C) (3/4,−1), (D) (4/3, 0).

Q 2.5 QZwk02: Uniform distribution. The rv X has the uniform distribution on (0, 1).Write down the pdf and the cdf. Decide which of the following are true or false.

(a) P(X ≥ 0.4) = 0.6,(b) P(X = 0.3) = 0.3,(c) P(0.6 ≤ X ≤ .9) = 0.3,(d) median is 0.5.

(A) TTTT, (B) FTTT, (C) TFTT, (D) TTFT, (E) TTTF.

Q 2.6 QZwk02: Uniform. A random sample of size 9 from the uniform distributionof a random variable X taking continuous values from from 0 to 1 can be drawn anddisplayed by

x = runif(9,min=0,max=1)

x

Draw a random sample of size 99 from the Uniform(0, 1) distribution and plot itshistogram using the R command hist.

x = runif(99,0,1)

hist(x, 20, col=’yellow’)

3

The sample mean of the 99 values is nearest

(A) 0.4, (B) 0.5, (C) 0.6, (D) 0.7, (E) 0.8.

Q 2.7 QZwk02: Uniform mean and variance. Find the expected value and varianceof the random variable X with Uniform distribution, Uniform(0, 1).

Generate a column vector x of a sample of values of the random variable X:

x = runif(1000,0,1) # 1000 random numbers

hist(x)

hist(x,20,col=’yellow’) #

The sample mean and variance

mean(x)

var(x)

are near

(A) 0 and 1, (B) 1 and 1/2, (C) 1/2 and 1/12, (D) 1/2 and 1/2, (E) 1/2 and1.

Q 2.8 QZwk02: Triangular. A random variable X has the triangular pdf

fX(x) =

{

2(1 − x) 0 < x ≤ 1,0 otherwise.

Find the cdf, FX(x).

Indicate which of the following are true or false(a) P(X ≥ 0.4) = 0.36,(b) P(X ≥ y2) = y2,(c) P(0.6 ≤ X ≤ .9) = 0.3.(d) upper quartile is 0.5.

(A) TTFF, (B) FTTF, (C) TFFT, (D) FTFT, (E) TFTF.

Q 2.9 CWwk02: Device. The pdf of X, the lifetime (in hours) of an electronic deviceis

fX(x) =

{

10x2 if x > 100 otherwise.

(a) Find the cdf, FX(x) of X. Sketch the cdf and pdf of X,

(b) Find FX(15) and FX(5), (c) Find P(X > 30). [7]

Q 2.10 CWwk02: Petrol. A filling station has its tank filled (full) with petrol oncea week. Suppose the weekly volume of sales (in thousands of gallons) is a randomvariable X with pdf

fX(x) =

{

5(1 − x)4 0 < x < 10 otherwise.

4

What does the capacity of the tank need to be for the probability of the supply beingexhausted in any given week to be 0.01? Choose the correct answer.

(A) 0.702, (B) 0.602, (C) 0.502, (D) 0.402 thousand gallons. [2]

Q 2.11 CWwk02: Expectation. Show that for a continuous random variable X, anyfunctions g and h, and any constants a, b and c that

E[cg(X)] = c E[g(X)]

E[ah(X) + b] = a E[h(X)] + b.

[3]

Q 2.12 CWwk02: Evar. Define the expectation and variance of a continuous randomvariable X.

A random variable X has probability density function, pdf,

fX(x) =

{

2x if 0 < x < 1;0 otherwise.

The E(X) and var(X) are

(A) 12

and 19, (B) 1

3and 2

9, (C) 2

3and 1

18, (D) 2

3and 1

9. [3]

Q 2.13 CWwk02: Quantiles. A model for the distribution of a proportion, X, is atruncated distribution with cdf

FX(x) = 2x exp[1 − 2 x], 0 < x < 0.5,

and is 0 for x < 0 and 1 for x > 0.5.

(a) State the equation giving the median of X. (b) Carefully plot F and, from this,find the three quartiles approximately. (c) Find the pdf. [5]

Q 2.14 Let the cdf of a continuous random variable X be

FX(x) =

0 if x < 10(x − 10)/10 if 10 < x < 201 if x > 20.

(a) Find the pdf of X, (b) Sketch the cdf and the pdf of X.

Q 2.15 A continuous random variable X has pdf

fX(x) =

{

1/2 if − 1 < x < 10 otherwise.

Find E(Xr) for all odd integer values of r.

For a random variable Y which has a symmetric pdf about zero, i.e. fY (−y) = fY (y),and all its moments are finite, show that E(Y r) = 0 for all odd integer values of r.

Q 2.16 For a continuous random variable X write each of the following probabilitiesin two different ways, one in terms of fX(x) and one in terms of FX(x):

5

(i) P(X > 10),

(ii) P(5 < X < 10),

(iii) P(5 < X < 10 or X > 50).

Q 2.17 The lifetime in years of an electronic tube is a random variable X, having apdf given by

fX(x) = x exp(−x) x ≥ 0.

Find the cumulative distribution function of X. Hence, or otherwise, find P(X > 5).Evaluate P(X > 10 |X > 5)?

Q 2.18 Suppose E(X) = 3 and var(X) = 4. Compute E(Y ) and var(Y ) when (i)Y = 3X + 2, (ii) Y = −5X + 4.

Questions for Math 230 Probability: Week 3: Distributions

Q 3.1 WSwk03: Indicator function. Let A be an interval or a set of intervals on thereal line. For a set A the function IA(x) of x is defined as

IA(x) =

{

1 if x ∈ A0 if x /∈ A.

For the continuous random variable X, find E[IA(X)].

Q 3.2 WSwk03: Bus times. Buses for the University via Hala leave the bus stationat 15 minute intervals starting at 7-00, whereas buses via the A6 leave at 15 minuteintervals starting at 7-05. When I arrive at the bus station I always catch the first bus,irrespective of its route.

(a) Identify the times between 7-00 and 8-00 that, if I arrived at the bus station atthese times, I would travel to the University via Hala.

(b) If I arrive at the bus station at a time uniformly distributed between 7-00 and 8-00,what is the probability that I travel via Hala?

(c) What is this probability if I arrive at the bus station with a time uniformly dis-tributed between 7-10 and 8-10?

Q 3.3 WSwk03: Normalise. What values of c are required to make the follow-ing functions valid pdfs (Hint: you will find it helpful to look at the Appendix onIntegration first).

fX(x) =

{

cx3 exp(−βx) if x > 00 otherwise,

(for β > 0) and

fX(x) =

{

cx3(1 − x)5 if 0 < x < 10 otherwise.

Q 3.4 QZwk03: Exponential. Generate a random sample of 10000 from the Exp(β)distribution with β = 1/3. Plot the histogram of the sample.

6

x = rexp(10000,rate=1/3)

The proportion of the sample whose values exceed 2 is nearest

(A) 0.7, (B) 0.6, (C) 0.5, (D) 0.4, (E) 0.3.

Q 3.5 QZwk03: Exponential Continued. Select the subsample of x whose values exceed2.

z = x[x>2]

Plot the histogram of the subsample. The proportion of the subsample whose valuesexceed 4 is nearest

(A) 0.7, (B) 0.6, (C) 0.5, (D) 0.4, (E) 0.3.

Q 3.6 QZwk03: Gamma quantiles. Plot the pdf of X ∼ Gamma(4, 2) and then findits 95%-quantile.

xval = seq(-1,12,length=100)

pdf = dgamma( xval, shape=4, rate=2)

plot(xval, pdf, type=’n’)

lines(xval, pdf,col=’red’,lwd=2)

qgamma( 0.95, shape=4, rate=2)

Decide the truth of the statements:(i) The 5%-quantile of Gamma(4, 2) is larger than that of Gamma(8, 4).(ii) The 90%-quantile of Gamma(4, 2) is larger than of Gamma(8, 4).

(A) TT, (B) TF, (C) FT, (D) FF.

Q 3.7 QZwk03: Some R for factorials. Try this code

5! # fails

prod(1:5)

gamma(6)

fac=1; for (r in 1:5){fac=fac*r}; fac

Now plot

r = 0:6

plot(r, gamma(r), type =’p’, col=’red’,cex=2 )

r= seq(0.1,6,length=100)

lines( r, gamma(r), col=’blue’,cex=2)

Decide the truth of the statements:(i) The factorial function grows quickly.(ii) The factorial of 11 is over 1 million.

7

(A) TT, (B) TF, (C) FT, (D) FF.

Q 3.8 QZwk03: Bell shaped curve. The random variable X ∼ N(0, 1) has the bell-shaped pdf

f(x) =1

(2π)exp

(

−1

2x2

)

, −∞ < x < ∞

Plot the pdf on the range (−3, 3) using the function dnorm.

range = seq(-3,3,length=100)

pdfx = dnorm(range)

plot( range, pdfx, type=’n’)

lines(range, pdfx)

Decide the truth of the statements(i) the pdf is unimodal;(ii) the pdf is symmetric about 0.

(A) TT, (B) FT, (C) TF, (D) FF.

Q 3.9 QZwk03: Normal cdf. Plot the cdf on the range (−3, 3) using the functionpnorm. Decide the truth of the statements

(i) the cdf is monotonically increasing;(ii) the cdf is symmetric about 0.

(A) TT, (B) FT, (C) TF, (D) FF.

Q 3.10 QZwk03: Normal interval. Generate a random sample of size 10000 from thestandard normal distribution:

z = rnorm(10000,0,1)

Find the proportion of the sample whose values lie between 0 and 2:

ind = (z>0)&(z<2) # logical operation

mean(ind)

The proportion whose values lie between −1 and 1 is nearest

(A) 0.74, (B) 0.71, (C) 0.68, (D) 0.65, (E) 0.61.

Q 3.11 CWwk03: Moments. Assume that X has pdf

fX(x) =

{

β exp(−βx) if x > 00 otherwise,

where β > 0 is a constant.(a) The skewness, µ3, of X is

(A) 2.0, (B) 3.2, (C) 2.5, (D) 4.2.

8

(b) The kurtosis, µ4 − 3, of X is

(A) 9.0, (B) 6.0, (C) 3.2, (D) 4.5.

(Hint: show that µX = β−1, σ2X = β−2, E(X3) = 6/β3 and E(X4) = 24/β4. Now ex-

pand [(X − µX)/σX ]4 − 3 as a polynomial in X and take expectations. )

(c) Very briefly, give a reason for subtracting 3 from µ4. [5]

Q 3.12 CWwk03: Quantiles. Find the median and inter-quartile range for the randomvariables: (a) Uniform(a, b), (b) Exp(β).

How do these quantities compare with the expectation and standard deviation for thesedistributions? [6]

Q 3.13 CWwk03: Beta. If X has a Beta(α, β) distribution its pdf is

fX(x) =

{

Γ(α+β)Γ(α)Γ(β)

xα−1(1 − x)β−1 if 0 < x < 1

0 otherwise,

for α > 0 and β > 0. The E(X) is

(A) βα+β

, (B) Γ(α+β)Γ(α)

, (C) Γ(α+1)Γ(α+β+1)

, (D) αα+β

.

(Hint see Appendix A.1 on Integration). [3]

Q 3.14 CWwk03: Weibull. The Weibull distribution is important in reliability theory.Its probability density function can be written

fX(x) =

{

0 x < 0αβαxα−1 exp{−(βx)α} x ≥ 0,

where β > 0 is the scale parameter and α > 0 is the shape parameter.(a) Show that the cdf of X is

FX(x) =

{

0 x < 01 − exp{−(βx)α} x ≥ 0.

Hint: first try this with β = 1 and α = 2 and make a substitution to evaluate theintegral.

(b) Show that the expectation of a random variable with the above Weibull distributionis Γ(1 + α−1)/β. (Hint: see the Appendix for integrals).

(c) Lengths in cms, X between flaws in a production strand of wire can be assumed tohave Weibull distribution with scale 1 and shape 2.

Find P(0.5 < X ≤ 2) and P(X > 2 | X > 1). Check your answers with the R functionpweibull. [6]

Q 3.15 If X is uniformly distributed over (0, 1), calculate (a) P(X > 0.5), (b) E(X),(c) var(X).

Q 3.16 Let X ∼ N(µ, σ2) and let Z = X−µσ

. Show that:

9

(a) P(Z ≤ x) = P(X ≤ σx + µ), (b) E(Z) = 0 and var(Z) = 1.

Q 3.17 A soft drinks machine is regulated so that volumes average 30cl per cup, withstandard deviation 4cl. Assuming a Normal distribution, find the probability of thevolume exceeding 35cl.

Questions for Math 230 Probability: Week 4: Normal and Gamma

Q 4.1 WSwk04: Normal quantiles. Find the median and inter-quartile range for theN(µ, σ2) random variable.

How do these quantities compare with the expectation and standard deviation?

Q 4.2 WSwk04: Tyre mileage. Tyre mileage to failure can be assumed to havea Normal distribution with mean µ = 36, 500 miles and standard deviation σ = 5000miles. What is the probability that a tyre will fail within 30,000 miles? If a tyre isknown to have failed within 30,000 miles, what is the probability that it failed within25,000 miles?

Q 4.3 WSwk04: Models. For the following random variables identify (with justifica-tion) which family of distribution (but not the parameter values) you would considerfor modelling their distribution:(a) marks in a statistics exam paper, (b) waiting times in a queue, (c) proportion ofvotes in an election for a candidate.

Q 4.4 QZwk04: Normal tail probability. Generate a random sample of 1000 from aN(0, 1) distribution and obtain the histogram of these values. Estimate the probabilitythat a N(0, 1) random variable is larger than 1.645. Indicate the best guess of the trueprobability.

(A) 0.50, (B) 0.75, (C) 0.25, (D) 0.05, (E) 0.95

Q 4.5 QZwk04: Transformed tail probability. Indicate the best guess of the probabilitythat the random variable Y = X2 is larger than (1.645)2 = 2.706.

(A) 0.5, (B) 0.4, (C) 0.6, (D) 0.1, (E) 0.9

Q 4.6 QZwk04: Gamma. If X ∼ Gamma(4, 5) use R to find P(X < 2) and P(1 < X < 2).The numbers are nearest

(A) [.95,.25], (B) [.9,.2], (C) [.5,.2], (D) [.85,.25].

Q 4.7 QZwk04: A shifted scaled Normal rv. When X ∼ N(3, 4) it has the pdf

f(x) =1

(2π4)exp

[

−1

2

(x − 3)2

4

]

, −∞ < x < ∞

Generate 1000 realisations of X ∼ N(3, 4), and 1000 realisations of Z ∼ N(0, 1).Transform to get realisations from Y = 2Z + 3.

x = rnorm(1000,mean=3,sd=2) # note sqrt 4

z = rnorm(1000,mean=0,sd=1)

10

y = 2*z+3

Decide the truth of the statements(i) the pdfs of Y and X are the same;(ii) the pdf of Y is symmetric about 3.(ii) the standard deviation of Y is about 1.

(A) TTT, (B) FTT, (C) TTF, (D) FFT, (E) TFF.

Q 4.8 QZwk04: Weibull distribution. Plot the pdf of X ∼ Weibull(2, 1) and compareit to that of Y ∼ Gamma(3, 3).

xval = seq(-1,6,length=100)

fx = dweibull( xval, shape=2, scale=1)

fy = dgamma( xval, shape=3, rate=3)

plot(xval, fx, type=’n’)

lines(xval, fx, col=’red’,lwd=3)

lines(xval, fy, col=’blue’,lwd=3)

grid()

pweibull( 1, shape=2, scale=1)

Decide which of the following are true or false.(a) The two pdfs are different but close,(b) P(X ≤ 1) > P(Y ≤ 1),(c) The cdf of X is never below that of Y .

(A) TTT, (B) FTT, (C) TFT, (D) TTF, (E) FTF.

Q 4.9 CWwk04: Paternity. An expert witness in a paternity suit testifies that thelength (in days) of pregnancy (that is, the time from impregnation to the delivery of thechild) is approximately Normally distributed with parameters µ = 270 and σ2 = 100.The defendant in the suit is able to prove that he was out of the country during aperiod that began 290 days before the birth of the child and ended 240 days beforethe birth. If the defendant was, in fact, the father of the child, what is the probabilitythat the mother could have had the very long or very short pregnancy indicated by thetestimony? Choose the correct answer.

(A) 0.034, (B) 0.014, (C) 0.024, (D) 0.044. [2]

Q 4.10 CWwk04: Waiting times. The duration of appointments at a doctor’s surgerycan be assumed to be Normally distributed with mean 10 minutes and standard devi-ation 3 minutes.

(a) Express the probability of a randomly selected appointment taking less than 15minutes in terms of the standard Normal cdf Φ, and evaluate numerically in R.

(b) Assuming independent appointment times, what is the probability that at leastone of the doctor’s 20 appointments will be longer than 15 minutes?

(c) Are the assumptions of independence and a Normal distribution reasonable? [6]

Q 4.11 CWwk04: Exam marks. Let X, the marks of a randomly selected student in

11

a probability exam, be a Normal random variable. Lecturers are said to grade on thecurve if they know the average µ and the standard deviation σ of the marks and thenassign grades according to the following table:

Range of mark X ≥ µ + σ µ ≤ X < µ + σ X < µgrade A B C

If a lecturer does grade on the curve, what are the probabilities of students gettingeach of grades A, B and C? [4]

Q 4.12 CWwk04: Moment identification. The figure shows the pdf for four differentrandom variables, with their associated expectations and variances.

0 2 4 6 8

0.00

0.10

0.20

0.30

0.0 0.5 1.0 1.5 2.0 2.5 3.0

0.0

0.5

1.0

1.5

2.0

−2 0 2 4 6 8 10

0.00

0.05

0.10

0.15

0.20

−0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2

01

23

4

xx

xx

f X(x

)

f X(x

)

f X(x

)

f X(x

)

The means and variances of the pdfs shown in the figure are

E(X) = 4 E(X) = 1/2

Var(X) = 2 Var(X) = 1/4

E(X) = 4 E(X) = 1/2

Var(X) = 4 Var(X) = 1/8

In each case, guess the distribution family (eg Gamma), evaluate its parameters byrelating these to the mean and variance and choose the correct answer.

(a) The first figure (top left) follows(A) Gamma(8, 2), (B) N(4, 4), (C) N(4, 2), (D) Gamma(8, 4).

(b) The second figure (top right) follows(A) Exp(4), (B) Exp(1/4), (C) Exp(2), (D) Exp(1.5).

(c) The third figure (bottom left) follows(A) Gamma(4, 8), (B) N(4, 4), (C) Gamma(4, 2), (D) N(4, 2).

(d) The fourth figure (bottom right) follows

12

(A) Beta(14, 1

2), (B) Beta(1

2, 1

2), (C) Beta(1

2, 1

4), (D) Beta(1

8, 1

4). [8]

Q 4.13 For a random variable X the rth central standardized moment is defined by

µr = E

{(

X − µX

σX

)r}

where µX = E(X) and σ2X = var(X).

(i) Describe the use of µ3 and µ4 for summarising the shape of the probability densityfunction of X.

(ii) For X ∼ Exp(β), use the result that E(Xr) = r!βr for r = 0, 1, 2, . . . , to show that

µ3 = 2 for this probability density function.

Questions for Math 230 Probability: Week 5: Transformations

Q 5.1 WSwk05: Power transform. If X ∼ Exp(1), find and identify by name thedistribution of Y = X1/c, for c > 0.

Q 5.2 WSwk05: Bus times. The length of time X (in minutes) that it takes the busto travel the 3 miles from campus to Lancaster is a continuous random variable withcdf

FX(x) =

0 x ≤ 80.25(x − 8) 8 < x ≤ 121 x > 12.

Write down a transformation which converts X to the average speed for the trip inmiles per hour. Derive the cdf and pdf of speed, and determine its expected value.

Q 5.3 WSwk05: Scaled. If X is an Exp(β) random variable and c > 0, show thatthe random variable cX follows an Exp(β/c) distribution.

Q 5.4 WSwk05: Switch. If U ∼ Uniform(0, 1) find the distribution of V = 1 − U .

Q 5.5 WSwk05: Simulation. The random variable X has pdf

fX(x) =

{

exp(x)/[exp(1) − 1] for 0 < x < 10 otherwise.

Given three realisations u = c(.0127, 0.3721, 0.7453) from the Uniform distribu-tion, simulate three values from X.

Q 5.6 QZwk05: Sine transformed uniform. Generate a random sample from a U ∼ Uniform(0, 1)random variable of size n = 1000.

Transform to X = 2πU which follows a Uniform(0, 2π) distribution.

Transform to Y = sin(X).

By finding the sample mean of the Y realisations as an approximation to E(Y ), indicatethe true value of E(Y ).

(A) 0, (B) −1, (C) 0.5, (D) −1.3, (E) 0.3.

13

Q 5.7 QZwk05: Uniform: shift transform. Generate a random sample from a U ∼ Uniform(0, 1)random variable of size n = 1000 and transform to a new variable Y = X + 10:

x = runif(1000,0,1)

y = x + 10

hist(y) ; mean(y) ; var(y)

Consider the statements(a) The distribution of Y is also Uniform.(b) The expected value of Y is the same as that of X.(c) The variance of Y is the same as that of X.(d) The variance of Y = 5X is the same as that of X.

(A) FFFF, (B) TTTT, (C) TTFF, (D) TFFT, (E) TFTF.

Q 5.8 QZwk05: Uniform: sqrt transform. Generate a sample of X ∼ Uniform(0, 1)

and transform to a sample of the random variable Z =√

X. Plot the histogram of theZ sample.

The shape of the pdf of Z is

(A) uniform, (B) exponential , (C) J shaped , (D) triangular, (E) U shaped.

Q 5.9 QZwk05: Uniform to Exponential. Theory states that if U is Uniform then thetransformation X = − log (1 − U) has the Exp(1) distribution, with pdf

f(x) = exp(−x), 0 < x < ∞.

Verify this empirically:

u = runif(1000) ; hist(u,20)

x = -log(1-u) ; hist(x,20)

Definitely exponentially shaped!

Find the shape of the histograms of the following transforms, and decide truth of thestatements

(i) X = −3 log (U) is flat;(ii) X = log (U) sin(U), U-shaped;(iii) X = U2(1 − U)2 is U-shaped.

(A) TTT, (B) FFT, (C) FTF, (D) TFF, (E) FFF.

Q 5.10 QZwk05: Sums of exponentials. This is a taster for a bivariate transformation.If Y ∼ Exp(β) and Z ∼ Exp(β) are independent exponential random variables thenthe distribution of the sum X = Y + Z is X ∼ Gamma(2, β).

beta = 1/2

y = rexp(1000,rate=beta)

z = rexp(1000,rate=beta)

x = y+z

hist(x,20, col=’yellow’)

14

Decide truth of the statements(i) X has an exponentially shaped histogram;(ii) the histogram is unimodal;(iii) the mean of X is approximately 4.

(A) TTT, (B) FTT, (C) TFT, (D) TFF, (E) FFF.

Q 5.11 CWwk05: Scaled Gamma. If X ∼ Gamma(α, β), the distribution of Y = βXis

(A) Gamma(α, β2), (B) Gamma(α + 1, 1), (C) Gamma(α, 1), (D) Gamma(β, 1)

[2]

Q 5.12 CWwk05: Linear transform. Let X have pdf

fX(x) =

{

2x 0 ≤ x ≤ 10 otherwise.

Find and roughly sketch the pdf of Y = −4X + 3. [7]

Q 5.13 CWwk05: Quadratic transform. If X ∼ N(0, 1) and Y = X2, express thecdf FY (y) in terms of the cdf Φ for a N(0, 1) random variable.

Hence show that

fY (y) =

1√2πy

exp(

−y2

)

y ≥ 0

0 y ≤ 0,

i.e. Y ∼ χ21. [7]

Q 5.14 CWwk05: Crystals. Crystals of a certain mineral are cubes with side lengthX (in mm) which has cdf

FX(x) =

0 x ≤ 0

14x2 0 < x ≤ 2

1 x > 2.

(a) Find and roughly sketch the pdf of the volume, Y , of a crystal, where Y = X3.(b) The probability of volume exceeding 3.375mm3 is

(A) 0.4375, (B) 0.4875, (C) 0.5625, (D) 0.5125. [4]

Q 5.15 The diameter X (in mm) of a circular imperfection in a slice through a steelsample can be assumed to have pdf

fX(x) =

29x 0 < x ≤ 3

0 otherwise.

Find and roughly sketch the pdf of the area of imperfection, Y .

15

Q 5.16 The random variable X ∼ Weibull(1.5, 2). Simulate three values fromthis random variable starting with three realisations u = (0.0127, 0.3721, 0.7453) of aUniform random variable.

Q 5.17 A continuous random variable X has cdf

FX(x) =

0 x ≤ 0

12x 0 < x ≤ 2

1 x > 2

Find the cdf of Y = (X − 1)2. (Note that this is not a one-to-one transformation).

Q 5.18 If X has pdf

fX(x) =

{

(x − a)α−1(b − x)β−1/[ Beta(α, β)(b− a)α+β−1] if a < x < b0 otherwise,

where Beta(α, β) is the Beta function, see the Appendix on integrals), show thatY = (X − a)/(b − a) follows a Beta(α, β) distribution. Find the distribution of T = 1 − Y .

Q 5.19 Let X have pdf

fX(x) =

{

(x + 1)/2 −1 ≤ x ≤ 10 otherwise.

Find the pdf of Y = X2. (Note that this is not a one-to-one transformation).

Q 5.20 If X ∼ Uniform(−π/2, π/2) show that Y = sin(X) has cdf

FY (y) =

0 if y ≤ −112

+ 1π

arcsin(y) if − 1 < y < 11 if y ≥ 1.

where arcsin : [−1, 1]→[−π/2, π/2] is the inverse function of sin. Using the fact that

d

dyarcsin(y) =

1√

1 − y2for − 1 < y < 1,

find the pdf of Y . This problem is interesting as the sea tides can be treated (to areasonable approximation) as the sine function of time, so this pdf reflects the heightof the tide if you arrive at Morecambe sea-front at a random time.

Q 5.21 (following on from the previous question) Use the relation (which you maywant to derive yourself) that

π

2+ arcsin(2z − 1) = 2 arcsin(

√z) for 0 < z < 1,

to show that Z = (Y + 1)/2 has cdf:

FZ(z) =

0 if z ≤ 02π

arcsin(√

z) if 0 < z < 11 if z ≥ 1.

16

Find the pdf of Z. This is the pdf of a distribution you have already met in thequestions for Chapter 2 and the text of Chapter 3. Which?

Q 5.22 Three realisations of a U(0, 1) random variable are 0.0127, 0.3721 and 0.7453.Use these values in questions requiring simulation. You may do this by hand or usingR and setting u=c(.0127, 0.3721, 0.7453)

The random variable Y is given by Y = 3U + π, where U is a Uniform(0, 1) randomvariable. Simulate three values from this random variable.

Q 5.23 Simulate three values from the Beta(3, 1) distribution, using the Uniformrealisations above.

Q 5.24 Suppose that U ∼ Uniform(0, 1), and that F is a cumulative distributionfunction of a continuous random variable for which F−1 exists.

(i) Show that the random variable X = F−1(U) has cumulative distribution functionF .

(ii) Show that X = − 1β

log (1 − U) for β > 0 is an Exponential(β) random variable.

(iii) Use the following 5 realisations of a Uniform (0, 1) random variable

0.4049, 0.8137, 0.4797, 0.7029, 0.1015

to simulate 5 values from a Exponential(1) random variable,

Q 5.25 Let X denote the time (in years) between stock market crashes. It is proposedthat for some θ > 0,

fX(x) =

{

θ exp(−θx) for x > 00 for x ≤ 0.

Show that the expected time between stock market crashes is θ−1 years. If someoneinvests in the stock market immediately after a market crash, assuming that crashesoccur independently, what is the probability that there are no crashes in the stockmarket before the expected time?

Questions for Math 230 Probability: Week 6

Q 6.1 WSwk06 Discrete random variables X and Y have joint probability massfunction

X0 1 2

Y 0 0 0 4/152 6/15 3/15 2/15

Find the marginal pmf of X and Y .

Q 6.2 WSwk06 Sketch the region where the joint pdf

fXY (x, y) =

{

12, 0 < x < y, 0 < y < 2

0, otherwise.

17

is positive, and show that fXY integrates to unity.

Q 6.3 WSwk06 The random variables (X, Y ) have joint distribution function

FXY (x, y) = 1 − exp(−x) − exp(−y) + exp(−x − y) for 0 < x < ∞, 0 < y < ∞.

Obtain: (a) the joint pdf, (b) P(X < 1, Y < 1), (c) P(X < 1), (d) P(X + Y ≤ 1).

Q 6.4 WSwk06 The random variables (X, Y ) have joint pdf

fXY (x, y) =

{ 1√2π

exp(−x2/2) for −∞ < x < ∞, 0 < y < 1,

0 otherwise,

Find the marginal distributions of X and Y and identify their forms.

Q 6.5 QZwk06: Discrete joint pmf The joint pmf of X and Y is

pXY (x, y) = xy/36 for x, y = 1, 2, 3.

Decide on the truth of the following statements.(i) X and Y are identically distributed.(ii) The conditional pmf of X given Y = 2 is uniform.(iii) X and Y are independent.

(A) TTT, (B) TFT, (C) FTF, (D) FFT, (E) FFF.

Q 6.6 QZwk06: Discrete joint pmf continued For the joint pmf above, evaluate(i) P(X < Y ),(ii) P(X + Y ≥ 4).

Which pair is nearest to the truth?

(A) (0.3, 0.9), (B) (0.4, 0.6), (C) (0.3, 0.6), (D) (0.4, 0.9), (E) (0.2, 0.6).

Q 6.7 QZwk06: Normal regression Generate realisations of a random variable X ∼ N(0, 1)and of a second random variable Y ∼ N(αx, 1). Plot the joint realisation, and comparethe standard deviations of X and Y .

n = ??

x = rnorm(n, mean=0 , sd=1 )

alpha = ??

y = rnorm(n, mean=alpha*x, sd=1 )

par( mfrow=c(2,2)) # four subplots

hist(y,col=’yellow’,br=20)

plot(x,y,pch=’.’,cex=3,col=’red’)

frame() # spare plot

hist(x,col=’green’,br=20)

sd(x) ; sd(y) ; cor(x,y)

(i) Choose the sample size and try several values for α.

(ii) Compare the scatterplots when α < 0 and α > 0.

18

(iii) Guess the name of the theoretical marginal distribution of Y from the shape ofthe empirical distribution.

Decide the truth of the statements:(i) The scatterplots are oval clouds,(ii) The principal axis of the oval increases when α > 0,(iii) Both X and Y have bell-shaped histograms,(iv) The standard deviation of X and Y are the same whatever α.

(A) TTTT, (B) TTTF, (C) TTFT, (D) TFTT, (E) FTTT.

Q 6.8 QZwk06: Family planning The average family in the UK has 1.8 children. Thenumber of children that a family has can be modelled by the Poisson distribution. Ifyou assume that each child also has independently a Poisson number of children thena family with x children will have Y ∼ Poisson(1.8x) grandchildren.

Simulate the number of children X and grandchildren Y that 1000 families have.

n = 1000

x = rpois(n, 1.8)

y = rpois(n, 1.8*x)

par( mfrow=c(2,2)) # four subplots

hist(x,col=’green’,br=20)

hist(y,col=’yellow’,br=20)

plot(x,y,pch=’.’,cex=3,col=’red’)

mean(x); mean(y)

sd(x) ; sd(y) ; cor(x,y)

Obtain an estimate for the probability P(Y = 0) that a family has no grandchildren.It is closest to

(A) 0.03, (B) 0.17, (C) 0.22, (D) 0.38, (E) 0.54.

Q 6.9 QZwk06: Family planning continued In Hong Kong, the average family has onechild. Simulate the joint distribution (X, Y ) for the number of children and grandchil-dren in Hong Kong.

Decide the truth of the following statements.(i) X and Y have the same mean,(ii) X and Y have the same standard deviation,(iii) Y has a Poisson distribution.

(A) TTT, (B) TFT, (C) TFF, (D) FTT, (E) FFF.

Q 6.10 CWwk06 Construction firms A, B and C all bid for (the same) two contracts.Each contract is equally likely to be awarded to any firm, and the decisions on the twocontracts are independent. Let X be the number of contracts awarded to firm A andY be the number awarded to firm B.

(a) Write down the joint probability mass function for (X, Y ).

(b) Find FXY (1, 0) = P(X ≤ 1, Y ≤ 0).

19

Q 6.11 CWwk06 Let X and Y have joint pdf

fXY (x, y) =

{

6(1 − y) 0 ≤ x ≤ y ≤ 10 otherwise.

(a) Sketch the set of (x, y) values for which fXY (x, y) > 0 and confirm that this is aprobability density function.(b) Indicate on the sketch the region for which x + y > 1 and find the probability thatP(X + Y > 1).

Q 6.12 CWwk06 Let X and Y have joint pdf fXY (x, y) = 6(1 − y) for 0 ≤ x ≤ y ≤ 1and 0 otherwise.

(a) Sketch the subset of (x, y) values for which both x ≤ 3/4 and y > 1/2. Hence findP(X ≤ 3/4, Y > 1/2).(b) Obtain the marginal distribution for X and Y .

Q 6.13 CWwk06 Peter is waiting at a bus stop where two different buses stop, bothof which can take him home. The joint distribution (in minutes) for the times X andY he needs to wait for the two buses has joint pdf

fXY (x, y) =

{

1150

exp(− 110

x) exp(− 115

y) for 0 < x < ∞, 0 < y < ∞,0 otherwise.

(a) The probability that Peter has to wait for longer than 1 minute to catch a bus is(A) exp(−1/3), (B) exp(−2/3), (C) exp(−1/4), (D) exp(−1/6).

(b) The probability that a bus with waiting time given by X arrives before a bus withwaiting time given by Y is(A) 1

5, (B) 3

5, (C) 2

5, (D) 1

3.

Q 6.14 Exam 2001. Let X and Y be continuous random variables with joint proba-bility density function fXY (x, y) for all −∞ < x < ∞ and −∞ < y < ∞.

(i) Write down P(X ≥ 0, Y + X ≥ 1) in terms of a double integral of fXY (x, y) andsketch the area of integration.

(ii) Define the marginal densities fX(x) and fY (y) of X and Y in terms of fXY (x, y).

Questions for Math 230 Probability: Week 7

Q 7.1 WSwk07 The rvs X and Y follow a distribution specified by X ∼ Exp(1) andY |X = x ∼ Uniform(0, x).

(a) Write down E[Y |X = x] and var[Y |X = x]. (b) Find E[X] and E[Y ]. (c) Findcov(X, Y ).

Q 7.2 WSwk07 Exam 2000. Random variables X and Y have joint probabilitydensity function

fXY (x, y) =1

2πexp{−1

2(x2 + y2)} for −∞ < x < ∞,−∞ < y < ∞.

20

(a) Are X and Y independent?(b) Find the marginal densities of X and Y and identify their form.

Q 7.3 WSwk07 Let X and Y denote the proportions of two chemicals in a pesticide.Suppose they have joint pdf

fXY (x, y) =

2, for 0 < x < 1, 0 < y < 1 0 < x + y < 1

0, otherwise.

Find the marginal pdf of Y , and the conditional pdf of X given Y = y (y ∈ (0, 1)).

Q 7.4 WSwk07 Show that(a) cov(X, Y ) = E(XY ) − E(X) E(Y ).(b) For constants a, b, c and d with a > 0 and c > 0

corr(aX + b, cY + d) = corr(X, Y ).

Is this result true if a > 0 and c < 0? Explain your answer.

Q 7.5 WSwk07 The duration of appointments at a doctor’s surgery can be assumedto be independent and identically distributed exponential random variables with mean5 minutes. If there are 2 patients ahead of you in the waiting room and 1 patientalready with the doctor, what is the expectation and variance of your waiting time?

Q 7.6 WSwk07 Let X, Y be independent normal random variables, each with mean0 and variance 1/2. Find the mgf of the rv X + Y .

Q 7.7 QZwk07: Exponential regression model A random variable X ∼ Exp(1) anda second random variable Y ∼ Exp( 1

αx). Evaluate mathematically the conditional

expected value E(Y |X = x) of Y given X; and the marginal expected value E(Y ).

Generate a random sample from the joint distribution using

n = 1000

x = rexp(n, rate=1 )

alpha = 2

y = rexp(n, rate=1/(alpha*x) )

mean(y)

cor(x,y)

par( mfrow=c(2,2))

hist(y,col=’yellow’,br=20)

plot(x,y,pch=’.’,col=’red’)

frame()

hist(x,col=’green’,br=20)

Decide the truth of the statements:(i) E(Y ) = α,(ii) Permissible values of α that give a valid pdf include −1,(iii) X has an exponentially-shaped histogram,(iv) Y does not have an exponentially-shaped histogram.

21

(A) TTTT, (B) TTTF, (C) TTFT, (D) TFTT, (E) FTTT.

Q 7.8 QZwk07: Exponential again The following code generates a joint distributionof X and Y .

n = 1000

x = rexp(n, rate=1 )

y = x + rexp(n, rate=1 )

par( mfrow=c(2,2))

hist(y,col=’yellow’,br=20)

plot(x,y,pch=’.’,col=’red’)

frame()

hist(x,col=’green’,br=20)

From this code find the analytic form of the conditional and joint distributions of Y .Guess the marginal distribution of Y from the shape of the histogram.

Decide the truth of the statements:(i) The conditional pdf of Y is exp{−(y − x)}, y > x > 0.(ii) The scatterplot is a rectangular cloud,(ii) The marginal distribution of Y is multimodal,(iv) The marginal distribution Y ∼ Gamma(2).

(A) TFFT, (B) FTTF, (C) FFTT, (D) TTFF, (E) FTFT.

Q 7.9 QZwk07: Correlated uniforms This can be adapted to generate samples of abivariate random variable (X1, X2) with correlation ρ:

par( mfrow=c(1,1))

n = 1000 ;

z1 = runif(n,0,1) ; z2 = runif(n,0,1) ;

cor(z1,z2) # should be near zero

plot(z1,z2) # reflects independence

rho = 0.5

x1 = z1 ;

x2 = z1*rho + z2*(1-rho^2)^(0.5) ;

sd(x1) ; sd(x2)

cor(x1,x2)

plot(x1,x2,pch=’x’) # reflects dependence

Decide the truth of the statements:(i) The scatterplot is a trapezoidal shaped cloud,(ii) The marginal distribution of X1 is uniform,(iii) The marginal distribution of X2 is uniform,

(A) TTT, (B) FTT, (C) TFT, (D) TTF, (E) FFF.

Q 7.10 QZwk07: Linear transformations A taxi driver travels X1 hours at 55mph,X2 hours at 35mph and X3 hours at 25mph. Suppose X1, X2 and X3 are indepen-dent with expectations 1.7, 4.6 and 2.7 (hours), and variances 0.16, 0.25 and 0.18

22

respectively. Find the expectation and variance of the total number of miles travelledD = 55X1 + 35X2 + 25X3.

These are closest to the pair

(A) (300, 900), (B) (300, 20), (C) (100, 900), (D) (100, 20).

Q 7.11 QZwk07:Moment generating functions A random variable X follows the expo-nential distribution with X ∼ Exp(6) and the mgf is given by MX(t) = 6

6−tfor t < 6.

Find the mgf of the rv Z = 12

+ 2X.

Its value at t = 2 is

(A) 32, (B) 3, (C) 3e, (D) 3e2, (E) e3.

Q 7.12 CWwk07 Exam 2000. Random variables X and Y have joint probabilitydensity function

fXY (x, y) =

{

24x(1 − y) for 0 < x < y < 10 otherwise.

(a) Confirm that this is a probability density function.(b) Are X and Y independent? Give reasons.(c) Find and roughly sketch the marginal probability density functions of X and Y .

Q 7.13 CWwk07 A drinks machine has a random amount Y (in gallons) in supplyat the beginning of a given day and dispenses a random amount X during the day. Itis not resupplied during the day and so X < Y . The joint pdf is

fXY (x, y) =

1/2 0 < x < y 0 < y < 2

0 otherwise.

Find the conditional density of X given Y = y. Evaluate the probability that less then0.5 gallons are sold, given that the machine contains 1 gallon at the start of the day.Is this joint model sensible? (Hint: think about P(X = y | Y = y)).

Q 7.14 CWwk07 Which, if any, of the following joint pdfs correspond to independentrandom variables?

a) fXY (x, y) = 1√2πσ

e−1

2σ2 (x−µ)2 0 < y ≤ 1, −∞ < x < ∞

b) fXY (x, y) = 12(x + y)e−(x+y) x, y > 0

c) fXY (x, y) = 1y

0 < x < y < 1

d) fXY (x, y) = λk+1yk−1e−λ(x+y)

(k−1)!x, y > 0

(Hint: there is no need to obtain marginals).

Q 7.15 CWwk07 Exam 2001.

(i) State cov(X, Y ) in terms of E(X), E(Y ) and E(XY ).

23

(ii) Let X1 and X2 be two random variables and let a1, a2, b1 and b2 be four constants.The expression of cov(a1X1 + a2X2, b1X1 + b2X2) in terms of var(X1), var(X2)and cov(X1, X2) is given by(A) a1a2 var(X1) + b1b2 var(X2),(B) a1a2 var(X1) + (a1a2 + b1b2) cov(X1, X2) + b1b2 var(X2),(C) a1b1 var(X1) + a2b2 var(X2),(D) a1b1 var(X1) + (a1b2 + b1a2) cov(X1, X2) + a2b2 var(X2).

(iii) Let var(X1) = 2, var(X2) = 3, and cov(X1, X2) = −1. The var(X1 + X2) is(A) 3, (B) 5, (C) 4, (D) 7.

Q 7.16 CWwk07 Let X, Y be independent rvs, each of them follows the standardnormal distribution. Using the mgf show that the rvs X + Y and X − Y are indepen-dent.

The mgf of a normally distributed rv with mean 0 and variance 1 is et2

2 .

Q 7.17 Exam 2001. Which, if any, of the following joint probability density functionscorrespond to independent random variables X and Y ? Give reasons.

(i) fXY (x, y) = 1

2 log 2· 1

x+yfor 0 ≤ x ≤ 1, 0 ≤ y ≤ 1,

(ii) fXY (x, y) = 2

log 2· x

y+1for 0 ≤ x ≤ 1, 0 ≤ y ≤ 1,

(iii) fXY (x, y) = 154x4(x + y) for 0 ≤ x ≤ 1, 0 ≤ y ≤ 1,

(iv) fXY (x, y) = 6(y − x) for 0 ≤ x ≤ y ≤ 1.

Q 7.18 If X and Y are independent continuous random variables show thatE(Y |X) = E(Y ).

Q 7.19 The weight W of material in a container is determined by the gross weight Gminus tare (empty) weight T . The same tare is used for all measurements and the tareweight is measured with a measurement error that is zero mean and variance σ2

T . Thegross weight is measured with a measurement error that is zero mean and variance σ2

G.All measurements are independent. Suppose the gross weight of two different materialsare G1 and G2.

(a) What are the random variables W1 = G1 − T and W2 = G2 − T .

(b) Find cov(W1, W2) and var(W1 + W2).

Questions for Math 230 Probability: Week 8

Q 8.1 WSwk08 Suppose X1, X2 and X3 are independent random variables withexpectations 3, -1 and 2, and variances 5, 8 and 9 respectively. Find the means,variances and covariance of

Y1 = 3X1 − 2X2 + X3 and Y2 = X2 − X3.

24

Q 8.2 WSwk08 Let X = (X1, X2, X3)′ have variance matrix

4 2 02 6 00 0 4

.

Find the variance matrix of Y = AX where

A =

1 −1 01 0 −10 1 −1

.

Q 8.3 WSwk08 The random variables X, Y ∼ Exp(β) and X and Y are independent.Find the joint and the marginal distribution of S = X

X+Y, T = X + Y . Are these

independent?

Q 8.4 WSwk08 Exam 2001. Let X1 and X2 be two continuous random variables withjoint probability density function

fX1X2(x1, x2) =

12, |x1| + |x2| ≤ 1

0, otherwise.

(i) Sketch the area where fX1X2(x1, x2) = 12.

(ii) Are X1 and X2 independent?

(iii) Show that the marginal probability density function of X1 is

fX1(x1) =

1 − |x1|, −1 ≤ x1 ≤ 1

0, otherwise.

(iv) Derive the joint probability density function of S = X1 + X2 and T = X1 − X2.

(v) Are S and T independent?

Q 8.5 WSwk08 Let X and Y have joint pdf

f(x, y) =

exp(−x − y) x > 0, y > 0

0 otherwise.

Find the joint pdf of S = X and T = X + Y . First sketch the region of (S, T ) for which(X, Y ) has non-zero joint density.

Q 8.6 QZwk08: Bivariate normal A univariate normal generator can be adapted togenerate a sample of a bivariate random variable (X1, X2) with correlation ρ.

25

par( mfrow=c(2,2))

n = 10000

z1 = rnorm(n) ; z2 = rnorm(n)

plot(z1,z2,pch=’.’) # reflects independence

cor(z1,z2)

rho = 0.5

x1 = z1

x2 = z1*rho + z2*(1-rho^2)^(0.5)

plot(x1,x2,pch=’.’) # reflects dependence

Now consider the transformation

y1 = 1 + 2*x1

y2 = -1 + 4*x2

From what distribution is y1 a sample:

(A) Exp(1), (B) N(2, 2), (C) Uniform(−2, 2), (D) N(1, 2), (E) N(1, 4).

Q 8.7 QZwk08: Bivariate normal continued Now consider the transformation

y1 = x1 - x2

y2 = x1 + x2

Identify the correlation in the joint distribution of (X1, X2) and of Y1 and Y2.

Decide if

(A) −0.1, (B) −0.0, (C) 0.1, (D) 0.2, (E) 0.3

Q 8.8 QZwk08: Bivariate normal regions Estimate P(X1 + X2 > 2) from your sample.It is closest to

(A) 0.52, (B) 0.12, (C) 0.00, (D) 0.84, (E) 0.35

Q 8.9 QZwk08: Regions continued Estimate P(X1X2 < 0) from your sample. It isclosest to

(A) 0.35, (B) 0.52, (C) 0.00, (D) 0.65, (E) 0.15

Q 8.10 CWwk08 Suppose X1, X2, . . .Xn are independent and identically distributedrandom variables, and let X be their sample mean. Define Yi = Xi − X for i = 1, 2, . . . , n.Show that X and Yi are uncorrelated for any i. (Hint: by symmetry, if the result holdsfor Y1 it will hold for any i. Write both X and Y1 as linear combinations, i.e. findconstants {aj} and {bj}, j = 1, 2, . . . , n, such that X =

ajXj and Y1 =∑

bjXj . Usethe vector results for covariances from notes).

Q 8.11 CWwk08 Marks for course-work on this course are likely to follow a N(7, 2)distribution and the marks for the exam follow a N(45, 100) distribution. The totalmark for the course is a sum of course-work and exam marks, with a pass and firstcorresponding to marks of 35 and 70 respectively.

26

(a) Assuming marks for the course-work and exam are independent, the probabilitiesof failing and of obtaining a first are(A) 0.434 and 0.429, (B) 0.046 and 0.037, (C) 0.057 and 0.048, (D) 0.316 and0.281.

(b) Repeat (a) under the assumption of perfect correlation between course-work andexam marks. The corresponding probabilities are now(A) 0.048 and 0.039, (B) 0.224 and 0.211, (C) 0.068 and 0.057, (D) 0.448 and0.445.

(c) Which assumption of dependence is more realistic and why?

Q 8.12 CWwk08 If X ∼ Binomial(n, θ), use the fact that we can write X =∑n

i=1 Xi

where Xi are IID Bernoulli(θ) random variables to show that E(X) = nθ and thatVar(X) = nθ(1 − θ).

Q 8.13 CWwk08 Exam 2000. Random variables X and Y have joint probabilityfunction

fXY (x, y) =

{

x exp(−xy) for 0 < x < ∞, 1 < y < ∞0 otherwise.

(a) Show that the joint probability density function of S = XY and T = X is

fST (s, t) =

{

exp(−s) for 0 < t < s < ∞0 otherwise.

(b) Find the marginal probability density functions of both S and T .

Q 8.14 The time for appointments at a doctor’s surgery can be assumed to be in-dependent and identically distributed Normal random variables with mean 10 minutesand standard deviation 3 minutes. There are 3 patients ahead of you in the queue.(a) What is the distribution of your waiting time?(b) What is the probability you wait less than 25 minutes?

Q 8.15 Suppose X ∼ Gamma(a, λ) and, independently, Y ∼ Gamma(b, λ). Derivethe joint pdf of S = X + Y and T = X/Y . Are S and T independent? Give yourreason.

Q 8.16 Let X and Y be independent random variables with X having a Betadistribution with pdf

fX(x) =Γ(α + β)

Γ(α)Γ(β)xα−1(1 − x)β−1 0 < x < 1

and Y having a Gamma(α + β, 1) distribution with pdf

fY (y) =yα+β−1e−y

Γ(α + β)y > 0.

(a) Find the joint probability density function of S = XY and T = (1 − X)Y .(b) Find the marginal pdfs of S and T , and show that S and T are independent.

Q 8.17 The lecture notes show that if the Cartesian coordinates of a point in a planeare independent standard Normal random variables, then the polar coordinates R and

27

Θ are also independent, with R having pdf

f(r) = re−r2/2

for r > 0, and Θ ∼ U(0, 2π).(a) Given the simulated value u1 = 0.715, obtain a simulated realisation of Θ, explain-ing your method. Keep 4dp accuracy.(b) Given the simulated value u2 = 0.114, obtain a simulated realisation of R, againexplaining your method.(c) Hence generate two independent standard Normal random variables.

Q 8.18 Let X ∼ N(0, 1) and, independently, Y ∼ χ2r . Show that

X√

Y/r∼ tr

(i.e. a t distribution with parameter r).

Q 8.19 Suppose X ∼ χ2r and independently Y ∼ χ2

s. Show that F = (X/r)/(Y/s)has Fr,s distribution.

Q 8.20 Lifetimes X and Y of two mechanical components can be assumed to havejoint pdf

fXY (x, y) =

x exp{−(x + y)/2}/8 x > 0, y > 0

0 otherwise.

Find the pdf of the relative efficiency S = Y/X.

Questions for Math 230 Probability: Week 9

Q 9.1 WSwk09 Prove that the ratio of two independent N(0, 1) random variables Xand Y has the Cauchy distribution with pdf

f(s) =1

π(1 + s2)−∞ < s < ∞.

(Hint: try S = X/Y , T = Y , and remember to multiply by the absolute value of theJacobian).

Q 9.2 WSwk09 Let X be a random variable with mean µ and E(X − µ)4 = τ . Showthat

P(|X − µ| > ǫ) ≤ τ

ǫ4.

Q 9.3 WSwk09 Exam 2006.

(a) State the Central Limit Theorem for a sequence of iid random variables X1, X2, . . .each with mean µ and finite variance σ2.

(b) Find the expected value and variance of the random variable X ∼ Bernoulli(θ)where 0 < θ < 1.

28

(c) Suppose X1, X2, . . . is a sequence of iid Bernoulli(θ) random variables, and thatXn = 1

n

∑ni=1 Xi. State the expected value and variance of Xn.

(d) Find approximately P(Xn < 0.6) in terms of the standard Normal distributionfunction Φ(), when it is known that θ = 0.5 and n = 100,

Q 9.4 WSwk09 An airline knows that the weight of a randomly chosen suitcase (inkg) is a random variable with expectation 16 and standard deviation 5. A cargo areaholds 100 such suitcases. What is the approximate probability that the total weightwill exceed 1700kg? What is the 99th quantile of the distribution of total weight?(Express all answers in terms of the cdf for the standard Normal distribution, Φ(·).)

Q 9.5 WSwk09 Exam 2004.

(a) Let X denote the daily sales of Product A in thousands of units sold. The pdf ofX is

fX(x) =

{

γx−γ−1 for x > 10 otherwise,

where γ > 0 is a constant. The daily profit from sales of Product A, in pounds, is givenby Y = log (X).

(i) Show that

E(X) =γ

γ − 1for γ > 1.

(ii) Show that the pdf for Y is given by

fY (y) =

{

γ exp(−γy) for y > 00 otherwise.

(iii) State the expected daily profit and explain why E(Y ) 6= log E(X).

(iv) Assuming that daily sales are independent from day-to-day, identically distributed,and that there are 300 trading days in a year, give an approximate distribution of thetotal annual profit. You may assume that the variance of the daily profit is γ−2.

(v) For γ = 0.001, use the approximate distribution found in (iv) to show that theprobability that the total annual profit exceeds £334, 000 is 0.025.

(b) Daily profits on Product B are independent from, and have the same distributionas, daily profits on Product A with γ = 0.001. For a shop that sells both products findthe probability that the total annual profits from the two products exceeds £668, 000.

Q 9.6 QZwk09: Exponential simulation and the LLN Suppose the random variable Xhas the Exp(1/8) distribution. One Monte Carlo estimation to approximate P(X > 4)is

x = rexp(1000,rate=1/8)

ind = (x>4)

mean(ind)

Repeat this calculation with 1000000 repetitions. Write down the true probability

29

(A) 0.3, (B) 0.4, (C) 0.5, (D) 0.6, (E) 0.7

Q 9.7 QZwk09: LLN again Again if X ∼ Exp(1/8), find the best guess of E(sin(X)).

(A) −0.06, (B) 0.12, (C) 0.17, (D) 0.22, (E) 0.26

Q 9.8 QZwk09: Evidence of the CLT for means Simulate samples of size 1000 fromthe means of n Uniform[0, 1] random variables, for n = 1, 2, 20, 100. The value n = 1is for comparison. The code to generate means with n = 2 is

par(mfrow=c(2,2)) # to get 4 subplots

z = matrix(0,nrow=1000) # initialise storage

n = 2

for (i in 1:1000){ z[i] = mean( runif(n) ) }

sd(z)

y = (z-0.5)/sd(z) # rescale

mean(y)

hist(y,30,col=’yellow’)

Decide the truth of the statements:(i) The standard deviations of Z decrease as the number n increases,(ii) The means of Y increase as n increases,(ii) The histograms of Y become more bell-shaped as n increases.

(A) TTT, (B) TTF, (C) TFT, (D) FTT, (E) FFF.

Q 9.9 QZwk09: Evidence of a limiting distribution for maximums Simulate samplesof size 1000 from the maxima of n Uniform[0, 1] random variables, for n = 1, 2, 4, 20.The value n = 1 is for comparison. The code to generate means with n = 2 is

par(mfrow=c(2,2)) # to get 4 subplots

z = matrix(0,nrow=1000) # initialise storage

n = 2

for (i in 1:1000){ z[i] = max( runif(n) ) }

sd(z)

y = (z-0.5)/sd(z) # rescale

mean(y)

hist(y,30,col=’yellow’)

Decide the truth of the statements:(i) The standard deviations of Z decrease as n increases,(ii) The means of Y increase as n increases,(ii) The histograms of Y become more bell-shaped as n increases.

(A) TTT, (B) TTF, (C) TFT, (D) FTT, (E) FFF.

Q 9.10 QZwk09: Bernoulli proportions Modify the following code to:generate 100 independent Bernoulli random variables with P(X = 1) = 0.7,take their mean to generate X,repeat this 1000 times. Calculate the proportion of X values bigger than 0.8.

30

par(mfrow=c(2,2)) # to get 4 subplots

z = matrix(0,nrow=1000) # initialise storage

n = 2

for (i in 1:1000){ z[i] = mean( runif(n) ) }

y = (z>0.7)

mean(y)

hist(z,30,col=’yellow’)

This proportion is nearest

(A) 0.01, (B) 0.05, (C) 0.1, (D) 0.15, (E) 0.20

Q 9.11 CWwk09 When a current X (measured in amperes) flows through a resistanceY (measured in ohms) the power generated is given by S = X2Y (measured in watts).Suppose that X and Y are independent random variables with densities

fX(x) = 6x(1 − x) 0 < x ≤ 1

andfY (y) = 2y 0 < y ≤ 1.

Determine the pdf of S. [Hint: let T = Y .]

Q 9.12 CWwk09 Insurance companies consider annual profit on a policy for oildrilling platforms to be random variables with expectation 17.5 thousand pounds andvariance 1.62 (thousand pounds)2.

(a) Assume that there 50 such annual policies, how would you represent them?

(A) X, Y, . . ., (B) x, y, . . ., (C) x1, x2, . . ., (D) X1, X2, . . .

(b) If the profits for different annual policies are mutually independent, the probabilitythat the average profit from 50 annual policies will exceed 18 thousand pounds isapproximately

(A) 0.0027, (B) 0.3472, (C) 0.9973, (D) 0.3788.

Q 9.13 CWwk09 Times spent on processing orders are independent random variableswith mean 1.5 minutes and standard deviation 1 minute. Let n be the number of ordersan operator is scheduled to process in 2 hours. Find the value of n which give 95%chance of completion in that time.

Q 9.14 CWwk09 Exam 2001.

(a) Let Xn = 1n

∑ni=1 Xi, where X1, X2, . . . is a sequence of independent and identi-

cally distributed random variables with mean µ and finite variance σ2.

(i) State the central limit theorem.

(ii) Use the central limit theorem to give the approximate distribution of Xn.

(b) Two companies A and B produce batteries. Batteries from company A have anexpected lifetime of µA = 9 hours with a standard deviation of σA = 2 hours.Batteries from company B have an expected lifetime of µB = 10 hours with astandard deviation of σB = 1 hour.

31

(i) Let X1, . . . , X10 be the lifetimes of 10 randomly chosen batteries from com-pany A. The distribution of the average lifetime X10 = 1

10

∑10i=1 Xi is ap-

proximately

(A) N(10, 4), (B) N(9, 4), (C) N(9, 0.2), (D) N(9, 0.4).

(ii) Independent of the batteries already chosen, 10 randomly chosen batteriesfrom company B are selected. Let Y1, . . . , Y10 be the corresponding life-times, and let Y10 = 1

10

∑10i=1 Yi be the average lifetime. The approximate

distribution of X10 − Y10 is

(A) N(−1, 0.3), (B) N(−1, 0.5), (C) N(1, 0.3), (D) N(−1, 3).

(iii) Using the approximation in (ii), the probability that X10 is less than Y10 is

(A) 0.079, (B) 0.921, (C) 0.977, (D) 0.966.

(iv) As the probability P(X10 < Y10) is not close to 1, it is difficult, from samplesof size 10, to identify which company makes the better batteries. Let Xn bethe average lifetime of n randomly chosen batteries from company A, andlet Yn be the average lifetime of n randomly chosen batteries from companyB. How big should n be for P(Xn < Yn) to be approximately 0.99?

(A) 36.23, (B) 19.26, (C) 27.05, (D) 11.63.

(v) Now, suppose n batteries are chosen from company A and m from companyB. It can be shown that P(Xn < Ym) = 0.99 when n = 32 and m = 16, so thecorrect ordering of sample means can be achieved with the same probabilityas in part (iv) but using less batteries. Explain why it is better to take morebatteries from company A than from company B.

Q 9.15 Suppose X ∼ Gamma(α, 1) and, independently, Y ∼ Gamma(β, 1). Showthat S = X/(X + Y ) has a Beta pdf

fS(s) =Γ(α + β)

Γ(α)Γ(β)sα−1(1 − s)β−1 0 < s < 1.

(Hint: try T = X + Y ).

Questions for Math 230 Probability: Week 10

Q 10.1 WSwk10 The joint distribution of (X, Y )′ is bivariate Normal with mean[

3 5]′

and variance

[

3 −1−1 2

]

.

Find the distribution of T = 4X − Y .

Q 10.2 WSwk10 Exam 2008. Random variables X and Y have joint pdf

fXY (x, y) =1

2πexp

{

−1

2(x2 + y2)

}

, for −∞ < x, y < ∞

(a) Find the marginal densities of X and Y and identify their form.

32

(b) Are X and Y independent? Give reasons.

(c) Suppose

[

ST

]

=

[

1−2

]

+

[

1 2−1 3

] [

XY

]

.

Give the mean and the variance of the random vector

[

ST

]

and hence state its dis-

tribution.

Q 10.3 WSwk10 Let (X1, X2, X3, X4)′ be multivariate Normal with

X1

X2

X3

X4

∼ MVN4

230

−1

,

17 2 −3 −22 9 5 −9

−3 5 11 1−2 −9 1 14

.

Find the marginal distribution of (X1 + X3, 2X2 − X4, X3 + X4).

Q 10.4 WSwk10 Suppose that X and Y have bivariate Normal distribution withparameters µX , µY , σ2

X , σ2Y and ρ. Show that the conditional distribution of X given

Y = y is Normal with expectation µX + ρ(y − µY )σX/σY and variance σ2X(1 − ρ2). You

may assume that the marginal distribution of Y is N(µY , σ2Y ).

Q 10.5 WSwk10 The random variables X1, . . .Xn are independent with E(Xi) = µi

and var(Xi) = σ2 for 1 ≤ i ≤ n. For constants ai, bi, 1 ≤ i ≤ n, show that

cov

(

i

aiXi,∑

i

biXi

)

= σ2∑

i

aibi.

Deduce that if X1, . . . , Xn are normal random variables, then∑

i aiXi and∑

i biXi areindependent if and only if

i aibi = 0.

33