$t(lfloorfrac{n}{2}rfloor)+t(lceilfrac{n}{2}rceil)+n=n(lfloorlog nrfloor+3)-2^{lfloorlog nrfloor +1}$
up vote
0
down vote
favorite
Given the following recurrence relation:
$t(1) = 1$
$t(n) = t(lfloor frac{n}{2} rfloor) + t(lceil frac{n}{2} rceil) + n$
How would a proof for the solution $t(n) = n (lfloor log n rfloor + 3) - 2^{lfloor log n rfloor + 1}$ look?
I suppose this should be proven by induction.
The base case would be $t(1) = 1 = 3 - 2 = 1 cdot (log 1 + 3) - 2^{log 1 + 1}$
Next consider two cases. The case $n$ is even and $n$ is odd...
Is that correct? And if yes, how would you choose $n$? $n=2k$ and $n=2k+1$?
proof-writing recurrence-relations recursive-algorithms
add a comment |
up vote
0
down vote
favorite
Given the following recurrence relation:
$t(1) = 1$
$t(n) = t(lfloor frac{n}{2} rfloor) + t(lceil frac{n}{2} rceil) + n$
How would a proof for the solution $t(n) = n (lfloor log n rfloor + 3) - 2^{lfloor log n rfloor + 1}$ look?
I suppose this should be proven by induction.
The base case would be $t(1) = 1 = 3 - 2 = 1 cdot (log 1 + 3) - 2^{log 1 + 1}$
Next consider two cases. The case $n$ is even and $n$ is odd...
Is that correct? And if yes, how would you choose $n$? $n=2k$ and $n=2k+1$?
proof-writing recurrence-relations recursive-algorithms
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Given the following recurrence relation:
$t(1) = 1$
$t(n) = t(lfloor frac{n}{2} rfloor) + t(lceil frac{n}{2} rceil) + n$
How would a proof for the solution $t(n) = n (lfloor log n rfloor + 3) - 2^{lfloor log n rfloor + 1}$ look?
I suppose this should be proven by induction.
The base case would be $t(1) = 1 = 3 - 2 = 1 cdot (log 1 + 3) - 2^{log 1 + 1}$
Next consider two cases. The case $n$ is even and $n$ is odd...
Is that correct? And if yes, how would you choose $n$? $n=2k$ and $n=2k+1$?
proof-writing recurrence-relations recursive-algorithms
Given the following recurrence relation:
$t(1) = 1$
$t(n) = t(lfloor frac{n}{2} rfloor) + t(lceil frac{n}{2} rceil) + n$
How would a proof for the solution $t(n) = n (lfloor log n rfloor + 3) - 2^{lfloor log n rfloor + 1}$ look?
I suppose this should be proven by induction.
The base case would be $t(1) = 1 = 3 - 2 = 1 cdot (log 1 + 3) - 2^{log 1 + 1}$
Next consider two cases. The case $n$ is even and $n$ is odd...
Is that correct? And if yes, how would you choose $n$? $n=2k$ and $n=2k+1$?
proof-writing recurrence-relations recursive-algorithms
proof-writing recurrence-relations recursive-algorithms
edited Nov 17 at 12:22
asked Nov 17 at 12:03
upe
123
123
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Hint:
If you take the $2k$ and $2k+1$ approach, your recurrence becomes
$$t(2k)=2t(k)+2k$$
$$t(2k+1)=t(k)+t(k+1)+2k+1$$
while your inductive hypothesis becomes
$$t(2k)=2k(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
$$t(2k+1)=(2k+1)(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
and the inductive step looks reasonably simple, with some care needed when $k$ is one less than a power of two. I might start by checking the cases when $k=1$, i.e. $n=2,3$
That's plausible thanks. In the end i want $t(2k) = 2k(lfloor log 2k rfloor + 3)-2^{lfloor log 2k rfloor + 1}$ for an even $n$, don't i?
– upe
Nov 17 at 13:49
@Peter: yes, though for positive real $x$ you have $log_2(2x)=log_2(x)+1$ and so for positive integer $k$ you have $lfloor log_2(2k)rfloor=lfloor log_2(2k+1)rfloor = lfloor log_2(k)rfloor +1$
– Henry
Nov 17 at 20:29
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Hint:
If you take the $2k$ and $2k+1$ approach, your recurrence becomes
$$t(2k)=2t(k)+2k$$
$$t(2k+1)=t(k)+t(k+1)+2k+1$$
while your inductive hypothesis becomes
$$t(2k)=2k(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
$$t(2k+1)=(2k+1)(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
and the inductive step looks reasonably simple, with some care needed when $k$ is one less than a power of two. I might start by checking the cases when $k=1$, i.e. $n=2,3$
That's plausible thanks. In the end i want $t(2k) = 2k(lfloor log 2k rfloor + 3)-2^{lfloor log 2k rfloor + 1}$ for an even $n$, don't i?
– upe
Nov 17 at 13:49
@Peter: yes, though for positive real $x$ you have $log_2(2x)=log_2(x)+1$ and so for positive integer $k$ you have $lfloor log_2(2k)rfloor=lfloor log_2(2k+1)rfloor = lfloor log_2(k)rfloor +1$
– Henry
Nov 17 at 20:29
add a comment |
up vote
0
down vote
accepted
Hint:
If you take the $2k$ and $2k+1$ approach, your recurrence becomes
$$t(2k)=2t(k)+2k$$
$$t(2k+1)=t(k)+t(k+1)+2k+1$$
while your inductive hypothesis becomes
$$t(2k)=2k(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
$$t(2k+1)=(2k+1)(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
and the inductive step looks reasonably simple, with some care needed when $k$ is one less than a power of two. I might start by checking the cases when $k=1$, i.e. $n=2,3$
That's plausible thanks. In the end i want $t(2k) = 2k(lfloor log 2k rfloor + 3)-2^{lfloor log 2k rfloor + 1}$ for an even $n$, don't i?
– upe
Nov 17 at 13:49
@Peter: yes, though for positive real $x$ you have $log_2(2x)=log_2(x)+1$ and so for positive integer $k$ you have $lfloor log_2(2k)rfloor=lfloor log_2(2k+1)rfloor = lfloor log_2(k)rfloor +1$
– Henry
Nov 17 at 20:29
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Hint:
If you take the $2k$ and $2k+1$ approach, your recurrence becomes
$$t(2k)=2t(k)+2k$$
$$t(2k+1)=t(k)+t(k+1)+2k+1$$
while your inductive hypothesis becomes
$$t(2k)=2k(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
$$t(2k+1)=(2k+1)(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
and the inductive step looks reasonably simple, with some care needed when $k$ is one less than a power of two. I might start by checking the cases when $k=1$, i.e. $n=2,3$
Hint:
If you take the $2k$ and $2k+1$ approach, your recurrence becomes
$$t(2k)=2t(k)+2k$$
$$t(2k+1)=t(k)+t(k+1)+2k+1$$
while your inductive hypothesis becomes
$$t(2k)=2k(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
$$t(2k+1)=(2k+1)(lfloorlog krfloor+4)-2^{lfloorlog krfloor +2}$$
and the inductive step looks reasonably simple, with some care needed when $k$ is one less than a power of two. I might start by checking the cases when $k=1$, i.e. $n=2,3$
answered Nov 17 at 12:29
Henry
96.8k474154
96.8k474154
That's plausible thanks. In the end i want $t(2k) = 2k(lfloor log 2k rfloor + 3)-2^{lfloor log 2k rfloor + 1}$ for an even $n$, don't i?
– upe
Nov 17 at 13:49
@Peter: yes, though for positive real $x$ you have $log_2(2x)=log_2(x)+1$ and so for positive integer $k$ you have $lfloor log_2(2k)rfloor=lfloor log_2(2k+1)rfloor = lfloor log_2(k)rfloor +1$
– Henry
Nov 17 at 20:29
add a comment |
That's plausible thanks. In the end i want $t(2k) = 2k(lfloor log 2k rfloor + 3)-2^{lfloor log 2k rfloor + 1}$ for an even $n$, don't i?
– upe
Nov 17 at 13:49
@Peter: yes, though for positive real $x$ you have $log_2(2x)=log_2(x)+1$ and so for positive integer $k$ you have $lfloor log_2(2k)rfloor=lfloor log_2(2k+1)rfloor = lfloor log_2(k)rfloor +1$
– Henry
Nov 17 at 20:29
That's plausible thanks. In the end i want $t(2k) = 2k(lfloor log 2k rfloor + 3)-2^{lfloor log 2k rfloor + 1}$ for an even $n$, don't i?
– upe
Nov 17 at 13:49
That's plausible thanks. In the end i want $t(2k) = 2k(lfloor log 2k rfloor + 3)-2^{lfloor log 2k rfloor + 1}$ for an even $n$, don't i?
– upe
Nov 17 at 13:49
@Peter: yes, though for positive real $x$ you have $log_2(2x)=log_2(x)+1$ and so for positive integer $k$ you have $lfloor log_2(2k)rfloor=lfloor log_2(2k+1)rfloor = lfloor log_2(k)rfloor +1$
– Henry
Nov 17 at 20:29
@Peter: yes, though for positive real $x$ you have $log_2(2x)=log_2(x)+1$ and so for positive integer $k$ you have $lfloor log_2(2k)rfloor=lfloor log_2(2k+1)rfloor = lfloor log_2(k)rfloor +1$
– Henry
Nov 17 at 20:29
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%2f3002282%2ft-lfloor-fracn2-rfloort-lceil-fracn2-rceiln-n-lfloor-log-n-rfloo%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