Combination without repetition in Mathematica

How can I get 48 random pairs of two different elements taken from Range[96] without repeating? These are 96 elements that are used only once.

While I was trying to use Tuples / Subsets in combination with Select, I believe there must be an easier way to achieve this.

+4
source share
2 answers

Please tell me if this is correct:

 Partition[ RandomSample@Range @96, 2] 
+7
source
 Partition[RandomSample[Range[96]],2] 
+4
source

Source: https://habr.com/ru/post/1383132/


All Articles