Hi All, I am looking for a built function in Mathematica for this kind of permutation.. Any idea?
In[9]:= list = Table[i, {i, 1, 3}]
Out[9]= {1, 2, 3}
In[10]:= Flatten[
Table[{list[[i]], list[[j]], list[[k]]}, {i, Length@list}, {j,
Length@list}, {k, Length@list}], 2]
Out[10]= {{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 2, 1}, {1, 2, 2}, {1,
2, 3}, {1, 3, 1}, {1, 3, 2}, {1, 3, 3}, {2, 1, 1}, {2, 1, 2}, {2, 1,
3}, {2, 2, 1}, {2, 2, 2}, {2, 2, 3}, {2, 3, 1}, {2, 3, 2}, {2, 3,
3}, {3, 1, 1}, {3, 1, 2}, {3, 1, 3}, {3, 2, 1}, {3, 2, 2}, {3, 2,
3}, {3, 3, 1}, {3, 3, 2}, {3, 3, 3}}