Tessellate S.T.E.M.S. (2019) - Computer Science - School - Set 4 - Subjective Problem 1

There are 1010 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 1010 houses?


This problem is a part of Tessellate S.T.E.M.S (2019)

#Combinatorics

Note by Tessellate Stems Computer Science
2 years, 5 months ago

No vote yet
1 vote

  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:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

Let's first try smaller cases and write an a_n as the number of ways to paint n n houses according to the rules.

1 house

Obviously, there are a1=3 a_1 = 3 ways.

2 houses

If the left house is green, then there are a1=3 a_1 = 3 ways.
If the left house is red or blue, then there is only one way each.

a2=a1+21=5 a_2 = a_1 + 2 \cdot 1 = 5

3 houses

If the leftmost house is green, then there are a2=5 a_2 = 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+23=11 a_3 = a_2 + 2 \cdot 3 = 11

4 houses

Leftmost house green: a3=11 a_3 = 11 Leftmost house red/blue: next house green, a2=5 a_2 = 5 ways for remaining houses.

a4=a3+2a2=21 a_4 = a_3 + 2 \cdot a_2 = 21

n n houses

Leftmost house green: an1 a_{n-1} ways for the remaining houses.
Leftmost house red/blue: next house green and an2 a_{n-2} ways each for the remaining houses.

So, in general:

an={3, for n=15, for n=2an1+2an2, for n>2 a_n = \begin{cases} 3, &\ \text{for } n=1 \\ 5, &\ \text{for } n=2 \\ a_{n-1} + 2 a_{n-2}, &\ \text{for } n>2 \end{cases}

With this formula, we can calculate a10=1365 a_{10} = \boxed{1365} .

Henry U - 2 years, 5 months ago

Log in to reply

Yup...........same approach as mine!!! :)

Aaghaz Mahajan - 2 years, 5 months ago
×

Problem Loading...

Note Loading...

Set Loading...