What is the height of the recursion tree for t(n) when n is a power of 2?

Click For Summary

Discussion Overview

The discussion revolves around the recursive function t(n) defined for powers of 2, specifically focusing on determining the height of the recursion tree and the sum of values at a specific level. Participants explore the implications of the recursive definition and attempt to derive answers related to the tree structure and its properties.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Exploratory

Main Points Raised

  • One participant outlines the recursive definition of t(n) and attempts to analyze the recursion tree, noting that each level has nodes valued at ##\frac{n+1}{2^k}## with ##3^k## nodes at height k.
  • Another participant questions the clarity of the recursive definition and suggests a correction to the notation.
  • A participant proposes evaluating specific cases like t(2) and t(4) to better understand the recursion, expressing uncertainty about the term "recursion tree."
  • There is a mention of confusion regarding the multiple-choice options available for the height of the tree, indicating a possible misunderstanding in the manipulation of the recursive formula.
  • Participants express uncertainty about the sum of values at level 3 and how to derive it correctly, with one suggesting a potential answer that does not match the available options.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the correct interpretation of the recursion tree or the calculations involved. There are multiple competing views on how to approach the problem and derive the necessary values.

Contextual Notes

There are unresolved assumptions regarding the manipulation of the recursive formula and the interpretation of the recursion tree. The discussion reflects varying levels of understanding of the recursive definition and its implications.

scorpius1782
Messages
107
Reaction score
0

Homework Statement


Let the function t(n) be defined recursively by:

##t(1) = 1##
##t(n) = 3t(\frac{n}{2}) + n + 1## for n a power of two greater than 1.

Draw several levels of the recursion tree for t, and answer the following:

What will the height of the tree be if n is a power of 2?

And what is the sum of values on level 3. assume ##n\geq 16##

Homework Equations


The Attempt at a Solution



I did the tree where (n+1) is the root. Each successive level is ##\frac{n+1}{2^k}## with ##3^k## nodes at each height (height =k). So, from my lecture notes to get height I set ##\frac{n+1}{2^k}=1##. I'm sort of stuck here. I do not have the option (it is multiple choice) of ##k=log_2(n+1)## so I must have don't something wrong or I need to manipulate my answer in a way that isn't clear to me.

For the sum of values I have 3^3 nodes each of value ##\frac{n+1}{2^3}## I thought that I could just say ##3^3\frac{n+1}{2^3}## but this is not an answer either. The closest possible answer was ##3^3n+3^3##

Thanks for any help!
 
Last edited:
Physics news on Phys.org
scorpius1782 said:

Homework Statement


Let the function t(n) be defined recursively by:

##t(1) = 1##
##t(n) = 3t\frac{n}{2} + n + 1## for n a power of two greater than 1.
I don't understand the line above.

Did you mean this:
##t(n) = 3 t(\frac{n}{2}) + n + 1##
scorpius1782 said:
Draw several levels of the recursion tree for t, and answer the following:

What will the height of the tree be if n is a power of 2?

And what is the sum of values on level 3. assume ##n\geq 16##

Homework Equations


The Attempt at a Solution



I did the tree where (n+1) is the root. Each successive level is ##\frac{n+1}{2^k}## with ##3^k## nodes at each height (height =k). So, from my lecture notes to get height I set ##\frac{n+1}{2^k}=1##. I'm sort of stuck here. I do not have the option (it is multiple choice) of ##k=log_2(n+1)## so I must have don't something wrong or I need to manipulate my answer in a way that isn't clear to me.

For the sum of values I have 3^3 nodes each of value ##\frac{n+1}{2^3}## I thought that I could just say ##3^3\frac{n+1}{2^3}## but this is not an answer either. The closest possible answer was ##3^3n+3^3##

Thanks for any help!
 
Yes sorry, i fixed it. I pasted plain text and took them out for some reason.
 
I would start playing with it. You're given t(1) = 1. What's t(2)? t(4)? And so on. I'm not sure what is meant by "recursion tree" other than how many times the formula will be used to evaluate t(n).
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
867
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K