You have 6 red balls, 7 green balls and 4 blue balls. You are asked to choose two balls. How many different ways you can select the balls if the color should match. How many different ways you can select the balls if the color does not match.
There are 6 choose 2 different ways to select red balls and 7 choose 2 different ways to select green balls and 4 choose 2 different ways to select blue balls:
6 choose 2 = 6!/4!2! = 15 7 choose 2 = 7!/5!2! = 21 4 choose 2 = 4!/2!2! = 6
So the total number of ways to select two balls of the same color
15 + 21 + 6 = 42
If the color does not match then we need to select one red and one green, one red and one blue or one green and one blue. There are 6 ways to select a red ball and 7 ways to select a green ball so we have 42 ways to select the first pair. The second pair is 6x4 = 24 and the third pair is 7x4 = 28
So the total number of ways to select two balls with different color
42 + 24 + 28 = 94