jeudi 26 novembre 2020

Am I overlooking something in the statistics of my Secret Santa draw?

We are doing the typical Secret Santa draw in my Company for Christmas. We are 12 people divided into 2 companies, the first company is "Bit" and the second is "MP".

I will describe here how the draw works, programmed in C#:

We have a list with 12 people:

  • 6 people are from Bit
  • 6 people are from MP

First we shuffle the list so the first person who begins choosing is fully random and therefore the order of the list does not matter anymore.

Then we start the draw with the first person of the shuffled list, let's say Person 6.

Person 6 pulls one person from the whole 12 people pool. If this person 6 has pulled himself, then it does not count and he pulls another one (the person 6 would be again available in the pool), until it is different from Person 6.

So let's say Person 6 (MP) -> Person 1 (Bit)

When person 6 obtains someone assigned, this assigned person (in this case Person 1) can't be assigned anymore and we continue with the draw with the other remaining 11 people.

We also catch the case, which the last person can not pull anyone but himself. For instance (example with 4 people):

  • Person 1 -> Person 3
  • Person 2 -> Person 1
  • Person 3 -> Person 2
  • Person 4 -> ?????

In this case, all people and their assignee are reset and the draw begins again.


With the draw explained, we just programmed some statistics to test that the draw random enough is.

After some simulations ~ 10.000 iterations (draws) we got these results:

  • Bit -> Bit: 29881 (this means it has happened 29881 times that someone from the Company Bit got assigned someone from the company Bit)
  • Bit -> MP: 30119
  • MP -> Bit: 30119
  • MP -> MP: 29881

And the question is: WHY no matter how many times we do the simulation and how many iterations/simulation are configured, the number of Bit -> MP = MP -> Bit and Bit -> Bit = MP -> MP?




Aucun commentaire:

Enregistrer un commentaire