Solving recurrence by changing variables

So, to change ##m## to ##k##, you can substitute ##k=2m##, which gives ##S(k)=2S(\frac{k}{2}) + \frac{k}{2}##. Therefore, to change ##m## to ##k## in the equation, you can substitute ##m=\frac{k}{2}##.In summary, to change 'm' to 'k' in the equation ##S(k) = 2 S(\frac{k}{2}) + m##, you can substitute ##m=\frac{k}{2}##.
  • #1
22990atinesh
143
1
Consider the below recurrence
##T(n) = 2 T(\sqrt(n)) + \log n##
substituting ##\log n = m \implies n = 2^m##
##T(2^m) = 2 T(2^{\frac{m}{2}}) + m##
substituting ##S(k) = T(2^m)## I'm getting below equation
##S(k) = 2 S(\frac{k}{2}) + m##
How can I change 'm' to 'k' in above equation.
 
Technology news on Phys.org
  • #2
22990atinesh said:
Consider the below recurrence
##T(n) = 2 T(\sqrt(n)) + \log n##
substituting ##\log n = m \implies n = 2^m##
##T(2^m) = 2 T(2^{\frac{m}{2}}) + m##
substituting ##S(k) = T(2^m)## I'm getting below equation
##S(k) = 2 S(\frac{k}{2}) + m##
How can I change 'm' to 'k' in above equation.
You need to define the relation between ##k## and ##m## when setting ##S(k) = T(2^m)##.
You could define ##S## by ##S(m)=T(2^m)##.
Then you get ##S(m)=2S(\frac{m}{2}) + m##.
 
  • Like
Likes 22990atinesh

1. What is the purpose of changing variables when solving a recurrence?

The purpose of changing variables in solving a recurrence is to simplify the recurrence relation and make it easier to solve. By substituting a new variable, the recurrence can be transformed into a new form that is easier to analyze and solve.

2. How do you choose which variable to substitute?

The choice of variable to substitute depends on the type of recurrence. For linear recurrences, it is often helpful to choose a variable that will eliminate the coefficient of the highest order term. For non-linear recurrences, it may be necessary to choose a variable that will introduce a new term to cancel out an existing term.

3. Can changing variables always solve a recurrence?

No, changing variables is not a guaranteed method for solving a recurrence. It may not always lead to a simpler form of the recurrence, and in some cases, it may not lead to a closed form solution. Other methods such as iteration and generating functions may be more effective in solving certain types of recurrences.

4. Is there a specific set of steps to follow when changing variables to solve a recurrence?

There is no set algorithm or formula for changing variables to solve a recurrence. It requires careful observation and analysis of the recurrence to determine the appropriate substitution. It may also involve trial and error to find the most effective substitution.

5. What are some common pitfalls when using changing variables to solve a recurrence?

One common pitfall is choosing a variable that does not lead to a simpler form of the recurrence, making it more difficult to solve. Another pitfall is not considering the initial conditions of the recurrence, which may affect the choice of substitution. It is also important to check the validity of the substitution and make sure it does not introduce any extraneous solutions.

Similar threads

  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
31
Views
2K
  • Programming and Computer Science
Replies
6
Views
849
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
Replies
20
Views
1K
  • Introductory Physics Homework Help
Replies
16
Views
410
  • Programming and Computer Science
Replies
2
Views
979
Back
Top