Question: How do I shuffle a list most efficiently?

Hi, I am going to do a couple, not to say a lot of, Monte-Carlo-Simulations.

Therefore I need to define a procedure "Shuffle", which shuffles the n elements of a list k times.

e.g.

L := [1,2,3,4,5,6,7,8,9,0];
Shuffle := proc(L,n,??)
"Mixes the ten elements of the list L randomly and most efficient"
end proc;

Does anyone of you know an efficient way to realize that?

Thanks.

Please Wait...