The time complexity of the n-ary cartesian product over n sets












0












$begingroup$


Recall that the Cartesian product $Atimes A$ is defined as the set $lbrace (x,y):xin A ,y in A rbrace$ . Thus, if for example, $A=lbrace 1,2,3 rbrace$,$A times A=lbrace(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)rbrace$, then the time complexity is $O(n^2 log n)$, where n refers to the number of members of the set (I presume). But suppose I would like to evaluate $A times A times A$ or any finite number of sets in $A times A times A$... What would the time complexity be then?










share|cite|improve this question











$endgroup$

















    0












    $begingroup$


    Recall that the Cartesian product $Atimes A$ is defined as the set $lbrace (x,y):xin A ,y in A rbrace$ . Thus, if for example, $A=lbrace 1,2,3 rbrace$,$A times A=lbrace(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)rbrace$, then the time complexity is $O(n^2 log n)$, where n refers to the number of members of the set (I presume). But suppose I would like to evaluate $A times A times A$ or any finite number of sets in $A times A times A$... What would the time complexity be then?










    share|cite|improve this question











    $endgroup$















      0












      0








      0





      $begingroup$


      Recall that the Cartesian product $Atimes A$ is defined as the set $lbrace (x,y):xin A ,y in A rbrace$ . Thus, if for example, $A=lbrace 1,2,3 rbrace$,$A times A=lbrace(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)rbrace$, then the time complexity is $O(n^2 log n)$, where n refers to the number of members of the set (I presume). But suppose I would like to evaluate $A times A times A$ or any finite number of sets in $A times A times A$... What would the time complexity be then?










      share|cite|improve this question











      $endgroup$




      Recall that the Cartesian product $Atimes A$ is defined as the set $lbrace (x,y):xin A ,y in A rbrace$ . Thus, if for example, $A=lbrace 1,2,3 rbrace$,$A times A=lbrace(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)rbrace$, then the time complexity is $O(n^2 log n)$, where n refers to the number of members of the set (I presume). But suppose I would like to evaluate $A times A times A$ or any finite number of sets in $A times A times A$... What would the time complexity be then?







      computational-complexity






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Jun 30 '15 at 22:57









      mich95

      6,98211126




      6,98211126










      asked Jun 30 '15 at 22:01









      Carl HillCarl Hill

      62




      62






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          I assume the task is generating a string representation of $A^k$.



          If $A$ has $n$ elements, we have to list $n^k$ tuples with $k$ components each.



          However the size of the numbers themselves grows with growing $n$, needing about $log_{10}(n) + 1$ digits per component.



          So that will give an output of roughly $n^k k log_{10} n$ digits.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Again, thank you for the response. My only other question is if this is considered "fast" to compute. Is it faster or slower than polynomial time?
            $endgroup$
            – Carl Hill
            Jul 4 '15 at 1:42












          • $begingroup$
            The number of digits seems to be $O(n^{k+1})$ so needing polynomial time. Yes that is fast in quotes.
            $endgroup$
            – mvw
            Jul 4 '15 at 6:48











          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1345148%2fthe-time-complexity-of-the-n-ary-cartesian-product-over-n-sets%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$

          I assume the task is generating a string representation of $A^k$.



          If $A$ has $n$ elements, we have to list $n^k$ tuples with $k$ components each.



          However the size of the numbers themselves grows with growing $n$, needing about $log_{10}(n) + 1$ digits per component.



          So that will give an output of roughly $n^k k log_{10} n$ digits.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Again, thank you for the response. My only other question is if this is considered "fast" to compute. Is it faster or slower than polynomial time?
            $endgroup$
            – Carl Hill
            Jul 4 '15 at 1:42












          • $begingroup$
            The number of digits seems to be $O(n^{k+1})$ so needing polynomial time. Yes that is fast in quotes.
            $endgroup$
            – mvw
            Jul 4 '15 at 6:48
















          0












          $begingroup$

          I assume the task is generating a string representation of $A^k$.



          If $A$ has $n$ elements, we have to list $n^k$ tuples with $k$ components each.



          However the size of the numbers themselves grows with growing $n$, needing about $log_{10}(n) + 1$ digits per component.



          So that will give an output of roughly $n^k k log_{10} n$ digits.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Again, thank you for the response. My only other question is if this is considered "fast" to compute. Is it faster or slower than polynomial time?
            $endgroup$
            – Carl Hill
            Jul 4 '15 at 1:42












          • $begingroup$
            The number of digits seems to be $O(n^{k+1})$ so needing polynomial time. Yes that is fast in quotes.
            $endgroup$
            – mvw
            Jul 4 '15 at 6:48














          0












          0








          0





          $begingroup$

          I assume the task is generating a string representation of $A^k$.



          If $A$ has $n$ elements, we have to list $n^k$ tuples with $k$ components each.



          However the size of the numbers themselves grows with growing $n$, needing about $log_{10}(n) + 1$ digits per component.



          So that will give an output of roughly $n^k k log_{10} n$ digits.






          share|cite|improve this answer









          $endgroup$



          I assume the task is generating a string representation of $A^k$.



          If $A$ has $n$ elements, we have to list $n^k$ tuples with $k$ components each.



          However the size of the numbers themselves grows with growing $n$, needing about $log_{10}(n) + 1$ digits per component.



          So that will give an output of roughly $n^k k log_{10} n$ digits.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jun 30 '15 at 22:45









          mvwmvw

          31.5k22252




          31.5k22252












          • $begingroup$
            Again, thank you for the response. My only other question is if this is considered "fast" to compute. Is it faster or slower than polynomial time?
            $endgroup$
            – Carl Hill
            Jul 4 '15 at 1:42












          • $begingroup$
            The number of digits seems to be $O(n^{k+1})$ so needing polynomial time. Yes that is fast in quotes.
            $endgroup$
            – mvw
            Jul 4 '15 at 6:48


















          • $begingroup$
            Again, thank you for the response. My only other question is if this is considered "fast" to compute. Is it faster or slower than polynomial time?
            $endgroup$
            – Carl Hill
            Jul 4 '15 at 1:42












          • $begingroup$
            The number of digits seems to be $O(n^{k+1})$ so needing polynomial time. Yes that is fast in quotes.
            $endgroup$
            – mvw
            Jul 4 '15 at 6:48
















          $begingroup$
          Again, thank you for the response. My only other question is if this is considered "fast" to compute. Is it faster or slower than polynomial time?
          $endgroup$
          – Carl Hill
          Jul 4 '15 at 1:42






          $begingroup$
          Again, thank you for the response. My only other question is if this is considered "fast" to compute. Is it faster or slower than polynomial time?
          $endgroup$
          – Carl Hill
          Jul 4 '15 at 1:42














          $begingroup$
          The number of digits seems to be $O(n^{k+1})$ so needing polynomial time. Yes that is fast in quotes.
          $endgroup$
          – mvw
          Jul 4 '15 at 6:48




          $begingroup$
          The number of digits seems to be $O(n^{k+1})$ so needing polynomial time. Yes that is fast in quotes.
          $endgroup$
          – mvw
          Jul 4 '15 at 6:48


















          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1345148%2fthe-time-complexity-of-the-n-ary-cartesian-product-over-n-sets%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

          Human spaceflight

          Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

          張江高科駅