Hey there,

I'm getting a very odd error, and I would be grateful for any help solving it.

I have a notebook with the following:

(* Amy's program to generate random orthogonal matrices (RUM) and sort their \

eigenvalues (EigenRUM)*)

<< LinearAlgebra`MatrixManipulation`

<< Statistics`NormalDistribution`

RUM[NxN_] := (

f[x_, y_] := Random[NormalDistribution[0, 1]];

RM1 = Array[f, {NxN, NxN}];

RM2 = QRDecomposition[RM1];

R1 = Flatten[Drop[RM2, 1], 1];

f2[x_] := R1[[x, x]]/Abs [R1[[x, x]]];

R2 = Array[f2, NxN];

R3 = DiagonalMatrix[R2];

Q1 = Flatten[Take[RM2, 1], 1];

Q2 = Conjugate[Transpose[Q1]];

Transpose[Q2].Q2;

RM = Q2.R3);

I wrote this over two years ago, and several members of my department and I have been using it happily since - until today, when it has suddenly started throwing up errors - specifically:

NormalDistribution::shdw: Symbol NormalDistribution appears in multiple \ contexts {Statistics`NormalDistribution`, Global`}; definitions in context \ Statistics`NormalDistribution` may shadow or be shadowed by other definitions.
The notebook has not been altered since it was last working, so I am very confused as to why it now has errors.

I also get the error

Random::randt: Type specification NormalDistribution[0, 1] in \ Random[NormalDistribution[0, 1]] should be Real, Integer, or Complex.
on running

Random[NormalDistribution[0, 1]]

by itself. I've read through the help page on NormalDistribution, but even trying to input the examples from there throws up errors.

Anyone who can shed any light on this will receive a lot of gratitude, as my PhD is kinda at a standstill unless I can generate random orthogonal matrices!