Recurrent Relation Problem
up vote
0
down vote
favorite
I am having trouble finishing this problem for finding a recurrent relation. The problem is:
$T(n)=8T(n/2) + n^3$, $T(1)=1$ ; find $T(n)$
So I am using iteration to generate a general formula for the equation and have managed to get to the following point after performing three iterations:
$8^3T(n/2^3) + n^3 + n^3+ n^3$
I make this out to be:
$8^kT(n/2^k) + n^3(1+1+1+.... 1^k-1)$
From here I struggle and do not quite know how to proceed to find the answer. If anyone can help me it would be much appreciated.
discrete-mathematics
|
show 3 more comments
up vote
0
down vote
favorite
I am having trouble finishing this problem for finding a recurrent relation. The problem is:
$T(n)=8T(n/2) + n^3$, $T(1)=1$ ; find $T(n)$
So I am using iteration to generate a general formula for the equation and have managed to get to the following point after performing three iterations:
$8^3T(n/2^3) + n^3 + n^3+ n^3$
I make this out to be:
$8^kT(n/2^k) + n^3(1+1+1+.... 1^k-1)$
From here I struggle and do not quite know how to proceed to find the answer. If anyone can help me it would be much appreciated.
discrete-mathematics
1
T(0) doesn't seem to fit with the recurrence relation
– Yuriy S
Nov 17 at 10:24
T(0) is all that was given, T(1) was not given.
– Noob Coder
Nov 17 at 10:34
Substitute $n=0$ into your equation. You get $7=0$. This problem has no solution
– Yuriy S
Nov 17 at 10:36
Either you copied it wrong, or whoever gave it to you is wrong.
– Yuriy S
Nov 17 at 10:37
Well maybe the question maker made an error then?
– Noob Coder
Nov 17 at 10:38
|
show 3 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am having trouble finishing this problem for finding a recurrent relation. The problem is:
$T(n)=8T(n/2) + n^3$, $T(1)=1$ ; find $T(n)$
So I am using iteration to generate a general formula for the equation and have managed to get to the following point after performing three iterations:
$8^3T(n/2^3) + n^3 + n^3+ n^3$
I make this out to be:
$8^kT(n/2^k) + n^3(1+1+1+.... 1^k-1)$
From here I struggle and do not quite know how to proceed to find the answer. If anyone can help me it would be much appreciated.
discrete-mathematics
I am having trouble finishing this problem for finding a recurrent relation. The problem is:
$T(n)=8T(n/2) + n^3$, $T(1)=1$ ; find $T(n)$
So I am using iteration to generate a general formula for the equation and have managed to get to the following point after performing three iterations:
$8^3T(n/2^3) + n^3 + n^3+ n^3$
I make this out to be:
$8^kT(n/2^k) + n^3(1+1+1+.... 1^k-1)$
From here I struggle and do not quite know how to proceed to find the answer. If anyone can help me it would be much appreciated.
discrete-mathematics
discrete-mathematics
edited Nov 17 at 10:40
asked Nov 17 at 10:17
Noob Coder
63
63
1
T(0) doesn't seem to fit with the recurrence relation
– Yuriy S
Nov 17 at 10:24
T(0) is all that was given, T(1) was not given.
– Noob Coder
Nov 17 at 10:34
Substitute $n=0$ into your equation. You get $7=0$. This problem has no solution
– Yuriy S
Nov 17 at 10:36
Either you copied it wrong, or whoever gave it to you is wrong.
– Yuriy S
Nov 17 at 10:37
Well maybe the question maker made an error then?
– Noob Coder
Nov 17 at 10:38
|
show 3 more comments
1
T(0) doesn't seem to fit with the recurrence relation
– Yuriy S
Nov 17 at 10:24
T(0) is all that was given, T(1) was not given.
– Noob Coder
Nov 17 at 10:34
Substitute $n=0$ into your equation. You get $7=0$. This problem has no solution
– Yuriy S
Nov 17 at 10:36
Either you copied it wrong, or whoever gave it to you is wrong.
– Yuriy S
Nov 17 at 10:37
Well maybe the question maker made an error then?
– Noob Coder
Nov 17 at 10:38
1
1
T(0) doesn't seem to fit with the recurrence relation
– Yuriy S
Nov 17 at 10:24
T(0) doesn't seem to fit with the recurrence relation
– Yuriy S
Nov 17 at 10:24
T(0) is all that was given, T(1) was not given.
– Noob Coder
Nov 17 at 10:34
T(0) is all that was given, T(1) was not given.
– Noob Coder
Nov 17 at 10:34
Substitute $n=0$ into your equation. You get $7=0$. This problem has no solution
– Yuriy S
Nov 17 at 10:36
Substitute $n=0$ into your equation. You get $7=0$. This problem has no solution
– Yuriy S
Nov 17 at 10:36
Either you copied it wrong, or whoever gave it to you is wrong.
– Yuriy S
Nov 17 at 10:37
Either you copied it wrong, or whoever gave it to you is wrong.
– Yuriy S
Nov 17 at 10:37
Well maybe the question maker made an error then?
– Noob Coder
Nov 17 at 10:38
Well maybe the question maker made an error then?
– Noob Coder
Nov 17 at 10:38
|
show 3 more comments
2 Answers
2
active
oldest
votes
up vote
2
down vote
Hint:
Make a change of variable:
$$n=2^m \ T(n)=a(m)$$
This means that:
$$frac{n}{2}=2^{m-1}$$
Then you should substitute it into the initial equation:
$$begin{array}( T(n) & = & 8 T left(frac{n}{2} right) &+&n^3 \ downarrow & ~ & ~downarrow & ~ & downarrow \ a(m) & = & 8 a left(m-1 right) &+&2^{3m} end{array}$$
Now you get a linear recurrence:
$$a(m)=8 a(m-1)+8^{m}$$
Do you know how to solve it?
Further hint:
Consider another sequence:
$$a(m)=8^{m} b(m)$$
I am honestly lost at this point. I do not know how to get past the linear recurrence part,
– Noob Coder
Nov 17 at 19:19
@NoobCoder, what do you get after using my last hint? What does the recurrence for $b(m)$ look like?
– Yuriy S
Nov 17 at 19:32
What does b(m) equal?
– Noob Coder
Nov 17 at 19:42
@NoobCoder, substitute the expression for $a(m)$ in terms of $b(m)$ I have written into the recurrence equation for $a(m)$ I have obtained. Show me what you get, then I will answer your question
– Yuriy S
Nov 17 at 19:44
Would I be doing $a(m)/8^m$ ?
– Noob Coder
Nov 17 at 19:48
|
show 7 more comments
up vote
0
down vote
When proceeding with master theorem relations $$T(bn)=a,T(n)+f(n)$$
You can try to find a simpler relation either
$U(n)=adfrac{T(n)}{n^alpha}$
$V(n)=adfrac{T(n)}{n^alpha}+cdfrac{f(n)}{n^alpha}$
with a suitable choice of $alpha$ (depends on what $f(n)$ looks like...)
See for example some instances of the second method here : solving recurrence equations and get complexity T(n)...
But sometimes it does not work and first method is preferable.
Here we have $$T(2n)=8T(n)+8n^3$$
If you try second method on this relation ( e.g. $V(n)=8dfrac{T(n)}n+cn^2$ ), you will get nowhere, you cannot find a suitable $c$ that works.
In this case first method works fine :
Let set $U(n)=dfrac{8T(n)}{n^3}$
Then $U(2n)=dfrac{T(2n)}{n^3}=8dfrac{T(n)}{n^3}+8=U(n)+8$
We have found a simpler relation $$U(2n)=U(n)+8$$
It solves to $U(2^m)=U(1)+8m$
which is equivalent to $U(n)=U(1)+8dfrac{ln(n)}{ln(2)}=U(1)+8log_2(n)$
Finally you deduce $T(n)=dfrac{n^3U(n)}{8}=n^3(C+log_{2}(n))$
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Hint:
Make a change of variable:
$$n=2^m \ T(n)=a(m)$$
This means that:
$$frac{n}{2}=2^{m-1}$$
Then you should substitute it into the initial equation:
$$begin{array}( T(n) & = & 8 T left(frac{n}{2} right) &+&n^3 \ downarrow & ~ & ~downarrow & ~ & downarrow \ a(m) & = & 8 a left(m-1 right) &+&2^{3m} end{array}$$
Now you get a linear recurrence:
$$a(m)=8 a(m-1)+8^{m}$$
Do you know how to solve it?
Further hint:
Consider another sequence:
$$a(m)=8^{m} b(m)$$
I am honestly lost at this point. I do not know how to get past the linear recurrence part,
– Noob Coder
Nov 17 at 19:19
@NoobCoder, what do you get after using my last hint? What does the recurrence for $b(m)$ look like?
– Yuriy S
Nov 17 at 19:32
What does b(m) equal?
– Noob Coder
Nov 17 at 19:42
@NoobCoder, substitute the expression for $a(m)$ in terms of $b(m)$ I have written into the recurrence equation for $a(m)$ I have obtained. Show me what you get, then I will answer your question
– Yuriy S
Nov 17 at 19:44
Would I be doing $a(m)/8^m$ ?
– Noob Coder
Nov 17 at 19:48
|
show 7 more comments
up vote
2
down vote
Hint:
Make a change of variable:
$$n=2^m \ T(n)=a(m)$$
This means that:
$$frac{n}{2}=2^{m-1}$$
Then you should substitute it into the initial equation:
$$begin{array}( T(n) & = & 8 T left(frac{n}{2} right) &+&n^3 \ downarrow & ~ & ~downarrow & ~ & downarrow \ a(m) & = & 8 a left(m-1 right) &+&2^{3m} end{array}$$
Now you get a linear recurrence:
$$a(m)=8 a(m-1)+8^{m}$$
Do you know how to solve it?
Further hint:
Consider another sequence:
$$a(m)=8^{m} b(m)$$
I am honestly lost at this point. I do not know how to get past the linear recurrence part,
– Noob Coder
Nov 17 at 19:19
@NoobCoder, what do you get after using my last hint? What does the recurrence for $b(m)$ look like?
– Yuriy S
Nov 17 at 19:32
What does b(m) equal?
– Noob Coder
Nov 17 at 19:42
@NoobCoder, substitute the expression for $a(m)$ in terms of $b(m)$ I have written into the recurrence equation for $a(m)$ I have obtained. Show me what you get, then I will answer your question
– Yuriy S
Nov 17 at 19:44
Would I be doing $a(m)/8^m$ ?
– Noob Coder
Nov 17 at 19:48
|
show 7 more comments
up vote
2
down vote
up vote
2
down vote
Hint:
Make a change of variable:
$$n=2^m \ T(n)=a(m)$$
This means that:
$$frac{n}{2}=2^{m-1}$$
Then you should substitute it into the initial equation:
$$begin{array}( T(n) & = & 8 T left(frac{n}{2} right) &+&n^3 \ downarrow & ~ & ~downarrow & ~ & downarrow \ a(m) & = & 8 a left(m-1 right) &+&2^{3m} end{array}$$
Now you get a linear recurrence:
$$a(m)=8 a(m-1)+8^{m}$$
Do you know how to solve it?
Further hint:
Consider another sequence:
$$a(m)=8^{m} b(m)$$
Hint:
Make a change of variable:
$$n=2^m \ T(n)=a(m)$$
This means that:
$$frac{n}{2}=2^{m-1}$$
Then you should substitute it into the initial equation:
$$begin{array}( T(n) & = & 8 T left(frac{n}{2} right) &+&n^3 \ downarrow & ~ & ~downarrow & ~ & downarrow \ a(m) & = & 8 a left(m-1 right) &+&2^{3m} end{array}$$
Now you get a linear recurrence:
$$a(m)=8 a(m-1)+8^{m}$$
Do you know how to solve it?
Further hint:
Consider another sequence:
$$a(m)=8^{m} b(m)$$
edited Nov 17 at 20:00
answered Nov 17 at 11:58
Yuriy S
15.3k433115
15.3k433115
I am honestly lost at this point. I do not know how to get past the linear recurrence part,
– Noob Coder
Nov 17 at 19:19
@NoobCoder, what do you get after using my last hint? What does the recurrence for $b(m)$ look like?
– Yuriy S
Nov 17 at 19:32
What does b(m) equal?
– Noob Coder
Nov 17 at 19:42
@NoobCoder, substitute the expression for $a(m)$ in terms of $b(m)$ I have written into the recurrence equation for $a(m)$ I have obtained. Show me what you get, then I will answer your question
– Yuriy S
Nov 17 at 19:44
Would I be doing $a(m)/8^m$ ?
– Noob Coder
Nov 17 at 19:48
|
show 7 more comments
I am honestly lost at this point. I do not know how to get past the linear recurrence part,
– Noob Coder
Nov 17 at 19:19
@NoobCoder, what do you get after using my last hint? What does the recurrence for $b(m)$ look like?
– Yuriy S
Nov 17 at 19:32
What does b(m) equal?
– Noob Coder
Nov 17 at 19:42
@NoobCoder, substitute the expression for $a(m)$ in terms of $b(m)$ I have written into the recurrence equation for $a(m)$ I have obtained. Show me what you get, then I will answer your question
– Yuriy S
Nov 17 at 19:44
Would I be doing $a(m)/8^m$ ?
– Noob Coder
Nov 17 at 19:48
I am honestly lost at this point. I do not know how to get past the linear recurrence part,
– Noob Coder
Nov 17 at 19:19
I am honestly lost at this point. I do not know how to get past the linear recurrence part,
– Noob Coder
Nov 17 at 19:19
@NoobCoder, what do you get after using my last hint? What does the recurrence for $b(m)$ look like?
– Yuriy S
Nov 17 at 19:32
@NoobCoder, what do you get after using my last hint? What does the recurrence for $b(m)$ look like?
– Yuriy S
Nov 17 at 19:32
What does b(m) equal?
– Noob Coder
Nov 17 at 19:42
What does b(m) equal?
– Noob Coder
Nov 17 at 19:42
@NoobCoder, substitute the expression for $a(m)$ in terms of $b(m)$ I have written into the recurrence equation for $a(m)$ I have obtained. Show me what you get, then I will answer your question
– Yuriy S
Nov 17 at 19:44
@NoobCoder, substitute the expression for $a(m)$ in terms of $b(m)$ I have written into the recurrence equation for $a(m)$ I have obtained. Show me what you get, then I will answer your question
– Yuriy S
Nov 17 at 19:44
Would I be doing $a(m)/8^m$ ?
– Noob Coder
Nov 17 at 19:48
Would I be doing $a(m)/8^m$ ?
– Noob Coder
Nov 17 at 19:48
|
show 7 more comments
up vote
0
down vote
When proceeding with master theorem relations $$T(bn)=a,T(n)+f(n)$$
You can try to find a simpler relation either
$U(n)=adfrac{T(n)}{n^alpha}$
$V(n)=adfrac{T(n)}{n^alpha}+cdfrac{f(n)}{n^alpha}$
with a suitable choice of $alpha$ (depends on what $f(n)$ looks like...)
See for example some instances of the second method here : solving recurrence equations and get complexity T(n)...
But sometimes it does not work and first method is preferable.
Here we have $$T(2n)=8T(n)+8n^3$$
If you try second method on this relation ( e.g. $V(n)=8dfrac{T(n)}n+cn^2$ ), you will get nowhere, you cannot find a suitable $c$ that works.
In this case first method works fine :
Let set $U(n)=dfrac{8T(n)}{n^3}$
Then $U(2n)=dfrac{T(2n)}{n^3}=8dfrac{T(n)}{n^3}+8=U(n)+8$
We have found a simpler relation $$U(2n)=U(n)+8$$
It solves to $U(2^m)=U(1)+8m$
which is equivalent to $U(n)=U(1)+8dfrac{ln(n)}{ln(2)}=U(1)+8log_2(n)$
Finally you deduce $T(n)=dfrac{n^3U(n)}{8}=n^3(C+log_{2}(n))$
add a comment |
up vote
0
down vote
When proceeding with master theorem relations $$T(bn)=a,T(n)+f(n)$$
You can try to find a simpler relation either
$U(n)=adfrac{T(n)}{n^alpha}$
$V(n)=adfrac{T(n)}{n^alpha}+cdfrac{f(n)}{n^alpha}$
with a suitable choice of $alpha$ (depends on what $f(n)$ looks like...)
See for example some instances of the second method here : solving recurrence equations and get complexity T(n)...
But sometimes it does not work and first method is preferable.
Here we have $$T(2n)=8T(n)+8n^3$$
If you try second method on this relation ( e.g. $V(n)=8dfrac{T(n)}n+cn^2$ ), you will get nowhere, you cannot find a suitable $c$ that works.
In this case first method works fine :
Let set $U(n)=dfrac{8T(n)}{n^3}$
Then $U(2n)=dfrac{T(2n)}{n^3}=8dfrac{T(n)}{n^3}+8=U(n)+8$
We have found a simpler relation $$U(2n)=U(n)+8$$
It solves to $U(2^m)=U(1)+8m$
which is equivalent to $U(n)=U(1)+8dfrac{ln(n)}{ln(2)}=U(1)+8log_2(n)$
Finally you deduce $T(n)=dfrac{n^3U(n)}{8}=n^3(C+log_{2}(n))$
add a comment |
up vote
0
down vote
up vote
0
down vote
When proceeding with master theorem relations $$T(bn)=a,T(n)+f(n)$$
You can try to find a simpler relation either
$U(n)=adfrac{T(n)}{n^alpha}$
$V(n)=adfrac{T(n)}{n^alpha}+cdfrac{f(n)}{n^alpha}$
with a suitable choice of $alpha$ (depends on what $f(n)$ looks like...)
See for example some instances of the second method here : solving recurrence equations and get complexity T(n)...
But sometimes it does not work and first method is preferable.
Here we have $$T(2n)=8T(n)+8n^3$$
If you try second method on this relation ( e.g. $V(n)=8dfrac{T(n)}n+cn^2$ ), you will get nowhere, you cannot find a suitable $c$ that works.
In this case first method works fine :
Let set $U(n)=dfrac{8T(n)}{n^3}$
Then $U(2n)=dfrac{T(2n)}{n^3}=8dfrac{T(n)}{n^3}+8=U(n)+8$
We have found a simpler relation $$U(2n)=U(n)+8$$
It solves to $U(2^m)=U(1)+8m$
which is equivalent to $U(n)=U(1)+8dfrac{ln(n)}{ln(2)}=U(1)+8log_2(n)$
Finally you deduce $T(n)=dfrac{n^3U(n)}{8}=n^3(C+log_{2}(n))$
When proceeding with master theorem relations $$T(bn)=a,T(n)+f(n)$$
You can try to find a simpler relation either
$U(n)=adfrac{T(n)}{n^alpha}$
$V(n)=adfrac{T(n)}{n^alpha}+cdfrac{f(n)}{n^alpha}$
with a suitable choice of $alpha$ (depends on what $f(n)$ looks like...)
See for example some instances of the second method here : solving recurrence equations and get complexity T(n)...
But sometimes it does not work and first method is preferable.
Here we have $$T(2n)=8T(n)+8n^3$$
If you try second method on this relation ( e.g. $V(n)=8dfrac{T(n)}n+cn^2$ ), you will get nowhere, you cannot find a suitable $c$ that works.
In this case first method works fine :
Let set $U(n)=dfrac{8T(n)}{n^3}$
Then $U(2n)=dfrac{T(2n)}{n^3}=8dfrac{T(n)}{n^3}+8=U(n)+8$
We have found a simpler relation $$U(2n)=U(n)+8$$
It solves to $U(2^m)=U(1)+8m$
which is equivalent to $U(n)=U(1)+8dfrac{ln(n)}{ln(2)}=U(1)+8log_2(n)$
Finally you deduce $T(n)=dfrac{n^3U(n)}{8}=n^3(C+log_{2}(n))$
answered Nov 17 at 23:09
zwim
11.2k628
11.2k628
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3002171%2frecurrent-relation-problem%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
T(0) doesn't seem to fit with the recurrence relation
– Yuriy S
Nov 17 at 10:24
T(0) is all that was given, T(1) was not given.
– Noob Coder
Nov 17 at 10:34
Substitute $n=0$ into your equation. You get $7=0$. This problem has no solution
– Yuriy S
Nov 17 at 10:36
Either you copied it wrong, or whoever gave it to you is wrong.
– Yuriy S
Nov 17 at 10:37
Well maybe the question maker made an error then?
– Noob Coder
Nov 17 at 10:38