Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Assignment 7, Due: 30th November, 23:59

All questions carry equal marks.

1 1 1 1 n
(Q1) Prove the following by induction: + + … =
2× 5 5 ×8 8 ×11 ( 3 n−1 )( 3 n+1 ) 6 n+ 4

(For other interesting problems using induction, look at problems 1, 2, 3, 10-18, on


https://www.math.waikato.ac.nz/~hawthorn/MATH102/InductionProblems.pdf )

(Q2) Consider the following recursive algorithm:

Let T (n) be the running time of the above algorithm, when the input is n. Express T (n) as a
recursive formula in terms of T (n−1) , T (n−2) and, maybe, some integers. Also, write the
base cases. (see the videos on recursive functions).
Please note above, that the function definition of ‘weird(n)’ does not follow the syntax of any programming
language --- although it is close to Python. It was just written in a way so that you can understand what it is

GO TO THE NEXT PAGE FOR QUESTION 3.


(Q3) Consider the following recursive formulae:
T ( 0 )=3

T ( n )=5 T ( n−1 )+ 6 , whenever n is an integer greater than 0.

Remember that the dots mean multiplication (they are typically written higher than where the decimal points are
placed, as you can see below) .

We want to calculate a non-recursive formula for T(n). Someone reasoned like follows:
We know that T(0) = 3. Hence by the recursive formula,
T ( 1 )=5 T ( 0 ) +6=5∙ 3+6
T ( 2 ) =5T ( 1 )+ 6=5 ∙ 5∙ 3+5 ∙ 6+6
T ( 3 )=5 T ( 2 ) +6=5∙ 5 ∙5 ∙ 3+5 ∙5 ∙ 6+5 ∙ 6+6

And so on ….

So, it ‘seems’, that T ( n )=3 ∙5 n+ 6 ∙5n−1 +6 ∙ 5n−2 +… 6 ∙5 0

Note above, that after the first term, 6 is common.

Taking it common above, the expression becomes: T ( n )=3 ∙5 n+ 6(50 +51 +… 5n −1 ).

But note, this is a ‘guess’. One still needs to prove by induction, which is what the question
asked you to do.

(a) From the above numerical experiment, how would you get to the ‘guess’ that
6
T ( n )=3 ∙5 n+ ( 5 n−1 ). Explain in just 1 – 3 sentences.
4
(b) Prove this formula using induction. That is, the recursive formula at the top of this
n 6 n
question, can also be given by: T ( n )=3 ∙5 + ( 5 −1 )
4

You might also like