OLS Derivation, CLT Approximation, and Kelly Betting
Statistics & ExperimentsModel answerLast updated
Derive the OLS slope estimator, apply the CLT to a Bernoulli sample mean, and find the Kelly-optimal bet fraction for a biased coin.
Setup
This problem has three independent parts. Each can be answered in sequence during a technical screen. Show your work: interviewers care about the reasoning chain, not just the final number.
Part 1: OLS Slope Estimator
You observe n data points $(x_i, y_i)$ generated by the model:
$$y_i = \beta_0 + \beta_1 x_i + \varepsilon_i$$
where the errors $\varepsilon_i$ are i.i.d. with mean zero and constant variance $\sigma^2$, and are independent of the $x_i$.
- Starting from the least-squares objective, derive a closed-form expression for $\hat{\beta}_1$.
- Write down $\text{Var}(\hat{\beta}_1 \mid x)$ and explain what happens to it as $n \to \infty$, given that $\text{Var}(x)$ is finite and strictly positive.
Part 2: Sample Mean of Bernoulli Trials
Let $X_1, X_2, \ldots, X_n$ be independent Bernoulli random variables, each with success probability $p = 0.6$. Define the sample mean $\bar{X}n = \frac{1}{n}\sum{i=1}^n X_i$.
- State the Law of Large Numbers and the Central Limit Theorem as they apply to $\bar{X}_n$.
- For $n = 100$, use the Normal approximation to compute $P(\bar{X}_{100} > 0.65)$. Round to four decimal places.
Part 3: Optimal Bet Sizing
You start with a bankroll of $10,000. Each round you bet a fraction $f$ of your current wealth on an event that pays even money (win: gain your stake; lose: lose your stake) with win probability $p = 0.55$.
- Define the Kelly Criterion in terms of maximizing expected log-wealth growth, and derive the optimal fraction $f^*$ for even-money bets in general.
- Compute $f^$ and the dollar amount wagered on the first round. State the per-round compounded growth rate at $f^$, rounded to four decimal places.
Constraints and notes
- Use the standard Normal distribution for all approximations; treat $\Phi(1.02) \approx 0.8461$.
- Express closed-form answers symbolically before substituting numbers.
- Round numerical answers to four decimal places.
- Briefly note what breaks if a key assumption is violated for each part.
Hints
Hint 1
For Part 1, take the partial derivative of the sum of squared residuals with respect to β₁, substitute the expression for β̂₀ = ȳ − β̂₁x̄, and simplify by noting that deviations from the mean sum to zero. The result is a ratio of a sample covariance to a sample variance.
Hint 2
For Part 2, the standard deviation of the sample mean is √(p(1−p)/n), not √(p(1−p)). Compute the z-score by centering at p = 0.6 and scaling by that standard deviation before looking up the tail area.
Hint 3
For Part 3, write the expected log-wealth change per round as p·ln(1+f) + (1−p)·ln(1−f) for even-money bets, differentiate with respect to f, set equal to zero, and solve. The answer simplifies neatly to p − q.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Part 1: OLS Slope Estimator
Derivation
Ordinary least squares minimizes the sum of squared residuals:
$$L(\beta_0, \beta_1) = \sum_{i=1}^n (y_i - \beta_0 - \beta_1 x_i)^2$$
Intercept first-order condition:
$$\frac{\partial L}{\partial \beta_0} = -2\sum(y_i - \beta_0 - \beta_1 x_i) = 0 ;\Rightarrow; \hat{\beta}_0 = \bar{y} - \hat{\beta}_1 \bar{x}$$
Slope first-order condition:
$$\frac{\partial L}{\partial \beta_1} = -2\sum x_i(y_i - \beta_0 - \beta_1 x_i) = 0$$
Substituting $\hat{\beta}_0$ and rewriting in deviations from the mean (using the fact that $\sum(x_i - \bar{x}) = 0$):
$$\boxed{\hat{\beta}1 = \frac{\sum{i=1}^n (x_i - \bar{x})(y_i - \bar{y})}{\sum_{i=1}^n (x_i - \bar{x})^2}}$$
This is the sample covariance of $x$ and $y$ divided by the sample variance of $x$. The objective is a convex quadratic, so this stationary point is a unique global minimum, provided the $x_i$ are not all identical.
A common mistake: writing $\hat{\beta}_1 = \sum x_i y_i / \sum x_i^2$. That formula applies only to regression through the origin.
Variance and consistency
Substituting the true model into the estimator:
$$\hat{\beta}_1 = \beta_1 + \frac{\sum(x_i - \bar{x})\varepsilon_i}{\sum(x_i - \bar{x})^2}$$
Since errors have mean zero and are uncorrelated with constant variance $\sigma^2$:
$$\text{Var}(\hat{\beta}1 \mid x) = \frac{\sigma^2}{\sum{i=1}^n (x_i - \bar{x})^2} \approx \frac{\sigma^2}{n \cdot \text{Var}(x)}$$
This shrinks to zero at rate $1/n$, so the standard error decays like $1/\sqrt{n}$. An unbiased estimator whose variance vanishes is consistent: $\hat{\beta}_1 \xrightarrow{p} \beta_1$.
The intuition matters here: wider spread in $x$ (larger $\text{Var}(x)$) gives more leverage to identify the slope, reducing variance. More residual noise (larger $\sigma^2$) does the opposite.
Assumption violation worth flagging: if $\text{Var}(\varepsilon_i \mid x_i) = \sigma_i^2$ varies across observations (heteroscedasticity), the estimator stays unbiased and consistent, but the formula above gives the wrong variance — invalidating standard errors, t-tests, and confidence intervals. The fix is either heteroscedasticity-robust (White/HC) standard errors or weighted least squares.
Part 2: Bernoulli Sample Mean
Each $X_i$ has $E[X_i] = 0.6$ and $\text{Var}(X_i) = 0.6 \times 0.4 = 0.24$.
LLN and CLT
- LLN: $\bar{X}_n \xrightarrow{p} 0.6$ as $n \to \infty$. The sample mean converges to the true mean.
- CLT: $\sqrt{n}(\bar{X}_n - 0.6) \xrightarrow{d} N(0, 0.24)$, or equivalently $Z_n = (\bar{X}_n - 0.6)/\sqrt{0.24/n} \to N(0,1)$. The LLN tells you the destination; the CLT describes the fluctuations around it, which are of order $1/\sqrt{n}$.
Computing $P(\bar{X}_{100} > 0.65)$
Standard deviation of the sample mean:
$$\text{SD}(\bar{X}_{100}) = \sqrt{\frac{0.24}{100}} = \sqrt{0.0024} \approx 0.04899$$
Z-score:
$$z = \frac{0.65 - 0.60}{0.04899} \approx 1.0206$$
Tail probability:
$$P(\bar{X}_{100} > 0.65) \approx 1 - \Phi(1.02) \approx 1 - 0.8461 = \mathbf{0.1539}$$
Continuity correction (worth mentioning): $\bar{X}_{100} > 0.65$ is equivalent to $\sum X_i \ge 66$. Using 65.5 as the boundary gives $z \approx 1.12$ and $P \approx 0.1314$, which is much closer to the exact binomial tail (~0.131). Lead with the plain Normal answer, then note the refinement — that earns extra credit.
Part 3: Kelly Criterion
Definition and derivation
The Kelly criterion selects the fraction $f$ of current wealth to wager so as to maximize the expected log growth per round:
$$g(f) = p \ln(1 + f) + q \ln(1 - f), \quad q = 1 - p$$
Maximizing $E[\ln W]$ is equivalent to maximizing the long-run compounded growth rate, because by the LLN, $\frac{1}{n}\ln W_n \to g(f)$ almost surely.
Differentiating and setting equal to zero:
$$g'(f) = \frac{p}{1+f} - \frac{q}{1-f} = 0 ;\Rightarrow; p(1-f) = q(1+f) ;\Rightarrow; f^* = p - q$$
The second derivative is negative, confirming this is a maximum.
Numerical answer
With $p = 0.55$ and $q = 0.45$:
$$f^* = 0.55 - 0.45 = \mathbf{0.10}$$
- First-round stake: $0.10 \times $10{,}000 = $1{,}000$. The fraction stays fixed at 10% of current wealth each subsequent round, so the dollar amount adjusts as the bankroll changes.
- Per-round growth rate: $g(0.10) = 0.55\ln(1.1) + 0.45\ln(0.9) \approx 0.55(0.09531) + 0.45(-0.10536) \approx \mathbf{0.0050}$ per round (~0.5% compounded growth).
Common mistake: reading "doubles your bet on a win" as net odds of $b = 2$. Even-money means you net exactly your stake — so $b = 1$ and the formula reduces to $f^* = p - q$.
Contrasting with expected-value maximization: betting your entire bankroll maximizes expected wealth per round but leads to ruin almost surely, because a single loss wipes you out. Kelly avoids this by operating in log-space.
Practical caveats: edge $p$ must be estimated, and overbetting is severely penalized — betting $2f^*$ produces near-zero growth. For this reason, practitioners often use half-Kelly or fractional-Kelly, accepting ~75% of peak growth in exchange for substantially lower drawdowns and volatility.