Question: Counting Number of Ways to Color 
Each of the nine dots in this figure is to be colored red, white or blue. No two dots connected by a segment (with no other dots between) may be the same color. How many ways are there to color the dots of this figure?
What I have done so far: I know there are $3\cdot 2\cdot 1=6$ ways to color the leftmost triangle. How do I proceed?
 A: Assume the middle triangle is coloured R, B, W, starting from the top vertex and moving clockwise. Then the top vertex of the rightmost triangle cannot be R, and the bottom-left vertex cannot be B.
You can list all possible valid arrangements of the rightmost triangle, of which there are $3$ in total. Draw them for yourself!
The top vertex must be of the other two colours, B or W in our case. There are $2$ arrangements when B is the top vertex, and $1$ arrangement when W is the top vertex, as in the other colouring, the bottom two vertices have the same colour. This is true for the leftmost triangle as well by symmetry.
Therefore, the number of possible arrangements is $6 \times 3 \times 3 = 54$.
A: Let us start by fixing a coloring of the leftmost triangle.
If we now want to color the middle triangle, we get the following situation:
The two vertices neighboring the leftmost triangle give us two colors whose usage is restricted, say $1$ and $2$.
Coloring any of these vertices with the remaining color fixes the colors in the triangle, so this gives us two possible colorings.
If we choose to not use the unrestricted color for the vertices neighboring the leftmost triangle then the coloring is fixed -- we have two colors for two vertices and for each of these vertices, one of the colors is illegal.
Hence we find that there are $3$ possible ways to color the middle triangle once the colors for the leftmost one are fixed.
As for the rightmost triangle, note that the situation is symmetric to the middle one (i.e. we want to color a triangle which is connected with an already colored one via 2 vertices) so we again have 3 possible ways to continue the coloring correctly.
You already got the number of possible colorings for a single triangle correctly, so the total number of legal colorings is $6 \cdot 3 \cdot 3 = 54$.
