Painting Rooms

To make the room colors contrasting, Robin decides to paint in such a way that no two rooms connected by a door have the same color.

Here is the blueprint of her house, where she used numerous colors:

Can she achieve her goal using just her two favorite paint colors, red and yellow?

Yes No

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.

3 solutions

Geoff Pilling
Jan 31, 2017

Consider the room in the middle that doesn't touch any exterior walls. WLOG we can paint this red.

Then the two tiny rooms below it (painted orange and red in the picture) would both need to be yellow (to be different from the red room). However they share a door, so they would need to different colors from each other.

Therefore, no \boxed{\text{no}} there is no way to achieve the above using only red and yellow paint.

Moderator note:

Trying to color any loop of an odd numbers of rooms with only two colors (so the same color doesn't get used in adjacent rooms) will always fail:

This is as opposed to coloring an even number of rooms:

This is because the alternating red-yellow-red-yellow pattern is allowed to return to the original color at the starting room when the loop has an even number of rooms.


More generally, a floor plan can be colored with 2 colors if and only if every loop of rooms involve an even number of rooms. We've established the only if part above. How can we show the if part?

Yep, that is an excellent observation!

Agnishom Chattopadhyay - 4 years, 4 months ago

We can look at this house as a graph where the rooms are nodes and the doors are edges. The question asks if this is a bipartite graph. It is not a bipartite graph because there is a cycle of length 3 present.

Pranshu Gaba - 4 years, 4 months ago

Log in to reply

Is it true in general that a graph is bipartite if and only if it has no odd cycles?

Agnishom Chattopadhyay - 4 years, 4 months ago

Log in to reply

Yes .

Christopher Boo - 4 years, 4 months ago
Siva Budaraju
Feb 3, 2017

The tiny orange room has three doors. WLOG we can paint this yellow. This means that the red room, green room, and yellow room next to it would all have to be red. But wait! The green room has a door to the red room! So this cannot be painted with two colors

Dramatic solution :D

Christopher Boo - 4 years, 4 months ago

Without loss of generality - meaning it does not matter whether we painted it red or yellow.

Siva Budaraju - 4 years, 3 months ago

Log in to reply

Oh, okay. Thank you.

Sameer Syed - 4 years, 3 months ago

What is WLOG?

Sameer Syed - 4 years, 3 months ago

Log in to reply

WLOG = without loss of generality

Geoff Pilling - 4 years, 3 months ago
Bimol Nath Roy
Feb 13, 2017

The green, orange and red rooms are connected to each other with a door. The condition is no two rooms connected by a door have the same color. To fulfill the condition for those three rooms Robin minimum need three paint colors. So she can not achieve her goal using just two colors.

Yes, and to generalise, if it has a cycle of odd length (in this case, 3) then it is not possible. See the comments in Geoff's solution.

Christopher Boo - 4 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...