Question about solving recurrences/difference equations

  • Context: Graduate 
  • Thread starter Thread starter homomorphism
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around methods for solving recurrences or difference equations commonly encountered in algorithm analysis. Participants explore various approaches to express and solve a specific recurrence relation, T(n) = 2T(n/2) + n, without relying on the master theorem or recursion trees.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about a standard symbolic method for solving recurrences, specifically how to express T(n) = 2T(n/2) + n in difference equation form.
  • Another participant suggests substituting n with 2^i, leading to the expression T(2^k) = 2T(2^{k-1}) + 2^k, although they question its utility.
  • A different participant proposes the use of z-transforms or Fourier transforms as potential methods for solving the recurrence.
  • One participant mentions using WolframAlpha to solve the recurrence and questions the method employed by the engine to derive the solution.

Areas of Agreement / Disagreement

Participants express various methods and approaches to the problem, but there is no consensus on a single method or solution. The discussion remains unresolved regarding the best approach to express and solve the recurrence.

Contextual Notes

Some participants express uncertainty about how to correctly formulate the difference equation and the implications of their substitutions. There are also unresolved questions about the methods used by WolframAlpha to solve the recurrence.

homomorphism
Messages
19
Reaction score
0
i want to know if there's any standard symbolic method of solving recurrences often found in the analysis of algorithms. many of these recurrences are readily solved by the master theorem. let's say we don't want to use that (for whatever reason) and we don't want to draw recursion trees.

let's take for example:
T(n) = 2T(n/2) + n

how exactly would we put this in difference equation form? something like T[i+1] = kT + n? k is some constant (basically some function on the 2) after we do that it is straightforward (i think) to use some symbolic differentiation and then solve the recurrence. We should be getting nlogn (log base 2) as the solution to this recurrence. but i don't think I'm writing down the actual difference equation correctly.
 
Physics news on Phys.org
Let n=2i

T(n) = 2T(n/2) + n will gives T(2i) = 2T(i) + 2i.

How am I going to expressed this as T[i+1] = kT + n ? :confused:
 
For T(n) = 2T(n/2) + n you can set n=2^k
Then you have T(2^k) = 2T(2^{k-1}) + 2^k. I don't know if that helps.
 
Wow that's good idea Edgardo. So what do we do next to solve T(n) = 2T(n/2) + n ?

May be we need to use z-transform or Fourier transform directly.
 
homomorphism said:
i want to know if there's any standard symbolic method of solving recurrences often found in the analysis of algorithms. many of these recurrences are readily solved by the master theorem. let's say we don't want to use that (for whatever reason) and we don't want to draw recursion trees.

let's take for example:
T(n) = 2T(n/2) + n

how exactly would we put this in difference equation form? something like T[i+1] = kT + n? k is some constant (basically some function on the 2) after we do that it is straightforward (i think) to use some symbolic differentiation and then solve the recurrence. We should be getting nlogn (log base 2) as the solution to this recurrence. but i don't think I'm writing down the actual difference equation correctly.


Let n=2m.
T(n) = 2T(n/2) + n will gives T(2m) = 2T(m) + 2n.

I have just come to know about WolframAlpha at Sticky: WolframAlpha guide on electrical engineering forum.
Solving the http://www09.wolframalpha.com/input/?i=f(2*m)=2*f(m)+2*m,+f(1)=1", and simplify (assuming T(1)=1 )

T(2n) = 2nlog2n + 4n.

What method does the WolframAlpha engine used to get the answer?
 
Last edited by a moderator:

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 22 ·
Replies
22
Views
9K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K