1. ## Recursion

I am using the textbook Mathematical Structures for Computer Science - A Modern Approach to Discrete Mathematics (6e) by Judith L. Gersting.

I don't understand what is going on at all in any of the section 2.4s examples. If someone could explain how the book arrives at the following answers for these questions, I would be very appreciative.

Write the first five values in the sequence
:
1. S(1) = 10
S(n) = S(n-1) + 10 for n >= 2

The books answer is: 10, 20, 30, 40, 50

7. M(1) = 2
M(2) = 2
M(n) = 2M(n - 1) + M(n - 2) for n >= 2

The books answer is: 2, 2, 6, 14, 34

2. S(1) is the first term of the sequence
S(2) is the second term of the sequence
S(3) is the third term of the sequence

S(27) is the 27th term of the sequence

S(n) is just some term of the sequence
S(n-1) is the term just prior to "just some term of the sequence"
S(n-2) is the term TWO prior to "just some term of the sequence"

Fir the first example

S(n) = S(n-1) + 10

S(1) = 10
S(2) = S(1) + 10 = 10+10 = 20
S(3) = S(2) + 10 = 20+10 = 30

You show the second example.

3. I understand what you did for #1, but I don't see how it could relate to #7. It seems odd that the first and second number in the sequence are the same.

4. M(n) = 2M(n - 1) + M(n - 2) for n >= 2

M(1) = 2
M(2) = 2
M(3) = M(2)*2 + M(1) = (2 * 2) + 2 = 6
M(4) = M(3)*2 + M(2) = (2 * 6) + 2 = 14
M(5) = M(4)*2 + M(3) = (2 * 14) + 6 = 34

I think that's the correct way to do it. Am i right?

5. Originally Posted by meditate
M(n) = 2M(n - 1) + M(n - 2) for n >= 2

M(1) = 2
M(2) = 2
M(3) = M(2)*2 + M(1) = (2 * 2) + 2 = 6
M(4) = M(3)*2 + M(2) = (2 * 6) + 2 = 14
M(5) = M(4)*2 + M(3) = (2 * 14) + 6 = 34

I think that's the correct way to do it. Am i right?
Yes!

--Chris