Question
I have a question regarding recurrence relations problem....If I have a hallway with length '1 by n' and 4 types of carpet: Red, Blue, Green,
I have a question regarding recurrence relations problem....If I have a hallway with length '1 by n' and 4 types of carpet: Red, Blue, Green, and Purple with sizes 1 by 5, 1 by 2, 1 by 1, and 1 by 1 respectively. There are some conditions as well, all green/purple carpets should appear AFTER red/blue carpets. Also, I cannot have green carpet AFTER purple. For example, an INCORRECT combination for a 1 by 10 hallway is 1 red carpet, 1 green carpet, 1 purple carpet, 1 green carpet, and 1 blue carpet is not allowed for the 2 reasons stated above. Because a green carpet is after a purple carpet and also the blue carpet is after green/purple. One CORRECT combination would be for the 1 by 10 hallway 1 red carpet, 1 blue carpet, 2 green carpets, and 1 purple carpet. I need to find the recurrent relation for this problem. I managed to solve most of it and came up with this so far: an= an-1 + (an-1 - an-2). However this recurrence relation does not take into account hallways that are made up of ONLY of RED and BLUE carpet. So the example I gave above would be counted in this recurrence relation because it has purple/green in the hallway. I am not sure how to count hallways with only Red/Blue carpet. Please explain how I can correct my recurrence relation to also count Red/Blue hallways. Here are some initial conditions: a0 = 1, a1 = 2, a2=4, a3=6, a4=9,a5=13, a6=18. So to clarify a6=a5+(a5-a4)+(ONLY RED/BLUE HALLWAYS) Thanks.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started