You are on page 1of 8

Some results from theory:

X X (n  1) S 2 Pˆ p approx
~ N (0,1) ~ tn 1 ~ 2n1 ~ N (0,1)
/ n S/ n  2
pq / n
(each result is only valid under certain requirements)

Binomial distribution:
n
X ~ BIN(n, p)  f X ( x)    p x (1  p)n  x for x  0,1,..., n
 x
E( X )  np, Var( X )  np(1  p)

Multinomial distribution:
( X1 ,..., X k ) ~ MULT(n, p1,..., pk ) 
n!
f X ( x1 ,..., xk )  p1x1 p2 x2 ... pkxk 11 for xi  0,1,..., n
x1 ! x2 !... xk ! xk 1 !
k k
where pk 1  1   pi , pi  0 (i  1,..., k  1) and xk 1  n   xi .
i 1 i 1
A – questions 1 to 4

A1 [7] The independent discrete random variables X and Y have the following pdf’s:

x 0 1 2 y 0 1 2

f X ( x) 0.5 0.3 0.2 fY ( y) 0.1 0.6 0.3

Determine P( X  1| X Y  2)

A2 The continuous random variables X and Y have the following joint pdf:

 x  1 y  xy for 0  x  1, 0  y  2
f X ,Y ( x, y )   2
 0 elsewhere

a [3] Find the marginal pdf of Y.


b [6] Find the joint CDF of X and Y.
c [5] Write the integral (or integrals) which can be used to determine the CDF of W  X Y . Make sure that you
find the correct integration limits.
d [9] Find the pdf of W  X Y using the transformation method.

A3a [4] Describe in words the model assumptions underlying the multinomial distribution. (Example of such a model
assumption for the Poisson-process: the probability of one event in a very short (time)interval is proportional
to the length of the interval).
Assume for the rest of this question that (X,Y ) ~ MULT( n, p1, p2 ).
b [3] Argue why it follows that X ~ BIN(n, p1) and Y ~ BIN(n, p2).
(Here you are asked for a logical argument, not for a mathematical proof)
p2
c [4] Prove that Y | X  x ~ BIN(n  x, ).
1  p1

d [5] Use the results in parts b and c to find Var[E(Y | X )].

A4 [9] Let 𝑋1 , 𝑋2 , … , 𝑋𝑛 represent a random sample from a normal distribution with unknown mean and a known
variance 𝜎 2 = 12.2. How large should the sample size be, such that the margin of error associated with a
99%-confidence interval for μ will be at most 0.1?

B – questions 5 to 7

B5 [8] Explain as clearly as possible what is meant by the ‘power of a test’. Pay attention to the definition of this
concept, to the relation of the power with the sample size and the sample outcomes, and to the relations with
the ‘error of type I’ and ‘error of type II’.
n
B6a [4] Show that the following equation always holds: (n  1) S 2  n( X  )2   ( X i  )2 where S 2 denotes the
i 1

sample variance and X the sample mean.


b [10] Consider a sample 𝑋1 , 𝑋2 , … , 𝑋𝑛 from a normal distribution with mean  and variance  2 . Prove clearly and
(n  1) S 2
step-by-step that has a chi-square distribution with n – 1 degrees of freedom. The following results
2
may be used in your proof (you do not need to prove the results 1 to 4 below!):

(n  1) S 2 ( X  )2 n
( X i  ) 2
1)
2

2 n
 
i 1 2
(follows from part a)

2) X (the sample mean) and S 2 are independent random variables when sampling is done from normal
distributions
3) the moment generating function of a chi-square distribution with n degrees of freedom is given by
M (t )  (1  2t )
1
2n

4) the square of a standard normal random variable has a chi-square distribution with 1 degree of
freedom
Hint: use moment generating functions.

B7 An important indicator for the level of customer satisfaction at a certain Fastfood-restaurant is the so-called
service time. Both the variation as the mean of the service time contribute to the overall customer satisfaction.
The service times should not differ too much from customer to customer, and the service times should not
exceed the norm (240 sec.) too often. The table below shows some data which were gathered during two days,
by taking random samples of 41 and 61 customers respectively. For each customer, the service time is
recorded in seconds. The table also shows the proportion of customers whose service times exceeded the
norm.
Day Service time Proportion exceeding
norm
1 mean 168.196 0.121952
sample size 41 41
variance 4102.980 0.109756
2 Mean 138.004 0.163934
sample size 61 61
variance 10669.770 0.139344
total Mean 150.140 0.147059
sample size 102 102
variance 8184.714 0.137254

