# Derangement with extra box

I was going through PnC questions and I came across this problem.

Four balls numbered $$1,2,3,4$$ are to be placed into five boxes numbered $$1,2,3,4,5$$ such that exactly one box remains empty and no ball goes to its own numbered box. The no. of ways is?

I worked out the problem in the following way.

Case 1: box 5 is not selected and thus total derangements $$d_4=9$$

Case 2: Any one of 4 boxes say box 1 is not selected $$C(4,1)$$

case 2(a) ball 1 goes to box 5 then total derangements $$d_3=2$$

Case 2(b) ball 1 goes to either of other two boxes say box 2

Case 2(b)(i) ball 2 goes to 5 then $$d_2=1$$

Case 2(b)(ii) ball 2 doesn’t go to box 5 then also $$d_2=1$$

Thus, total number of ways $$=9+C(4,1){2+2*2}=33$$