Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

MATH1725 Introduction to Statistics: Worked examples

Worked Example: Lectures 12


The lifetimes of 400 light-bulbs were found to the nearest hour. The results were recorded as
follows.
Lifetime (hours)
Frequency

0199
143

200399
97

400599
64

600799
51

800999
14

10001199
14

12001999
17

Construct a histogram and cumulative frequency polygon for these data. Estimate the percentage
of bulbs with lifetime less than 480 hours.

120
20 40 60 80
0

Freq. per 200 hour class

Answer: Lifetimes cannot be negative so class intervals are [0, 199.5), [199.5, 399.5), [399.5, 599.5),
and so on.

500

1000

1500

2000

Lifetime (hours)

Adjust height of the rectangle for the 12002000 interval to make histogram area proportional
to frequency. If the vertical axis is frequency per interval of 200 hours, the height of the [0, 199.5)
class is 143 200/199.5 = 143.4 to allow for the first class not being of width 200.
Lifetime (hours)
Cumulative frequency

0.0
0

199.5
143

399.5
240

599.5
304

799.5
355

999.5
369

1299.5
383

1999.5
400

300
280

265.8
260

Cumulative freq.

300
200

480

240

100
0

Cumulative freq.

400

Make the cumulative frequency at time zero equal to 0.

500

1000

1500

2000

400

450

Lifetime (hours)

500
Lifetime (hours)

Estimated number of light-bulbs with lifetime less than 480 hours is


240 +

480 399.5
(304 240) = 265.8.
200
1

550

600

Required percentage is

265.8
100 = 66.4%
400

Worked Example: Lectures 12


The Christmas cactus Zygocactus truncatus has branches made up of separate segments. For one
such cactus the number of segments in each branch were counted.
Number x of segments
Number of branches with x segments

1
3

2
0

3
6

4
7

5
8

6
18

7
8

8
0

9
2

Construct a cumulative frequency polygon to represent these data.


Answer: The data is discrete so cumulative frequency plot is a step function.
1
3

2
3

3
9

4
16

5
24

6
42

7
50

8
50

9
52

40
30
20
0

10

Cumulative freq.

50

60

Number x of segments
Number of branches with x segments

10

Number of segments

Worked Example: Lectures 12


The following data give one hundred measurement errors made during the mapping of the American
state of Massachusetts during the last century.
Error X (in minutes of arc)
Frequency

(4, 2]
10

(2, 0]
43

(0, +2]
39

(+2, +4]
5

(+4, +6]
3

Show that the sample mean and sample standard deviation for these data are x
= 0.04 and
s = 1.717 respectively.
Answer:
Class
4< x 2
2< x 0
0< x +2
+2< x +4
+4< x +6
Totals

Class frequency f
10
43
39
5
3
n = 100

Class mid-point x
3
1
+1
+3
+5

fx
30
43
39
15
15
4

f x2
90
43
39
45
75
292

x
=
s2 =

4
= 0.04 .
100

1
(292 100 (0.04)) = 2.9479,
99

so

s=

(s2 ) =

2.9479 = 1.717 .

Worked Example: Lectures 12


The time between arrival of 60 patients at an intensive care unit were recorded to the nearest hour.
The data are shown below.
Time (hours)
Frequency

019
16

2039
13

4059
17

6079
4

8099
4

100119
3

120139
1

140159
1

160179
1

Determine the median and semi-interquartile range. Explain why this pair of statistics might be
preferred to the mean and standard deviation for these data.
Answer:
Time (hours)
Cumulative frequency

0.0
0

19.5
16

39.5
29

59.5
46

79.5
50

99.5
54

119.5
57

139.5
58

159.5
59

179.5
60

Median lies in 4059 class, corresponding to cumulative frequency 30.


Lower quartile is in 019 class, corresponding to cumulative frequency 15. Notice that this
class has width 19.5 hours, not 20 hours.
Upper quartile is in 4059 class, corresponding to cumulative frequency 45.
30 29
20 = 40.7 hours.
46 29
15 0
19.5 = 18.3 hours.
Lower quartile = 0.0 +
16 0
45 29
Upper quartile = 39.5 +
20 = 58.3 hours.
46 29
Median = 39.5 +

Semi-interquartile range = 21 (58.3 18.3) = 20.0 hours.

15
10
5
0

Freq. per 20 hour class

20

The histogram for these data is positively skew, so the median and semi-interquartile range might
be preferred to the mean and standard deviation as measures of location and dispersion respectively.

50

100
Interarrival time (hours)

150

200

Worked Example: Lectures 46


A firm investigates the length of telephone conversations of their office staff. Ten consecutive
conversations had lengths, in minutes:
10.7, 9.5, 11.1, 7.8, 11.9, 4.1, 10.0, 9.2, 6.5, 9.2.
derive a 95% confidence interval for the mean conversation length. Test whether the mean length
of a conversation is eight minutes.
Answer:

