A $2\times 2$, real, symmetric random matrix $M$ is provided with diagonal entries $M_{11}$ and $M_{22}$ following independent normal distributions $N(0,1)$ and off-diagonal entries $M_{12}=M_{21}$ following normal distribution $N(0,1/2)$.
What's the distribution and the mean of the absolute value of the difference between its two eigenvalues $\Delta E$ ?
Attempt :
The eigenvalues satisfy equation $x^2-Tx+\Delta=0$ where $T$ and $\Delta$ denote the trace and determinant of said matrix, respectively.
Therefore, $x_{\pm}=\frac 12(T\pm\sqrt{T^2-4\Delta})$ and $\Delta E=\sqrt{T^2-4\Delta}=\sqrt{(A-D)^2+4BC}$
($A=M_{11}, B=M_{12}, C=M_{21}, D=M_{22})$
$A$ and $D$ are two independent Gaussian variables with mean $0$ and variance $1$, therefore $A-D$ is a Gaussian random variable with mean $0$ and variance $2$, $N(0,2)$.
$B=C$ is a Gaussian random variable with mean $0$ and variance $1/2$
Therefore, $4BC=\frac1416B^2=\frac14(4B)^2$ with $4B \sim4N(0,1/2)=N(0,2)$
So, $\Delta E \sim\sqrt{N(0,2)^2+\frac14N(0,2)^2}=\sqrt{\frac54 N(0,2)^2}=\sqrt{N(0,\sqrt{5})^2}=|N(0,\sqrt{5})|$
This happens to be a folded normal distribution with $\mu=0$ and $\sigma=\sqrt{\sqrt{5}}$
So the mean should be $\sqrt{\frac{2\sqrt{5}}{\pi}}\approx 1.1931$.
However, the following MATLAB code seems to suggest otherwise :
for i=1:1e+5
M(1,1)=normrnd(0,1);
M(2,2)=normrnd(0,1);
M(1,2)=normrnd(0,1/2);
M(2,1)=M(1,2);
ei=eig(M);
tab(i)=abs(ei(1)-ei(2));
end
mean(tab)
returns $1.5241$
Am I handling distributions wrongly again ?
Context : lonely physics student who wanted to learn maths, uni says it's useless for a physicist and that adults learn by themselves, gives (ungraded) exercises to train instead, but I can't do a single one correctly, despite spending a whole day on the first question of a single problem. Can't improve no matter what. Work hard and you'll get there, they said. $\text{*roll eyes*}$