Artificial intelligent assistant

Flag making with 6 vertical stripes I was preparing for my Engineering entrance exam and got across this question. A flag is to be made with 6 vertical stripes by using colours yellow, blue, green and red in such a way that none of the adjacent stripes have same colour. How many ways is it possible? I landed up with 12x81 but I tried again and landed with 24x216

what you do is you consider the first strip - its colour can be chosen out of all possible $4$. once you chose the colour of the first one you only have $3$ choices for the second one - cause it can't be the same which gives you $4 \cdot 3$ possibilities for the first two stripes. continuing this way you end up with $4 \cdot 3^5$ ways

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 97f78ebdb64d7e748ab92cb5bff4d826