I want to fill a matrix randomly with True and False.

The code below does produce a matrix where the proportion of True is roughly p, but all the Trues are at the beginning, and all the False at the end (so it looks like it generates the same random number over and over).

Can you tell me how to fix this?

Thank you,

Alastair

```
program GeoTournament;
const
n = 20;
p = 0.5;
var
Adj : array[1..n,1..n] of Boolean;
i,j : integer;
BEGIN
randomize;
FOR i := 1 TO n-1 DO
FOR j := i+1 TO n DO
IF random <= p THEN
BEGIN
Adj[i,j] := TRUE;
Adj[j,i] := FALSE;
END
ELSE
BEGIN
Adj[i,j] := FALSE;
Adj[i,j] := TRUE;
END;
END.
```