5

I'm currently using substitution method to solve recurrences. The problem I'm having is dealing with T(n) that have either ceilings or floors. For example in the following example see example here.

They end up using the guess: T(n) ≧ c(n+2) lg(n+2)

My first guess was T(n) ≧ n lg(n), which turns out to not work but my problem is I end up having to play around with guess to try get one to work. So questions are as follows:

  1. What is the best way to deal with these floors and ceiling in general?
  2. With regards to guesses, does this come with practice or are there betters ways of deducing the correct guess off the first shot without having to use Recursion Trees.

(PS not sure how to write equations in math notation, its my first time using this forum)

1
  • 1
    In lieu of a good answer, I would suggest an excellent book: Concrete Mathematics by Graham, Knuth & Patashnik. I have just started reading it, and one stated goal is for the reader to be able to solve recurrences without guessing. Chapter 3 covers floors and ceilings, and recurrences involving them.
    – Andrew
    Nov 7, 2014 at 8:02

1 Answer 1

1

In an attempt to answer question 2, I would like to quote the following

Ultimately, there is only one fail-safe method to solve any recurrence:

Guess the answer, and then prove it correct by induction.

Please check out the following link - https://courses.engr.illinois.edu/cs473/sp2010/notes/99-recurrences.pdf .This describe techniques to generate guesses that are guaranteed to be correct, provided you use them correctly. It was a while ago that I did anything along these lines but I also think following a process in a book as suggested by Andrew is the best solution since it is not something that can quickly be described in a forum post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.