A student can do the things bellow:
- a. Do his homework in 2 days
- b. Write a poem in 2 days
- c. Go on a trip for 2 days
- d. Study for exams for 1 day
- e. Play pc games for 1 day
A schedule of n days can be completed by any combination of the activities above. For example 3 possible schedules for 7 days are:
- homework, poem, homework, play
- poem, study, play, homework, study
- trip, trip, trip, study
Find a recursive function T(n) that represents the number of all possible schedules for n days.
HINT: He has $T(n-1)$ ways to schedule $n-1$ days; for each of those ways, he can spend the $n$-th day studying for exams or playing pc games, so those $T(n-1)$ ways to schedule $n-1$ days can be extended to $2T(n-1)$ ways to spend $n$ days. That accounts for all of the $n$-day schedules in which the last activity takes only one day.