Assume I have a matrix.
mat = {{1, 1, 8, 3, 5}, {2, 2, 6, 5, 3}, {3, 3, 9, 2, 7}, {4, 4, 7, 1,
7}, {5, 5, 3, 6, 8}, {6, 6, 8, 7, 7}, {7, 7, 2, 4, 4}, {8, 8, 9,
1, 6}, {9, 9, 1, 1, 2}, {10, 10, 2, 1, 6}, {11, 11, 6, 2, 4}, {12,
12, 9, 2, 1}};
I would like to create new matrix that has dimension $12\times3$.
First 2 column is fixed but 3rd column is randomly selected from last 3 column.
First row would be {1, 1, 8}
or {1, 1, 3}
or {1, 1, 5}
Second row would be {2, 2, 6}
or {2, 2, 5}
or {2, 2, 3}
For example one sample is the following.
sem={{{1, 1, 8}, {2, 2, 3}, {3, 3, 7}, {4, 4, 7}, {5, 5, 6}, {6, 6, 8}, {7, 7, 2}, {8, 8, 6}, {9, 9, 1}, {10, 10, 6}, {11, 11, 6}, {12,12, 9}}} ;
I need say 1000 sample like this. How can I achieve this?