Random Matrix

Author

Eric W. Weisstein
September 16, 2005

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

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

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

Expected Number of Real Eigenvalues for a Normally Distributed Real Matrix

Table[(1/2)+(Sqrt[2])((Hypergeometric2F1[1,-(1/2),n,(1/2)])/(Beta[n,(1/2)])),{n,6}]//Simplify

e[n_?EvenQ]:=(Sqrt[2])Sum[(((4k-1)!!)/((4k)!!)),{k,0,n/2-1}]
e[n_?OddQ]:=1+(Sqrt[2])Sum[(((4k-3)!!)/((4k-2)!!)),{k,(n-1)/2}]

e/@Range[5]

N[%]

Asymptotic

v5.2

Series[(1/2)+(Sqrt[2])((Hypergeometric2F1[1,-(1/2),n,(1/2)])/(Beta[n,(1/2)])),{n,∞,0}]

correct, but not useful

v6

Series[(1/2)+(Sqrt[2])((Hypergeometric2F1[1,-(1/2),n,(1/2)])/(Beta[n,(1/2)])),{n,∞,0}]

correct, but not useful

Even

Table[(Sqrt[2])Sum[(((4k-1)!!)/((4k)!!)),{k,0,n/2-1}],{n,0,6,2}]

v5.2

(Sqrt[2])Sum[(((4k-1)!!)/((4k)!!)),{k,0,n/2-1}]

(Sqrt[2])Sum[FunctionExpand[(((4k-1)!!)/((4k)!!))],{k,0,n/2-1}]

V6

(Sqrt[2])Sum[(((4k-1)!!)/((4k)!!)),{k,0,n/2-1}]

(Sqrt[2])Sum[FunctionExpand[(((4k-1)!!)/((4k)!!))],{k,0,n/2-1}]

V7

(Sqrt[2])Sum[(((4k-1)!!)/((4k)!!)),{k,0,n/2-1}]

(Sqrt[2])Sum[FunctionExpand[(((4k-1)!!)/((4k)!!))],{k,0,n/2-1}]

Table[(Sqrt[(2/π)]) DifferenceRoot[Function[{\[FormalY],\[FormalN]},{(3+16 \[FormalN]+16 (\[FormalN]^2)) \[FormalY][\[FormalN]]+(-11-40 \[FormalN]-32 (\[FormalN]^2)) \[FormalY][1+\[FormalN]]+(8+24 \[FormalN]+16 (\[FormalN]^2)) \[FormalY][2+\[FormalN]]==0,\[FormalY][0]==0,\[FormalY][1]==(Sqrt[π])}]][Floor[(n/2)]],{n,2,10,2}]

Table[(1/2)+(Sqrt[2])((Hypergeometric2F1[1,-1/2,n,1/2])/(Beta[n,1/2])),{n,2,10,2}]//Simplify

Odd

Table[1+(Sqrt[2])Sum[(((4k-3)!!)/((4k-2)!!)),{k,0,(n-1)/2}],{n,1,6,2}]

v5.2

1+(Sqrt[2])Sum[(((4k-3)!!)/((4k-2)!!)),{k,(n-1)/2}]

1+(Sqrt[2])Sum[FunctionExpand[(((4k-3)!!)/((4k-2)!!))],{k,(n-1)/2}]

v6

1+(Sqrt[2])Sum[(((4k-3)!!)/((4k-2)!!)),{k,(n-1)/2}]

1+(Sqrt[2])Sum[FunctionExpand[(((4k-3)!!)/((4k-2)!!))],{k,(n-1)/2}]

Monte Carlo

<<Statistics`ContinuousDistributions`

v=RandomArray[NormalDistribution[],10^6];//Timing

eigen=Table[Count[#,_?(Abs[Im[#]]==0.&)]&/@Eigenvalues/@(Partition[#,n]&/@Partition[v,n^2]),{n,5}];//Timing

N[Through[{Mean,Variance}[#]]&/@eigen]

Expected Number of Complex Eigenvalues for a Normally Distributed Real Matrix

FullSimplify[(Sqrt[(2/π)])y Exp[y^2-x^2]Erfc[(Sqrt[2])y]Sum[((((x^2+y^2))^k)/(k!)),{k,0,n-2}],n∈Integers&&n>0]

ρ[n_,{x_,y_}]:=(Sqrt[(2/π)])Exp[2(y^2)]y Erfc[(Sqrt[2])y]((Gamma[n-1,(x^2)+(y^2)])/(Gamma[n-1]))

Show[GraphicsArray[Plot3D[ρ[#,{x,y}],{x,-5,5},{y,0,5},
DisplayFunction->Identity,PlotPoints->100,Mesh->False,
AxesLabel->TraditionalForm/@{x,y,""},PlotRange->All,PlotLabel->TraditionalForm[n==#]]&/@{2,3,10}]]//Timing

Integral

FullSimplify[FunctionExpand[n-(1/2)-(Sqrt[2])((Hypergeometric2F1[1,-1/2,n,1/2])/(Beta[n,1/2])),n∈Integers&&n>0]]

FullSimplify[-(1/2)+n-(1/(2^n))((2n-1)!! Hypergeometric2F1Regularized[-1+n,-(1/2),n,-1])]

c=Table[-(1/2)+n-(2^(-n)) (-1+2 n)!! Hypergeometric2F1Regularized[-1+n,-(1/2),n,-1],{n,14}]//FullSimplify

Prepend[First/@Rest[c],0]

Through[{Numerator,Denominator}[-Last/@Rest[c]/Sqrt[2]]]

A046161

Table[n-(1/2)-(Sqrt[2])((Hypergeometric2F1[1,-1/2,n,1/2])/(Beta[n,1/2])),{n,5}]//Simplify

N[%]

Do[
Print[{n,2NIntegrate[ρ[n,{x,y}],{y,0,∞},{x,-∞,∞}]//Simplify//Timing}],{n,5}]

v4.2

Do[
Print[{n,2Integrate[ρ[n,{x,y}],{y,0,∞},{x,-∞,∞}]//Simplify//Timing}],{n,5}]

v5

2Integrate[ρ[n,{x,y}],{y,0,∞}]

2Integrate[ρ[n,{x,y}],{x,-∞,∞}]

Do[
Print[{n,2Integrate[ρ[n,{x,y}],{y,0,∞},{x,-∞,∞}]//Simplify//Timing}],{n,5}]

v6

2Integrate[ρ[n,{x,y}],{y,0,∞}]

2Integrate[ρ[n,{x,y}],{x,-∞,∞}]

Do[
Print[{n,2Integrate[ρ[n,{x,y}],{y,0,∞},{x,-∞,∞}]//Simplify//Timing}],{n,5}]