a [8] Test with a level of significance of 5% (and using the complete sample of 102 customers) whether the mean
service time is less than 175 seconds.
b [8] Determine the p-value associated with a test which is aimed at establishing whether sufficient proof exists (at
α = 0.1) to state that the standard deviation of the service times (combined for both days) is less than 150
seconds.
c [7] Find the 95%-confidence level for the difference (between the two days) of the proportions of service times
which exceeded the norm. Then use this confidence interval to draw a conclusion about the question whether
these two proportions are different from each other.

End
Solutions

1. Joint pdf of X and Y :

y x=0 x=1 x=2


0 0.05 0.03 0.02
1 0.30 0.18 0.12
2 0.15 0.09 0.06

P( X  1  X Y  2) P( X  1 Y  2) 0.09 3
P( X  1| X Y  2)    
P( X Y  2) P( X  1  Y  2)  P( X  2  Y  1) 0.09  0.12 7

1
 12 x2  12 xy  12 x2 y  x0
x 1
2a. fY ( y )    x  12 y  xy  dx   1
2
for 0  y  2
0

2b. for 0 < 𝑥 < 1 en 0 < 𝑦 < 2:


𝑦 𝑥
1 2 1 1 1 1 1
∫ ∫ 𝑓𝑋,𝑌 (𝑢, 𝑣) 𝑑𝑢 𝑑𝑣 = 𝑥 𝑦 + 𝑥𝑦 2 − 𝑥 2 𝑦 2 = 𝑥𝑦 (𝑥 + 𝑦 − 𝑥𝑦)
2 4 4 2 2 2
0 0

FX ,Y  x, y   P  0  X  x  0  Y  y 
 0 voor x0 of y0
 1 xy x  1 y  1 xy
 2  2 2  voor 0  x  1 en 0  y  2
  1
2
y voor x 1 en 0  y  2
 x voor 0  x  1 en y2

 1 voor x 1 en y2

2c. Draw figure, see below. We have to integrate over the grey area. That area has to be split into two parts, for
example like shown below (light and dark grey):

w
2 1 wx

 x   w   x  12 y  xy  dy dx
2
FW ( w)  P( XY  w)  1
2
y  xy dy dx 
0 0 2 0
Or, alternatively with other integration order:

w
w1 2 y
FW ( w)  P( XY  w)     x  12 y  xy  dx dy     x  12 y  xy  dx dy
00 w 0

2d. To be able to apply the transformation method, we need to define first another random variable in such a way that
𝑊
we obtain a one-to-one transformation. For example choose 𝑉 = 𝑋, 𝑊 = 𝑋 ⋅ 𝑌 ⟹ 𝑋 = 𝑉, 𝑌 = 𝑉

1 0 1
The Jacobian is: |− 𝑤 1| =
𝑣
𝑣2 𝑣

𝑤 1 0 𝑤 1 𝑤 w
And thus 𝑓𝑊,𝑉 (𝑤, 𝑣) = 𝑓𝑋,𝑌 (𝑣, 𝑣 ) ∙ |− 𝑤 1| = (𝑣 + 2𝑣 − 𝑤) ∙ 𝑣 = 1 + 2𝑣 2 − v
𝑣2 𝑣

To find the support for (W, V ) we substitute x = v and y = w/v into the support for (X, Y ): 0 < v < 1 and
0 < w/v < 2. This can be rewritten as: 0 < v < 1 and 0 < w < 2v. (or 0 < w < 2v < 2, or 0 < w/2 < v < 1)
1
𝑤 w 𝑤 𝑣=1
1
𝑓𝑊 (𝑤) = ∫ (1 + 2
− ) 𝑑𝑣 = (𝑣 − − 𝑤 ln 𝑣)| 𝑤 = 2 − 𝑤 + 𝑤 ln 2𝑤 for 0 < 𝑤 < 2
2𝑣 v 2𝑣 𝑣=
𝑤 2
2

3a. Model assumptions for the multinomial distribution:


1. Fixed number (n) of trials
2. all trials are independent of each other
3. At each trial k + 1 possible, mutually exclusive, outcomes: E ,…,E
1 k+1
4. At each trial same probabilities p for outcome E
i i

3b. Given: (X, Y) ~ MULT(n, p1, p2)


