A box contains some red balls and some blue balls. There are four more blue balls than red balls. A ball is removed at random, replaced and a second ball randomly removed. The probability that the two balls are different colours is 21/50. How many balls of each colour are in the box?

Why did the red ball go to therapy?

Because it had a case of the blues!

Let's assume the number of red balls in the box is 'x'.

According to the given information, there are four more blue balls than red balls. So, the number of blue balls would be 'x + 4'.

When a ball is removed at random and replaced, the ratio of red balls to the total number of balls remains the same. So, the probability of choosing a red ball would be (x) / (x + (x + 4)) or x / (2x + 4).

Similarly, the probability of choosing a blue ball would be ((x + 4)) / (2x + 4).

Now, we need to calculate the probability of selecting two balls of different colors.

The probability of selecting a red ball and then a blue ball would be (x / (2x + 4)) * ((x + 4) / (2x + 4)) = (x * (x + 4)) / ((2x + 4)^2).

The probability of selecting a blue ball and then a red ball would be ((x + 4) / (2x + 4)) * (x / (2x + 4)) = (x * (x + 4)) / ((2x + 4)^2).

Adding these two probabilities would give the probability of selecting two balls of different colors:

(x * (x + 4)) / ((2x + 4)^2) + (x * (x + 4)) / ((2x + 4)^2) = 21/50.

The denominators are the same for both terms, so we can combine the numerators:

2(x * (x + 4)) = 21/50 * ((2x + 4)^2).

Now, we can simplify the equation and solve for 'x':

2x^2 + 8x = 21/50 * (4x^2 + 16x + 16).

Multiplying both sides by 50 to eliminate the denominator:

100x^2 + 400x = 21 * (4x^2 + 16x + 16).

100x^2 + 400x = 84x^2 + 336x + 336.

Simplifying further:

16x^2 - 64x - 336 = 0.

Dividing by 16:

x^2 - 4x - 21 = 0.

Factoring the quadratic equation:

(x -7)(x + 3) = 0.

This equation has two solutions, x = 7 and x = -3.

Since we cannot have a negative number of balls, the number of red balls in the box is x = 7.

Therefore, the number of blue balls in the box would be x + 4 = 7 + 4 = 11.

So, there are 7 red balls and 11 blue balls in the box.

To determine the number of red and blue balls in the box, let's assign variables to represent the quantities we need to find.

Let's say there are x red balls in the box. Therefore, there are x + 4 blue balls since there are four more blue balls than red balls.

When the first ball is removed and replaced, the probability of getting a red ball is x/(x + (x + 4)) = x/(2x + 4).

When the second ball is randomly removed, there is still the same number of red balls and blue balls as before, so the probability of getting a different color is (x + 4)/(2x + 4).

Multiplying the probabilities together, we get the joint probability of getting two different colored balls:

P(different color) = (x/(2x + 4)) * ((x + 4)/(2x + 4))

Given that the probability is 21/50, we can set up the equation:

(x/(2x + 4)) * ((x + 4)/(2x + 4)) = 21/50

To solve this equation, we can cross-multiply and simplify:

50x(x + 4) = 21(2x + 4)^2

50x^2 + 200x = 84x^2 + 336x + 336

34x^2 + 136x - 336 = 0

Dividing by 2 to simplify the equation:

17x^2 + 68x - 168 = 0

Now, we can solve this quadratic equation using factoring, completing the square, or the quadratic formula. After solving for x, we can substitute the value of x back into the equation to find the number of red and blue balls.

Math - Probability

Let the number of red balls in the box be x.
Then the number of blue balls in the box is x + 4.
Hence the total number of balls in the box is 2x + 4.

P(R) = x/(2x + 4)
P(B) = (x + 4)/(2x + 4)

Thus P(2 different colours, with replacement):
= P(R, then B) + P(B, then R)
= 2 [x/(2x + 4)][(x + 4)/(2x + 4)] = 21/50

Solve the equation to find your answer.