Question

Question 1. Solving Recursive Relations [3 mark]. A naive multiplication of two matrices of order n requires O(nᵒ) additions.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:
Using substitution method prove that T(n) = 7T(n/2) + cn2 has O(nlog27) complexity.
O(nlog27) = O(n2.81) (approx.)

Substitution Method:

In the substitution method, we make a guess for the solution and then we use mathematical induction to prove the guess is incorrect or correct.

For example consider the recurrence T(n) = 2T(n/2) + n

We guess the solution as T(n) = O(nLogn). Now we use inductionto prove our guess.

We need to prove that T(n) <= cnLogn. We can assume that it is true for values smaller than n.
 
T(n) = 2T(n/2) + n
    <= cn/2Log(n/2) + n
    =  cnLogn - cnLog2 + n
    =  cnLogn - cn + n
    <= cnLogn

Now solving our problem.

T(n) = 7T(n/2) + cn2

As given in the question we guess the solution as O(nlog27). Now we use induction to prove our guess.

We need to prove that T(n) <= cnlog27. We assume that it is true for the values smaller than n.

T(n) = 7T(n/2) + cn2
<= c(n/2)log27 + cn2
<= c(nlog27 - 2log27) + cn2


As we know that: blogb(x) = x. Therefore, 2log27 = 7.
Then,
T(n) <= c(nlog27 - 7) + cn2
<= cnlog27 - 7c + cn2

As c is constant therefore assume 7c = c.

So,
T(n) <= cnlog27 + cn2 - c

As nlog27 > n2. So we take O(nlog27) as our solution.

Hence T(n) = O(nlog27) or T(n) = O(n2.81) is our required solution.

Add a comment
Know the answer?
Add Answer to:
Question 1. Solving Recursive Relations [3 mark]. A naive multiplication of two matrices of order n...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT