There are houses in a row which are being painted red, blue and green.
The mayor of the town however passed a law.
If a house is painted red or blue, the house to its right has to be green.
How many ways are there of painting the houses?
This problem is a part of Tessellate S.T.E.M.S (2019)
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Let's first try smaller cases and write an as the number of ways to paint n houses according to the rules.
1 house
Obviously, there are a1=3 ways.
2 houses
If the left house is green, then there are a1=3 ways.
If the left house is red or blue, then there is only one way each.
a2=a1+2⋅1=5
3 houses
If the leftmost house is green, then there are a2=5 ways.
If the leftmost house is red or blue, then the next house has to be green and the third house has 3 possibilities each.
a3=a2+2⋅3=11
4 houses
Leftmost house green: a3=11 Leftmost house red/blue: next house green, a2=5 ways for remaining houses.
a4=a3+2⋅a2=21
n houses
Leftmost house green: an−1 ways for the remaining houses.
Leftmost house red/blue: next house green and an−2 ways each for the remaining houses.
So, in general:
With this formula, we can calculate a10=1365.
Log in to reply
Yup...........same approach as mine!!! :)