Answer:
Ways to choose a set two balls of the same color:
[0.5 * (b) * (b - 1)] + [0.5* (r) * (r - 1)]
Different colors:
0.5 * [(b) * (r) + (r) * (b)] = 0.5 * (2 * b * r)
= b * r
Any two balls
0.5 * (b + r) * (b + r - 1)
= 0.5 * [b * (b + r - 1) + r * (b + r - 1)]
= 0.5 * [b^2 + b * r - b + b * r + r^2 - r]
= 0.5 * [b^2 - b + r^2 - r + b * r + b * r]
= 0.5 * [b * (b - 1) + r * (r - 1) + 2 * b * r]
= 0.5 * (b * (b - 1)) + 0.5 * (r * (r - 1)) + 0.5 * (2 * b * r)
= [0.5 * (b * (b - 1)) + 0.5 * (r * (r - 1))] + [b * r]
= Number of ways of choosing two balls of the same color + number of ways of choosing two balls with different colors
Explanation: