MLCrack

    PROBABILITY & STATISTICS · INTERVIEW QUESTION

    What is the Law of Large Numbers? How does it relate to ML?

    🟢 beginner · Probability Theory

    Hint: Think about sample averages converging to expected values as sample size grows.

    Answer

    The Law of Large Numbers (LLN) states that as sample size n → ∞, the sample mean converges to the true expected value: X̄_n → E[X]. Weak LLN: convergence in probability. Strong LLN: almost sure convergence. ML relevance:

    1. Justifies using empirical risk minimization (average loss on training data) as a proxy for true risk
    2. Explains why larger training sets lead to better estimates
    3. Underlies Monte Carlo methods (MCMC, MC dropout)
    4. SGD works because mini-batch gradients approximate true gradient
    5. More representative independent observations can improve estimation; increasing folds on the same dataset does not guarantee a more stable cross-validation estimate.

    Caveat: convergence rate matters — CLT tells us the error is O(1/√n)O(1/√n), so 4x data only halves the error.