Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 Mathematica 中使用 RandomInteger 函数,这样一旦绘制了一个整数,就不能再次绘制它。例如,我希望使用 RandomInteger 绘制 12 个整数,介于 1 和 12 之间,这样每个数字只绘制一次。谢谢。
应用于列表时,RandomSample会产生随机排列。
RandomSample
RandomSample@Range[12]