A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

yrelhan4

  • one year ago

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. I just need a start. Any ideas will be greatly appreciated.

  • This Question is Closed
  1. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 12

    Basically you want to find the number of nonnegative integer solutions to below equation \[n=2a+2b+2c+d+e\]

  2. yrelhan4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    So, T(n)=3T(n-2)+2T(n-1)?

  3. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 12

    may i know how you got that

  4. yrelhan4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Well to be honest, i don't exactly know how. I have been searching for examples over the net and this is how they write a recursive function. For example, i read this question where there are n steps, and a person can either take 1 step at a time, or 2 steps at a time. We had to tell the number of ways to take n steps. and as you said, the equation that time would be a+2b=n.. and the recursive fucntion they wrote was t(n)=t(n-1)+t(n-2).. so yeah I don't exactly know how. I have been taking this for granted. I'd be very happy if could tell me more about it.

  5. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 12

    check this http://math.stackexchange.com/questions/614356/difficult-recursion-problem

  6. yrelhan4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    I checked that out before posting it here. Don't really understand it completely.

  7. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 12

    suppose \(n=1\), how many ways can you schedule \(1\) day ?

  8. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 12

    you can either `study` or `play`, so only \(2\) ways, yes ?

  9. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 12

    that means \[T(1)=2\]

  10. ganeshie8
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 12

    next let \(n=2\) and work the number of ways \(2\) days can be scheduled

  11. yrelhan4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    I get it now. Thank you very much... also, suppose i don't want the duplicates.. like, i treat "poem, study, play, homework, study" and "study, poem, play, homework, study" the same... how do I draft an algo for that? @ganeshie8

  12. yrelhan4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @Luigi0210

  13. yrelhan4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @Nurali

  14. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    no idea how you can even solve this its more of an opinion than a math question.

  15. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.