S14 Machine learning · Practice
Every topic, mixed
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
Topics: all 51
Check
Fit a least-squares line to the points (0, 2), (1, 2), (3, 10). What's its slope?
Check
A fit has sum-of-squares error E = 2 over 10 examples. What's its RMS error?
Check
A correct linear model with 3 parameters is fitted to 100 examples with noise variance 0.04. What test mean squared error should you expect?
Check
For the same fit (3 parameters, 100 examples, noise variance 0.04), what's the expected gap between test and training error?
Check
A single weight through the origin has Σx² = 10 and Σxt = 3. What weight does regularization with λ = 20 give?
Check
A correct model with 5 parameters on data with noise variance 0.02: how many examples keep the expected test–training gap down to 0.01?
Check
A least-squares line is fitted to 10 points with Σx = 20, Σx² = 80, Σt = 80 and Σxt = 140.
(a)
What is the slope ?
(b)
What is the intercept ?
Check
RMS error: E = 0.1, N = 5?
Check
Expected test error: σ² = 0.005, p = 2, N = 500?
Check
Ridge weight: Σx² = 1, Σxt = 0.5, λ = 50?
Check
Four measurements read 1, 2, 9 and 10. What's the maximum-likelihood estimate of the Gaussian variance?
Check
The maximum-likelihood variance of 3 samples is 4. What's the unbiased estimate?
Check
A test detects a condition with probability 0.9 and falsely flags 0.05 of negatives. The condition's prevalence is 0.01. Given a positive, what's the probability of the condition?
Check
4 Gaussian observations have squared deviations from μ summing to 20. With σ² = 1, what's the log-likelihood?
Check
Targets have Gaussian noise of variance 0.1, and the weights a Gaussian prior with standard deviation 0.5. What regularization constant does MAP estimation correspond to?
Check
Samples of size 2 come from a Gaussian of variance 4. What's the expected value of the maximum-likelihood variance estimate?
Check
A photon counter records 3, 1, 5 and 8 counts in four equal intervals, assumed Poisson.
(a)
What is the maximum-likelihood count rate per interval?
(b)
At that rate, what's the probability of an interval with no counts?
Check
Unbiased variance from σ²_ML = 0.5, N = 2?
Check
Posterior: prevalence 0.0005, detection 0.8, false alarms 0.1?
Check
MAP λ: noise variance 0.001, prior std 0.1?
Check
A false alarm costs 5 and a miss costs 10. Above what posterior probability of the positive class should you decide positive?
Check
Class 1 has mean 0 and class 2 mean 1, both Gaussian with σ = 1; class 1's prior is 0.9. Where's the minimum-error boundary?
Check
Two equally likely classes have unit-variance Gaussian densities whose means are 2 apart. What's the Bayes error?
Check
Unit-variance classes 1 apart have priors 0.8 and 1 − 0.8. What's the Bayes error?
Check
The posterior of a fault is 0.2. A false alarm costs 1 and a miss 50. What's the expected cost of the better decision?
Check
Given an input, the target is equally likely to be 1, 3 or 20. What prediction minimizes the expected squared error?
Check
Two equally likely unit-variance Gaussian classes have means 2 apart. The classifier rejects whenever the larger posterior is below 0.7.
(a)
How far on each side of the midpoint does the reject band reach?
(b)
What fraction of inputs does it reject?
Check
Threshold: false alarm 0.5, miss 2?
Check
Bayes error, means 2 apart, equal priors, σ = 1?
Check
Boundary: μ₁ = −1, μ₂ = −0.5, σ = 2, P₁ = 0.6?
Check
A binary event has probability 0.1. What's its entropy?
Check
A classifier assigns probability 0.3 to the correct class. What's the cross-entropy loss for this example?
Check
The true probability is 0.6; a model says 0.5. What's the KL divergence ?
Check
What's the entropy of a uniform choice among 10 outcomes?
Check
A binary symmetric channel flips bits with probability 0.1. With uniform input, what's the mutual information between input and output?
Check
On three examples a classifier gives the correct class probabilities 0.9, 0.8 and 0.5. What's its average cross-entropy loss?
Check
A model approximates a Gaussian p with mean 0 and standard deviation 1 by a Gaussian q with mean 1.5 and standard deviation 2.
(a)
What is ?
(b)
And ?
Check
Binary entropy at p = 0.1?
Check
Loss for correct-class probability 0.1?
Check
: p = 0.2, q = 0.1?
Check
An error rate must be measured to within ±0.01 with probability 0.01 of failure, using Hoeffding's inequality.
(a)
How many test examples does it need?
Check
A model is scored on 1000 examples, and the bound must hold with failure probability 0.01.
(a)
How far can its measured error sit from the true error?
(b)
And for the best of 1000000 models scored on the same examples?
Check
A system passes 300 independent trials with no failures.
(a)
What upper bound on its failure rate holds with confidence 0.9?
Check
A classifier's error rate is about 0.05, and it must be measured to within ±0.005 at 95% confidence.
(a)
How many test examples does the normal approximation call for?
(b)
How many times more does Hoeffding's bound ask for?
Check
A learner picks any Boolean function of 16 binary inputs that fits its training data.
(a)
How many training examples guarantee error below 0.01 with failure probability 0.05?
Check
A linear classifier with a bias works on 10-dimensional inputs.
(a)
What is its VC dimension?
(b)
About how many training examples does the ten-per-dimension rule of thumb suggest?
Check
Hoeffding test size: ±0.01, δ = 0.05?
Check
Zero failures in 100: bound at confidence 0.95?
Check
Best of 10 models on 500 examples, δ = 0.05?
Check
Points (0, 1), (1, 3), (2, 9), (3, 11).
(a)
Least-squares slope?
(b)
Intercept?
Check
A correct linear model with 4 parameters, 120 examples, noise variance 0.02.
(a)
Expected training error?
(b)
Expected test error?
(c)
Expected test RMS error?
Check
A single weight with Σx² = 4, Σxt = 3; separately, a fit with E = 6 on 20 examples.
(a)
Least-squares weight?
(b)
With λ = 10?
(c)
RMS error of the other fit?
Check
Three samples: 1, 3, 9.
(a)
ML mean?
(b)
ML variance?
(c)
Unbiased variance?
Check
A detector: prevalence 0.002, detection 0.95, false alarms 0.05; separately, regression noise variance 1 with a weight prior of standard deviation 0.5.
(a)
Posterior after a positive?
(b)
Equivalent ridge λ?
Check
5 Gaussian samples with squared deviations from μ totaling 40; σ² = 1.
(a)
Log-likelihood?
(b)
σ² that would maximize it (given μ)?
Check
Unit-variance Gaussian classes at 0 and 1, with class 1's prior 0.5.
(a)
Boundary?
(b)
Bayes error?
Check
Costs: false alarm 1, miss 20; the posterior of the positive class is 0.4.
(a)
Threshold?
(b)
Expected cost of the best decision?
Check
A binary event with true probability 0.7, predicted as 0.6.
(a)
Entropy?
(b)
Cross-entropy?
(c)
KL divergence?
Check
A classifier gives correct-class probabilities 0.8 and 0.95 on two examples; a uniform 100-way guess.
(a)
Average loss?
(b)
Loss of the uniform guess?
Check
A binary symmetric channel with error rate 0.02; equal-prior unit-variance classes 2 apart.
(a)
Mutual information (uniform input)?
(b)
Bayes error?
Check
Noise variance 0.05, 5 parameters, a target gap of 0.01; separately, an ML variance of 9 from 4 samples.
(a)
Examples needed?
(b)
Unbiased variance?
Check
6 units start a 2000-hour life test. 2 fail, at an average of 600 hours; the rest survive to the end.
(a)
What is the maximum-likelihood failure rate per hour?
(b)
What mean time to failure does it imply?
Check
A class has prior 0.3. A binary feature is on with probability 0.7 in that class and 0.3 otherwise.
(a)
What is the feature's entropy?
(b)
What is the mutual information between feature and class?
Check
Two equally likely unit-variance classes have means 2 apart; a classifier abstains unless its larger posterior is at least 0.75.
(a)
How wide is the band of inputs it rejects?
(b)
What fraction of all inputs does it then get wrong?
Check
A beta(2, 1) prior is updated with 7 successes in 20 trials. What's the posterior mean?
Check
With the same kind of update (beta(2, 2) prior, 7 of 20), what's the MAP estimate?
Check
After 3 successes in 10 trials, what does Laplace's rule of succession predict for the next trial?
Check
What's the variance of a beta(5, 3) distribution?
Check
A three-outcome source produced counts 1, 1 and 9. With a Dirichlet prior of 1 on each outcome, what's the predictive probability of the first?
Check
How far does the posterior mean (beta(1, 1) prior, 3 successes in 50) sit from the maximum-likelihood estimate?
Check
A failure rate has a gamma(2, 500 h) prior; then 12 failures occur in 10000 hours.
(a)
What is the posterior mean rate, per thousand hours?
(b)
What is its posterior standard deviation, per thousand hours?
Check
Posterior mean: beta(0.5, 0.5), 30 of 100?
Check
Laplace's rule: 0 of 60?
Check
Beta(1, 1) variance?
Check
A mean has a prior with standard deviation 2. 20 observations with noise variance 0.25 arrive. What's the posterior variance?
Check
Prior N(0, 0.5²), and 10 observations averaging 3 with noise variance 1. What's the posterior mean?
Check
x and y are zero-mean jointly Gaussian with = 1, = 0.5 and correlation 0.8. Given x = 2, what's E[y|x]?
Check
y has standard deviation 2 and correlation 0.3 with x. What's var(y|x)?
Check
A point (x, y) = (1, −2) is compared with a zero-mean Gaussian of diagonal covariance with standard deviations 2 and 3. What's its Mahalanobis distance?
Check
The mean of the first 50 − 1 samples is 2. Sample number 50 is 1. What's the new mean?
Check
A quantity has prior N(0, 1²). A sensor reads with noise variance 2, and reports y = 4.
(a)
What is the posterior variance of x?
(b)
What is its posterior mean?
Check
Posterior variance: σ₀ = 0.1, σ² = 0.05, N = 100?
Check
var(y|x): σ_y = 0.2, ρ = 0.05?
Check
Mahalanobis: (0.5, 0.5), σ = (3, 4)?
Check
A weight w = 0.5 is estimated by ridge with Σx² = 5 and λ = 20. What's the squared bias?
Check
For the same estimate (Σx² = 5, λ = 20) with noise variance 1, what's the variance?
Check
For a single weight w = 0.5 with noise variance 4, what ridge λ minimizes the mean squared error?
Check
has eigenvalues 5, 0.5 and 0.2. With λ = 5, how many effective parameters remain?
Check
How many terms does a polynomial basis of degree 3 in 2 inputs have (including the constant)?
Check
With Σx² = 5, noise variance 1 and a true weight 2, what mean squared error does the best ridge λ achieve?
Check
A two-weight least-squares problem has with a = 5, b = 2, c = 1.5, and = (6, −1).
(a)
What is ?
(b)
What is ?
Check
Best λ: σ² = 0.1, w = 0.2?
Check
Effective parameters: eigenvalues 1, 0.2, λ = 10?
Check
Polynomial terms: degree 1, 1 inputs?
Check
A one-weight model has prior precision 1, noise precision 1 and data with Σx² = 50. What's the posterior precision of the weight?
Check
With prior precision 1, noise precision 1, Σx² = 50 and Σxt = 8, what's the posterior mean of the weight?
Check
For that model (α = 0.5, β = 1, Σx² = 10), what's the predictive standard deviation at x = 10?
Check
A Bayesian regression has prior precision 2 and noise precision 1. What ridge λ gives the same weights?
Check
With α = 0.5 and β = 1, how large must Σx² be for the weight's posterior standard deviation to reach 0.2?
Check
For the same kind of model (α = 0.5, β = 1, Σx² = 10), how large is the part of the predictive standard deviation that comes from weight uncertainty alone at x = 6?
Check
A one-weight model's current posterior has precision 2 and mean 0.5. A new batch arrives with Σx² = 20 and Σxt = 2, noise precision 4.
(a)
What is the new precision?
(b)
What is the new mean?
Check
Posterior mean: α = 0.01, β = 0.5, Σx² = 200, Σxt = 100?
Check
Predictive sd: α = 0.1, β = 0.5, Σx² = 40, x = 20?
Check
Σx² needed for sd 0.3: α = 0.1, β = 0.5?
Check
A beta(1, 1) prior updated with 8 successes in 25 trials.
(a)
Posterior mean?
(b)
MAP?
(c)
Posterior variance?
Check
A three-outcome source with counts 0, 2, 10 and a Dirichlet prior of 1 each; separately, 0 successes in 12.
(a)
Predictive probability of outcome 1?
(b)
Laplace's estimate for the second source?
Check
Prior on a mean N(0, 1²); 15 observations averaging 1 with noise variance 2.
(a)
Posterior variance?
(b)
Posterior mean?
Check
Zero-mean jointly Gaussian x, y: = 1, = 1.5, ρ = 0.9; observed x = 2.
(a)
E[y|x]?
(b)
Conditional standard deviation?
Check
A point (1, 1) against a zero-mean Gaussian with standard deviations 2 and 4; a running mean of 3 over 4 − 1 samples when sample 4 = 2 arrives.
(a)
Mahalanobis distance?
(b)
Updated mean?
Check
Ridge on one weight: Σx² = 5, true w = 0.5, noise variance 6, λ = 5.
(a)
Squared bias?
(b)
Variance?
(c)
Best λ?
Check
eigenvalues 3, 0.5, 0.3 with λ = 2; a polynomial basis of degree 2 in 3 inputs.
(a)
Effective parameters?
(b)
Basis size?
Check
Bayesian regression of one weight: α = 0.5, β = 2, Σx² = 20, Σxt = 15.
(a)
Posterior mean?
(b)
Posterior standard deviation?
(c)
Predictive standard deviation at x = 1?
Check
A prior precision 0.2, noise precision 1, and a target posterior standard deviation 0.15 for one weight.
(a)
Equivalent ridge λ?
(b)
Σx² needed?
Check
A beta(2, 2) prior; separately, the best-λ ridge error for Σx² = 40, noise variance 5, w = 1.
(a)
Prior variance?
(b)
Best ridge mean squared error?
Check
A prior standard deviation 0.5 on a mean, noise variance 1, 100 observations.
(a)
Posterior variance?
(b)
Weight given to the data in the posterior mean?
Check
1 successes in 3 trials with a beta(2, 2) prior.
(a)
Maximum likelihood?
(b)
Posterior mean?
Check
A failure rate has a gamma(1, 2000 h) prior, and 5 failures occur in 20000 hours.
(a)
What is the posterior mean, per 10,000 hours?
(b)
What is the posterior's standard deviation as a fraction of its mean?
Check
A quantity has prior N(0, 0.5²). A sensor with gain 0.25 and noise variance 1 reads y = 3.
(a)
What is the posterior standard deviation?
(b)
What is the posterior mean?
Check
A two-weight fit has with a = 6, b = 3, c = −2, and = (10, 1); ridge uses λ = 0.
(a)
What is ?
(b)
What is ?
Check
A least-squares fit with 10 parameters uses 50 points. One point has residual 1 and leverage 0.75.
(a)
What is the average leverage?
(b)
What is that point's leave-one-out residual?
Check
A ridge fit on 100 points has 2 effective parameters and a mean squared training residual of 2.
(a)
What is its generalized cross-validation score?
Check
A model with 3 parameters reaches a maximized log-likelihood of −500 on 10000 examples.
(a)
What is its AIC score (in the form ln L − M)?
(b)
Its BIC score (ln L − (M/2) ln N)?
Check
A larger model has 5 more parameters than a smaller one and raises the maximized log-likelihood by 3 nats, on 100000 examples.
(a)
By how much does it change the BIC score (positive favors the larger model)?
Check
Each of a model's 4 parameters has a prior 2 units wide and a posterior 0.5 wide.
(a)
What is the log of its Occam factor?
Check
A one-weight model has Σx² = 5 and Σxt = 8, with noise precision 1.
(a)
What prior precision maximizes its evidence?
(b)
How many well-determined parameters γ does it have there?
Check
Leave-one-out residual: residual 0.3, leverage 0.2?
Check
BIC: ln L = −80, M = 4, N = 5000?
Check
Evidence-optimal α: S = 10, T = 12, β = 8?
Check
A defect detector's error rate is near 0.02. It must be measured to within ±0.005 with failure probability 0.01.
(a)
How many test examples does Hoeffding's inequality call for?
(b)
And the normal approximation (z = 1.96 for δ = 0.05, 2.576 for δ = 0.01)?
Check
A safety function must be shown to fail less often than 0.001 per demand with confidence 0.9.
(a)
How many failure-free demands does that take?
(b)
What rate is demonstrated by 2000 failure-free demands at that confidence?
Check
A team tunes 20 hyperparameter settings on a validation set of 1000 examples.
(a)
How far might the best setting's validation error sit from its true error, with failure probability 0.01?
(b)
How large a validation set would bring that bound down to a single model's on 1000 examples?
Check
A yield has a beta(1, 1) prior; 3 of 10 parts then fail.
(a)
What is the posterior mean failure rate?
(b)
What is its posterior standard deviation?
(c)
What probability does it give the next two parts both passing?
Check
A failure rate has a gamma(1, 1000 h) prior; a fleet then logs 7 failures in 30000 hours.
(a)
What is the posterior mean rate, per 10,000 hours?
(b)
What probability does the posterior give a unit running 10000 hours with no failure?
Check
Three independent unbiased sensors read 10, 14 and 9, with noise variances 4, 0.5 and 3.
(a)
What is the best combined estimate?
(b)
What is its standard deviation?
Check
A component's temperature y and a sensor's reading x are jointly Gaussian: y has mean 60 and standard deviation 10, x has mean 20 and standard deviation 2, and their correlation is 0.9. The sensor reads 22.
(a)
What is the expected temperature?
(b)
What is its conditional standard deviation?
Check
A two-feature fit has with a = 4, b = 2, c = −1.5, and = (12, 3). It's fitted by ridge regression with λ = 0.5.
(a)
What is ?
(b)
What does the fit predict for features (1, −1)?
Check
A one-weight Bayesian regression has prior precision 5, noise precision 1, Σx² = 30 and Σxt = 40.
(a)
What is the posterior mean of the weight?
(b)
What is the predictive standard deviation at x = 1?
Check
Three points of a least-squares fit have residuals 0.2, 0.3 and 0.25, and leverages 0.5, 0.15 and 0.45.
(a)
What is the first point's leave-one-out residual?
(b)
What do the three contribute to the leave-one-out sum of squared errors?
Check
A ridge fit with λ = 10 on 30 points has eigenvalues 50, 5 and 2, and a mean squared training residual of 0.4.
(a)
How many effective parameters does it have?
(b)
What is its GCV score?
Check
A model with 4 parameters reaches ln L = −412 on 80 examples; a larger one with 6 more parameters gains 9 nats.
(a)
By how much does the larger model change the AIC score (ln L − M)?
(b)
And the BIC score?
(c)
What is the larger model's BIC score?
Check
A line through the origin, with noise precision 4, is fitted to the single point (2, 1.2), and its prior precision chosen by the evidence.
(a)
What prior precision maximizes the evidence?
(b)
What slope does the posterior then give?
Check
A learner outputs a conjunction of literals (each of 20 Boolean variables appears plain, negated, or not at all) consistent with its training data.
(a)
What is ln M for this hypothesis class?
(b)
How many training examples guarantee error below 0.01 with failure probability 0.01?
Check
A linear classifier with a bias is trained on 200 examples with 5 features, and evaluated by 10-fold cross-validation.
(a)
What is its VC dimension?
(b)
How many training examples per unit of VC dimension does each fold's fit get?
Check
A linear classifier has w = (1, 2) and = 1. What's the signed distance of the point (4, 0) from its boundary?
Check
Two classes project onto a line with means 1 and 4 and variances 2 and 3. What's Fisher's separation J?
Check
Class means differ by (1, 1) and the within-class scatter is diagonal with variances 4 and 9. At what angle from the first axis is Fisher's direction?
Check
With the same classes (Δm = (1, 1), variances 4 and 9), what separation does Fisher's direction achieve?
Check
A perceptron with w = (1, −2) and learning rate 0.5 updates on the misclassified point (3, −1) with target 1. What's the new second component of w?
Check
Separable data lie within radius 5 with margin 0.1. At most how many mistakes does the perceptron make?
Check
Two classes share a within-class covariance with a = 2, b = 1.5, c = 0.9, and their means differ by (2, −1.5).
(a)
What separation J does Fisher's direction achieve?
(b)
What separation would projecting onto the mean difference itself give?
Check
Signed distance: w = (−2, 1), = 2, point (3, 1)?
Check
Fisher's J: Δm = (0.5, 0.5), variances 5, 6?
Check
Perceptron mistake bound: R = 2, γ = 0.05?
Check
What's σ(0.5)?
Check
A logistic model outputs 0.6. What's its activation (the log-odds)?
Check
A model with = −4 and = 0.5 sees an example at x = 4 with target 1. What's the cross-entropy gradient with respect to ?
Check
Where is the decision boundary of a logistic model with = −2 and = 0.5?
Check
A logistic model has weight 0.7 on a feature. By what factor do the odds change when the feature increases by 1?
Check
What does one example at x = 3 contribute to the Hessian's slope entry for a model with = −3, = 1?
Check
A logistic model with = −1 and = 0.5 sees one example at x = 3 with target 1.
(a)
What is the gradient of the cross-entropy loss with respect to ?
(b)
What is the second derivative with respect to ?
Check
σ(−1)?
Check
Log-odds of 0.3?
Check
Boundary: = −10, = 0.3?
Check
Gaussian classes with means 1 and 0 share variance 3². What weight does the posterior's linear function put on x?
Check
For those classes (means 1 and 0, variance 2²) with class 1's prior 0.9, what's the offset ?
Check
Equally likely Gaussian classes with means 1 and 0 and variance 2²: what's the posterior of class 1 at x = 1.5?
Check
Spam has prior 0.3. A message has two features whose likelihood ratios (spam over good) are 5 and 0.8. What's its naive Bayes spam probability?
Check
How many parameters does a shared-covariance Gaussian classifier (two classes) need in 5 dimensions?
Check
And with a separate covariance for each class (QDA), in 5 dimensions?
Check
Two equally likely zero-mean Gaussian classes have standard deviations 0.5 and 1.5.
(a)
At what |x| are their densities equal?
(b)
What is the Bayes error?
Check
LDA weight: μ₁ = 0.5, μ₂ = −2, σ = 3?
Check
Naive Bayes: prior 0.01, ratios 2 and 3?
Check
LDA parameters in 5 dimensions?
Check
Data are uniform in a 2-dimensional unit cube.
(a)
What edge length must a smaller cube have to hold a fraction 0.01 of them?
Check
A unit cube in 3 dimensions.
(a)
What fraction of its volume lies within 0.05 of its surface?
Check
A two-class problem has Bayes error 0.05.
(a)
What is the most error a 1-nearest-neighbor classifier can have with unlimited data?
Check
Among 500 points, the 10 nearest to x lie within radius 0.3.
(a)
Estimate the density at x if the points lie in a plane.
(b)
And if they lie in three dimensions?
Check
Pairs of points are drawn uniformly from a 10-dimensional unit cube.
(a)
What is the mean squared distance between them?
(b)
What is the squared distance's standard deviation relative to its mean?
Check
A service searches 10000 reference vectors of dimension 64 by brute force, answering 5000 queries a second.
(a)
How many multiply-adds per second does it need, in billions?
(b)
How much memory do the references take in 32-bit floats, for 50 copies?
Check
Edge for a fraction 0.01 in 5 dimensions?
Check
1-NN limit for Bayes error 0.05?
Check
Planar density: K = 8, N = 1000, radius 0.02?
Check
A classifier has 30 true positives, 3 false positives and 40 false negatives. What's its precision?
Check
With 30 true positives, 3 false positives and 40 false negatives, what's the F1 score?
Check
A test has sensitivity 0.9 and specificity 0.9, and the condition has prevalence 0.1. What fraction of positive results are true?
Check
Positive and negative scores are Gaussian with equal variance and means 1.5 standard deviations apart. What's the AUC?
Check
A classifier scores 0.9 accuracy on 100 independent test examples. What's the standard error of that estimate?
Check
5-fold cross-validation runs on 1000 examples. How many examples does each fit train on?
Check
A classifier's accuracy is about 0.95, and the test set must measure it with a standard error of 0.5 percentage points.
(a)
How many independent test examples does that take?
(b)
How wide is the 95% confidence interval's half-width then, in percentage points?
Check
Recall: TP = 10, FP = 1, FN = 60?
Check
Precision: sensitivity 0.8, specificity 0.8, prevalence 0.3?
Check
AUC for separation 1?
Check
A Gaussian variable is flagged when it's more than 3 standard deviations from its mean. What percentage of normal readings are flagged?
Check
A detector with recall 0.9 and false-alarm rate 0.002 watches events where a fraction 0.01 are anomalous. What percentage of its alarms are real?
Check
For two-dimensional Gaussian data, what threshold on the squared Mahalanobis distance gives a 1% false-alarm rate?
Check
Two standardized variables with correlation 0.8 take the values 1.5 and −1.
(a)
What is the squared Mahalanobis distance?
(b)
What percentage of normal points lie at least that far out?
Check
A system monitors 100 independent variables, each with a false-alarm rate of 0.001 per check. What percentage of checks raise at least one false alarm?
Check
Build a Gaussian anomaly detector. Generate 5000 normal training points and 5000 normal test points from a 2D Gaussian with unit variances and correlation rho = 0.5, then 500 anomalies: fresh normal points plus the vector [shift/2, -shift/2], with shift = 2. Use rng = numpy.random.default_rng(seed) and rng.multivariate_normal in that order (train, test, anomalies). Fit the mean and covariance on the training set, flag points with squared Mahalanobis distance above , and set far (false-alarm rate on the normal test set) and tpr (detection rate on the anomalies).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
What precision does a detector with recall 0.95 and false-alarm rate 0.002 reach at prevalence 0.05?
Check
What threshold gives a 1% false-alarm rate in two dimensions?
Check
A linear discriminant with w = (2, 1) and = −3.
(a)
Signed distance of (4, 2)?
(b)
Distance of the boundary from the origin?
Check
Classes whose means differ by (1, 2), with a diagonal within-class scatter of variances 2 and 8.
(a)
Fisher's direction, from the first axis?
(b)
Its separation J?
(c)
J along the line joining the means?
Check
A perceptron with w = (1, 2), rate 0.25, updating on a misclassified (3, 2) with target 1; separately, data of radius 3 and margin 0.2.
(a)
New first component?
(b)
Mistake bound?
Check
A logistic model with = −5 and = 0.5.
(a)
Probability at x = 4?
(b)
Decision boundary?
(c)
Odds ratio per unit of x?
Check
The same kind of model ( = −3, = 0.5) trains on an example at x = 3 with target 1.
(a)
Gradient with respect to ?
(b)
Cross-entropy loss for this example?
Check
Log-odds and probabilities.
(a)
Log-odds of 0.6?
(b)
Change in activation to move a prediction from 0.05 to 0.6?
Check
Gaussian classes with means 1 and −1, shared variance 1.5², class 1's prior 0.8.
(a)
Weight on x?
(b)
Offset ?
(c)
Posterior of class 1 at x = 0.5?
Check
Naive Bayes with prior 0.05 and three features whose likelihood ratios are 3, 0.6 and 4.
(a)
Posterior log-odds?
(b)
Posterior probability?
Check
Two-class classifiers in 8 dimensions.
(a)
Shared-covariance Gaussian parameters?
(b)
Separate covariances?
(c)
Logistic regression?
Check
A confusion matrix: TP = 25, FP = 4, FN = 30, TN = 900.
(a)
Precision?
(b)
Recall?
(c)
F1?
(d)
Accuracy?
Check
A test with sensitivity 0.85 and specificity 0.9 at prevalence 0.05; separately, Gaussian scores 2.5 standard deviations apart.
(a)
Precision?
(b)
AUC?
Check
A test accuracy of 0.75 on 200 examples; separately, 10-fold cross-validation on 2000 examples.
(a)
Standard error?
(b)
Training examples per fit?
Check
Two classes share a within-class covariance with a = 2, b = 1, c = −0.8; their means differ by (2, 1).
(a)
What separation does Fisher's direction achieve?
(b)
And projecting onto the mean difference itself?
Check
A three-class softmax gives activations 1, 0 and 0.5; the true class is the second.
(a)
What probability does it give the true class?
(b)
What is the loss?
(c)
What is the loss's gradient with respect to the first activation?
Check
Two classifiers are tested on the same examples: the first is wrong and the second right on 25, and the reverse on 10.
(a)
What is McNemar's statistic?
Check
An anomaly detector has recall 0.9 and false-alarm rate 0.002 at prevalence 0.01; it thresholds a 2D Mahalanobis distance.
(a)
What percentage of its alarms are real?
(b)
What threshold gives a 0.1% false-alarm rate?
Check
Points (0, 1), (1, 2), (3, 9); separately, a correct model with 4 parameters fitted to 30 examples with noise variance 0.1.
(a)
Least-squares slope?
(b)
Expected test error?
(c)
Expected gap between test and training error?
Check
4 Gaussian samples whose maximum-likelihood variance is 2; and a log-likelihood with squared deviations summing to 60 at σ² = 2.
(a)
Unbiased variance?
(b)
Log-likelihood?
Check
Noise variance 0.01 with a weight prior of standard deviation 0.3; a false alarm costing 10 against a miss costing 500.
(a)
Equivalent regularization constant?
(b)
Posterior threshold for deciding positive?
Check
Gaussian classes with means 0 and 1, σ = 1.5, class 1's prior 0.8.
(a)
Minimum-error boundary?
(b)
Bayes error if the priors were equal?
Check
A binary event with probability 0.1, modeled as 0.2; a binary symmetric channel with flip probability 0.15.
(a)
Entropy of the event?
(b)
KL divergence in nats?
(c)
Channel mutual information with uniform input?
Check
A beta(1, 2) prior updated with 9 successes in 30 trials.
(a)
Posterior mean?
(b)
MAP?
(c)
Laplace's rule, ignoring this prior?
Check
Prior N(0, 0.5²) on a mean; 20 observations averaging 2 with noise variance 3.
(a)
Posterior variance?
(b)
Posterior mean?
Check
Zero-mean jointly Gaussian x, y with = 1, = 2, ρ = 0.8.
(a)
E[y | x = 3]?
(b)
var(y | x)?
(c)
Mahalanobis distance of (3, 1) if ρ were 0?
Check
Ridge on one weight: Σx² = 4, true w = 0.5, noise variance 8, λ = 6.
(a)
Mean squared error of the estimate?
(b)
Error at the best λ?
Check
Bayesian regression of one weight: α = 0.5, β = 2, Σx² = 15, Σxt = 12.
(a)
Posterior mean?
(b)
Predictive standard deviation at x = 1?
(c)
Equivalent ridge λ?
Check
Two classes whose means differ by (1, 1), with diagonal within-class variances 2 and 6.
(a)
Fisher's direction from the first axis?
(b)
Separation J?
Check
A logistic model with = −4, = 0.5, and an example at x = 3 with target 1.
(a)
Predicted probability?
(b)
Gradient with respect to ?
(c)
Decision boundary?
Check
LDA with means 1 and −1 and variance 2²; naive Bayes with prior 0.5 and feature likelihood ratios 4 and 0.25.
(a)
LDA weight?
(b)
Naive Bayes posterior?
Check
TP = 20, FP = 3, FN = 25.
(a)
Precision?
(b)
Recall?
(c)
F1?
Check
A detector with sensitivity 0.8 and specificity 0.92 at prevalence 0.08; scores 2.2 standard deviations apart; a measured accuracy 0.85 on 250 test examples.
(a)
Precision?
(b)
AUC?
(c)
Standard error of the accuracy?
Check
A two-class problem has Bayes error 0.08, and a 1-nearest-neighbor classifier works on 50 features.
(a)
What is the most error 1-NN can have with unlimited data?
(b)
How many test examples does Hoeffding's inequality require to measure its error within ±0.01 at 95% confidence?
(c)
What edge must a neighborhood cube have to hold 1% of uniform data in the unit cube of its features?
Check
How many parameters does a 64–16–10 network with biases have?
Check
How many multiply-accumulates does a 32–64–100 network need for a batch of 32 inputs?
Check
A one-input network has two tanh hidden units with weights 1 and −1 (no biases) and output weights 2 and 0.5. What's its output at x = 0.5?
Check
A three-class softmax has activations 1, 0 and 0.5. What probability does it give the first class?
Check
A one-input network has a single hidden layer of 10 ReLU units and a linear output. At most how many linear pieces can its output have?
Check
What's the derivative of the logistic sigmoid at a = 0?
Check
A 25-million-parameter network trains for 20 epochs on 0.05 million examples, on hardware sustaining 0.3 of its 100 TFLOP/s peak.
(a)
About how much arithmetic does training take?
(b)
How long does it take?
Check
Parameters of a 2–4–50 network?
Check
Softmax of the first of (−2, −3, 2)?
Check
σ′(−1)?
Check
For with = 1.2, = 1.5, input 2, target 1 and squared error, what's ?
Check
For the same network ( = 1.2, = 1.5, x = 2, t = 1), what's ?
Check
A network computes with w = 2, b = −0.25, v = −1. For input 1, target 1 and squared error, what's ?
Check
Through each of 20 layers, the backward signal is multiplied by a weight 1 and an activation slope 0.1. By what overall factor is it scaled?
Check
A central-difference gradient check with step 0.001 is off by 1 × 10⁻⁶. What error do you expect with a step 10 times smaller (rounding aside)?
Check
A network has 1000000 weights. Backpropagation computes the gradient for about 2 forward passes' cost. How many times more work does a central-difference gradient take?
Check
A linear layer has with a = 1, b = 0.5, c = 2, d = 4. The input is x = (1, −1) and the upstream gradient = (0.5, 2).
(a)
What is ?
(b)
What is (the weight from to )?
(c)
What is ?
(d)
What is ?
Check
: = −1.5, = −3, x = 2, t = 1?
Check
Gradient scale through 30 layers, slope 0.05, weight 0.5?
Check
Central-difference error 1 × 10⁻⁸, step divided by 1.5?
Check
The Hessian's largest eigenvalue is 50. What's the largest learning rate for which gradient descent is stable?
Check
The Hessian's eigenvalues run from 2 to 20. What fixed learning rate converges fastest?
Check
A problem has condition number 100. With the best fixed learning rate, how many gradient-descent steps reduce the error by a factor of 0.001?
Check
With well-tuned momentum, what factor per step does gradient descent achieve on a quadratic with condition number 100?
Check
Adam's first-moment average starts at 0 with β₁ = 0.9. After 20 steps with constant gradient 0.2, what's the uncorrected m?
Check
Single-example gradients have standard deviation 2. What's the standard deviation of a minibatch gradient over 16 examples?
Check
Gradient descent with rate 0.01 runs 1000 steps from zero on a quadratic.
(a)
What fraction of the solution has it learned along a direction of curvature 0.1?
(b)
What fraction would ridge regression with λ = 1/(kη) keep along that direction?
Check
Best rate: eigenvalues 0.5 to 10?
Check
Momentum rate, κ = 100?
Check
Minibatch std: σ = 0.1, B = 1?
Check
A simple recurrent layer has 128 hidden units on 10 inputs, followed by a linear output layer of 20 units.
(a)
How many parameters does the recurrent layer have?
(b)
And the output layer?
Check
A recurrent layer with 256 hidden units reads 32 inputs per step.
(a)
How many parameters does an LSTM layer have?
(b)
And a GRU layer?
Check
A linear recurrent unit updates .
(a)
How much of an input from 5 steps ago remains in ?
(b)
What is its memory time constant?
Check
The backward signal through a recurrent network is multiplied by a gain of about 0.9 per step.
(a)
By what factor has it changed after 10 steps?
(b)
After how many steps has it changed by a factor of 1000?
Check
An LSTM's forget gate sits at its bias, 1.
(a)
What fraction of the cell's contents survives each step?
(b)
What is the cell's memory time constant?
Check
A gradient's norm is 40, and training clips it to norm 1.
(a)
By what factor is the gradient scaled?
(b)
What does a component of −6 become?
Check
LSTM parameters: H = 100, D = 20?
Check
Memory time constant at gain 0.95?
Check
Cell time constant at forget bias 2?
Check
A 3 × 3 convolution with padding 2 and stride 2 is applied to a 32 × 32 input. How wide is the output?
Check
A layer has 512 filters of size 3 × 3 over 3 input channels. How many parameters does it have, with biases?
Check
A convolutional layer produces a 56 × 56 × 256 output with 3 × 3 filters over 128 input channels. How many multiply-accumulates does it take?
Check
5 convolutional layers of 3 × 3 filters with stride 1 are stacked. How wide is each final output's receptive field?
Check
Inverted dropout drops units with probability 0.2 during training. By what factor must surviving units be scaled?
Check
With learning rate 0.05 and weight decay λ = 0.001, what fraction of a weight remains after 60000 steps if the data's gradient on it is zero?
Check
A 5 × 5 convolution maps 32 channels to 256.
(a)
How many weights does a depthwise separable version need (no biases)?
(b)
By what factor does it cut the weights?
Check
Output width: N = 16, K = 1, P = 5, S = 4?
Check
Parameters: 2048 filters, 1 × 1, 1 channels?
Check
Receptive field: 1 layers of 3 × 3?
Check
A transformer has width 1024, 6 layers and a vocabulary of 100000 tokens (feedforward width 4d).
(a)
How many weights do its layers hold, in millions?
(b)
Including the token embedding, how many in all?
Check
Queries and keys have 64 independent entries with zero mean and unit variance.
(a)
What is the standard deviation of a query–key dot product?
(b)
And after dividing by ?
Check
A query attends to 10 keys; one scores 1 above the rest, which are equal.
(a)
What weight does the softmax give it?
(b)
How large a margin would give it a weight of 0.9?
Check
A model with 32 layers of width 2048 keeps its key–value cache at 2 bytes per number.
(a)
How much cache does each token need?
(b)
How much for a batch of 1 sequences of 32768 tokens?
Check
A transformer layer of width 1024 processes a context of 1024 positions.
(a)
About how many operations does one token cost in this layer?
(b)
At what context length does attention's share reach half?
Check
Attention over 8192 positions with 8 heads stores its score matrices in 4-byte numbers.
(a)
How much memory would one layer's scores take?
Check
Layer weights: d = 768, L = 12?
Check
KV cache per token: L = 32, d = 4096, 2 bytes?
Check
Softmax weight: 20 keys, margin 2?
Check
A 16–32–10 network with biases, run on batches of 64.
(a)
Parameters?
(b)
Multiply-accumulates per batch?
Check
A one-input network with tanh hidden weights 0.4 and −0.8 and output weights 2.5 and 0.5; separately, softmax activations 0.5, −1, 0.
(a)
Network output at x = 0.5?
(b)
Softmax probability of the first class?
Check
with = 0.3, = 1.5, x = 2, target 1, squared error.
(a)
Error?
(b)
?
(c)
?
Check
with w = 0.5, b = 0.25, v = 3; input 1, target 2, squared error.
(a)
?
(b)
?
Check
Backward signals scaled by slope 0.25 and weight 1 per layer through 20 layers; a gradient check off by 0.0003; a 100000-weight network.
(a)
Overall gradient scale?
(b)
Central-difference error with the step divided by 2?
(c)
Forward passes for a central-difference gradient?
Check
A quadratic error with Hessian eigenvalues from 0.5 to 40.
(a)
Stability limit for η?
(b)
Best fixed η?
(c)
Factor per step at that η?
(d)
Factor per step with tuned momentum?
Check
Condition number 20, target reduction 0.0001.
(a)
Gradient-descent steps at the best rate?
(b)
With tuned momentum?
Check
Adam with β₁ = 0.9 and β₂ = 0.999, after 10 steps of constant gradient 0.5.
(a)
Uncorrected first moment m?
(b)
Uncorrected second moment v?
(c)
Ratio of the uncorrected step to the corrected one?
Check
Gradient noise 1 per example with batches of 32; dropout probability 0.4; weight decay λ = 0.001 at η = 0.05 for 40000 steps.
(a)
Minibatch gradient standard deviation?
(b)
Inverted-dropout scale?
(c)
Fraction of an unsupported weight left?
Check
A 3 × 3 convolution, padding 2, stride 2, from 3 channels to 16, on a 64 × 64 input.
(a)
Output width?
(b)
Parameters?
(c)
Multiply-accumulates?
Check
3 stacked 3 × 3 stride-1 layers; a fully connected layer mapping a 224 × 224 × 16 input to a 224 × 224 × 16 output.
(a)
Receptive field width?
(b)
Weights in the fully connected layer (no biases)?
(c)
How many times more than one 3 × 3 convolutional layer's weights?
Check
A one-input ReLU layer of 4 units; a sigmoid at a = −1.5; lesson 24's two-hinge network at the inputs (1.5, 1).
(a)
Maximum number of linear pieces?
(b)
σ′(a)?
(c)
Output at (1.5, 1)?
Check
A 5-million-parameter network trains for 30 epochs on 0.1 million examples, on hardware sustaining 0.35 of 300 TFLOP/s.
(a)
How much arithmetic does training take?
(b)
How many minutes does it take?
Check
A layer computes with , a = 2, b = 1, c = −2, d = 1, on x = (3, 2); the loss's gradient with respect to y is (1, 0.5).
(a)
What is , the weight from to ?
(b)
What is , the weight from to ?
(c)
What is ?
(d)
And ?
Check
A 3 × 3 convolution maps 64 channels to 512.
(a)
By what factor does a depthwise separable version cut its weights?
Check
12 binary variables form a Bayesian network in which every variable but the first 1 has exactly 1 binary parents (the first 1 have none).
(a)
How many numbers specify it?
(b)
How many does a full table need?
Check
A chain of 20 variables with 2 states each.
(a)
About how many multiply-adds do forward and backward messages take to give every marginal?
(b)
How many digits long is the number of terms in the full sum (log₁₀ of )?
Check
Two independent causes A and B (priors 0.01 and 0.02) each set off an effect E, with probabilities 0.99 and 0.95; nothing else does (deterministic OR otherwise, no leak).
(a)
What is P(A | E)?
(b)
What is P(A | E, B)?
Check
A hidden state x₁ is 1 with probability 0.1 and persists to x₂ with probability 0.7 (and from 0 to 1 with probability 1 − 0.7). A sensor on x₂ reads 1 with probability 0.9 when x₂ = 1 and 0.2 when x₂ = 0; it reads 1.
(a)
What is the message from x₁ to x₂, the prior P(x₂ = 1)?
(b)
What is P(x₂ = 1 | reading)?
Check
Parameters: 10 binary nodes, 1 parents each?
Check
Message cost on a chain: N = 10, K = 4?
Check
Message P(x₂ = 1): p = 0.2, persistence 0.8?
Check
Two inputs are 1.5 apart. What's their Gaussian kernel value with width s = 0.5?
Check
What's the polynomial kernel for x = (1, 0.5) and z = (3, −0.5)?
Check
How many features does the kernel correspond to for 20-component inputs?
Check
Two inputs are 1.5 apart. With a Gaussian kernel of width 1, what's the squared distance between their feature vectors?
Check
Kernel ridge regression on two points with targets 1 and −1, kernel values 1 on the diagonal and 0.7 between them, and λ = 0.5. What does it predict at the first training point?
Check
How many gigabytes does the Gram matrix for 30000 examples take in double precision (8 bytes per entry)?
Check
Two training inputs are 0.5 apart, and a Gaussian kernel of width s = 0.5 is used.
(a)
What is the Gram matrix's smaller eigenvalue?
(b)
What is its condition number?
Check
Gaussian kernel: distance 0.1, width 0.3?
Check
Polynomial kernel features: D = 2, M = 1?
Check
Feature-space squared distance: d = 0.2, s = 0.5?
Check
A canonical linear SVM has w = (3, 2). What's its margin?
Check
A point with target 1 gets output −0.8. What's its hinge loss?
Check
An SVM is trained on two points: (1, 1) labeled +1 and (−1, −1) labeled −1. What's its margin?
Check
A kernel SVM has two support vectors: one with t = +1, multiplier 0.3 and kernel value 0.5 with a new input, and one with t = −1, multiplier 2 and kernel value 0.9. The bias is −0.3. What's the output?
Check
A linear SVM has w = (1, 0.5), and (2, 0.5) is a support vector with label 1. What's the bias b?
Check
A soft-margin SVM has = 20, C = 0.1 and total slack 8. What's its objective?
Check
A soft-margin SVM has = 1 and C = 0.1. Three training points have margins = 2.5, −0.2 and 1.2.
(a)
What is their total slack?
(b)
What is the objective?
Check
Margin for w = (0.2, 0.2)?
Check
Hinge loss: t = 1, y = −0.6?
Check
Kernel SVM output: a₁ = 0.1, k₁ = 0.1, a₂ = 2 (t = −1), k₂ = 1, b = −1?
Check
A squared-exponential kernel has = 2 and ℓ = 0.5. What's the covariance of two function values 2 apart?
Check
A Gaussian process with = 1, length scale 2 and noise variance 0.5 observes 0.5 at one point. What's its posterior mean 0.5 away?
Check
For that process ( = 1, ℓ = 1, noise variance 0.5, one observation), what's the posterior variance 0.5 away?
Check
A process with prior variance 1² observes a point with noise variance 0.1. What's the posterior variance of f at that same point?
Check
A single observation 0.5 has total variance C = 0.5 under a model. What's its log marginal likelihood?
Check
A squared-exponential process has length scale 2. At what separation does the correlation between function values fall to 0.1?
Check
A Gaussian process ( = 1, length scale 0.5, noise variance 0.1) observes the same value 2 at x = 0 and x = 2.
(a)
What mean does it predict halfway between?
(b)
What standard deviation?
Check
SE covariance: σ_f = 0.2, ℓ = 0.1, d = 8?
Check
Posterior mean: t = −2, d = 0.2, ℓ = 3, σ_n² = 1?
Check
Posterior variance at the observed point: σ_f = 0.3, σ_n² = 0.001?
Check
A success probability has a uniform prior, and 15 of 50 trials succeed.
(a)
Where is the Laplace approximation centered?
(b)
What standard deviation does it give?
Check
A rate's posterior is gamma with shape 10 and rate 0.5.
(a)
What standard deviation does its Laplace approximation have?
(b)
By how many exact standard deviations is the approximation's center below the true mean?
Check
A Gaussian posterior over two variables has equal standard deviations 1 and correlation 0.5. It's approximated by minimizing KL(q‖p) over factorized Gaussians.
(a)
What standard deviation does each factor get?
(b)
What is the KL divergence of the approximation from the posterior?
Check
A VAE encoder outputs μ = 0.5 and σ = 0.2 for each of 64 latent dimensions.
(a)
What is the total KL term?
(b)
What sample does ε = 0.7 give in one dimension?
Check
A model with 5 parameters has a peak log-likelihood of −150 and log prior −3 at its mode, where the log posterior's Hessian has determinant 2000 (in magnitude).
(a)
What log evidence does Laplace's method estimate?
Check
Laplace sd: 5 of 20, uniform prior?
Check
VAE KL: μ = 0.3, σ = 0.4?
Check
Mean-field sd: σ = 1, ρ = 0.6?
Check
A mixture has unit-variance components at −1 and 1.5 with weights 0.8 and 1 − 0.8. What responsibility does the first take for a point at 1?
Check
A component's responsibilities for the points 1, 2 and 5 are 0.2, 0.4 and 0.6. What's its new mean in the M step?
Check
Out of 10 points, a component's responsibilities are 0.2, 0.4 and 0.6 (zero for the rest). What's its new mixing weight?
Check
A component takes responsibilities 0.5 and 0.3 for the points 1 and 5. What's its new variance?
Check
How many parameters does a 4-component Gaussian mixture with full covariances have in 2 dimensions?
Check
What's the log-likelihood of a point at 2 under a mixture of unit-variance Gaussians at 0 and 3 with weights 0.6 and 1 − 0.6?
Check
A Gaussian mixture with 3 components and diagonal covariances models 10000 points in 2 dimensions.
(a)
How many free parameters does it have?
(b)
How much does BIC subtract from the log-likelihood for it?
Check
Responsibility: components at −2, 2, weight 0.9, x = 3?
Check
M-step mean: γ = 0.05, 0.05 for x = 2, 9?
Check
GMM parameters: K = 2, D = 1?
Check
Inputs 0.5 apart under a Gaussian kernel of width 0.7; a polynomial kernel of degree 3 on 30 inputs.
(a)
Gaussian kernel value?
(b)
Squared feature-space distance?
(c)
Polynomial feature count?
Check
x = (1, 0.5) and z = (2.5, 1); a Gram matrix for 20000 examples.
(a)
?
(b)
Gram matrix size in gigabytes (doubles)?
Check
Kernel ridge regression on two points: targets 1 and −1, off-diagonal kernel 0.8, unit diagonal, λ = 0.4.
(a)
Coefficient ?
(b)
Coefficient ?
(c)
Prediction at the second training point?
Check
A linear SVM with w = (0.5, 1.3); (2, 0.3) is a support vector labeled 1.
(a)
Margin?
(b)
Bias?
Check
A point with target 1 and output −0.6; a soft-margin SVM with = 30, C = 5, total slack 1.5.
(a)
Hinge loss?
(b)
Logistic loss in bits?
(c)
Soft-margin objective?
Check
A kernel SVM with support vectors (+1, multiplier 0.4, kernel 0.3) and (−1, multiplier 1.8, kernel 0.7), bias −0.2; a two-point training set (1, 0.5) labeled +1 and (−1, −0.5) labeled −1.
(a)
Kernel SVM output?
(b)
Margin of the two-point SVM?
Check
A squared-exponential process with = 0.5 and ℓ = 0.5.
(a)
Covariance at separation 1.5?
(b)
Separation where the correlation falls to 0.6?
Check
A process with = 1, ℓ = 2 and noise variance 0.3 observes 0.8 at one point.
(a)
Posterior mean 0.3 away?
(b)
Posterior variance there?
(c)
Posterior variance at the observed point?
Check
One observation 0.4; two candidate models give it total variance 0.6 and 5.
(a)
Log marginal likelihood under the first?
(b)
How much higher is it than under the second?
Check
A mixture of unit-variance components at −1 and 1.5 with weights 0.7 and 1 − 0.7; a point at 1.
(a)
Responsibility of the first component?
(b)
Log-likelihood of the point?
Check
A component's responsibilities are 0.3, 0.2 and 0.5 for the points 1, 2 and 6, and zero for the other points of 5.
(a)
New mean?
(b)
New variance?
(c)
New mixing weight?
Check
Gaussian mixtures with 3 components in 3 dimensions.
(a)
Parameters with full covariances?
(b)
Parameters with diagonal covariances?
Check
Two training inputs are 1 apart under a Gaussian kernel of width 0.5.
(a)
What is the Gram matrix's smaller eigenvalue?
(b)
What is its condition number?
Check
A Gaussian process ( = 1, ℓ = 1, noise variance 0.2) observes −2 at both x = 0 and x = 2.
(a)
What does it predict halfway between?
(b)
What predictive variance does the function have there?
Check
Gaussian mixtures with diagonal covariances, 4 components in 3 dimensions, are compared by BIC on 100000 points.
(a)
How many free parameters does the mixture have?
(b)
How much more log-likelihood must one more component buy to be worth adding under BIC?
Check
An LSTM layer with 128 hidden units reads 40-dimensional inputs, over sequences 1000 steps long.
(a)
How many parameters does it have?
(b)
About how many million multiply-adds does one sequence's forward pass take?
Check
Backward signals through a recurrent network change by about a factor of 0.95 per step. Separately, a gradient of norm 500 is clipped to 5.
(a)
By what factor does a signal change over 20 steps?
(b)
By what factor does clipping scale the gradient?
Check
An LSTM cell should start training with a memory time constant of 50 steps.
(a)
What forget-gate value gives that?
(b)
What forget-gate bias produces it?
Check
A transformer has width 2048, 24 layers and a 128000-token vocabulary, and trains on 2 trillion tokens on hardware sustaining 0.4 of a 1000 TFLOP/s peak.
(a)
How many billion parameters does it have?
(b)
How many days does training take?
Check
A model with 32 layers of width 4096 serves 32768-token contexts with a 16-bit key–value cache, on a device with 192 GB of memory, 14 GB of which hold the weights.
(a)
How much cache does one sequence need?
(b)
How many sequences fit at once?
Check
A query's raw dot products with two keys are 24 and 16, in 64 dimensions.
(a)
What attention weight does the first key get?
Check
A transformer layer of width 768 attends over 1024 positions.
(a)
What fraction of the layer's per-token arithmetic is attention itself?
Check
In a Bayesian network, a node with 3 states has two parents with 2 and 4 states.
(a)
How many free parameters does its conditional table need?
(b)
How many would a full joint table over the three variables need?
Check
Two independent faults (priors 0.02 and 0.05) trip an alarm with probabilities 0.99 and 0.95 (noisy-OR), which also trips on its own with probability 0.001.
(a)
What is the first fault's probability given the alarm?
(b)
And given the alarm and the second fault?
Check
A two-state chain stays in state 1 with probability 0.8 and moves from state 2 to 1 with probability 0.1. It's observed in state 1 at time 1.
(a)
What is the probability it's in state 1 at time 3?
Check
Counts are Poisson with rate λ; λ has a gamma(1, 10) prior, and 15 events occur in time 500.
(a)
Where is the Laplace approximation centered?
(b)
What standard deviation does it give?
Check
A Gaussian posterior has standard deviations 1 and 0.5 and correlation 0.9; a mean-field approximation minimizes KL(q‖p).
(a)
What standard deviation does the first factor get?
(b)
And the second?
(c)
What is KL(q‖p)?
Check
A VAE encoder outputs μ = 0.2 and σ = 0.8 in each of 8 latent dimensions, and the decoder's reconstruction log-likelihood is −180 nats.
(a)
What is the KL term?
(b)
What is the ELBO?
Check
A Gaussian process with prior variance 1 and noise variance 0.1 observes t = 3 at one input.
(a)
What does it predict for the function at that same input?
(b)
What is the function's posterior variance there?
Check
A mixture of two unit-variance Gaussians with equal weights has means 1 and 3. EM sees the points 0, 1.5 and 5.
(a)
What responsibility does the first component take for 1.5?
(b)
What is the first component's new mean?
Check
A covariance matrix has variances 2 and 1 and covariance 1.5. What's the variance along the first principal component?
Check
For variances 3 and 1 with covariance 1.5, at what angle from the first axis does the first principal component point?
Check
A data set's covariance has eigenvalues 4, 2, 1.5 and 0.5. What fraction of the variance do the first 1 components explain?
Check
With eigenvalues 4, 2, 1.5 and 0.5, what mean squared reconstruction error does keeping 1 components leave?
Check
Eigenvalues fall geometrically, with r = 0.8, over a long series. How many components capture a fraction 0.9 of the variance?
Check
500 samples of dimension 100 are stored as 40 principal-component coordinates each, plus the components and the mean. By what factor does storage shrink?
Check
Two features have variances 2 and 1 and covariance 1.2.
(a)
What is the variance along the second principal component?
(b)
What is the covariance's condition number?
Check
First eigenvalue: a = 0.5, b = 0.5, c = 2?
Check
Components for fraction 0.8, ratio 0.3?
Check
Compression: N = 100, D = 50, M = 100?
Check
How many dimensions does the Johnson–Lindenstrauss bound require for 100000 points at distortion ε = 0.1?
Check
A unit vector is projected to 64 dimensions with entries. What is the standard deviation of its projected squared length?
Check
At ε = 0.1, how many more dimensions does the bound require for 10 times as many points (starting from 10000)?
Check
1000 million vectors of 1024 dimensions (4-byte floats) are randomly projected to 32 dimensions.
(a)
How much memory do the original vectors take?
(b)
By what factor does the projection shrink them?
Check
For one fixed vector projected to 200 dimensions, the chance its squared length is off by more than ε = 0.1 is at most . What is that bound?
Check
Test the lemma. With rng = numpy.random.default_rng(seed), draw n = 100 points in 5000 dimensions from a standard Gaussian, then a projection matrix R = rng.standard_normal((k, 5000))/sqrt(k) with k = 200. Compute all pairwise squared distances before and after projecting, and set max_dist, the largest |ratio − 1| over all pairs, and rms_dist, the RMS of (ratio − 1). Compare rms_dist with .
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
What dimension does the JL bound give for 5000 points at ε = 0.15?
Check
What's the typical relative spread in squared length after projecting to 64 dimensions?
Check
A two-state chain leaves state 1 with probability 0.2 and leaves state 2 with probability 0.1. What's the stationary probability of state 1?
Check
A state persists from one step to the next with probability 0.9. How many steps does a visit last on average?
Check
The same kind of chain (leaving probabilities 0.1 and 0.2) starts in state 1 with probability 1. What's the probability of state 1 after 3 steps?
Check
A machine is healthy with prior probability 0.5. An alarm fires with probability 0.05 when healthy and 0.9 when faulty. It fires. What's the probability the machine is faulty?
Check
A chain starts healthy with probability 0.5 and stays healthy with probability 0.8. Alarms fire with probability 0.3 when healthy and 0.9 when faulty. What's the joint probability of "healthy, healthy" with alarms in both hours?
Check
Roughly how many multiply-adds does the forward algorithm need for a 4-state model and 10 observations?
Check
A two-state chain leaves state 1 with probability 0.1 and state 2 with probability 0.2 per step. It starts in state 1.
(a)
What is the probability it's in state 1 after 4 steps?
(b)
What is the time constant of its approach to equilibrium?
Check
Stationary state 1: leave 0.01, return 0.01?
Check
Mean visit length, stay probability 0.8?
Check
P(faulty | alarm): prior healthy 0.1, alarm rates 0.01 and 0.99?
Check
A quantity with standard deviation 2 is estimated by Monte Carlo. How many samples give a standard error of 0.001?
Check
A uniform draw u = 0.6 is converted to an exponential sample with rate 0.5 by inverting the CDF. What's the sample?
Check
A density on an interval of length 2 has a maximum of 3. Rejection sampling with a uniform proposal scaled to cover that maximum accepts what fraction of proposals?
Check
A Metropolis sampler targets a zero-mean Gaussian with standard deviation 2. It sits at x = 1 and proposes a move 0.5 farther out. What's the acceptance probability?
Check
A Markov chain's successive states have correlation 0.5. About how many independent samples are 10000 steps worth?
Check
Three importance samples have weights 0.5, 0.2 and 4. What's their effective sample size?
Check
A Gibbs sampler targets a standard bivariate Gaussian with correlation 0.9 and runs 100000 sweeps.
(a)
What standard deviation does x | y have, the step size along x?
(b)
What effective sample size do the x values give?
(c)
Where is x | y centered when y = −1?
Check
Samples for error 0.0001, σ = 0.1?
Check
Exponential sample: u = 0.01, λ = 0.1?
Check
Effective samples: N = 100, ρ = 0.1?
Check
A node's examples are 0.3 positive. What's its Gini impurity?
Check
A split sends 20 positive and 5 negative examples left and 15 positive and 60 negative right. By how much does it reduce the Gini impurity?
Check
100 models, each with prediction variance 1, have pairwise error correlation 0.4. What's the variance of their average?
Check
A bootstrap sample draws 5 times with replacement from 5 examples. What fraction of the examples does it contain on average?
Check
An AdaBoost weak learner has weighted error 0.25. What's its vote α?
Check
By what factor does AdaBoost multiply the weight of an example that a learner with error 0.25 misclassified (before renormalizing)?
Check
A regression stump splits the targets 1 and 3 from 12; gradient boosting starts from their mean with learning rate 1.
(a)
By how much does the split reduce the mean squared error about the mean?
(b)
What mean squared error remains after one boosting step?
Check
Gini impurity at p = 0.2?
Check
Ensemble variance: ρ = 0, σ² = 0.5, B = 1000?
Check
AdaBoost α for error 0.1?
Check
An agent with discount 0.95 receives a steady reward of 1 per step.
(a)
What is the stream's discounted value?
(b)
What is its effective horizon?
Check
Value iteration runs with discount 0.95.
(a)
How many sweeps shrink the error by a factor of 0.01?
Check
Q(s, a) = 0. The agent receives r = −1 and lands where the best action value is 10; γ = 0.99 and the learning rate is 0.05.
(a)
What is the temporal-difference error?
(b)
What does Q(s, a) become?
Check
A fixed policy earns 1 per step in state 1 and 0 in state 2. It moves from state 1 to 2 with probability 0.3 and from 2 to 1 with probability 0.6; γ = 0.8.
(a)
What is state 1 worth?
(b)
And state 2?
Check
A bandit action has averaged 0.3 over 500 of 100 pulls.
(a)
What is its UCB1 index?
Check
An ε-greedy agent with ε = 0.1 chooses among 2 actions.
(a)
How often does it take the greedy action?
Check
Discounted value of 2 per step at γ = 0.9?
Check
Q-learning: Q = 1, r = 0, max Q′ = 5, α = 0.2, γ = 0.9?
Check
UCB1 index: mean 0.4, 200 of 500 pulls?
Check
A dense layer maps 1024 inputs to 256 outputs for a batch of 32. How many FLOPs does it take?
Check
A model has 7 × 10⁹ parameters stored at 4 bits each. How many gigabytes do its weights take?
Check
A 7 × 10⁹-parameter model with 4-bit weights generates text at batch size 1 on a device with 3000 GB/s of memory bandwidth. What's the upper limit on tokens per second?
Check
A chip peaks at 100 TFLOP/s with 0.5 TB/s of memory bandwidth. What performance can a kernel with arithmetic intensity 300 FLOP/byte reach, in TFLOP/s?
Check
Weights up to ±0.5 are quantized symmetrically with 127 positive levels. What's the RMS rounding error?
Check
An inference does 1 × 10⁷ multiplies at 0.2 pJ each and reads 1 × 10⁸ values from DRAM at 640 pJ each. How much energy does it take?
Write units the way you normally would: 1.5 J, 1500 mJ and 0.0015 kJ are the same answer.
Check
A 7-billion-parameter model with 4-bit weights runs on a chip with 1000 TFLOP/s and 3 TB/s.
(a)
At what batch size does it become compute-bound?
(b)
What throughput does it reach once compute-bound?
Check
FLOPs: D = 64, H = 64, B = 512?
Check
Tokens/s bound: 1 × 10⁸ parameters, 4 bits, 8000 GB/s?
Check
Roofline: F = 1, W = 0.1, I = 1000?
Check
A covariance matrix with variances 2 and 1 and covariance 1.2.
(a)
First eigenvalue?
(b)
Fraction of variance it explains?
(c)
Its angle from the first axis?
Check
Eigenvalues 6, 2, 1.5, 0.4; 1000 samples of dimension 200 kept with two components.
(a)
Variance explained by two components?
(b)
Mean squared reconstruction error?
(c)
Compression factor?
Check
A two-state chain leaving state 1 with probability 0.05 and state 2 with probability 0.2, starting in state 1 with probability 1.
(a)
Stationary probability of state 1?
(b)
Mean stay in state 1?
(c)
Probability of state 1 after 4 steps?
Check
A machine is healthy with prior 0.6, stays healthy with probability 0.85, and raises an alarm with probability 0.15 when healthy and 0.8 when faulty. Hour 1 has an alarm.
(a)
P(faulty | alarm)?
(b)
(healthy)?
(c)
Probability of the path healthy–healthy with alarms in both hours?
Check
Monte Carlo with per-sample standard deviation 0.3; an inverse-CDF draw from an exponential of rate 4.
(a)
Samples for standard error 0.002?
(b)
Sample for u = 0.8?
Check
A Metropolis sampler for a zero-mean Gaussian with σ = 1.5 at x = 0.5 proposes a step 0.4 outward; separately, a chain of 50000 steps with neighbor correlation 0.8.
(a)
Acceptance probability?
(b)
Effective sample size?
Check
Importance weights 0.4, 1, 0.6; rejection sampling a density of maximum 2 on an interval of length 2 with a uniform proposal.
(a)
Effective sample size of the weights?
(b)
Acceptance rate?
Check
A split sends 25 positive and 5 negative left, 20 positive and 70 negative right.
(a)
Parent Gini impurity?
(b)
Weighted Gini of the children?
Check
An ensemble of 50 models with variance 1 and correlation 0.2; bootstrap samples of size 20.
(a)
Ensemble variance?
(b)
Fraction of distinct examples in a bootstrap sample?
Check
An AdaBoost learner with weighted error 0.2.
(a)
Its vote α?
(b)
Multiplier for misclassified weights?
(c)
Share of the weight on misclassified examples after renormalizing?
Check
A dense 1024-to-1024 layer at batch 16; a 3 × 10¹⁰-parameter model at 4 bits on 100 GB/s.
(a)
Layer FLOPs?
(b)
Model size in GB?
(c)
Token-rate bound at batch 1?
Check
A chip with 50 TFLOP/s and 1 TB/s runs an int8 layer at batch 64 (intensity about 2B); weights up to ±1 are quantized to int8.
(a)
Ridge point in FLOP/byte?
(b)
Attainable TFLOP/s?
(c)
RMS rounding error?
Check
A covariance matrix has variances 3 and 1 and covariance 1.2.
(a)
What is its smaller eigenvalue?
(b)
By what factor does whitening stretch that direction?
Check
A Gibbs sampler for a standard bivariate Gaussian with correlation 0.7 runs 50000 sweeps.
(a)
Where is x | y = 1 centered?
(b)
What effective sample size do its x values give?
Check
Gradient boosting with squared loss and learning rate 1 starts from the mean of the targets 2, 6 and 15, and adds a stump splitting 2 and 6 from 15.
(a)
What is the starting mean squared error?
(b)
What is it after one step?
Check
A dataset of 10000 points is randomly projected.
(a)
What dimension does the JL bound require at ε = 0.1?
(b)
Projected to 1024 dimensions, what's the typical relative spread of a squared length?
Check
A four-dimensional data set's covariance has eigenvalues 6, 3, 1.2 and 0.6. Probabilistic PCA keeps two components.
(a)
What noise variance does it estimate?
(b)
What fraction of the variance do the two components explain?
Check
Data have covariance with a = 4, b = 1, c = −1.5. A point lies at (−1, 1) from the mean.
(a)
How far is it after whitening (its Mahalanobis distance)?
Check
A machine is faulty with probability 0.02 at hour 1. A healthy machine stays healthy with probability 0.95; a faulty one is repaired with probability 0.6 per hour. Its alarm fires with probability 0.1 when healthy and 0.6 when faulty, and it fires in hours 1 and 2.
(a)
What is P(faulty at hour 1 | the first alarm)?
(b)
What is P(faulty at hour 2 | both alarms)?
Check
The same kind of machine: faulty with probability 0.05 at hour 1, staying healthy with probability 0.9, repaired with probability 0.5, alarms 0.2 healthy and 0.7 faulty.
(a)
What is the probability of an alarm in hour 1?
(b)
What is the probability of alarms in both hours 1 and 2?
Check
A two-state chain leaves state 1 with probability 0.05 and state 2 with probability 0.1.
(a)
By what factor does its distance from equilibrium shrink each step?
(b)
How many steps bring that distance down by a factor of 0.001?
Check
A random-walk Metropolis sampler targets a Gaussian of standard deviation 1 with proposal steps of standard deviation 1.
(a)
What fraction of proposals does it accept?
(b)
What step size would give an acceptance rate of 0.6?
Check
A Gibbs sampler alternates between two standard Gaussian variables with correlation 0.9.
(a)
What fraction of its sweeps count as independent samples?
(b)
How many sweeps give 500 effective samples?
Check
Importance sampling estimates expectations under N(0, 1) with samples from N(0, 2²).
(a)
What fraction of the samples is effective (1 over the mean squared weight)?
(b)
How many samples give an effective 1000?
Check
A split sends 30 positive and 10 negative examples left and 20 positive and 35 negative right.
(a)
What is the parent node's entropy?
(b)
What is the split's information gain?
Check
An AdaBoost round's stump has weighted error 0.2. One example it misclassified had weight 0.01.
(a)
What is the stump's vote α?
(b)
What is that example's weight after reweighting and normalizing?
Check
Bagged trees each have prediction variance 1 and pairwise correlation 0.6. Sampling features at each split cuts the correlation to 0.15 but raises each tree's variance by a factor of 1.5.
(a)
What variance does averaging 50 bagged trees give?
(b)
And 50 trees with feature sampling?
Check
A sensor policy earns 1 per step while charged and 0 while low, goes low with probability 0.4 and recharges with probability 0.6; γ = 0.9.
(a)
What is the charged state worth?
(b)
What is its long-run average reward per step?
Check
An agent with discount 0.8 has Q(s, a) = 1, receives r = 1 and lands where the best action value is 4; its learning rate is 0.2.
(a)
What does Q(s, a) become?
(b)
How many value-iteration sweeps would shrink an error by a factor of 0.001 at this discount?
Check
An 8-billion-parameter model with 4-bit weights runs on a chip with 1000 TFLOP/s and 3.35 TB/s, at batch 8.
(a)
At what batch does it become compute-bound?
(b)
What throughput does it reach at batch 8?
Check
A 7-billion-parameter model's weights are quantized symmetrically. Reading a byte from DRAM costs 640 pJ.
(a)
How much memory does going from 8-bit to 4-bit weights save?
(b)
How much signal-to-quantization-noise ratio does a full-scale uniform signal lose (127 levels against 7 on each side)?
(c)
How much energy does reading the 4-bit weights once take?
Write units the way you normally would: 1.5 J, 1500 mJ and 0.0015 kJ are the same answer.
Check
One-weight ridge: Σx² = 2, Σxt = 1, λ = 20?
Check
An intercept-only logistic model is fitted to 3 positives out of 10. What's the maximum-likelihood intercept?
Check
Backprop: = −1, = −2.5, x = 1.5, t = 1?
Check
Responsibility: unit-variance components at −2 and 2, weight 0.7, point 1.5?
Check
Reconstruction error keeping one component: eigenvalues 5, 1, 0.8?
Check
Two clusters with centers 2 apart, a fraction 0.3 in one, noise σ = 2: variance along the line joining the centers?
Check
A defect rate has a beta(1, 1) prior and 6 defects are seen in 20 units; a false alarm costs 1 and a missed defect 50.
(a)
Posterior probability that the next unit is defective?
(b)
Probability above which a unit should be flagged?
(c)
Expected cost of flagging the next unit?
Check
Bayesian regression of one weight: α = 0.5, β = 4, Σx² = 20, Σxt = 18.
(a)
Posterior mean weight?
(b)
Predicted value at x = 2?
(c)
Its predictive standard deviation?
Check
Gaussian classes (means 2 and 0, variance 1.5²) with class 1's prior 0.3; a point at 1.
(a)
Posterior of class 1?
(b)
Decision boundary?
Check
A detector with sensitivity 0.8 and specificity 0.9 screens 10000 units with fault rate 0.05.
(a)
Expected true positives?
(b)
Expected false positives?
(c)
Precision?
(d)
F1?
Check
A network of 48 identical blocks, each two dense layers 512 → 2048 → 512 (no biases), stored at 16 bits and run at batch 1 on 200 GB/s.
(a)
Parameters?
(b)
Weight memory in GB?
(c)
Upper bound on forward passes per second?
Check
with = 0.4, = −1.5, input 2, target 1; one gradient step with rate 0.05.
(a)
?
(b)
after the step?
(c)
after the step?
Check
A training problem with Hessian eigenvalues from 0.2 to 50; a stride-1, padded 5 × 5 convolution from 16 to 32 channels on a 224 × 224 map.
(a)
Best learning rate?
(b)
Per-step factor with tuned momentum?
(c)
Convolution multiply-accumulates (same-size output)?
Check
Two inputs 0.5 apart under a squared-exponential kernel with = 1 and ℓ = 1; a Gaussian process with noise variance 0.25 observes 3 at one of them.
(a)
Kernel value?
(b)
Posterior mean at the other input?
(c)
Posterior variance there?
Check
A linear SVM with w = (3, 4); (2, 1) is a support vector labeled 1; the soft-margin constant is C = 1 and the total slack is 0.6.
(a)
Margin?
(b)
Bias?
(c)
Objective?
Check
A mixture of unit-variance components at 0 and 3 with weights 0.6 and 1 − 0.6; a 3-component full-covariance mixture in 4 dimensions.
(a)
Responsibility of the first component at 2?
(b)
Parameters of the 4-dimensional mixture?
Check
Two-dimensional data with variances 3 and 1 and covariance 1.5; separately, 10000 samples of dimension 64 compressed to 8 components.
(a)
Fraction of variance in the first component?
(b)
One-component reconstruction error?
(c)
Compression factor?
Check
A Monte Carlo average of a quantity with standard deviation 0.5, drawn from a Markov chain with neighbor correlation 0.9; separately, an ensemble of 20 models with error correlation 0.3.
(a)
Independent samples needed for standard error 0.005?
(b)
Chain steps needed?
(c)
Ensemble variance as a fraction of one model's?
Check
A quantity x has prior N(0, 1²) and is measured as y = 1.5 with noise variance 0.5. Acting when x > 0 gains 3; acting when x ≤ 0 costs 2.
(a)
What is the posterior mean of x?
(b)
What is P(x > 0 | y)?
(c)
Above what posterior probability is acting worthwhile?
Check
A transformer with width 2048 and 24 layers (ignore its embedding) stores 16-bit weights and serves batch 16 from 2 TB/s of memory bandwidth, memory-bound.
(a)
How much do its weights take?
(b)
How many tokens per second does it generate in all?
Check
A classifier makes no errors on 500 independent test examples.
(a)
What error rate does that bound with confidence 0.95?
(b)
What bound holds if the classifier was the best of 1000 candidates checked on the same examples?
Check
Scores are N(0, 1) for good units and N(2.5, 1) for faulty ones, and 0.01 of units are faulty. A false alarm costs 5 and a missed fault 200.
(a)
What score threshold minimizes the expected cost?
(b)
What fraction of faulty units does it miss?
(c)
What fraction of good units does it flag?
Check
A detector's recall is about 0.8. It must be measured with a standard error of 1 percentage points, and positives make up 0.05 of the data.
(a)
How many positive examples does the test set need?
(b)
How many examples must be labeled in all?
Check
A learning curve fits test error as 0.03 + 20/N, with N training examples.
(a)
How many examples reach a test error of 0.08?
(b)
How many more is that than for an error 0.01 higher?
Check
A weight expected to be about 1 in size is estimated from data with Σx² = 10 and noise variance 0.5.
(a)
What ridge λ minimizes the mean squared error?
(b)
What mean squared error does it achieve?
Check
A one-weight Bayesian model (prior precision 0.1, noise precision 4) must predict at x = 5 with a predictive standard deviation of 0.8.
(a)
How large must Σx² be?
Check
A grid of 20 hyperparameter settings is searched by 5-fold cross-validation, then the best is refitted on all the data. One fit on all the data takes 40 minutes, and fits scale with training size.
(a)
How many fits does it run?
(b)
How long does it take?
Check
A network with 64 inputs, two hidden layers of equal width H and 2 outputs (with biases) must have about 1000000 parameters.
(a)
What width H gives exactly that many?
Check
A training run has a budget of 1 × 10²³ operations, and follows the rule of thumb of about 20 training tokens per parameter.
(a)
How many billion parameters should the model have?
(b)
On how many billion tokens of data?
Check
A quadratic training problem's Hessian eigenvalues run from 0.01 to 10; the error must shrink by a factor of 1 × 10⁻⁶.
(a)
How many steps does gradient descent at its best fixed rate need?
(b)
And with optimally tuned momentum?
Check
Trees in a forest have pairwise error correlation 0.1. Each tree takes 15 ms to evaluate.
(a)
How many trees bring the forest's variance within 0.05 of its floor?
(b)
How long does a prediction then take on one core?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
A Gaussian process's squared-exponential kernel must keep function values 0.5 apart correlated by at least 0.5.
(a)
What is the smallest length scale that does?
Check
A monitor flags any sample more than 4 standard deviations from a Gaussian model's mean, at 10 samples a second.
(a)
What fraction of normal samples does it flag?
(b)
How many false alarms does it raise per day (a number of alarms)?
Check
A recurrent model must keep at least 0.01 of a gradient signal across 200 steps.
(a)
What per-step gain does that require?
(b)
What forget-gate bias would hold an LSTM cell at that gain?
Check
A model with 32 layers of width 4096 and 32 GB of weights serves batches of 4 on a 141 GB device with a 16-bit key–value cache.
(a)
What is the longest context that fits?
Check
A Monte Carlo estimate of a quantity with standard deviation 1 must reach a standard error of 0.01, using a Markov chain whose successive samples are correlated by 0.9.
(a)
How many independent samples would that take?
(b)
How many chain samples does it take?
Check
A keyword spotter's main layer is a 3 × 3 convolution from 32 to 64 channels with a 16 × 16 output. Each multiply-add costs 2 pJ, and the device runs 1 inferences a second from a 3 V battery of 200 mAh.
(a)
How many million multiply-adds does the layer take?
(b)
How much energy does one inference of it take?
Write units the way you normally would: 1.5 µJ, 1500 nJ and 0.0015 mJ are the same answer.
(c)
How long would the battery last if this layer were the only load?
Check
A sound classifier computes spectra at 16000 samples a second with 10 Hz resolution, hopping by 1/4 of a frame.
(a)
How long is each frame?
(b)
At about 5N log₂ N operations per FFT, how many million operations a second do the spectra take?
Check
A sensor's noise is 0.5 mV RMS over a 2 V input range, and the ADC's quantization noise should be 4 times smaller.
(a)
How large can the quantization step be?
Write units the way you normally would: 1.5 mV, 1500 µV and 0.0015 V are the same answer.
(b)
How many bits does the ADC need?
Check
An int8 dense layer maps 1024 inputs to 1024 outputs at batch 256, on a chip with 400 TFLOP/s and 1 TB/s.
(a)
How long does its arithmetic take?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
(b)
How long does the layer take, reading its weights once?
Check
A slowly drifting quantity changes by a random walk with variance 0.01 per step and is measured each step with noise variance 0.5.
(a)
What steady-state posterior variance does a Kalman filter reach?
(b)
What gain does it apply to each measurement?
Check
A two-feature Gaussian model of normal operation flags samples whose squared Mahalanobis distance exceeds a threshold, at 1 samples a second, raising an alarm after 3 flags in a row.
(a)
What threshold flags a fraction 0.01 of normal samples?
(b)
About how many false alarms per day result, with independent samples (a number of alarms)?
Check
A microcontroller runs fixed-point logistic regression on 16 features, at 1 cycles per multiply-add plus 200 cycles for the sigmoid, clocked at 80 MHz and drawing 3 mW.
(a)
How long does an inference take?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
(b)
How much energy does it use?
Check
A server gives each of 64 users 20 tokens a second, drawing 10000 W.
(a)
What is its total throughput?
(b)
How much energy does each token take?
Write units the way you normally would: 1.5 J, 1500 mJ and 0.0015 kJ are the same answer.
Check
A logger records 8 channels at 100 samples a second, 24 bits each, onto a 512 GB card.
(a)
How much data does it collect per day?
(b)
How many days fill the card?
Check
Each device in a federated system uploads a model update of 10 million parameters at 8 bits each over a 2 Mb/s uplink.
(a)
How long does one upload take?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
Check
A binary detector's two classes produce antipodal features in Gaussian noise at an energy-to-noise ratio of 7 dB per decision.
(a)
What is its error rate?
(b)
And when it combines two independent observations of each decision coherently?
Check
A sensor array's 64 channels have covariance eigenvalues proportional to (k = 1, 2, …) with r = 0.5, and PCA keeps 16 components.
(a)
By what factor does it compress each sample?
(b)
What signal-to-reconstruction-error ratio does it achieve (treating the spectrum as infinitely long)?
Check
A learned power-management policy acts 100 times a second and should look about 1 s ahead.
(a)
What discount factor gives that horizon?
(b)
How many value-iteration sweeps shrink an error by a factor of 0.01?
Check
A microcontroller has 256 KB of RAM, 40 KB of which hold activations and buffers; the rest holds 4-bit weights.
(a)
How many parameters fit?
(b)
How wide a 64-input hidden layer, followed by a 10-output layer, fits (with biases)?
Check
An analog in-memory multiplier computes a dot product of 256 terms, each a weight of size 0.5 times a unit input; each weight's conductance varies randomly by a fraction 0.01.
(a)
What is the standard deviation of the result's error?
(b)
What signal-to-noise ratio does a full-scale result (all terms adding) have?
Check
Points (0, 0), (1, 3), (3, 10); a correct model with 5 parameters fitted to 50 examples of noise variance 0.3.
(a)
Least-squares slope?
(b)
Expected training error?
(c)
Expected test error?
Check
A test with detection rate 0.9 and false-alarm rate 0.05 for a condition of prevalence 0.002; 5 samples with maximum-likelihood variance 8.
(a)
P(condition | positive)?
(b)
Unbiased variance estimate?
Check
Unit-variance Gaussian classes 1.5 apart with priors 0.7 and 1 − 0.7; a false alarm costs 5, a miss 400.
(a)
Bayes error with equal priors?
(b)
Bayes error with these priors?
(c)
Posterior threshold for deciding positive?
Check
A true probability 0.7 modeled as 0.5; a classifier gives the correct class probabilities 0.8 and 0.9 on two examples.
(a)
KL divergence in nats?
(b)
Average cross-entropy loss in nats?
Check
A beta(2, 2) prior and 12 successes in 40 trials.
(a)
Posterior mean?
(b)
Posterior variance?
Check
A prior N(0, 1²) on a mean, 25 observations averaging 3 with noise variance 1; separately, y with σ = 2 and correlation 0.5 with x.
(a)
Posterior mean?
(b)
var(y | x)?
Check
Ridge on one weight (Σx² = 6, true w = 0.5, noise variance 8); a design whose has eigenvalues 40, 0.5, 0.05, with λ = 1.
(a)
Best λ for the weight?
(b)
Mean squared error at that λ?
(c)
Effective parameters of the design?
Check
Classes whose means differ by (1, 2) with diagonal within-class variances 2 and 9; separable data of radius 4 and margin 0.25.
(a)
Fisher's separation?
(b)
Fisher's direction from the first axis?
(c)
Perceptron mistake bound?
Check
A logistic model with = −4, = 1; a naive Bayes filter with prior 0.3 and two features with likelihood ratios 6 and 0.3.
(a)
Logistic probability at x = 3?
(b)
Its decision boundary?
(c)
Naive Bayes posterior?
Check
A confusion matrix with TP = 40, FP = 5, FN = 40; an accuracy 0.95 measured on 400 examples; scores 1 standard deviations apart.
(a)
F1?
(b)
Standard error of the accuracy?
(c)
AUC?
Check
A 100–64–26 network with biases; separately, a three-class softmax with activations 2, −1 and 0.
(a)
Parameters?
(b)
Softmax probability of the first class?
Check
with = 0.5, = −2, input 2, target 1; a quadratic training problem with condition number 30.
(a)
?
(b)
Gradient-descent steps to reduce the error by 0.0001?
Check
A 3 × 3 convolution with padding 2 and stride 1 from 3 to 32 channels on a 64 × 64 input; a stack of 4 such layers at stride 1.
(a)
Output width?
(b)
Parameters?
(c)
Receptive field of the stride-1 stack?
Check
A Gaussian process with = 1, ℓ = 1, noise variance 0.4, observing 2 at a point 0.8 away; a linear SVM with w = (1, 1); an AdaBoost learner with error 0.1.
(a)
GP posterior mean?
(b)
SVM margin?
(c)
AdaBoost vote?
Check
A covariance with variances 2 and 1 and covariance 1; a mixture of unit-variance components at 0 and 2 with weights 0.4 and 1 − 0.4.
(a)
First principal variance?
(b)
Responsibility of the first component at 0.5?
Check
A two-state chain leaving state 1 with probability 0.05 and state 2 with 0.1; Monte Carlo with σ = 3, target error 0.02, on a chain with correlation 0.5; a 7 × 10⁹-parameter model at 4 bits on 100 GB/s.
(a)
Stationary probability of state 1?
(b)
Chain steps needed?
(c)
Token-rate bound at batch 1?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to S14