Solving for specific variable when solving a recurrence equation

In summary, the conversation discusses a recurrence equation with a constant C and the attempt to solve it using a top-down approach. The equation is unrolled and rewritten to find the pattern, but running into difficulty solving for a specific variable. The solution is suggested to redo the unrolling process to get a more solvable equation.
  • #1
ATroelstein
15
0
I have the following recurrence equation, where C is just some constant:
$$
T(n) = 0, n = 1\\
T(n) = T(\frac{n-1}{2}) + 2C, n > 1
$$

Using a top-down approach to unrolling the equation to find the pattern, I get:

$$
T(n) = T(\frac{n-k}{2^{k}}) + 2kC
$$

Now I want to solve for k and associate it with n to finish solving the equation without k in it. In order to get:

$$
T(\frac{n-k}{2^{k}}) = T(1)
$$

Then:

$$
n-k = 2^{k}
$$

The problem I am running into is that I'm having trouble solving this for k. I have worked through many other examples where:

$$
n = 2^{k}
$$

and then I know:

$$
k = log_2 n
$$

But having the n-k is making it difficult for me to solve for k. Thanks in advance.
 
Physics news on Phys.org
  • #2
ATroelstein said:
Using a top-down approach to unrolling the equation to find the pattern, I get:

$$
T(n) = T(\frac{n-k}{2^{k}}) + 2kC
$$

Hi ATroelstein! :)

The equation you're trying to solve is not very solvable.

But perhaps you could redo the unrolling of the equation and get:
$$
T(n) = T\left(\frac{n-2^k+1}{2^k}\right) + 2kC
$$
 

FAQ: Solving for specific variable when solving a recurrence equation

How do you solve for a specific variable in a recurrence equation?

To solve for a specific variable in a recurrence equation, you need to use algebraic manipulation and substitution. Start by isolating the term with the variable you want to solve for, and then substitute any other known values for the other variables in the equation. From there, you can use algebraic techniques to solve for the specific variable.

What is a recurrence equation?

A recurrence equation is a mathematical formula that describes a sequence or pattern of values. It is a type of recursive function where each term in the sequence is defined in terms of previous terms. Recurrence equations are commonly used in computer science and other fields to model and solve problems.

What are some common techniques for solving recurrence equations?

Some common techniques for solving recurrence equations include substitution, iteration, and generating functions. These methods involve manipulating the recurrence equation in different ways to find a closed-form solution or a general formula for the sequence. In some cases, it may also be possible to use specialized algorithms or software to solve more complex recurrence equations.

Can all recurrence equations be solved for a specific variable?

No, not all recurrence equations can be solved for a specific variable. In some cases, the recurrence equation may be too complex or may not have a closed-form solution. In these cases, other methods may be used to approximate the solution or find a general formula for the sequence.

How are recurrence equations used in real-world applications?

Recurrence equations are used in a variety of real-world applications, including finance, biology, and computer science. They can be used to model and analyze patterns and sequences, such as stock market trends, population growth, or the time complexity of algorithms. By solving for specific variables in recurrence equations, scientists and researchers can better understand and predict these real-world phenomena.

Similar threads

Replies
1
Views
605
Replies
6
Views
1K
Replies
1
Views
1K
Replies
13
Views
1K
Replies
1
Views
1K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
5
Views
2K
Back
Top