Final answer:
To solve the recurrence relation T(n) = 3T(n) + log n by making a change of variables, we can define a new variable m such that n = 2^m. Then the recurrence becomes T(2^m) = 3T(2^m) + log(2^m). The solution to the recurrence relation T(n) = 3T(n) + log n, when expressed in terms of n, is T(n) = -log n/2.
Step-by-step explanation:
To solve the recurrence relation T(n) = 3T(n) + log n by making a change of variables, we can define a new variable m such that n = 2^m. Then the recurrence becomes T(2^m) = 3T(2^m) + log(2^m). We can simplify this to T(2^m) = 3T(2^m) + m. Now, let's solve this new recurrence relation.
- Substitute T(2^m) with T(m) to simplify the notation: T(m) = 3T(m) + m.
- Now, subtract 3T(m) from both sides: T(m) - 3T(m) = m.
- Simplify the left side of the equation: -2T(m) = m.
- Divide both sides by -2: T(m) = -m/2.
Since m = log n, we can substitute it back into the equation: T(n) = -log n/2.
Therefore, the solution to the recurrence relation T(n) = 3T(n) + log n, when expressed in terms of n, is T(n) = -log n/2.