0
|
5962 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
GROUPS:

# Any built function for this permutation?

Posted 9 years ago
 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}} 
2 Replies
Sort By:
Posted 9 years ago
 Thanks!!
Posted 9 years ago
 Try this g = Range[3]; Tuples[g, 3] And the output is {{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}} I hope tihs help you.