How can I randomly shuffle the positions within a Mathematica table?

2 replies · 3K views · last reply
natski
Messages
262
Reaction score
2
Hi everyone,

Does anybody know how to randomly shuffle the positions within a table about? For example a table T = {1,2,3,4,5,6...} gets randomly shuffled to be T' = {7,3,5,1,4...} [or whatever].

I thought there might be some kind of intrinsic RandomShuffle kind of function but can't find one...

Natski
 
Use the RandomPermutation[] function. It should do the trick. (need to load the DiscreteMath package to use it)