1X
90
x
=
xi =
= 9 minutes.
n
10
i=1
)
( n
X
1
x2i n
x2 = 5.42.
s2 =
n1
i=1

2
2
Estimate the population variance by s with s = 5.42 = 2.33. Then

X
tn1 .
s/ n

95% confidence interval for is x


t9 (2.5%)s/ 10. Here s/ 10 = 0.737, t9 (2.5%) = 2.262.
s
x
t9 (2.5%)
10

= 9 (2.262 0.737)
= 9 1.667 = (7.3, 10.7).

Since 8 minutes lies inside the 95% confidence interval we would accept H0 in testing H0 : =
8 vs. H1 : 6= 8 at the 5% significance level.

Worked Example: Lectures 56


A population has a Poisson distribution but it is not known whether the mean is 1 or 4. To
test the hypothesis H0 : = 1 vs. H1 : = 1 on the basis of one observation X the following test
procedure is considered: reject H0 if X i.
Type I error is defined to be rejecting H0 when H0 is true. Find the probability of type I
error for the three cases i = 2, 3, 4.
Answer: If H0 is true, = 1 and
pr{X = x} =

e1
,
x!

x = 0, 1, 2, . . . ,

so that pr{Type I error} = pr{X i}.


If i = 2,
pr{Type I error} = pr{X 2} = 1pr{X < 2} = 1pr{X = 0}pr{X = 1} = 1e1 e1 = 0.264.
Similarly if i = 3,
pr{Type I error} = pr{X 3} = 1 pr{X < 3} = 0.080.
If i = 4,
pr{Type I error} = pr{X 4} = 0.019.
Notice that an exact 5% or 10% significance level test does not exist for this discrete distribution.
4

Worked Example: Lectures 56


A sample of size 64 is drawn by simple random sampling from a normal population which has
variance 4. The sample mean is 0.45. Test the hypothesis H0 : = 0 vs. H1 : 6= 0 at the 5%
level of significance. Repeat for testing H0 : = 0 vs. H1 : > 0
N(, 2 /n) with 2 = 4, n = 64, so 2 /n = 0.0625 and X
N(, 0.0625).
Answer: Here X
Test statistic is

X
X
X
=
Z=
=
/ n
0.25
0.0625
where Z N(0, 1) if H0 is true.
For = 0.05 with a two-sided test, z/2 = 1.96. Critical region is Z < 1.96 and Z > 1.96.
Observed value is z = 0.45/0.25 = 1.8. This does not lie in critical region so accept H0 .
For = 0.05 with a one-sided test, z = 1.645. Critical region is Z < 1.645. Observed value
is z = 1.8 which lies in critical region so reject H0 .

Worked Example: Lecture 6


The absenteeism rates (in days and parts of days) for nine employees of a large company were
recorded in two consecutive years.
Employee
Year 1
Year 2

1
3.0
2.8

2
6.7
5.1

3
11.3
8.4

4
5.0
5.0

5
9.4
6.2

6
15.7
12.2

7
8.0
10.0

8
10.0
6.8

9
9.7
6.0

Is there any evidence that the average absenteeism rate is different for the two years?
Answer: Data paired same employee studied in each of the two years.
Form difference di = (year 1)i (year 2)i . Need to estimate variance d2 .
Test H0 : d = 0 vs. H1 : d 6= 0. See lecture 6.

Worked Example: Lecture 8


Which phrases i-iv below apply to the sample correlation coefficient rXY ?
(i) measures linear association between two variables,
(ii) is never negative,
(iii) has positive slope,
(iv) depends on the units of measurement of X and Y .
Answer: i only.

Worked Example: Lecture 8


The tensile strength of a glued joint is related to the glue thickness. A sample of six values gave
the following results:
Glue Thickness (inches)
Tensile Strength (lbs.)

0.12
49.8

0.12
46.1

0.13
46.5

0.13
45.8

0.14
44.3

0.14
45.9

Calculate the sample correlation coefficient r for these data.


Use the fitted least squares regression line to predict the tensile strength of a joint for a glue
thickness of 0.14 inches.
Using scatter-diagrams, sketch the form of regression line expected in the three cases when r
takes the values 1, 0, and +1.
5

Answer: Let X denote the glue thickness and Y the joint strength.
x
0.12
0.12
0.13
0.13
0.14
0.14
0.78

Totals

y
49.8
46.1
46.5
45.8
44.3
45.9
278.4

x2
0.0144
0.0144
0.0169
0.0169
0.0196
0.0196
0.1018

y2
2480.04
2125.21
2162.25
2097.64
1962.49
2106.81
12934.44

xy
5.976
5.532
6.045
5.954
6.202
6.426
36.135

1
s2X = {0.1018 6(0.131)2 } = 0.00008,
5
1
1
s2Y = {12934.44 6(46.41)2 } = 3.336, sXY = {36.135 6(0.131)(46.41)} = 0.0114.
5
5
sXY
0.0114
= 0.698.
rXY =
=
sX sY
0.00008 3.336
x
=

0.78
= 0.131,
6

y =

278.4
= 46.41,
6

Regression line:

y = y + (x x
)

sXY
0.0114
= 64.925 142.5x.
= 46.4 + (x 0.13)
0.00008
s2X

At x = 1.4 this gives y = 44.975 lbs..


Scatter-plots:
r = 1: data lies on a straight line with negative slope.
r = +1: data lies on a straight line with positive slope.
r = 0: data randomly scattered (X and Y independent) or could show case with X and Y having
a non-linear dependence as in the lecture notes. You could even show both of these cases!

Worked Example: Lecture 11


A coin is tossed three times. Let X denote the number of heads and Y the length of the longest
run of heads or tails. Thus HTT gives X = 1 and Y = 2, THT gives X = 1 and Y = 1.
(a) Obtain the joint probabilities of X and Y .
(b) Obtain the marginal probability distribution of X and Y .
(c) If X = 1, what is the distribution of Y ?
Answer: (a and b) All eight outcomes are equally likely, so occur with probability 1/8.
Outcome
X
Y
Probability

HHH
3
3
1/8

HHT
2
2
1/8

0
1
2
3
pY (y)

HTH
2
1
1/8

1
0
1/8
1/8
0
1/4

HTT
1
2
1/8
Y
2
0
1/4
1/4
0
1/2

3
1/8
0
0
1/8
1/4

THH
2
2
1/8

THT
1
1
1/8

pX (x)
1/8
3/8
3/8
1/8
Total = 1

TTH
1
2
1/8

TTT
0
3
1/8

Joint probabilities p(x, y) are found by summing probabilities for each outcome giving rise to
(X = x, Y = y). Thus p(1, 2) = pr{HT T or T T H} = 1/4.
Marginal probabilities are found by forming row or column sum. Thus, for Worked Example,
pr{X = 2} = p(2, 1) + p(2, 2) + p(2, 3) =

3
.
8

(c) If X = 1, then
pr{Y = y|X = 1} =

p(1, y)
p(1, y)
=
.
pX (1)
3/8

Thus
pr{Y = 1|X = 1} =

1/8
= 1/3,
3/8

pr{Y = 2|X = 1} =

2/8
= 2/3,
3/8

pr{Y = 3|X = 1} = 0.

If X = 1, then the outcome is one of HTT, THT, TTH. In one out of these three cases we observe
Y = 1 and in two out of three we observe Y = 2.

Worked Example: Lecture 11


X and Y are independent continuous random variables which are each uniformly distributed on
the interval (0, 1).
(a) Find the probability that 0 < X + Y < z for values z (0, 2).
(b) If Z = X + Y , deduce the form of the probability density function f (z) of Z.
Hints: In (a), think about the area on the x-y plane corresponding to 0 < x + y < z. In (b), first
find the cumulative distribution function F (z) = pr{Z z}.
Answer: X and Y are uniformly distributed on the interval [0, 1) so X and Y have pdf,


1 if 0 < x < 1,
1 if 0 < y < 1,
fX (x) =
fY (y) =
0 otherwise.
0 otherwise.
(a)
Joint probability density is f (x, y) = fX (x)fY (y)
by independence of X and Y . Hence f (x, y) = 1,
a constant, for 0 < x < 1 and 0 < y < 1.

f(x,y)

Probability of an event A is volume under pdf


with base area given by A. Here A is the region
for which 0 < X + Y < z.

0
1

Consider the two cases z < 1 and z > 1 separately.

Case z < 1

Case z > 1

2-z
x+y<z
x+y<z

From the figure above,

pr{0 < X + Y < z} =

1 2
2z

if 0 < z < 1,
1 21 (2 z)2 if 1 z < 2.

An alternative derivation uses integration. For example, in the case z < 1,


Z Z
Z z Z zy
Z z
1
(z y)dy = z 2 .
pr{0 < X + Y < z} =
f (x, y)dxdy =
dxdy =
2
y=0 x=0
y=0
0<x+y<z

(b) If Z = X + Y , then Z has cumulative distribution function F (z) where, from (a) above,
 1 2
if 0 < z < 1,
2z
F (z) = pr{X + Y z} =
1 12 (2 z)2 if 1 z < 2.
dF (z)
Probability density function for Z is then f (z) =
=
dz

z
if 0 < z < 1,
2 z if 1 z < 2.

Z has a triangular distribution on the interval (0, 2) with mode at z = 1.

Worked Example: Lecture 14


Measurements of stature were made on each member of a large population of pairs of adult brothers.
The height of the elder brother was denoted by X and of the younger brother by Y . Both X and
Y had the same mean and the same standard deviation . The correlation coefficient was .
Deduce the mean and variance of (i) U = X Y , and (ii) V = X + Y .
Derive the covariance of U and V .
Answer:
E[U ] = E[X Y ] = E[X] E[Y ] = = 0.

Var[U ] = Var[X Y ] = Var[X] + Var[Y ] 2cov(X, Y ) = 2 + 2 2 2 = 2 2 (1 ),


as
corr(X, Y ) = p

cov(X, Y )
Var[X]Var[Y ]

p
cov(X, Y ) = corr(X, Y ) Var[X]Var[Y ] = 2 2 = 2 .

E[V ] = E[X + Y ] = E[X] + E[Y ] = + = 2.


Var[V ] = Var[X + Y ] = Var[X] + Var[Y ] + 2cov(X, Y ) = 2 + 2 + 2 2 = 2 2 (1 + ).

cov(U, V ) = cov(X Y, X + Y ) = cov(X, X) cov(Y, Y ) + cov(X, Y ) cov(Y, X)


= Var[X] Var[Y ] + cov(X, Y ) cov(X, Y )
= 2 2 + cov(X, Y ) cov(X, Y )
= 0.

Worked Example: Lecture 14.


Let T = a1 X1 + a2 X2 , where X1 and X2 are uncorrelated random variables with mean and
variance 2 , and a1 and a2 are constants chosen so that E[T ] = .
Deduce that the choice a2 = 1 a1 gives E[T ] = .
In this case prove that the variance of T is a minimum if a1 = a2 = 21 .
8

Answer:
E[T ] = E[a1 X1 + a2 X2 ] = a1 E[X1 ] + a2 E[X2 ] = a1 + a2 = (a1 + a2 ).
If we require E[T ] = , then a1 + a2 = 1, so that a2 = 1 a1 .
Since E[T ] = , then T is said to be an unbiased estimator of the mean .

Var[T ] = Var[a1 X1 + a2 X2 ] = a21 Var[X1 ] + a22 Var[X2 ] = a21 2 + a22 2 = (a21 + a22 ) 2 .
Since a2 = 1 a1 , Var[T ] = {a21 + (1 a1 )2 } 2 = (2a21 2a1 + 1) 2 . Differentiate this with respect
to a1 to find the minimum.
d
Var[T ] = (4a1 2) 2 ,
da1
which is zero when a1 = 21 . Hence Var[T ] is a minimum when a1 = a2 =
Alternative derivation: write a1 =

1
2

+ , a2 =

1
2

1
2

so T = 21 (X1 + X2 ).

. Then

Var[T ] = (a21 + a22 ) 2 = {( 21 + )2 + ( 12 )2 } 2 = ( 12 + 22 ) 2 ,


and is a minimum if = 0.
What does this question show? In part (a) you chose a2 to restrict attention to linear combinations of the Xi which were unbiased estimators of the mean , so E[T ] = . In part (b) you then
is the one with smallest variance,
showed that of all such unbiased estimators, the sample mean X
so giving values closest to the true mean .

Worked Example: Lecture 15.


The following data give the noise level (in decibels) generated by fourteen different chain saws
powered in one of two different ways.
Petrol-powered chain saws
Electric-powered chain saws

103
97

103
95

105
94

106
93

108
91

105
95

106
94

At the 5% level of significance, test whether the average noise level of petrol-powered chain saws
is higher than for electric-powered chain saws.
Answer: Testing H0 : 1 = 2 vs. H1 : 1 > 2 , i.e. H0 : 1 2 = 0 vs. H1 : 1 2 > 0.
Have two independent samples with unknown variance. Need to assume variances are equal.

Worked Example: Lecture 15.


The following data give the length (in mm.) of cuckoo (cuculus canorus) eggs found in nests
belonging to wrens (A) and reed warblers (B).
A:
B:

19.8
23.2

22.1
22.0

21.5
22.2

20.9
21.2

22.0
21.6

21.0
21.6

22.3
21.9

21.0
22.0

20.3
22.9

20.9
22.8

Assuming the variances for each group are the same, is there any evidence at the 5% level to
suggest that the egg size differs between the two host species?

Answer: Have two independent normal distributions with unknown variances.


Wrens: x
1 = 21.18 mm., s21 = 0.6418, n1 = 10.
Reed warblers: x
2 = 22.14 mm., s22 = 0.4116, n2 = 10.
2
2
Assume 1 = 2 = 2 (unknown). Estimate 2 using
(n1 1)s21 + (n2 1)s22
9s2 + 9s22
= 1
= 0.5267.
n1 + n2 2
18
s 

1
1
2
Also x
1 x
2 = 21.18 22.14 = 0.96,
+
= 0.1053,
t18 (2.5%) = 2.101.
s
n1 n2
If 1 = 2 then the two groups of eggs have the same mean length.




x
1 x
2


To test H0 : 1 = 2 vs. H1 : 1 6= 2 at 5% level, reject H0 if p
t8 (2.5%).
2
s (1/n1 + 1/n2 )



0.96
x
1 x
2


= 2.95 so reject the null hypothesis of equal means at 5%
Here p
=
s2 (1/n1 + 1/n2 ) 0.1052
level. The two groups of eggs are significantly different at 5% level.
This does not necessarily imply cuckoos can control their egg size. It has been proposed that a
cuckoo lays its egg in the particular nest for which it is best adapted. For further information see:
Wyllie, I. (1981) The Cuckoo. Batsford: London.
Davies, N.B. and Brooke, M. Coevolution of the cuckoo and its host, Scientific American, January
1991, p.66-73.
s2 =

10

Question (lecture 1-2).


For values 1, 3, 4, 5, 6 obtain the sample mean, sample median, sample variance and sample
standard deviation.
Answer: 1

Question (lecture 1-2).


The number of insurance policies sold by a small firm per week is 7, 8, 5, 6, 6, 7, 9, 5, 7, 8, 4, 7, 6,
7, 7, 5, 8, 6, 7, 6, 6. Obtain the sample mean, sample median, sample variance, sample standard
deviation. Check your values using R.
Answer: 2

Question (lecture 3).


For Z N(0, 1), calculate pr{Z 0.55}, pr{Z > 2.25}, pr{Z 0.15}, pr{1.50 < Z 2.25}.
Answer: 3

Question (lecture 3).


For Z N(0, 1), calculate pr{Z < 0.63}.
Answer: 4

Question (lecture 3).


For Z N(0, 1), determine the value of z such that: pr{Z z} = 0.8944, pr{Z > z} = 0.9713,
pr{z < Z z} = 0.9108.
Answer: 5

Question (lecture 3).


An advertising company requires all of its job applicants to take a psychometric test. Based on
recent studies, it is believed that the test score follows a normal distribution with mean 100 and
standard deviation 15. Determine the probability that a job applicant will receive a test score
below 118, above 112, between 100 and 112.
Answer: 6

Question (lecture 4).


If X t5 , for what value of x is pr{X > x} = 0.05?
Answer: 7

Question (lecture 4).


If T t8 , for what value t is pr{T > t} = 0.025? For what value t is pr{T < t} = 0.05?
Answer: 8

Question (lecture 4).


1

3.8, 4, 3.7, 1.92.


6.524, 7.0 (middle ordered value), 1.462, 1.209.
3
pr{Z 0.55} = (0.55) = 0.7088, pr{Z > 2.25} = 1 (Z 2.25) = 1 (2.25) = 0.0122, pr{Z 0.15} =
1 pr{Z 0.15} = 1 (0.15) = 0.4404, pr{1.50 < Z 2.25} = pr{Z 2.25} pr{Z 1.50} = 0.9210. Recall
that pr{Z > z} = 1 pr{Z z}, pr{Z < z} = pr{Z > z} by symmetry, and also pr{X < b} = pr{X < a} +
pr{a < X < b}.
4
Using interpolation in the tables (0.63) = 0.7356.
5
pr{Z 1.25} = 0.8944, pr{Z > 1.90} = pr{Z 1.90} = 0.9713, pr{z < Z z} = (z) (z) = 2(z)
1 = 0.9108 so (z) = 0.9554 and z = 1.70.
`

6
0.8849, 0.2119, 0.2881. Hint: If X N(, 2 ), then pr{X x} = x
.

7
From tables, x = 2.015.
8
t8 (2.5%) = 2.306. pr{T > 1.860} = 0.05 so pr{T < 1.860} = 0.05 by symmetry. Thus t = 1.860.
2

11

If T t10 , what is pr{T < 2.228}? What is pr{2.228 < T < 2.228}?
Answer: 9

Question (lecture 4).


If 15, 13, 16, 18, 20 forms a random sample from a normal population with known variance 2 = 4,
obtain a 95% confidence interval for the mean .
Answer: 10

Question (lecture 4).


A firm investigates the length of time staff spend answering telephone calls. Nine consecutive
conservations had lengths in minutes 10.3, 9.4, 9.9, 7.5, 11.7, 3.4, 7.8, 11.0, 10.0. If these form
a random sample from a normal population with unknown variance 2 , obtain a 95% confidence
interval for the mean .
Answer: 11

Question (lecture 4).


It is required to obtain a 95% confidence interval for the mean of a normal population. Previous
work has suggested that the variance 2 = 16. How large should the sample size n be if it is
required to ensure that the width of the 95% confidence interval for is less than 0.5?
Answer: 12

Question (lecture 5).


For observations 3, 6, 5, 2 from a normal distribution with mean and known variance 2 = 4,
test the hypothesis H0 : = 0 against the alternative hypothesis H1 : 6= 0 at the 5% level.
Answer: 13

Question (lecture 5).


At a gambling establishment I notice that a particular die gives 25 sixes in 100 rolls of the die.
Is the die a fair one (is it biased)? (Test whether the probability of a six occurring equals 1/6
against the alternative hypothesis that 6= 1/6.)
Answer: 14

Question (lecture 6).


For observations 3, 6, 5, 2 from a normal distribution with mean and unknown variance 2 , test
the hypothesis H0 : = 1 against the alternative hypothesis H1 : 6= 1 at the 5% level.
9

0.025, 0.95.

n = 5, x
= 16.4, 1.96/ n = 1.753, so 95% interval is 16.4 1.75 = (14.65, 18.15).
s
11
n = 9, x
= 9.0, s2 = 6.25, t8 (2.5%) = 2.306. Interval is x
t8 (2.5%) = 9.0 1.92.
n
Rcode which could be used to obtain required quantities:
x=c(10.3,9.4,9.9,7.5,11.7,3.4,7.8,11.0,10.0)
mean(x)
var(x)
qt(0.975,8) # Gives 2.5% percentage point for t(8) pdf.

12
Width of interval is 2 (1.96/ n). Thus require 2 (1.96 4)/ n < 0.5 so n > 162 1.962 = 983.45 so take
n = 984.
x
0
13
= 4. Test rule is reject H0 if |z| > 1.96.
n = 4, x
= 4, 2 = 4, 0 = 0, 2 /n = 1. Test statistic is z =
/ n
Thus reject H0 at 5% level.
14
Let X be number of sixes in 100 throws, so X Bin(n = 100, = 1/6) if H0 true. X N( = 16.667, 2 =
x 16.667
13.889) if H0 true. Test statistic is z =
= 2.236. Test rule is reject H0 if |z| > 1.96, so reject H0 at 5%
13.889
level.
10

12

Answer:

15

Question (lecture 8).


For values (x, y) as given below, obtain the sample correlation r.
xi
yi
Answer:

1.1
3.3

2.2
6.1

3.4
7.0

4.5
10.4

5.0
11.5

16

Question (lecture 10).


For values (x, y) as given below, obtain the line of regression for y given x. What does the residual
at the first data point x1 = 1.1 equal? If x = 4, what is the predicted value of y?
xi
yi
Answer:

1.1
3.3

2.2
6.1

3.4
7.0

4.5
10.4

5.0
11.5

17

Question (lecture 10).


For values (x, y) as given below, a line of regression for y given x is fitted.
xi
yi

1.1
3.3

2.2
6.1

3.4
7.0

4.5
10.4

5.0
11.5

Test the hypothesis that the slope equals zero.


Answer: 18

Question (lecture 11).


x
Suppose pr{X = x} = 10
for x = 1, 2, 3, 4. Check that the probability function is valid (is 0
X
pr{X = x} 1 for all x and does
pr{X = x} = 1?). Calculate E[X] and Var[X].
x

15

n = 4, x
= 4, s2 = 3.333, 0 = 1, s2 /n = 0.8333. Test statistic is t =

41
x
0
=
= 3.286. Test rule is
/ n
0.8333

reject H0 if |t| > t3 (2.5%). As t3 (2.5%) = 3.182, reject H0 at 5% level.

1 X
1 X 2
16
x
= 3.24, s2x =
xi n
x2 = 2.593,
(xi x
)2 =
n1
n1

1 X
1 X 2
y = 7.66, s2y =
yi n
y 2 = 11.033,
(yi y)2 =
n1
n 1

X
p
1
1 X
xi yi n
xy = 5.2645, rXY = sxy / s2x s2y = 0.984.
(xi x
)(yi y) =
sxy =
n1
n1
Check your answer using R!
x=c(1.1,2.2,3.4,4.5,5.0)
# And setup y similarly.
cor(x,y)
17
x
= 3.24, y = 7.66, s2x = 2.593, s2y = 11.033, sxy = 5.2645. Regression line is y = + x where = sxy /s2x =
2.030,
= y x
= 1.082 so fitted line is y = 1.082 + 2.030x. If x1 = 1.1, predict y1 = 3.315. At x = 1.1, residual
is r1 = y1 y1 = 3.3 3.315 = 0.015. If x = 4, predict y = 9.023. Check your answers using R!
x=c(1.1,2.2,3.4,4.5,5.0)
# And setup y similarly.
lm(yx)
# Gives parameter estimates.
model=lm(yx)
# Stores regression model output as model.
model$residual[1]
# First residual value.
r
r
P

2
2
2
18

tn2 , where Sxx = (xi x


) = (n 1)sx . Here
= 0.2105 where
If H0 : = 0, then /
Sxx
Sxx
2
Sxx = (n 1)sx = 10.372. Thus t = 9.646. t3 (2.5%) = 3.182. As |t| > 3.182, reject H0 at 5% level. Check
your answers using R!
x=c(1.1,2.2,3.4,4.5,5.0)
# And setup y similarly.
model=lm(yx)
summary(model)
# Can you find your answers in the R output?

13

Answer:

19

Question (lecture 12).


Suppose (X, Y ) take values (0,0), (0,1), (1,0), (1,1) with probabilities 0.2, 0.5, 0.2, 0.1 respectively.
Obtain the marginal probabilities for X, and the conditional probabilities for Y given X = 1.
Obtain E[XY ]. Are X and Y independent?
Answer: 20

Question (lecture 12).


Suppose fXY (x, y) = 4xy for 0 < x < 1 and 0 < y < 1. Obtain the marginal pdf fX (x). Obtain
E[XY ]. Are X and Y independent?
Answer: 21

Question (lecture 13).


The table below gives the joint probability function for (X, Y ).

0
1
2

0
0.1
0.2
0.1

Y
1
0.1
0.0
0.0

2
0.1
0.2
0.2

Obtain the marginal probabilities pX (x) and pY (y) for X and Y . Hence obtain E[X], E[Y ], Var[X],
Var[Y ]. Obtain cov(X, Y ) and corr(X, Y ).
Answer: 22

Question (lecture 14).


If cov(X, Y ) = 0.5 and Var[X] = 2, what is cov(X, X + Y )?
Answer: 23

Question (lecture 14).


2 = Var[X],
If cov(X + Y, X Y ) = 12, Var[X + Y ] = 20 and Var[X Y ] = 16, obtain X
Y2 = Var[Y ], XY = cov(X, Y ) and so obtain corr(X, Y ).
Answer: 24

Question (lecture 14).


A fair die is rolled 100 times and the number X of ones and the number Y of twos is counted.
What distribution does X have? What distribution does Y have? If Z = X + Y is the total
number of ones or twos in the 100 rolls of the die, what distribution does Z have? What is the
variance of X, Y and Z? Hence obtain cov(X, Y ) and corr(X, Y ).
Answer: 25
19

Yes, 3, 1.
pX (0) = 0.7, pX (1) = 0.3, pr{Y = 0|X = 1} = 23 , pr{Y = 1|X = 1} = pr{X = 1 Y = 1} /pr{X = 1} = 13 .
E[XY ] = 0.1. RNo.
21
fX (x) = y fXY (x, y) dy = 2x for 0 < x < 1. E[XY ] = 94 . Yes.
22
Marginal probabilities for X are 0.3, 0.4, 0.3, and for Y they are 0.4, 0.1, 0.5. E[X] = 1, E[Y ] = 1.1,
Var[X] = 0.6, Var[Y ] = 0.89, cov(X, Y ) = 0.1, corr(X, Y ) = 0.137.
23
Var[X] + cov(X, Y ) = 2.5.
24 2
2
2
2
2
X Y2 = 12, X
+ 2XY + Y2 =20, X
2XY + Y2 = 16, so 2X
+ 2Y2 = 36 and 4XY = 4. Thus X
= 15,
2
Y = 3, XY = 1 and corr(X, Y ) = 1/ 45.
25
X Bin(n = 100, = 16 ). Similarly for Y . Z Bin(100, = 31 ). Var[X] = Var[Y ] = 500/36, Var[Z] = 200/9 =
2
X + 2XY + Y2 . Hence cov(X, Y ) = 100/36 so corr(X, Y ) = 15 . Notice X and Y are not uncorrelated. If you
have a lot of ones, you would expect fewer twos!
20

14

Question (lecture 14).


If Var[X] = 4 and Var[Y ] = 9 and corr(X, Y ) = 0.1, obtain cov(X + 2Y, X Y ).
Answer: 26

Question (lecture 14).


If X N(1, 9) and Y N(1, 16) and X and Y are independent, what is pr{|X Y | < 5}?
Answer: 27

Question (lecture 14).


Suppose that X1 , X2 , . . . , Xn are independent and identically distributed random variables with
denote the mean of the Xi
common mean E[Xi ] = and common variance Var[Xi ] = 2 . Let X
2
2
= ({Xi } {X
})2 and expanding
with mean and variance /n. By writing (Xi X)
the bracket, show that
n
1 X
2
(Xi X)
S2 =
n1
i=1

has mean E[S 2 ] = 2 .


Answer: 28

Question (lecture 15).


In January 2011 Durham police reported a significant increase in road accidents during December
[2010] . . . mainly due to severe weather. During December 2010 there were 336 reported collisions,
up from 308 in the previous December. By fitting a suitable model to these data, test whether
there is indeed a significant difference in the number of accidents between December 2009 and
December 2010. Source: http://www.bbc.co.uk/news/uk-england-12261462
(This is harder than you would get in the examination I have not done anything like this in the
module. We use the approximation that if X Poisson() and is large, then X N(, 2 = ).)
Answer: 29

Question (lecture 15).


Two independent samples gave values 3, 6, 5, 2 for sample 1 and 2, 2, 3, 3, 5 for sample 2.
Assuming that the samples come from independent normal distributions with known variances 4
and 1 respectively, test at the 5% level whether the difference in mean equals zero against the
alternative that it does not equal zero.
Answer: 30
26

p
cov(X, Y ) = corr(X, Y ) Var[X]Var[Y ] so cov(X, Y ) = 0.6 and cov(X + 2Y, X Y ) = Var[X] + cov(X, Y )
2Var[Y ] = 13.4.
27
X Y N(0, 25) so we want pr{5 < X Y +5}. pr{X Y 5} = (1) = 0.8413 so pr{X Y > 5} =
0.1587 and answer is 0.6826.
28
2
2
= E[(X

Recall that Var[Xi ] = E[(Xi )2 ] = 2 and Var[X]

P ) ] = /n. Also notice that


P ({Xi }
2
2
2
2

{
X

})
=
(X
(X

)
=
n(
X

).
Thus
(X

X)
=
i ) + (X ) 2(Xi )(X ) and
i
i
i
i
P
2
2

i (Xi ) n(X ) . Now take expectations.


29
A suitable model is to assume accidents occur randomly and independently in time. Assuming a constant level
of car usage we are using a Poisson process model. Thus the number X1 of accidents in December 2010 satisfies
X1 Poisson(1 ). Similarly the number X2 of accidents in December 2009 satisfies X2 Poisson(2 ). We want to
test whether 1 = 2 . For i large, Xi N(i , i ) for i = 1, 2 independently so X1 X2 N(1 2 , 1 + 2 ).
Thus if H0 is true, and 1 = 2 = ,
X1 X2
U=
N(0, 1).
2
= 322
Assuming the null hypothesis is true, we would estimate by
= 12 (336 + 308) = 322. Thus, replacing by
we obtain U = 1.103. Since |U | < 1.96, we accept the null hypothesis at the 5% level. The observed increase in
accidents was not significant!
30
n1 = 4, x
1 = 4, 12 = 4, n2 = 5, x
2 = 3, 22 = 1. Testing H0 : 1 2 = 0 vs. H1 : 1 2 6= 0. Test statistic is

15

Question (lecture 15).


Two independent samples gave values 3, 6, 5, 2 for sample 1 and 2, 2, 3, 3, 5 for sample 2. Assuming
that the samples come from independent normal distributions with common unknown variance 2 ,
test at the 5% level whether the difference in mean equals zero against the alternative that it does
not equal zero.
Answer: 31

Question (lecture 15).


Five randomly selected remuneration packages for US oil and gas CEOs in 2008 were (in thousands
of US dollars) 21333, 7294, 6712, 5727, 7087. Five randomly selected remuneration packages for
US health care CEOs in 2008 were (in thousands of dollars) 14262, 8381, 7245, 10211, 1817. Test
at the 5% level whether the difference in mean remuneration equals zero against the alternative
hypothesis that it does not equal zero. You can assume that the two populations have common
(unknown) variance 2 .
Answer: 32

Question (lecture 16).


A quarter of insurance claims are incomplete in some way. If you have 250 forms to process, what
is the approximate probability that you will find fewer than 50 of them incomplete?
Answer: 33

Question (lecture 16).


In n = 100 tosses of a coin I obtain X = 72 heads. Obtain an approximate 95% confidence interval
for the probability of a head.
Answer: 34

Question (lecture 17).


In December 2010 two analysts suggested several shares as likely to rise in 2011. By the end of
October 2011 one (Neil Woodford) had four out of n1 = 7 share tips showing a rise while the
other (Harry Nummo) had three out of n2 = 10 share tips showing a rise. Test at the 5% level
whether the two success proportions are significantly different.
Answer: 35
x
1 x
2
43
z= q 2
= 0.913. Test rule is reject H0 if |z| > 1.96. Thus accept H0 at 5% level.
= q
2
1
2
4
1
+
+
4
5
n1
n2
3s2 + 4s22
31
2
n1 = 4, x
1 = 4, s1 = 3.333, n2 = 5, x
2 = 3, s22 = 1.5, pooled estimate of 2 is s2 = 1
= 2.2857. Testing
7
x
1 x
2
43
q
H0 : 1 2 = 0 vs. H1 : 1 2 6= 0. Test statistic is t = q
=
= 0.986. Test rule is
s n11 + n12
1.5119 14 + 51
reject H0 if |t| > t7 (2.5%). As t7 (2.5%) = 2.365, accept H0 at 5% level.
32
Data source: http://graphicsweb.wsj.com/php/CEOPAY09.html.
n1 = 5, x
1 = 9630.6, s21 = 43158021, n2 = 5, x
2 = 8383.2, s22 = 20577907, n1 + n2 2 = 8, t8 (2.5%) = 2.306.
(n1 1)s21 + (n2 1)s22
= 31867964. Test statistic is t =
If variances are equal to 2 , estimate 2 using s2 =
n1 + n2 2
|
x1
x2 |
1247.4
r
= 3570.32 = 0.349. Since t8 (2.5%) = 2.306, then |t| < t8 (2.5%) so accept H0 that 1 = 2 against the
1
1
s2 (

n1

n2

alternative 1 6= 2 at the 5% level.


33
If X is the number of incomplete forms, X Bin(n = 250, = 41 ) N( = 62.5, 2 = 46.875). You require

49 + 12
= (1.899) = 0.0288. Notice we have used a continuity correction.
pr{X < 50} = pr{X 49} =

34
Number of heads X Bin(n = 100, ). s
Here n = 100, X = 72 observed, = X/n = 72/100 = 0.72.
)

(1
= 0.72 0.088.
n
http://www.thisismoney.co.uk/money/investing/article-1709914/Stock-market-predict

Approximate 95% confidence interval is 1.96


35

Data source:

16

Question (lecture 17).


In January 2011 Durham police were reported as disappointed by the increase in the number of people arrested for drinking and driving. Between December 1st 2010 and December
31st 2010 they had 52 positive breath tests out of 1799 breath tests administered, while for
the same period in 2009 they had 41 positive tests out of 1433 administered. Construct a
95% confidence interval for the difference in proportion of drivers who tested positive. Source:
http://www.bbc.co.uk/news/uk-england-12261462
Answer: 36

Question (lecture 17).


I observe two dice. For one die I notice that it gives a six 20 times out of 100 and for the second
die I notice that it gives a six 22 times out of 80. Test at the 5% level whether the two dice give
the same probability of showing a six.
Answer: 37

Question (lecture 18).


If X 24 , for what value of x is pr{X > x} = 0.05?
Answer: 38

Question (lecture 19).


I roll a die 100 times and observe the following results.
Outcome i
Observed frequency

1
16

2
15

3
16

4
15

5
15

6
23

Test at the 5% level whether the die is fair.


Answer: 39
ions-tips-2011.html
Two binomial proportions here. 1 = 4/7 = 0.571, 2 = 3/10 = 0.300, n1 = 7, n2 = 10. Common estimated
|1 2 |
71 + 102
= 0.412. Approximate test statistic is z = r
proportion is =
= 1.119. reject H0 at

17
)
1 + 1
(1
n1
n2

5% level if |z| > 1.96, so here accept the hypothesis that the two proportions are equal.
36
Two binomial proportions again. 1 = 52/1799 = 0.028905, 2 = 41/1433 = 0.028611, n1 = 1799, n2 = 1433.
17991 + 14332
Common estimated proportion is =
= 0.0288. (This is very small so the normal approxima3232
tion is doubtful. In practice we would transform to give approximate normality.) Approximate test statistic is
|1 2 |
z= r
= 0.0496. Reject H0 at 5% level if |z| > 1.96, so here accept the hypothesis that the two

1
1

(1 ) n1 + n2

proportions are equal.


37
n1 = 100, x1 = 20, 1 = 20/100 = 0.200, n2 = 80, x2 = 22, 2 = 22/80 = 0.275. We test H0 : 1 =
2 (= ) vs. H1 : 1 6= 2 . This is equivalent to testing H0 : 1 2 = 0 vs. H1 : 1 2 6= 0. Assuming H0 is
n1 1 + n2 2
20 + 22
true, the estimated common proportion is estimated by =
=
= 0.2333. Test statistic is
n1 + n2
180

1 2
0.200 0.275
z= q
=
= 1.31. Test rule is reject H0 if |z| > 1.96, so accept H0 at 5%

(1
)
(1
)
0.0017889
+ 0.0014907
+
n1

n2

level.
38
From tables, x = 9.488.
39
Let X denote the outcome of the die. We test whether pr{X = i} = 1/6 for all i. Expected frequency for any
outcome would then be 100 61 = 16.667.
Outcome i
Observed frequency Oi
Expected frequency Ei
(Oi Ei )2 /Ei

1
16
16.67
0.0267

2
15
16.67
0.1667

3
16
16.67
0.0267

17

4
15
16.67
0.1667

5
15
16.67
0.1667

6
23
16.67
2.407

sum=2.960

Question (lecture 19).


I live 55 miles commuting distance from the University. Over 35 journeys I count the number X
of road accidents observed and obtain the following data.
Number of accidents observed per journey X
Observed frequency

0
28

1
5

2
2

Test at the 5% level whether a Poisson distribution gives a good fit to the data. Why is the Poisson
distribution a suitable model for these data?
Answer: 40

Question (lecture 20).


Two surveys were conducted about a certain product and the following results obtained.
Survey A
Survey B
Total

Like
44
30
74

OK
23
20
43

Dislike
33
30
63

Total
100
80
180

Test whether the like/OK/dislike population proportions for the two surveys are equal.
Answer: 41
Number of cells is 6; number of estimated parameters is 0; number of constraints on expected frequencies is 1.
Number of degrees of freedom is k = 6 0 1 = 5. Test statistic is 2obs = 2.960. Reject H0 if 2obs > 25 (5%). As
25 (5%) = 11.071, we accept the null hypothesis that the die is fair.
40
x
= 9/35 = 0.257. Best fitting Poisson distribution is X Poisson( = 0.257). Fitted probabilities are
x e
for x = 0, 1, 2, . . .. Fitted frequencies are Ex = 35 pr{X = x} for x = 0, 1, 2, . . ..
pr{X = x} =
x!
Number of accidents X
Observed frequency Oi
Expected frequency Ei
(Oi Ei )2 /Ei

0
28
27.06

1
5
6.959

0.0324

0.5516

2
2
0.977
(by difference)
1.0723

sum=1.656

Number of cells is 3; number of estimated parameters is 1; number of constraints on expected frequencies is 1.


Number of degrees of freedom is k = 3 1 1 = 1. Test statistic is 2obs = 1.656. Reject H0 if 2obs > 21 (5%). As
21 (5%) = 3.841, we accept the Poisson distribution fit.
Poisson distribution sensible model by thinking of a Poisson process. If accidents happen randomly and independently
in time, number in one journey of an hour has a Poisson distribution.
In practice we might pool cells to ensure all expected frequencies are at least five. Also for 2 -tests with one degree
X (|Oi Ei | 1 )2
2
of freedom a better test uses Yatess continuity correction so that 2obs =
.
E
i
i
(row total) (column total)
41
. Thus:
Expected frequencies are
grand total
Survey A
Survey B
Total

Like
(100 74)/180 = 41.11
32.89
74

OK
23.89
19.11
43

Dislike
35.00
28.00
63

Total
100
80
180

Number of degrees of freedom is k = (3 1)(2 1) = 2.


(Oi Ei )2 /Ei
Survey A
Survey B
Test statistic is 2obs =

Like
0.2030
0.2538

OK
0.0331
0.0413

Dislike
0.1143
0.1429

X
(Oi Ei )2 /Ei = 0.7883. Reject H0 if 2obs > 22 (5%). As 22 (5%) = 5.991, so accept
i

hypothesis that the two surveys have the same overall proportions for each category.
Note that the test is whether the proportion liking is the same for surveys A and B, and the proportions saying OK
are the same for A and B, and the proportions disliking are the same for A and B.

18

You might also like