𝑛! 𝑦 𝑛−𝑥−𝑦
𝑓𝑋,𝑌 (𝑥, 𝑦) = 𝑝𝑥𝑥 𝑝𝑦 (1 − 𝑝𝑥 − 𝑝𝑦 ) voor 𝑥, 𝑦 = 0,1, … , 𝑛
𝑥! 𝑦! (𝑛 − 𝑥 − 𝑦)!
If we would be interested only in X (the number of outcomes in the first category) and not in Y (the number of
outcomes in the second category), then we can treat the second category simply as part of all outcomes which are
not in the first category. Thus, we obtain a distribution for X (number of ‘ successes’ = ‘ outcome in first category’)
which is binomial (because of the model assumptions for the binomial distribution).
n!
p1x p2 y (1  p1  p2 )n  x  y
f X ,Y  x, y  x ! y !(n  x  y )!
3c. fY | X  y | x   
f X ( x) n!
p1x (1  p1 ) n  x
x !(n  x)!
1
p2 y (1  p1  p2 ) n  x  y y n x y
y !(n  x  y )! (n  x)!  p2   1  p1  p2 
     
1
(1  p1 ) y  n  x  y y !(n  x  y )!  1  p1   1  p1 
(n  x)!
y (n x y)
 n  x   p2   p 
      1 2 
 y   1  p1   1  p1 
p2
This pdf can be recognised as the pdf of a binomial distribution, so Y | X  x ~ BIN(n  x, ).
1  p1
p2 p2
3d. Y | X  x ~ BIN(n  x, )  E Y | X  x   n  x 
1  p1 1  p1
 p 
 Var  E Y | X  x    Var  n  X   2 
 1  p1 
2 2
 p   p  p22 np1 p22
  2  Var  n  X    2  Var  X    np1 1  p1  
 1  p1   1  p1  1  p1 2 1  p1

4. σ is known, so we use the following confidence interval:


𝜎
𝜇 = 𝑋̅ ± 𝑧𝛼 ∙ met 𝛼 = 1% ⟹ 𝑧𝛼 = 2.575
2 √𝑛 2

We must have here:


2
𝜎 𝜎 2 √12.2
𝑧𝛼 ∙ ≤ 𝐵 = 0.1 ⟹ 𝑛 ≥ (𝑧𝛼 ∙ ) = (2.575 ∙ ) = 8089.4
2 √𝑛 2 𝐵 0.1

So the sample size should be at least 8090.

5 The power is the probability that the null hypothesis will be rejected when the alternative hypothesis is true.
It is always equal to 1 minus the probability of a type II error.

When the probability of a error of type I increases (so the probability that the null hypothesis will be rejected
when it is true), then the rejection region is becoming larger, and thus also the probability that the null
hypothesis will be rejected when the alternative hypothesis is true (i.e. the power).

The power of a test does not depend on the outcome of a specific outcome of the test statistic in a specific
sample. It is a characteristic of the test, not of a sample.

When the sample size increases, the power will becomes larger as well (when the level of significance remains
the same).

If the difference between the value of the unknown population parameter as stated in the null hypothesis and
its true value becomes larger, then the power will increase as well.

6a. We will use:

1 n
 X i  X   (n  1)S 2    X i  X 
n


2 2
 S2 
n  1 i 1 i 1
n n
 X
i 1
i  nX and X
i 1
2
 nX 2

The complete derivation:


( n  1) S 2  n( X  ) 2    X i  X   n( X  ) 2
n
2

i 1

   X i 2  2 X i X  X 2   n  X 2  2X   2 
n

i 1
n n n
  X i 2   2 X i X   X 2  nX 2  2nX  n 2
i 1 i 1 i 1
n n n
  X i  2 nX  nX 2  nX 2  2  X i    2
2 2

i 1 i 1 i 1
n n n
  X i 2  2 X i    2
i 1 i 1 i 1

   X i 2  2X i   2 
n

i 1
n
  X i  
2

i 1

(Or see the first part of the proof of Theorem 6.14 in the reader)

(n  1) S 2 ( X  )2 n
( X i  ) 2
6b. We focus first on the r.h.s. of the equation
2

2 n
 
i 1 2
:

Xi   4)
( X i  ) 2 3)  ( X i  ) 2 
X i ~ N (, 2 )  ~ N (0, 1)      ; t   (1  2t )  2
2 1
~ ( 1) M 
 2   2

 n ( X  ) 2  n  ( X  ) 2 
