What could be the recurrence relation that function_? The Next CEO of Stack OverflowSolving recurrence relation of algorithm complexity?Help with find recurrence relation running time.Recurrence Relation - Merge SortHow to extract fraction from a floating point numberHow could we prove the correctness of the algorithm?How to compare times?Divide and Conquer Recurrence RelationWhat could be the loop invariant for the following algorithm (addition of natural numbers)Solving recurrence relation with multiple variablesAlgorithm for returning a matrix that is the sum of the previous matrix

Could you use a laser beam as a modulated carrier wave for radio signal?

Oldie but Goldie

Is it possible to make a 9x9 table fit within the default margins?

Can you teleport closer to a creature you are Frightened of?

Is it reasonable to ask other researchers to send me their previous grant applications?

Why was Sir Cadogan fired?

Planeswalker Ability and Death Timing

What is the difference between 'contrib' and 'non-free' packages repositories?

Can a PhD from a non-TU9 German university become a professor in a TU9 university?

Advance Calculus Limit question

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

How exploitable/balanced is this homebrew spell: Spell Permanency?

Another proof that dividing by 0 does not exist -- is it right?

Does Germany produce more waste than the US?

How should I connect my cat5 cable to connectors having an orange-green line?

Avoiding the "not like other girls" trope?

Is the offspring between a demon and a celestial possible? If so what is it called and is it in a book somewhere?

pgfplots: How to draw a tangent graph below two others?

Upgrading From a 9 Speed Sora Derailleur?

What steps are necessary to read a Modern SSD in Medieval Europe?

How to pronounce fünf in 45

Is it OK to decorate a log book cover?

Compensation for working overtime on Saturdays

Is this a new Fibonacci Identity?



What could be the recurrence relation that function_?



The Next CEO of Stack OverflowSolving recurrence relation of algorithm complexity?Help with find recurrence relation running time.Recurrence Relation - Merge SortHow to extract fraction from a floating point numberHow could we prove the correctness of the algorithm?How to compare times?Divide and Conquer Recurrence RelationWhat could be the loop invariant for the following algorithm (addition of natural numbers)Solving recurrence relation with multiple variablesAlgorithm for returning a matrix that is the sum of the previous matrix










0












$begingroup$


float aFunc(nyArray, n)

