ADA 3.1
Solving Recurrences
Substitution Method
Textbook Chapter 4.3 - The substitution method for solving recurrences 課本 p.104
Textbook Chapter 4.4 - The recursion-tree method for solving recurrences 課本 p.109
Textbook Chapter 4.5 - The master method for solving recurrences 課本 p.114
Textbook Chapter 4.3 - The substitution method for solving recurrences
→
Proof
n = 1 , trivial
n > 1,
💡 這裡需要查一下對數運算
所以
💡 Substitution method (取代法)
guess a bound and then prove by induction
取代法流程: 猜 → 驗證 → 解決(沒辦法解決就重猜)
There exists postive constant s.t. for all
Use induction to find the constant
inductive hypothesis
💡
e.g.
holds when
上面的例子太鬆了找一個再緊一點的試試看
There exists postive constant s.t. for all
Use induction to find the constant
inductive hypothesis
💡 證不出來…
猜錯了?還是推導錯了?
💡 沒猜錯,推導也沒有錯
這次取代法的小盲點
所以策略就是,希望在計算的過程中生出一個負的東西可以把 bn 消掉
There exists postive constant s.t. for all
💡 Strengthen the induction hypothesis by substracting a low-order term
Use induction to find the constant
holds for
,
inductive hypothesis
💡
e.g.
holds when