$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$?










share|cite|improve this question




























    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$?










    share|cite|improve this question


























      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$?










      share|cite|improve this question















      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






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Nov 17 at 12:22

























      asked Nov 17 at 12:03









      upe

      123




      123






















          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$






          share|cite|improve this answer





















          • 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











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          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

























          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$






          share|cite|improve this answer





















          • 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















          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$






          share|cite|improve this answer





















          • 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













          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$






          share|cite|improve this answer












          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$







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          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


















          • 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


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          QoS: MAC-Priority for clients behind a repeater

          Ивакино (Тотемский район)

          Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)