if ( (n==1)
return nyArray[0];


// let nyArray1,nyArray2,nyArray3,nyArray4 be predefined arrarys
for (i= 0; i<= (n/2) -1 ; i++)

for (j =0; j<= (n/2)-1 ; i++)

nyArray1[i]= nyArray[i];
nyArray2[i]= nyArray[i+j];
nyArray3[i]= nyArray[n/2+j];
nyArray4[i]= nyArray[j];




x1 = aFunc(nyArray1,n/2);
x2 = aFunc(nyArray2,n/2);
x3 = aFunc(nyArray3,n/2);
x4 = aFunc(nyArray4,n/2);

return x1*x2*x3*x4;





I guess that its something like that, but Im not suce.
T(n) = 4T(n/2)+........










share|cite|improve this question







New contributor




Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$
















    0












    $begingroup$


    float aFunc(nyArray, n)

    if ( (n==1)
    return nyArray[0];


    // let nyArray1,nyArray2,nyArray3,nyArray4 be predefined arrarys
    for (i= 0; i<= (n/2) -1 ; i++)

    for (j =0; j<= (n/2)-1 ; i++)

    nyArray1[i]= nyArray[i];
    nyArray2[i]= nyArray[i+j];
    nyArray3[i]= nyArray[n/2+j];
    nyArray4[i]= nyArray[j];




    x1 = aFunc(nyArray1,n/2);
    x2 = aFunc(nyArray2,n/2);
    x3 = aFunc(nyArray3,n/2);
    x4 = aFunc(nyArray4,n/2);

    return x1*x2*x3*x4;





    I guess that its something like that, but Im not suce.
    T(n) = 4T(n/2)+........










    share|cite|improve this question







    New contributor




    Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$














      0












      0








      0





      $begingroup$


      float aFunc(nyArray, n)

      if ( (n==1)
      return nyArray[0];


      // let nyArray1,nyArray2,nyArray3,nyArray4 be predefined arrarys
      for (i= 0; i<= (n/2) -1 ; i++)

      for (j =0; j<= (n/2)-1 ; i++)

      nyArray1[i]= nyArray[i];
      nyArray2[i]= nyArray[i+j];
      nyArray3[i]= nyArray[n/2+j];
      nyArray4[i]= nyArray[j];




      x1 = aFunc(nyArray1,n/2);
      x2 = aFunc(nyArray2,n/2);
      x3 = aFunc(nyArray3,n/2);
      x4 = aFunc(nyArray4,n/2);

      return x1*x2*x3*x4;





      I guess that its something like that, but Im not suce.
      T(n) = 4T(n/2)+........










      share|cite|improve this question







      New contributor




      Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $endgroup$




      float aFunc(nyArray, n)

      if ( (n==1)
      return nyArray[0];


      // let nyArray1,nyArray2,nyArray3,nyArray4 be predefined arrarys
      for (i= 0; i<= (n/2) -1 ; i++)

      for (j =0; j<= (n/2)-1 ; i++)

      nyArray1[i]= nyArray[i];
      nyArray2[i]= nyArray[i+j];
      nyArray3[i]= nyArray[n/2+j];
      nyArray4[i]= nyArray[j];




      x1 = aFunc(nyArray1,n/2);
      x2 = aFunc(nyArray2,n/2);
      x3 = aFunc(nyArray3,n/2);
      x4 = aFunc(nyArray4,n/2);

      return x1*x2*x3*x4;





      I guess that its something like that, but Im not suce.
      T(n) = 4T(n/2)+........







      complex-analysis algorithms






      share|cite|improve this question







      New contributor




      Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|cite|improve this question







      New contributor




      Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|cite|improve this question




      share|cite|improve this question






      New contributor




      Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Mar 28 at 10:54









      Harlinton Palacios MosqueraHarlinton Palacios Mosquera

      1




      1




      New contributor




      Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Harlinton Palacios Mosquera is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          You are right about your equation.



          First, let's evaluate the for-loops. The for-loop are nested and run (n/2)-1 times each. Therefore, the run time of the for-loops is ((n/2)-1)^2. We will define this as the function f(n)=((n/2)-1)^2.



          The program function is recursively called for times with n/2 as its input. We can now describe the recurrence by the following equation:



          T(n)=4T(n/2)+((n/2)-1)^2


          This form of equation can be evaluated using the master's theorem. According to the definition of the master's theorem, we use case 2, because n^(log_b(a))=n^(log_2(4))=n^2=Theta(f(n)), which is our test case. The variable a if found by the constant times the recursive function and the variable b is found in the divisor within the recursive call.



          By the definition of case 2, the resulting complexity of your algorithm is Theta(n^(log_b(a))*log_2(n))=Theta(n^(log_2(4))*log_2(n))=Theta(n^2*log_2(n)).






          share|cite|improve this answer










          New contributor




          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          $endgroup$












          • $begingroup$
            Thank you for your feedback, if run time of the for-loops is ((n/2)-1)^2 and the function is f(n)=((n/2)-1)^2. The T(n) with recursive function time should be T(n)= T(n)=4T(n/2)+((n/2)-1)^2 ?
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 28 at 12:19











          • $begingroup$
            Yes, you are right! I will update it. Also, note I changed the result from using case 1 to use case 2 because of the mistake.
            $endgroup$
            – Martin Pekár
            Mar 28 at 19:56










          • $begingroup$
            Thank you so much.
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 29 at 8:27











          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',
          autoActivateHeartbeat: false,
          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
          );



          );






          Harlinton Palacios Mosquera is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3165736%2fwhat-could-be-the-recurrence-relation-that-function%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









          0












          $begingroup$

          You are right about your equation.



          First, let's evaluate the for-loops. The for-loop are nested and run (n/2)-1 times each. Therefore, the run time of the for-loops is ((n/2)-1)^2. We will define this as the function f(n)=((n/2)-1)^2.



          The program function is recursively called for times with n/2 as its input. We can now describe the recurrence by the following equation:



          T(n)=4T(n/2)+((n/2)-1)^2


          This form of equation can be evaluated using the master's theorem. According to the definition of the master's theorem, we use case 2, because n^(log_b(a))=n^(log_2(4))=n^2=Theta(f(n)), which is our test case. The variable a if found by the constant times the recursive function and the variable b is found in the divisor within the recursive call.



          By the definition of case 2, the resulting complexity of your algorithm is Theta(n^(log_b(a))*log_2(n))=Theta(n^(log_2(4))*log_2(n))=Theta(n^2*log_2(n)).






          share|cite|improve this answer










          New contributor




          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          $endgroup$












          • $begingroup$
            Thank you for your feedback, if run time of the for-loops is ((n/2)-1)^2 and the function is f(n)=((n/2)-1)^2. The T(n) with recursive function time should be T(n)= T(n)=4T(n/2)+((n/2)-1)^2 ?
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 28 at 12:19











          • $begingroup$
            Yes, you are right! I will update it. Also, note I changed the result from using case 1 to use case 2 because of the mistake.
            $endgroup$
            – Martin Pekár
            Mar 28 at 19:56










          • $begingroup$
            Thank you so much.
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 29 at 8:27















          0












          $begingroup$

          You are right about your equation.



          First, let's evaluate the for-loops. The for-loop are nested and run (n/2)-1 times each. Therefore, the run time of the for-loops is ((n/2)-1)^2. We will define this as the function f(n)=((n/2)-1)^2.



          The program function is recursively called for times with n/2 as its input. We can now describe the recurrence by the following equation:



          T(n)=4T(n/2)+((n/2)-1)^2


          This form of equation can be evaluated using the master's theorem. According to the definition of the master's theorem, we use case 2, because n^(log_b(a))=n^(log_2(4))=n^2=Theta(f(n)), which is our test case. The variable a if found by the constant times the recursive function and the variable b is found in the divisor within the recursive call.



          By the definition of case 2, the resulting complexity of your algorithm is Theta(n^(log_b(a))*log_2(n))=Theta(n^(log_2(4))*log_2(n))=Theta(n^2*log_2(n)).






          share|cite|improve this answer










          New contributor




          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          $endgroup$












          • $begingroup$
            Thank you for your feedback, if run time of the for-loops is ((n/2)-1)^2 and the function is f(n)=((n/2)-1)^2. The T(n) with recursive function time should be T(n)= T(n)=4T(n/2)+((n/2)-1)^2 ?
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 28 at 12:19











          • $begingroup$
            Yes, you are right! I will update it. Also, note I changed the result from using case 1 to use case 2 because of the mistake.
            $endgroup$
            – Martin Pekár
            Mar 28 at 19:56










          • $begingroup$
            Thank you so much.
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 29 at 8:27













          0












          0








          0





          $begingroup$

          You are right about your equation.



          First, let's evaluate the for-loops. The for-loop are nested and run (n/2)-1 times each. Therefore, the run time of the for-loops is ((n/2)-1)^2. We will define this as the function f(n)=((n/2)-1)^2.



          The program function is recursively called for times with n/2 as its input. We can now describe the recurrence by the following equation:



          T(n)=4T(n/2)+((n/2)-1)^2


          This form of equation can be evaluated using the master's theorem. According to the definition of the master's theorem, we use case 2, because n^(log_b(a))=n^(log_2(4))=n^2=Theta(f(n)), which is our test case. The variable a if found by the constant times the recursive function and the variable b is found in the divisor within the recursive call.



          By the definition of case 2, the resulting complexity of your algorithm is Theta(n^(log_b(a))*log_2(n))=Theta(n^(log_2(4))*log_2(n))=Theta(n^2*log_2(n)).






          share|cite|improve this answer










          New contributor




          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          $endgroup$



          You are right about your equation.



          First, let's evaluate the for-loops. The for-loop are nested and run (n/2)-1 times each. Therefore, the run time of the for-loops is ((n/2)-1)^2. We will define this as the function f(n)=((n/2)-1)^2.



          The program function is recursively called for times with n/2 as its input. We can now describe the recurrence by the following equation:



          T(n)=4T(n/2)+((n/2)-1)^2


          This form of equation can be evaluated using the master's theorem. According to the definition of the master's theorem, we use case 2, because n^(log_b(a))=n^(log_2(4))=n^2=Theta(f(n)), which is our test case. The variable a if found by the constant times the recursive function and the variable b is found in the divisor within the recursive call.



          By the definition of case 2, the resulting complexity of your algorithm is Theta(n^(log_b(a))*log_2(n))=Theta(n^(log_2(4))*log_2(n))=Theta(n^2*log_2(n)).







          share|cite|improve this answer










          New contributor




          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|cite|improve this answer



          share|cite|improve this answer








          edited Mar 28 at 19:55





















          New contributor




          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered Mar 28 at 11:18









          Martin PekárMartin Pekár

          11




          11




          New contributor




          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Martin Pekár is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.











          • $begingroup$
            Thank you for your feedback, if run time of the for-loops is ((n/2)-1)^2 and the function is f(n)=((n/2)-1)^2. The T(n) with recursive function time should be T(n)= T(n)=4T(n/2)+((n/2)-1)^2 ?
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 28 at 12:19











          • $begingroup$
            Yes, you are right! I will update it. Also, note I changed the result from using case 1 to use case 2 because of the mistake.
            $endgroup$
            – Martin Pekár
            Mar 28 at 19:56










          • $begingroup$
            Thank you so much.
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 29 at 8:27
















          • $begingroup$
            Thank you for your feedback, if run time of the for-loops is ((n/2)-1)^2 and the function is f(n)=((n/2)-1)^2. The T(n) with recursive function time should be T(n)= T(n)=4T(n/2)+((n/2)-1)^2 ?
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 28 at 12:19











          • $begingroup$
            Yes, you are right! I will update it. Also, note I changed the result from using case 1 to use case 2 because of the mistake.
            $endgroup$
            – Martin Pekár
            Mar 28 at 19:56










          • $begingroup$
            Thank you so much.
            $endgroup$
            – Harlinton Palacios Mosquera
            Mar 29 at 8:27















          $begingroup$
          Thank you for your feedback, if run time of the for-loops is ((n/2)-1)^2 and the function is f(n)=((n/2)-1)^2. The T(n) with recursive function time should be T(n)= T(n)=4T(n/2)+((n/2)-1)^2 ?
          $endgroup$
          – Harlinton Palacios Mosquera
          Mar 28 at 12:19





          $begingroup$
          Thank you for your feedback, if run time of the for-loops is ((n/2)-1)^2 and the function is f(n)=((n/2)-1)^2. The T(n) with recursive function time should be T(n)= T(n)=4T(n/2)+((n/2)-1)^2 ?
          $endgroup$
          – Harlinton Palacios Mosquera
          Mar 28 at 12:19













          $begingroup$
          Yes, you are right! I will update it. Also, note I changed the result from using case 1 to use case 2 because of the mistake.
          $endgroup$
          – Martin Pekár
          Mar 28 at 19:56




          $begingroup$
          Yes, you are right! I will update it. Also, note I changed the result from using case 1 to use case 2 because of the mistake.
          $endgroup$
          – Martin Pekár
          Mar 28 at 19:56












          $begingroup$
          Thank you so much.
          $endgroup$
          – Harlinton Palacios Mosquera
          Mar 29 at 8:27




          $begingroup$
          Thank you so much.
          $endgroup$
          – Harlinton Palacios Mosquera
          Mar 29 at 8:27










          Harlinton Palacios Mosquera is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Harlinton Palacios Mosquera is a new contributor. Be nice, and check out our Code of Conduct.












          Harlinton Palacios Mosquera is a new contributor. Be nice, and check out our Code of Conduct.











          Harlinton Palacios Mosquera is a new contributor. Be nice, and check out our Code of Conduct.














          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3165736%2fwhat-could-be-the-recurrence-relation-that-function%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

          Triangular numbers and gcdProving sum of a set is $0 pmod n$ if $n$ is odd, or $fracn2 pmod n$ if $n$ is even?Is greatest common divisor of two numbers really their smallest linear combination?GCD, LCM RelationshipProve a set of nonnegative integers with greatest common divisor 1 and closed under addition has all but finite many nonnegative integers.all pairs of a and b in an equation containing gcdTriangular Numbers Modulo $k$ - Hit All Values?Understanding the Existence and Uniqueness of the GCDGCD and LCM with logical symbolsThe greatest common divisor of two positive integers less than 100 is equal to 3. Their least common multiple is twelve times one of the integers.Suppose that for all integers $x$, $x|a$ and $x|b$ if and only if $x|c$. Then $c = gcd(a,b)$Which is the gcd of 2 numbers which are multiplied and the result is 600000?

          Ingelân Ynhâld Etymology | Geografy | Skiednis | Polityk en bestjoer | Ekonomy | Demografy | Kultuer | Klimaat | Sjoch ek | Keppelings om utens | Boarnen, noaten en referinsjes Navigaasjemenuwww.gov.ukOffisjele webside fan it regear fan it Feriene KeninkrykOffisjele webside fan it Britske FerkearsburoNederlânsktalige ynformaasje fan it Britske FerkearsburoOffisjele webside fan English Heritage, de organisaasje dy't him ynset foar it behâld fan it Ingelske kultuergoedYnwennertallen fan alle Britske stêden út 'e folkstelling fan 2011Notes en References, op dizze sideEngland

          Հադիս Բովանդակություն Անվանում և նշանակություն | Դասակարգում | Աղբյուրներ | Նավարկման ցանկ