There are four balls of different colour and four boxes of colour same as those of the balls one in each box could be placed such that a ball does not go to box of its own colour is?

1 Answer
Jun 28, 2018

There are 9 ways:

2143
2341
2413
3142
3412
3421
4123
4312
4321

Explanation:

This is the same as trying to arrange the digits 1, 2, 3, 4 in an order where no digit matches its position.

We start with the 4! (24) total ways to permute all 4 digits:

#1234" "2134" "3124" "4123#
#1243" "2143" "3142" "4132#
#1324" "2314" "3214" "4213#
#1342" "2341" "3241" "4231#
#1423" "2413" "3412" "4312#
#1432" "2431" "3421" "4321#

We will eliminate the ways we don't want, step by step.

First step:

We cannot have the number 1 in 1st position. Since this means fixing the 1 in place and permuting the other 3 digits, there are 3! (6) permutations of 1234 that do. Cross these 6 ways off the list:

#cancel1234" "2134" "3124" "4123#
#cancel1243" "2143" "3142" "4132#
#cancel1324" "2314" "3214" "4213#
#cancel1342" "2341" "3241" "4231#
#cancel1423" "2413" "3412" "4312#
#cancel1432" "2431" "3421" "4321#

Second step:

We cannot have the number 2 in 2nd position. Of the 18 ways remaining, there are 4 ways that do. Cross these 4 ways off the list:

#cancel1234" "2134" "3124" "4123#
#cancel1243" "2143" "3142" "4132#
#cancel1324" "2314" "cancel3214" "cancel4213#
#cancel1342" "2341" "cancel3241" "cancel4231#
#cancel1423" "2413" "3412" "4312#
#cancel1432" "2431" "3421" "4321#

Third step:

We cannot have the number 3 in 3rd position. Of the 14 ways remaining, there are 3 ways that do. Cross these 3 ways off the list:

#cancel1234" "cancel2134" "3124" "4123#
#cancel1243" "2143" "3142" "cancel4132#
#cancel1324" "2314" "cancel3214" "cancel4213#
#cancel1342" "2341" "cancel3241" "cancel4231#
#cancel1423" "2413" "3412" "4312#
#cancel1432" "cancel2431" "3421" "4321#

Final step:

We cannot have the number 4 in 4th position. Of the 11 ways remaining, there are 2 ways that do. Cross these 2 ways off the list, and circle the remaining ways.

#cancel1234" "cancel2134" "cancel3124" "[4123]#
#cancel1243" "[2143]" "[3142]" "cancel4132#
#cancel1324" "cancel2314" "cancel3214" "cancel4213#
#cancel1342" "[2341]" "cancel3241" "cancel4231#
#cancel1423" "[2413]" "[3412]" "[4312]#
#cancel1432" "cancel2431" "[3421]" "[4321]#

Counting the number of uncrossed ways, we see there are 9 remaining. This is our answer.