Suppose there is a class with 40 students. The students carry out an initial project in randomly assigned pairs. If the students carry out a second project, what is the probability that none of the randomly assigned pairs of the second project is the same as in the first project? In other words, there can be no repeated pairs in the two projects.
Can anyone provide an answer to this question by using a simulation in R and then by providing a formula?

Probability of person being in same pair second time round is 1/19 So probability of being in different pair is 18/19
So probability of everyone being in different pair is (18/19)^20