Matrices and the structure of random number sequences