Skip to content
nonconvexcard

Simulate Wigner and Wishart spectra

CodingIntermediate⏱ 1 hourRandom Matricessimulationwignersemicircleuniversality

Problem

  1. Generate symmetric d×dd\times d matrices with i.i.d. N(0,1)\Ncal(0,1) entries above the diagonal and plot the histogram of the eigenvalues of W/dW/\sqrt d against the semicircle density.
  2. Repeat with Rademacher entries, and with heavy-tailed but unit-variance entries. Comment on universality of the bulk.
  3. Track λmax⁡\lambda_{\max} across dd and compare with the prediction 22.

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

Write it

Solve it here7 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 60s · draft saved in this browser
7 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
SolvedProblemFieldTypeDifficultyTime
Simulate distance contrast runClassical MLCodingBeginner30 min
Balls into bins, with one choice and with two runAI SystemsCodingIntermediate1 hour
Cache hit rates under Zipf popularity runAI SystemsCodingIntermediate1 hour
Frobenius versus operator norm for random matricesRandom MatricesNumericalIntermediate30 min
Measure anisotropy in an embedding space runRAGCodingIntermediate1 hour