ต้องบอกก่อนว่าบทนี้จะไม่เหมือนกับ Sequence & Series ในมอปลายนะ จริง ๆ ก็เหมือนนั่นแหละ แต่ว่าอันนี้จะมองในภาพกว้าง ไม่ได้มีสมการมาให้ตรง ๆ ต้องวิเคราะห์เอง โดยใช้ Tool ที่สอนในบทนี้
- Tool for analyzing properties of recursive algorithm
- A recurrence a relation for the sequence is an equation that relates to certain of its predecessors
- Initial Conditions for the sequence are explicitly given values for a finite number of terms of the sequence.
- สิ่งที่ควรรู้
Recurrence Relation ต้อง depend on กับ พจน์ก่อนหน้า ด้วยนะ!
- ถ้าสมมติว่าเป็น แบบนี้ไม่ไช่ จะเรียกว่า Explicit formula
Solving Recurrence Relations
Derive Explicit Formula
- To solve a recurrence relation involving is to find an “explicit formula” for the general term
- In this section we discuss two methods of solving recurrence relations
Iterative Unfolding
-
We use the recurrence relation to write the -th term in terms of certain of its predecessors
- We then successively use the recurrence relation to replace each of by certain of their predecessors. We continue until an explicit formula is obtained.
- หรือว่าทำไปเรื่อย ๆ จนกว่าจะเจอ Pattern แล้วสามารถเขียนใน Term ได้นะ
-
ต้องใช้
- Recurrence Relation
- Initial Conditions
ทั้งคู่เพื่อให้ได้ Explicit Formula
Example
- โดยมี Initial condition เป็น
- เรียกขั้นตอนแรกว่า Iteratively unfold the recurrence relation
- ต่อไปเราก็จะ make use จาก นะ โดยให้ → (เรียกขั้นตอนนี้ว่า Make use of the initial condition)
Things You Should Know
Linear Homogeneous Recurrence Relations with Constant Coefficients (LHRRCC)
- A linear homogeneous recurrence relation of order k with constant coefficients is a recurrence relation of the form
- ส่วน เป็น Real number แต่ข้อห้ามคือ
- The following are linear homogenous
- (degree 1)
- (degree 2)
- (degree 5)
- The following are NOT linear homogenous
- (not linear)
- (not homogenous เพราะมี )
- (non-constant coefficients)
Solving LHRRCC of Order 2 with Constant Coefficients
- To solve do the following:
- Determine the roots and of the quadratic equation (คำตอบจากสมการที่จะแก้ต่อไปนี้!)
- If , an explicit formula for has the form
3. Determine and using the initial conditions
- จริง ๆ อาจจะงง ๆ วิธีก็คือหา กับ โดยใช้ Initial conditions กับ ที่ให้มา ตั้งสมการดังนี้
- แล้วก็แก้สมการ 2 ตัวแปรเพื่อหาค่า
4. แทนกลับเข้าสมการ เสร็จแล้ววววว!