Mathematica Random Integer Function

148 views Asked by At

Is there any way to use the RandomInteger function in Mathematica such that once an integer has been drawn, it cannot be drawn again. For example, I am looking to use the RandomInteger to draw 12 integers, between 1 & 12, such that each number is only drawn once. Thanks.

1

There are 1 answers

0
Alan On

When applied to a list, RandomSample produces a random permutation.

RandomSample@Range[12]