Skip to content
nonconvexcard

Simulate and compare the concentration inequalities

CodingIntermediate⏱ 1 hourHigh-Dim Probabilitysimulationhoeffdingbernsteincomparison

Problem

Write code that, for a given distribution on [0,1][0,1] and sample size nn, estimates P(∣Xˉn−μ∣≥t)\P(|\bar X_n - \mu| \ge t) by Monte Carlo and plots it against the Markov, Chebyshev, Hoeffding and Bernstein bounds on a logarithmic axis.

  1. Verify that all four curves lie above the empirical one for every tt.
  2. Identify, for Bernoulli(0.5)(0.5) and for Bernoulli(0.05)(0.05), which bound is tightest in which range of tt.
  3. Explain what limits the resolution of the empirical curve, and how to see that limit in the plot.

Implement it, then check the implementation against something you can verify independently.

Write it

Solve it here5 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 30s · draft saved in this browser
5 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.

Hints

Hints — 0 of 2 revealed

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
Markov and Chebyshev are attainedHigh-Dim ProbabilityProofFoundation15 min
Generalisation for a finite classLearning TheoryProofBeginner30 min
Simulate distance contrast runClassical MLCodingBeginner30 min
Two different curses of dimensionalityClassical MLNumericalBeginner15 min
Azuma for a random walk with driftHigh-Dim ProbabilityProofIntermediate30 min