Current location - Training Enrollment Network - Mathematics courses - Mathematical selection algorithm
Mathematical selection algorithm
1: Put any two balls at both ends of the balance.

2: If it is balanced, remove two balls, and then take two balls from the remaining balls and put them at both ends of the balance; If it is unbalanced, take the ball from the lighter end and put another ball from the rest.

3: If the number of remaining balls is 0, the ball at the heavier end is what you want; If it is not 0, please go to 2.