China Naming Network - Ziwei Dou Shu - C lottery algorithm

C lottery algorithm

The probability of the first person being drawn is 1/6.

The second person was selected on the premise that the first person didn't win, so the probability is (1-1/6) *1/6 = 5/36.

The third person was drawn, that is, the first two people didn't win, that is, (1-kloc-0//6) * (1-5/36) *1/6 =155/125.

The probability of the fourth person being drawn is (1-1/6) * (1-5/36) * (1-155/1296) */kloc-.

The fifth person is (1-1/6) * (1-5/36) * (1-155/1296) * (/kloc-0)

The sixth person is (1-1/6) * (1-5/36) * (1-155/1296) * (/kloc-0)

A has the highest probability of being drawn.