We can color each square red, blue, or green. How many ways are there to color the squares such that any 2 adjacent squares are different colors?
For example, these are valid:
but these are not:
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Why split it into two cases? The first square has three options, the second has two, and because it's adjacent to the second, the third also has two options. 3x2x2 = 12.
I'm not attacking your answer, as a note. I am sincerely curious if there was a better reason to split into two cases like that.
Log in to reply
That's another way of approaching this problem. (Isn't it amazing that there are multiple ways of solving a problem?!)
You should add that as a solution to this problem!
Very elegant problem with its solution!Upvoted.
To color the 1 s t square, we have 3 colors to choose from(red, green or blue).
Now, having chosen one color, we have 2 choices for the next square as adjacent squares can't have the same color.
However, for the 3 r d square, we can have 2 color choices, except the only one the 2 n d square was colored with.Note:-As in the question, we can have two alternate squares having the same color.So, we don't need to color every single square with a distinct color.
So, the total number of ways to color the whole square is
3 × 2 × 2 = 1 2 .
First square can be coloured by 3different colours,
Second can be coloured by 2 colours other than the first square colour.
Third can be coloured by 2 different colours other than the second square colour.
So total possibility is 3×2×2=12
So you have 3 boxes, correct? In the first box, you get to choose the colors: red, green, or blue (3 choices). Let's say we use red. Then for the second box, we can ONLY use either green or blue since we can't have two of the same colors next to each other (2 choices). Let us use blue. For the last box, we have the choice of two colors! Why? Well because you are NOT restricted from using red again but you ARE restricted from using blue (2 choices). So 3x2x2 = 12
Color the middle one first : 3 choices:
Then for the left and right, both have 2 choices
The number of ways = 2 ∗ 3 ∗ 2 = 1 2
BGR, BGB, BRB, BRG | GBG, GBR, GRB, GRG | RBG, RBR, RGB, RGR
Problem Loading...
Note Loading...
Set Loading...
Two cases:
1) We use 3 different colors, in which case the first square can be any color (3 options), the second square can be either of the other two colors (2 options), and then the final square must be the last color. By Rule of Product, that makes 3 × 2 = 6 options.
2) We use 2 different colors, making a sandwich with them. In this case, the outer squares could be any of the 3 colors and then the middle square can be either of the other two. So, again, by Rule of Product, that makes 3 × 2 = 6 options.
Combining the two cases together (by Rule of Sum), there are 12 ways to color altogether