O(2^n)

The Gateway to Computer Science Excellence

+1 vote

Question:

$T(1)=1$

$T(n) = 2 T(n - 1) + n$

evaluates to?

Can anyone solve it by substitution method?

Given answer

$T(n) = 2^{n+1} - (n+2)$

How?

0

What I think is that if you try to somehow convert the expression you are getting into the given answer it's not easy and not obvious. The question seems like selection and elimination type. If you have four options then successively find out values, say upto T(5), and see which option's result is matching with your result.

There will be a way to adjust the expression by adding or subtracting some terms to get the answer but it will be cubersome.

There will be a way to adjust the expression by adding or subtracting some terms to get the answer but it will be cubersome.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.6k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.5k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,833 questions

57,733 answers

199,459 comments

107,895 users