Simulate the Marchenko–Pastur law
CodingIntermediate⏱ 1 hourRandom Matricessimulationmarchenko-pasturuniversalitycovariance
Problem
Generate with i.i.d. unit-variance entries, form , and compare the eigenvalue histogram with the Marchenko–Pastur density.
- Sweep and check the edges.
- Replace Gaussian entries with Rademacher and with a heavy-tailed unit-variance law; comment on the bulk and on the extreme eigenvalues.
- Add a rank-one spike and find empirically the value of at which the top eigenvalue separates from the bulk. Compare with .
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.
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| Solved | Problem | Field | Type | Difficulty | Time |
|---|---|---|---|---|---|
| Marchenko–Pastur edges and conditioning | Random Matrices | Numerical | 15 min | ||
| Simulate distance contrast run | Classical ML | Coding | 30 min | ||
| Balls into bins, with one choice and with two run | AI Systems | Coding | 1 hour | ||
| Cache hit rates under Zipf popularity run | AI Systems | Coding | 1 hour | ||
| Measure anisotropy in an embedding space run | RAG | Coding | 1 hour |