Hello I have a matrix with 2 columns and 120 rows. the first columns has numbers 2-6 and the second one is 0 and 1 like the following
[2 1][3 0][2 0][4 0][6 1][2 1] etc.
I want to shuffle randomly the second column to produce a new column. In this new column I want to shuffle the rows of the second column, that their first column is between 2 and 5. Also shuffle the rows on the second column that the first column is 6 between them. More specifically if I have a sequence in the following way
[2 1] [3 0] [6 0] [2 0]
one new shuffled column will make the matrix
[2 0 0] [3 0 1] [6 0 0] [2 0 0]
but NOT
[2 0 0] [3 0 0] [6 0 1] [2 0 0]
because i don't wont to shuffle the rows that have 6 with the rows that have 2-5. I want with this process to create 100 new columns and to do this 2008 times with different matrixes of the same size. All this shuffling has to be in a random way except for the condition of 2-5 and 6 that I mentioned.
Best Answer