Positive correlation is not transitive!

x, y and z are each N(0, 1). (Normal distribution, mean = zero, std = 1)
x and y are correlated at 1/2.
y and z are correlated at 1/2
x and z are correlated at −1/2

gcc a.c rnd.c
./a.out
The routine rnd() produces Random Normal Deviates, N(0, 1).
The program prints 3 columns, x, y and z; the correlation matrix; and then the three means.
…
-0.314 -0.929 -0.614
 1.094  1.380  0.287
 0.606  0.622  0.016
-1.390 -1.217  0.173
 0.898  0.609 -0.289
 0.150 -1.583 -1.732
-1.539 -1.773 -0.234
 1.383  0.140 -1.244
-0.517 -0.456  0.061
 1.294  1.805  0.512
 1.528  0.929 -0.599
 1.128  0.695 -0.433
 0.814  0.218 -0.596
-0.835 -0.521  0.314
 1.00970  0.50045 -0.50925
 0.50045  1.00047  0.50002
-0.50925  0.50002  1.00927

 0.00159 -0.01708 -0.01868