Probability space, Bayes and password counting
MATH40005 Probability and Statistics Resit Preparation
Question 1
1(a). Two balls are drawn without replacement from an urn containing balls labelled 1, . . . ,6. Describe
a probability space when order matters and all ordered distinct pairs are equally likely. (3 marks)
1(b)(i). A disease has prevalence 0.02. A test has sensitivity 0.92 and false-positive rate 0.08. Find the
probability of a positive test. (3 marks)
1(b)(ii). Find the probability that a person with a positive result has the disease. (3 marks)
1(b)(iii). During an outbreak the prevalence rises to 0.10, with test characteristics unchanged. Recom-
pute the posterior probability and explain why it changes. (4
marks)
1(c)(i). An eight-character password contains four letters (26 choices, repetition allowed), two digits (10
choices, repetition allowed), and two distinct symbols selected from six symbols. Count the passwords.
(3 marks)
1(c)(ii). Assuming all type-position patterns are equally likely, find the probability that the two symbols
are adjacent. (4 marks)
T otal: 20 marks
7
Worked solution and marking guidance
MATH40005 Probability and Statistics Resit Preparation
Question 1: solution and marking guide
1(a). Take Ω = {(i, j) : i, j ∈ {1, . . . ,6}, i ̸= j}, F = P(Ω) and P(A) = |A|/30.
3 marks; A:3
1(b)(i). P (+) = 0 .92(0.02) + 0.08(0.98) = 0 .0968.
3 marks; A:3
1(b)(ii). By Bayes, P (D|+) = 0 .0184/0.0968 ≈ 0.1901.
3 marks; B:3
1(b)(iii). P (D|+) = 0 .92(0.10)/[0.92(0.10)+0 .08(0.90)] = 0 .092/0.164 ≈ 0.5610. The positive predictive
value increases because the prior prevalence is larger.
4 marks; D:4
1(c)(i). Choose symbol positions
8
2
, letter positions among the remaining six
6
4
, order the two distinct
symbols in 6 · 5 ways, then fill letters and digits:
8
2
6
4
(6 · 5)264102.
3 marks; A:2, B:1
1(c)(ii). There are
8
2
unordered symbol-position pairs and 7 adjacent pairs, so the probability is
7/
8
2
= 1/4.
4 marks; C:4
Question total: 20 marks
8
Joint density, transformations and conditional Poisson law
MATH40005 Probability and Statistics Resit Preparation
Question 2
2(a)(i). Let fX,Y (x, y) = ce−2x−y for x, y ≥ 0, and 0 otherwise. Find c. (3 marks)
2(a)(ii). Find the marginal densities and identify the distributions. (3 marks)
2(a)(iii). Find the conditional density of Y given X = x. (2 marks)
2(a)(iv). Are X and Y independent? (2 marks)
2(b). If U ∼ U (0, 1) and λ > 0, identify the distribution of T = − log U/λ. (4 marks)
2(c). Let X ∼ Poi(λ) and Y ∼ Poi(µ) be independent. Prove that, conditional on X + Y = n,
X ∼ Bin(n, λ/(λ + µ)). (6 marks)
T otal: 20 marks
8
Worked solution and marking guidance
MATH40005 Probability and Statistics Resit Preparation
Question 2: solution and marking guide
2(a)(i). The integral is c(1/2)(1), hence c = 2.
3 marks; A:3
2(a)(ii). fX (x) = 2 e−2x and fY (y) = e−y on [0, ∞); hence X ∼ Exp(2), Y ∼ Exp(1).
3 marks; A:3
2(a)(iii). fY |X=x(y) = fX,Y (x, y)/fX (x) = e−y for y ≥ 0.
2 marks; B:2
2(a)(iv). Yes, because fX,Y (x, y) = fX (x)fY (y).
2 marks; B:2
2(b). For t < 0, FT (t) = 0 . For t ≥ 0, P (T ≤ t) = P (U ≥ e−λt) = 1 − e−λt, so T ∼ Exp(λ).
4 marks; A:2, C:2
2(c). For k = 0, . . . , n,
P (X = k|X + Y = n) = e−λλk/k! e−µµn−k/(n − k)!
e−(λ+µ)(λ + µ)n/n! =
n
k
λ
λ + µ
k µ
λ + µ
n−k
.
6 marks; B:1, C:1, D:4
Question total: 20 marks
9
Quartiles, confidence intervals and multiple testing
MATH40005 Probability and Statistics Resit Preparation
Question 3
3(a). For the data {2, 4, 4, 5, 7, 8, 9, 10, 14} compute the median, lower quartile, upper quartile and IQR
using the convention that the median is included in both halves for an odd sample size. (4 marks)
3(b). Twelve normal observations have ¯x = 168 and s2 = 16. Find a 95% confidence interval for µ using
t11,0.975 = 2.201. (4 marks)
3(c). Independent normal samples have known variances. Group 1: n = 20 , ¯x = 72 , σ2
1 = 9 ; Group 2:
m = 25 , ¯y = 70 , σ2
2 = 16 . Test H0 : µ1 = µ2 against a two-sided alternative at 0.05 and calculate the
p-value. (7 marks)
3(d). Twenty hypotheses are tested with family-wise level 0.05. Using Bonferroni, determine which of
0.001, 0.003, 0.020, 0.0004, 0.080 are significant. (5 marks)
T otal: 20 marks
9
Worked solution and marking guidance
MATH40005 Probability and Statistics Resit Preparation
Question 3: solution and marking guide
3(a). The ordered data are already shown. Median = 7, lower quartile = 4, upper quartile = 9, so IQR
= 5.
4 marks; A:4
3(b). 168 ± 2.201(4/
√
12) = 168 ± 2.541, giving (165.46, 170.54).
4 marks; A:4
3(c). The statistic is
Z = 72 − 70p
9/20 + 16/25
= 1.916.
The two-sided p-value is 2{1 − Φ(1.916)} ≈ 0.0554. Fail to reject at 0.05.
7 marks; B:3, C:2, D:2
3(d). The adjusted threshold is 0.05/20 = 0 .0025. Therefore 0.001 and 0.0004 are significant; the others
are not.
5 marks; B:2, C:1, D:2
Question total: 20 marks
10
Least squares, diagnostics, bootstrap and MLE
MATH40005 Probability and Statistics Resit Preparation
Question 4
4(a). For the model yi = βx2
i + ei, derive the least-squares estimate of β. (6 marks)
4(b). A fitted model has the following residual plot. Comment on fit and suggest a remedy.
0 2 4 6 8 10 12 14 16 18 20
−0.5
0
0.5
xi
Residual ˆεi
(3 marks)
4(c). Describe how to construct a percentile bootstrap 95% confidence interval for a population median
from a sample of size n. (4 marks)
4(d). Independent observations follow a geometric distribution P (X = x) = p(1 − p)x−1, x ≥ 1, with
p ∈ (0, 1]. Find the MLE of p. (5 marks)
4(e). Why does a high correlation between two quantities not by itself establish causation? (2 marks)
T otal: 20 marks
10
Worked solution and marking guidance
MATH40005 Probability and Statistics Resit Preparation
Question 4: solution and marking guide
4(a). Minimise S(b) = P
i(yi − bx2
i )2. Then S′(b) = −2 P x2
i yi + 2b P x4
i . Hence bβ = P x2
i yi/ P x4
i
(assuming the denominator is positive). The second derivative is 2 P x4
i > 0.
6 marks; A:2, B:2, D:2
4(b). The wave pattern is systematic, so the linear mean function is inadequate and residual independence/mean-
zero structure is doubtful. Consider a nonlinear transformation, seasonal/cyclic terms, or a richer regres-
sion function.
3 marks; C:2, D:1
4(c). Generate many samples of size n by sampling with replacement from the observed data. Compute
the median for each replicate. If the ordered bootstrap medians have empirical quantiles q∗
0.025 and q∗
0.975,
use (q∗
0.025, q∗
0.975).
4 marks; B:3, D:1
4(d). The likelihood is L(p) = pn(1−p)
∑ xi−n. If P xi > n, the log-likelihood derivative is n/p−(P xi −
n)/(1 − p), and setting it to zero gives bp = n/ P xi = 1/¯x; the second derivative is negative. If all xi = 1,
then L(p) = pn is maximised at the permitted boundary p = 1 . Thus the same formula bp = 1 /¯x covers
both cases.
5 marks; A:4, B:1
4(e). Correlation can be produced by confounding, common trends, selection effects or chance. A causal
conclusion requires design or additional causal assumptions.
2 marks; A:2
Question total: 20 marks
11