Code: Select all
/¤\ /¤\
/ \ / \
/ \ / \
¤/ \¤/ \¤
| | |
| | |
| | |
The fence above has 2 spikes. The ¤'s represent marbles that are there for decoration, but currently they're all green! (as you can see) So I want to paint some of them red, to improve the looks. But there is a problem: something is wrong with the paint, so whenever I paint a marble on the top red, the paint runs down to the two marbles below, & colours those red too.
How many patterns are possible if my fence has n spikes?
(Example: for n=1 there are 5 patterns: all green; bottom left red; bottom right red; both at the bottom red; or all red.)
(Disclaimer: I intentionally tried to avoid very formal mathematical language while formulating this question.)