Distributing balls in boxes There are five balls of identical sizes but different colors. One of the balls is red, one is blue, one is green and the other two are yellow. Moreover, there are three boxes which are numbered 1, 2 and 3. There are two more boxes but both of them are numbered 4. In how many different ways can we place the five balls in the given five boxes such that each box contains exactly one ball?

One way to do it is to "temporarily mark" the identical balls and boxes so that all balls and boxes are distinguishable. That is, we imagine that we put a sticker on one of the yellow balls and on one of the boxes labeled $4.$
With the stickers, we have five distinguishable balls in five boxes
and can apply the known formula for that case.
Now we ask what happens when we remove the stickers. We will "lose" some arrangements because arrangements that were formerly distinguishable are no longer distinguishable.
For example, for the arrangement
$$ (1,R), (2,B), (3,Y), (4,Y), (4,G), $$
without the stickers we cannot tell which of the yellow balls is in box $3$ 
and we cannot tell which "box $4$" holds the green ball.
For most of the distinguishable arrangements that remain after we remove the stickers, there were four arrangements with stickers;
we can count these by choosing which yellow ball has a sticker and which "box 4" has a sticker.
There are some arrangements where this four-to-one ratio is not true, however:
if both yellow balls are in boxes labeled $4,$ there are only two ways to distinguish arrangements using the two stickers: put the ball with the sticker in the box with the sticker, or put it in the other box.
So you can add up your final answer as follows:
from all the arrangements of five distinguishable balls in five
distinguishable boxes, take half of the arrangements that put both
yellow boxes in boxes labeled $4,$ and add one quarter of the other arrangements.
