In an urn, there are several colored balls, with equal numbers of each color. We add 14 balls which are all of the same new color, that is different from those in the urn. It is calculated that the probability of drawing, without replacement, two balls of the same color is the same (when compared before and after the balls are added). How many balls are there in the urn initially?

A stimulating problem, combining probabilities with discrete mathematics.

The question requires the probability of successively picking two balls of same colour be the same before and after adding 14 balls of a new colour.

Initial situation:
Assume there are n balls with k of each colour, i.e. n/k (∈N) represents the initial number of colours.

Then probability of picking two balls of the same colour is therefore Psame=(k/n)*(k-1)/(n-1).
Probability of picking two balls of the same colour is therefore obtained by multiplying p1 by the number of colours, i.e.
P0=(n/k)*Psame=(k-1)/(n-1)

After adding 14 balls of the same (new) colour:
Total number of balls = n+14
Psame=(k/(n+14)*(k-1)/(n+13)
Pnew = 14/(n+14)*13/(n+13)
Probability of getting two balls of the same colour
P1=14/(n+14)*13/(n+13)+ (n/k)*(k/(n+14)*(k-1)/(n+13)

Solution
Since question specifies P0=P1, we have
(k-1)/(n-1) = 14/(n+14)*13/(n+13) + (n/k)(k/(n+14)(k-1)/(n+13))

(k-1)/(n-1) = ( n(k-1)+13*14 )/[(n+13)(n+14)]

Cross-multiplying and equating to zero yields the integer equation to be solved for zeroes for integer values of n and k:

f(n,k)=(k-1)(n+14)(n+13) - (n-1)(n*k-n+13*14) = 0

The easiest solution strategy is to assume integer values of k and solve for n such that n is also an integer and such that k|n (k divides n).

This can be easily solved to get (n,k) couplets of
(13,5) but 5 does not divide 13,
(26,6) but 6 does not divide 26
(91,7) yes, 7 divides 91.
So
n=91, k=7, i.e.
initially there are 91 balls with 7 each of the 13 colours.

You should proceed to check that the solution satisfies the given requirements.

Let's solve this step by step.

Step 1:
Let's assume there are 'n' colors initially in the urn, with an equal number of balls of each color.

Step 2:
Since the probability of drawing two balls of the same color is the same before and after adding the new balls, let's calculate the probability for each case.

Before adding new balls:
The chance of drawing two balls of the same color can be calculated using combinations.

For the first ball, we have n options (as there are n colors).
For the second ball, we have n-1 options (since we can't choose the same color again).

The probability of drawing two balls of the same color before adding new balls is given by:
P(Before) = (Number of favorable outcomes) / (Number of possible outcomes)
= (n * (n - 1)) / (n * (n - 1))
= 1

After adding new balls:
After adding 14 balls of a new color, the total number of balls in the urn becomes (n + 14).

The probability of drawing two balls of the same color can now be calculated similarly.

For the first ball, we have (n + 1) options (including the new color).
For the second ball, we have (n + 14 - 1) options (since we can't choose the same color again, including the new color).

The probability of drawing two balls of the same color after adding new balls is given by:
P(After) = (Number of favorable outcomes) / (Number of possible outcomes)
= ((n + 1) * (n + 14 - 1)) / ((n + 14) * (n + 13))

Step 3:
Since the probability of drawing two balls of the same color is the same before and after adding new balls, we can set the two probabilities equal to each other.

P(Before) = P(After)

1 = ((n + 1) * (n + 14 - 1)) / ((n + 14) * (n + 13))

Simplifying this equation will help us find the value of 'n'.

Step 4:
Multiply both sides of the equation by ((n + 14) * (n + 13)) to eliminate the fraction.

((n + 14) * (n + 13)) = (n + 1) * (n + 14 - 1)

Expand and simplify the equation.

(n^2 + 14n + 13n + 14 * 13) = (n^2 + 14n + n + 14 - 1)

Combine like terms.

(n^2 + 27n + 14 * 13) = (n^2 + 15n + 13)

Step 5:
Simplify the equation further by canceling out the common terms on both sides.

(n^2 + 12n + 182) = 0

Step 6:
This is a quadratic equation, set it equal to zero.

n^2 + 12n + 182 = 0

Using the quadratic formula, we can solve for 'n'.

n = (-b ± √(b^2 - 4ac))/(2a)

Here, a = 1, b = 12, and c = 182.

n = (-12 ± √(12^2 - 4 * 1 * 182))/(2 * 1)

n = (-12 ± √(144 - 728))/(2)

n = (-12 ± √(-584))/(2)

Since the discriminant (b^2 - 4ac) is negative, this equation has no real solutions.

Therefore, there is no valid value of 'n' for which the probability of drawing two balls of the same color is the same before and after adding new balls.

Hence, there is no solution to this problem.

To solve this problem, we need to consider the probability of drawing two balls of the same color before and after adding the new balls. Let's work through the steps to find the solution:

1. Let's assume that there are "n" balls in the urn initially.
2. Since there are equal numbers of each color initially, the number of colors before adding the new balls is given by the square root of "n". Let's call this value "c".
3. Before adding the new balls, the probability of drawing two balls of the same color can be calculated as follows:
- The probability of choosing the first ball of any color is 1/c.
- After choosing the first ball, there are n-1 balls remaining in the urn, with n-1/c balls of the same color as the first ball.
- The probability of choosing the second ball of the same color is (n-1)/c divided by (n-1) (since we are drawing without replacement).
- Hence, the probability before adding new balls is 1/c * (n-1)/c.

4. After adding the 14 new balls, the total number of balls in the urn becomes n + 14, and the number of colors is now c + 1.
5. The probability of drawing two balls of the same color after adding the new balls can be calculated as follows:
- The probability of choosing the first ball of any color is 1/(c+1).
- After choosing the first ball, there are n+14-1 = n+13 balls remaining in the urn, with n+13/(c+1) balls of the same color as the first ball.
- The probability of choosing the second ball of the same color is (n+13)/(c+1) divided by (n+13) (since we are drawing without replacement).
- Hence, the probability after adding new balls is 1/(c+1) * (n+13)/(c+1).

6. Now, we have the probability before and after adding new balls:
- Probability before adding = 1/c * (n-1)/c
- Probability after adding = 1/(c+1) * (n+13)/(c+1)

7. According to the problem, the probabilities are the same before and after adding the new balls. Therefore, we can set up the equation as follows:
1/c * (n-1)/c = 1/(c+1) * (n+13)/(c+1)

8. Simplify the equation by multiplying through by c(c+1) to eliminate the denominators:
(n-1)(c+1) = n(c+1) + 13c
nc + n - c - 1 = nc + n + 13c

9. Simplify further by canceling out common terms:
n - c - 1 = 13c

10. Rearrange the equation to solve for n:
n = 14c + 1

11. Since we are looking for the initial number of balls, n, it should be a positive integer. We also know that n and c must be integers.

12. The equation n = 14c + 1 implies that n is one more than a multiple of 14. Thus, we can test values of c that are multiples of 14 until we find an n that satisfies the condition.

For example, let's start with c = 14:
n = 14c + 1
n = 14 * 14 + 1
n = 197

By substituting these values into the equations in step 7, we can confirm if the condition holds. If it does, then the value of c and n are the solution. Otherwise, we can try different values of c until we find the correct solution.