Solution

35738

First name
Oliver Bel
School
Loreto College
Country
Age
16

The specific numbers on the balls don't matter, just whether they are odd or even.
Two odd numbers added together and two even numbers add together always give an even number, and an odd number and an even number added together always give an odd number. I won't bother including the proof for this.

For O odd numbers and E even numbers and N numbers in total, the probabilities for picking two balls of particular odd/even combinations are as follows:

OO => O/N * O-1/N-1 = O(O-1)/N(N-1)
EE => E/N * E-1/N-1 = E(E-1)/N(N-1)
OE/=> O/N * E/N-1 + E/N * O/N-1 = OE/N(N-1) + EO/N(N-1) = 2OE/N(N-1)

Picking OO or EE gives an even sum resulting in a win, and OE/EO will give an odd number resulting in a loss. If the "chance of getting an even total is the same as the chance of getting an odd total", the probabilities are equal. As the denominators for all probabilities are the same, we only need to consider the numerators.

O(O-1) + E(E-1)= 2OE

O^2 - O + E^2 - E - 2OE = 0

This cannot be factorized, so I will turn it into a quadratic equation, taking O as the variable, though E could also be used. O and E could be swapped around at this point, and the equation would still be valid.

O^2 + (-2E - 1)O + E^2 - E = 0

Finding the discriminant:

a = 1
b = -2E - 1
c = E^2 - E

(-2E-1)^2 - 4(1)(E^2 - E) = 8E + 1

The number of balls must be a real, positive, integer value, therefore 8E + 1 must be a positive, square number.

8E + 1 is odd so
8E + 1 = (2r + 1)^2
8E + 1 = 4r^2 + 4r + 1
8E = 4r^2 + 4r
E = (r^2 + r)/2

Therefore the number of even balls must be a triangle number.

Substituting the values of a, b and c into the quadratic equation and simplifying gives us:

O = [2E + 1 + SQRT(8E + 1)] 2

Substituting E = (r^2 + r)/2 gives:

O = [r^2 + r + 1 +/- SQRT(4r^2 + 4r + 1)]/2
O = [r^2 + r + 1 +/- (2r + 1)]/2

O = (r^2 + 3r + 2)/2 and O = (r^2 - r)/2

Both are the nth terms of triangle numbers, so the number of odd balls must also be a triangle number.

The equations also show that the number of odd balls must be either one triangle number above or below the (triangle) number of even balls, and vice versa.

Examples:
3 odd balls, 1 even ball
3 even balls, 1 odd ball
6 odd balls, 3 even balls
...

There are an infinite number of these sets as the triangle numbers go on to infinite.