M  i 2 ; t    M  i 2  
n
; t   (1  2t ) 2  (1  2t ) 
1 1
2n

 i 1   i 1   

(n  1) S 2 ( X  )2 n
( X  ) 2
Now we focus on the l.h.s. of   i 2 :
 2
 n
2
i 1 

2 X  4)
( X  ) 2  ( X  )2  3)
; t   1  2t  2
1
X ~ N (, )  ~ N (0, 1)  ~  2
(   1)  M 
n   2
  n
2

n n

S 2 and X are independent 


 (n  1) S 2 ( X  )2   (n  1) S 2   ( X  ) 2   (n  1) S 2 
; t   1  2t  2
1
M  ; t   M  ; t   M  ; t   M 
   n     n  
2 2 2 2 2
   

Together:

(n  1) S 2 ( X  ) 2 n
( X i  ) 2
2

2 n
 
i 1 2

 (n  1) S 2 ( X  ) 2   n ( X i  ) 2 
M  ; t   M  ;t  
  2 n 2
2
  i 1 
 (n  1) S 2 
; t   1  2t  2  1  2t 
1 1 n
M 2

 
2

 (n  1) S 
2
2
n 1
1  2t 
1
M ;t   
 
2

(n  1) S 2
~  2    n  1
 2
(Or see the second part of the proof of Theorem 6.14 in the reader)

7a. Requirements for the use of the hypothesis test below: random sample, “service times” in the population are
normally distributed.

Hypotheses: 𝐻0 ∶ 𝜇 = 175 𝐻1 ∶ 𝜇 < 175

𝑋̅−𝜇
Test statistic: 𝑇= 𝑠 ~ 𝑡[𝜈 = 101]
⁄ 𝑛

Rejection region: {𝑇 | 𝑇 ≤ 𝑡𝛼=0.05,𝜈=101 ≈ 𝑡𝛼=0.05,𝜈=100 = −1.660}

150.140−175
Observed value for test statistic: 𝑇= √8184.714
= −2.77523
√102

This value falls within the rejection region, so 𝐻0 will be rejected. There is sufficient proof (at a level of
significance of 0.05) to state that the mean service-time on the two days is below 175 seconds.

7b. 𝐻0 ∶ 𝜎 = 150 en 𝐻1 ∶ 𝜎 < 150. So this test is one-sided


(𝑛−1)𝑆 2
Test statistic: 𝜒2 = ~𝜒 2 [𝜈 = 101]
𝜎2
2 (102−1)∙8184.714
Observed value for test statistic: 𝜒𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑 = 1502
= 36.740
2 2 2
Because 𝜒𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑 = 36.740 < 67.328 = 𝜒𝛼=0.995,𝜈=100 ≈ 𝜒𝛼=0.995,𝜈=101 it must be true that:
2 2
𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 𝑃(𝜒 2 < 𝜒𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑 ) < 𝑃(𝜒 2 < 𝜒𝛼=0.995,𝜈=100 ) = 1 − 0.995 = 0.005,
so less than 0.005.

7c. Requirements for applying formula below:

n1 pˆ1  5, n1 (1  pˆ1 )  5, n2 pˆ 2  5 and n2 (1  pˆ 2 )  5


These reuirements are met, since 𝑛1 = 41, 𝑝̂1 = 0.121952, 𝑛2 = 61 and 𝑝̂2 = 0.163934, so that:

n1 pˆ1  5, n1 (1  pˆ1 )  36, n2 pˆ 2  10 and n2 (1  pˆ 2 )  51

The 95%-confidence interval becomes:

𝑝̂1 (1 − 𝑝̂1 ) 𝑝̂2 (1 − 𝑝̂2 )


(𝑝̂1 − 𝑝̂ 2 ) ± 𝑧0.025 ⋅ √ + = −0.04198 ± 0.1366
𝑛1 𝑛2
Because the value 0 is within this interval, the null hypothesis 𝐻0 ∶ 𝑝1 − 𝑝2 = 0 cannot be rejected at
𝛼 = 0.05. In other words: there is no reason to doubt that there is no difference in the two proportions, again
at level of significance 0.05. For smaller value of α, we can be sure that we can draw the same conclusion;
however, if α becomes larger, then at a certain point it will be possible to draw the conclusion that there is a
difference.

You might also like