# Random real antisymmetric matrix [duplicate]

Is there a way to create random real antisymmetric matrix in Mathematica. Please see the example of such a matrix.

• n = 10 ; a = RandomReal[{0.0, 1.0}, {n, n}] ; b = 0.5*(a - Transpose[a]) ; AntisymmetricMatrixQ[b]
– I.M.
Aug 3, 2021 at 4:09
• @DavidG.Stork Nop Aug 3, 2021 at 4:15
• How do you want the entries distributed? The simplest option would be a uniform distribution between some upper bound & lower bound for all of the independent entries, but other options exist. Aug 3, 2021 at 13:42

Here's a version which allows you to specify a distribution and only generates the required number of random draws for a symmetric matrix. You could replace the RandomVariate[...] code with something like RandomInterger[] if you'd like.

(*Dimension*)
n = 3;

(*Distribution*)
dist = NormalDistribution[];

(*Construct upper triangular SparseArray, efficiently only creating n*(n-1)/2 random numbers.*)
s = SparseArray[{i_, j_} /; i < j :> RandomVariate[dist], {n, n}];

(*Create antisymmetric matrix.*)
m = Normal[s - Transpose[s]];

AntisymmetricMatrixQ[m]
(*True*)


If you don't mind the distribution of generated matrices:

m = RandomInteger[{0, 50}, {3, 3}];
result = m - Transpose[m]

AntisymmetricMatrixQ[result]  (* True *)
$$$$


You can use SymmetrizedArray to create arrays with any kind of symmetry:

Normal @ SymmetrizedArray[
RandomInteger[10, {3, 3}],
Automatic,
Antisymmetric[{1, 2}]
]
`