Mock Midterm Exam #3
Rules
- Closed book: no notes, books, or electronic aids.
- Show all work — partial credit is awarded for correct reasoning even when the final number is wrong.
- You may leave answers in combinatorial / factorial form (e.g. \(\binom{9}{3}\)) unless a decimal is requested.
Exercise 1: Naming Services and Splitting GPUs
You are provisioning infrastructure for a new analytics team.
(a) Every internal service gets a codename that is an anagram (any rearrangement of the letters) of the word ANALYTICS. How many distinct codenames are possible? (ANALYTICS has 9 letters; the letter A appears twice and all others once.)
(b) You must distribute 10 identical GPUs among 4 project teams, and every team must receive at least one GPU. In how many ways can this be done? You may leave the answer in combinatorial form.
Exercise 2: When “Flagged” Doesn’t Mean “Fraud”
A marketplace runs a real-time model that flags transactions it believes are fraudulent. On this platform only 2% of transactions are actually fraudulent. The model flags a truly fraudulent transaction with probability 0.95 (its recall / sensitivity), and flags a legitimate transaction with probability 0.10 (its false-positive rate).
(a) A transaction has just been flagged. What is the probability it is actually fraudulent, i.e. \(P(\text{fraud}\mid\text{flagged})\)?
(b) A manager reads the spec sheet and says: “The model catches 95% of fraud, so when it flags something we should be about 95% sure it’s fraud.” In one or two sentences, explain precisely which quantity the manager has confused with which, and why the base rate makes the truth so different.
Exercise 3: EV Charging Station Demand
An electric-vehicle charging station logs the energy \(X\) (in kWh) delivered per session. A single session follows this distribution:
| Energy \(x\) (kWh) | 5 | 10 | 20 | 40 |
|---|---|---|---|---|
| Probability | 0.20 | 0.40 | 0.30 | 0.10 |
Sessions are independent and identically distributed.
(a) Compute \(E[X]\) and \(\mathrm{Var}(X)\).
(b) Suppose tomorrow has 64 sessions. Let \(S\) be the total energy delivered. Using the CLT, give an approximate distribution for \(S\) (state its mean and variance).
(c) The transformer trips if the day’s total exceeds 1100 kWh. Approximate \(P(S \ge 1100)\). Use \(\Phi(1.75)\approx 0.96\).
Exercise 4: Updating Belief About an Ad’s Click Rate
A growth team launches a new ad. From a previous, very similar campaign for the same product, click-through rates clustered around 20%. The team encodes this as a weakly informative prior \(\theta \sim \text{Beta}(2,8)\) on the true click-through probability \(\theta\). The new ad is shown 40 times and clicked 12 times.
(a) State the posterior distribution of \(\theta\) and compute its mean. Compare it to the prior mean and to the raw click fraction \(12/40\).
(b) A 95% credible interval for this posterior is approximately \([0.16,\,0.40]\). In one sentence, state what this interval means.
(c) A teammate suggests instead using a strong prior taken from a completely different product line in a different market. Why is that a worse modeling choice here?
Exercise 5: Choosing a Churn Threshold by Cost
A subscription company evaluates two candidate thresholds for its churn flag on the same held-out month of 1000 accounts (50 truly churn). For each, costs are charged on the same ledger: a false negative (a churned customer not flagged) costs $400 in lost lifetime value; a false positive (a wasted retention offer) costs $20.
| Threshold L (loose) | Threshold T (tight) | |
|---|---|---|
| True positives (caught churners) | 45 | 30 |
| False positives (flagged, did not churn) | 200 | 40 |
| False negatives (missed churners) | 5 | 20 |
(a) Compute the total cost of each threshold using the same rule \(400\cdot(\text{FN})+20\cdot(\text{FP})\). Which should the company deploy?
(b) Compute the recall of each threshold and explain how the cost asymmetry — not raw accuracy — drives the choice.
Exercise 6: The Winner’s Curse on the Landing Page
A team tests 8 redesigned landing pages against the current one. The current page converts at 5.0%. After the test, the team picks the page with the highest observed conversion — page #6, which converted at 6.2% (each page and the control had \(n = 4000\) visitors).
(a) Treating page #6 in isolation as a single two-proportion comparison against control, compute the standard error of the difference and the \(z\)-score. Use \(\text{SE}=\sqrt{\tfrac{p_c(1-p_c)}{n}+\tfrac{p_t(1-p_t)}{n}}\). Is it “significant” at \(\alpha=0.05\) for a single test? (Use \(z_{0.975}\approx 1.96\) as the two-sided 5% critical value.)
(b) Explain in 2–3 sentences why the 6.2% figure is likely an over-estimate of page #6’s true conversion rate, and name the phenomenon.
(c) What concrete step should the team take before rolling page #6 out to all traffic, and why?
Exercise 7: More Fire Trucks, More Damage?
An insurance analyst pulls records from 5 fires. For each she records \(X\) = number of fire trucks dispatched and \(Y\) = property damage (in millions of euro):
| Fire | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| \(X\) (trucks) | 1 | 2 | 3 | 4 | 5 |
| \(Y\) (damage, M€) | 2 | 3 | 5 | 4 | 6 |
(a) Compute the (population) covariance \(\operatorname{Cov}(X,Y)\) and the Pearson correlation \(r\). Use the population formulas (divide by \(n=5\)).
(b) A junior colleague concludes: “Sending more fire trucks causes more damage, so we should dispatch fewer trucks.” Explain why the strong positive correlation does not license this causal claim, and name a plausible confounder.
(c) Theory. In general, if two random variables are independent (and their covariance is defined), what is their covariance? Does \(\operatorname{Cov}(X,Y)=0\) by itself prove independence? Answer briefly.