I want to generate a random matrix (let's say a 5×4 matrix) with the following properties:
- There must be one 3, two 2s, nine 1s, eight 0s in the matrix.
- In each row, there is at most one 3 or 2 and at most two 1s.
- In each row, if there is a 3, then there is no 2.
- In each row, if there is a 3, then there is one 1.
- In each row, if there is a 2, then there are two 1s.
An example matrix:
0 0 1 13 1 0 02 1 1 00 1 1 20 1 1 0
How do I generate such a matrix? I don't even know where to begin. Any help is greatly appreciated.
Best Answer