A bag contains 40 balls from 4 different colors: red, white, black and green. There are 10 balls numbered (1, 2, 3, ..., 10) from each color. 5 balls are randomly selected from the bag.
In how many ways can 5 balls be chosen so that no more then 2 balls are of the same color?
Can you help me with this? I know that there are 2 cases, 1: 2 balls with same color & 3 balls with different colors 2: 2 balls with same color, another 2 balls with same color and 1 ball with different color. However, I could not understand my instructor's explanation.