Solving Recursion Trees with Log Properties of a Constant

In summary, the conversation is about the properties of logarithms when they are the power of a constant. The question is whether the expressions n^(log4 3) and 3^(log4 n) are equivalent and why. The answer is that they are equivalent, as shown by plugging in the expression for x in equation (1) into equation (2) and using exponent properties. This is helpful in finding the time complexity for solving a recursion tree problem.
  • #1
LauraSuh
4
0
Hi, I'd like to know the log properties when they are the power of a constant. I've searched everywhere but I can't find it. the reason I want to know it is that, when solving a recursion tree problem, my teacher got an result of n^(log4 3) but I got 3^(log4 n). the base of the log haven't changed, but i'd like to know if those are equivalent and if possible, in case the answer is that they are equal, why.
Thx in advance!
 
Mathematics news on Phys.org
  • #2
If we have to solve for x in [itex]4^x=3[/itex] then we have defined a log function to answer this problem for us. We denote the answer to this problem as [itex]x=\log_43[/itex]. This means that if we plug that expression for x back into the original problem, we get

[tex]4^{\log_43}=3[/tex] (1)


Now, for your answer
[tex]3^{\log_4n}[/tex] (2)

notice that we can plug the expression I gave in equation (1) into equation (2) to replace the 3. i.e.

[tex]3^{\log_4n}=\left(4^{\log_43}\right)^{\log_4n}[/tex]

and by exponent properties [itex](a^b)^c=a^{bc}=a^{cb}=(a^c)^b[/itex] we then have

[tex]=\left(4^{\log_4n}\right)^{\log_43}[/tex]

But now notice the part in the brackets is equivalent to equation (1), that is, the log base 4 cancels the base of the exponent since they're the same value.

[tex]4^{\log_4n}=n[/tex]

and so you finally have that your answer is equivalent to

[tex]n^{\log_43}[/tex]
 
  • #3
Thank you so much! You're like my super hero right now! =)
 
  • #4
You're welcome :smile: By the way, may I ask what the question was? I'm guessing you were finding a time complexity, but I'd just like to see how that order arose.
 
  • #5


Hello, thank you for your question. The log properties for a constant raised to a power are as follows:

1. loga (x^b) = b * loga (x)
2. loga (ab) = loga (a) + loga (b)

In the case of your example, n^(log4 3) and 3^(log4 n) are not equivalent. This is because the base of the log is different in each expression. In the first expression, the base is 4, while in the second expression, the base is 3. This means that the two expressions are not equal.

However, if we rewrite the first expression as 3^(log4 n), then we can use the second log property to simplify it to 3^(log4 n) = 3^(log4 4) * 3^(log4 3) = 3 * 3^(log4 3) = 3^(log4 3+1) = 3^(log4 4) = n^(log4 3).

So, in the end, both expressions are equivalent and your teacher's result is correct. This is because the log properties allow us to manipulate the expressions to make them equivalent, even though the initial expressions may look different.

I hope this helps to clarify the log properties and how they can be used to solve recursion tree problems. Keep up the good work in your studies!
 

1. What is recursion in computer science?

Recursion is a programming technique where a function calls itself repeatedly until a certain condition is met. This allows for solving complex problems by breaking them down into smaller sub-problems.

2. How do I solve recursion trees?

To solve recursion trees, you can use log properties of a constant. This involves using logarithmic rules to simplify the expressions within the tree and solve for the base case.

3. What are log properties of a constant?

Log properties of a constant refer to the rules and properties of logarithms, which are mathematical functions that represent the inverse of exponential functions. These properties include the product rule, quotient rule, power rule, and change of base rule.

4. Why is it important to use log properties when solving recursion trees?

Using log properties allows for simplification of the expressions within the recursion tree, making it easier to solve for the base case. This technique helps to save time and effort when solving complex recursion problems.

5. What are some common applications of solving recursion trees with log properties?

Solving recursion trees with log properties is commonly used in computer science, mathematics, and engineering to solve complex problems involving recursive functions. It is also useful in analyzing algorithms and data structures, as well as in cryptography and pattern recognition.

Similar threads

Replies
3
Views
1K
  • General Math
Replies
2
Views
9K
Replies
3
Views
2K
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
1K
  • Programming and Computer Science
Replies
5
Views
1K
Replies
19
Views
1K
Replies
13
Views
2K
Replies
3
Views
2K
  • Differential Equations
Replies
7
Views
2K
Back
Top