{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 5

# Cn ln pn now we look at the two terms assuming that we

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: hose that end with Plutonium. C(n) = L(n) + P(n) Now we look at the two terms, assuming that we add one new piece to the end. 15 Given are all chains of length n-1. There are again C(n-1) of those. To which of them can we add a piece of lead? To ALL of them. Therefore, 16 Given are all chains of length n-1. There are again C(n-1) of those. To which of them can we add a piece of Plutonium? Only to those that END with a piece of LEAD!! There are L(n-1) of those. Therefore, L(n) = C(n-1) P(n) = L(n-1) 17 18 C(n) = L(n) + P(n) = C(n-1) + L(n-1) = C(n-1) + C(n-2) Back to our example: This is the Fibonacci formula. However, we have slightly different base cases here. C(3) = C(2) + C(1) = 3 + 2 = 5. That exactly what we had before. s C(1) = 2 C(2) = 3 P or L PL of LP or LL 19 20...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online