In how many ways can the four walls of a room be painted with three colours so that no two adjacent walls have the same colour ?
I specifically want to use inclusion exclusion principle. So according to me it should be $$3^4-4\times 3^3+4\times 3^2-3 $$ which is $6$. The correct answer is $18$. Am making a mistake in applying the principle ? I thought like this - Total ways to colour - ways to colour two adjacent walls with same colour + ways to colour three adjacent walls with same colour - ways to colour all four walls with same colour.
See if we use $3$ colours then any one of the two pairs of opposite should have same colour . now total ways of doing so are. Lets use a colour. Say green is used at $1,3$ wall so we have two ways to use $Red,blue$ colours so for $1$ colour used twice its $2$ ways hence for $3$ its $6$ ways. Again think of green used at wall no $2,4$ so again we have $2$ ways to use $red,blue$ so again these are $6$ ways. So total ways are $12$ now using $2$ colours. Lets use green at $1,3$ so now ways of using red are $1$ and same for blue. So for $1$ colour fixed we can use two 1 out of $2$ colours for remaining walls in two ways ie $GRGR,GBGB$ .( assuming walls are identical) . so total ways where $2$ colours are ised is $6$ hence total ways are $6+6+6=18$