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.
Asked
Active
Viewed 132 times
0
-
@HighPerformanceMark Sweet, I think that will be perfect. Thank you sir. – SDH Mar 15 '19 at 19:08
-
“RandomSample[12]” is what ended up doing the trick. - SDH – SDH Mar 15 '19 at 21:45
-
@HighPerformanceMark haha. none the less, appreciate the help Mr Mark – SDH Mar 17 '19 at 03:58
1 Answers
0
When applied to a list, RandomSample
produces a random permutation.
RandomSample@Range[12]

Alan
- 9,410
- 15
- 20