Wigner's Semicircle Law

Author

Eric W. Weisstein
April 6, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/LinearAlgebra/WignersSemicircleLaw.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/WignersSemicircleLaw.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Statistics`ContinuousDistributions`
<<Graphics`Graphics`

Symmetric Marix

Normal

m=With[{n=5000},RandomArray[NormalDistribution[],{n,n}]];//Timing

m2=(m+Transpose[m])/2;//Timing

e=Eigenvalues[m2];//Timing

Through[{Min,Mean,Max}[e]]

MakeBoxes[label,TraditionalForm]:=RowBox[{"P","(","λ",")"}]

Histogram[e,AxesLabel->TraditionalForm/@{λ,label},BarEdges->None,HistogramCategories->60,HistogramScale->1]

Uniform

Timing comparison

With[{n=1000},RandomArray[UniformDistribution[],{n,n}]];//Timing

With[{n=1000},Table[Random[],{n},{n}]];//Timing

Computation

m=With[{n=5000},Table[Random[],{n},{n}]];//Timing

e=Eigenvalues[(m+Transpose[m])/2];//Timing

Through[{Min,Mean,Max}[e]]

MakeBoxes[label,TraditionalForm]:=RowBox[{"P","(","λ",")"}]

Histogram[e,AxesLabel->TraditionalForm/@{λ,label},BarEdges->None,HistogramCategories->30,HistogramRange->{-30,30},
HistogramScale->.3]

Position[e,_?(Abs[#]>40&)][[1,1]]

e[[1]]