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?

How is it 0.8? What is the working out?

I'm stuck on it to

Let's assume that there are "x" red balls in the box. Since there are four more blue balls than red balls, we can say that there are (x+4) blue balls in the box.

The probability of drawing a blue ball on the first draw is (x+4)/(2x+4) because there are a total of (x+4)+(x)=2x+4 balls in the box.

After replacing the first ball, the probability of drawing a different colored ball on the second draw is (x)/(2x+4-1)=(x)/(2x+3).

Multiplying these two probabilities together gives us the probability of drawing two different colored balls: (x+4)/(2x+4) * (x)/(2x+3) = 21/50.

Now, we can solve this equation for x:

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

Cross-multiplying gives us:

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

Expanding both sides:

50x^2 + 200x + 200 = 21(4x^2 + 14x + 12)

Simplifying:

50x^2 + 200x + 200 = 21(4x^2 + 14x + 12)

50x^2 + 200x + 200 = 84x^2 + 294x + 252

Combine like terms:

0 = 34x^2 + 94x +52

Now, we can solve this quadratic equation using factoring, completing the square, or the quadratic formula. Since it doesn't factor easily, we will use the quadratic formula:

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

Substituting the values in:

x = (-(94) ± √((94)^2 - 4(34)(52)))/(2(34))

Simplifying:

x = (-94 ± √(8836 - 8928))/68

x = (-94 ± √(-92))/68

Since we can't have a square root of a negative number in this context, this means that there is no solution to this equation.

Therefore, it seems that there is no combination of red and blue balls that satisfy the given conditions.

To determine the number of red and blue balls in the box, let's set up equations based on the given information.

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

According to the problem, there are four more blue balls than red balls. So, the number of blue balls in the box is "x + 4".

Now, let's calculate the probability of drawing two different colored balls.

When the first ball is drawn, the probability of drawing a red ball is (x / (x + x + 4)) = (x / (2x + 4)).
Since the ball is replaced, the same probability applies to the second ball as well.

Therefore, the probability of drawing two different colored balls is given by:

Probability of drawing different colors = Probability of drawing a red ball and then a blue ball + Probability of drawing a blue ball and then a red ball

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

Simplifying this expression, we get:

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

Now, we can solve this equation to find the value of "x" (the number of red balls).

Multiplying both sides of the equation by (2x + 4)^2:

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

Expanding and simplifying:

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

84x^2 + 336x + 336 = 2x^2 + 12x + 4x^2 + 16x

Rearranging and simplifying:

80x^2 + 308x + 336 = 0

Dividing the equation by 4:

20x^2 + 77x + 84 = 0

This quadratic equation can be solved using the quadratic formula:

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

Plugging in the values:

x = (-77 ± √(77^2 - 4 * 20 * 84)) / (2 * 20)

After solving this equation, you will find two solutions for "x", but only the positive value will be the number of red balls.

Once you find the value of "x" (the number of red balls), you can calculate the number of blue balls by adding 4 to the value of "x" (x + 4).