Random pair generation?

210 Views Asked by At

Suppose there are 6000 people, there will be a combination of $$\binom{6000}{2}$$ ways for 2 people to be chosen out.

Now the task is to randomly choose 5000 pairs of people in the total 6000 people.

One possible solution is to:

  1. list all possible pairs $$\binom{6000}{2} = 17997000$$
  2. randomly choose 5000 pairs.

There is one problem with this solution, it is very task heavy to generate 17997000 pairs first.

Is there any method to generate 5000 random pairs directly, without firstly generate all possible pairs then do random choose?