How can I pick random indices of a matrix with a constraints?

Printable View