How to run a CellularAutomaton until a configuration is repeated?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I would like to do something like CellularAutomaton[10, 1, 0, 0, 0, 0, 2^5], but instead of running for 2^5, it should stop as soon as a configuration has been seen twice, and report the number of such steps taken. Is it possible to do this?










share|improve this question







New contributor




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























    up vote
    2
    down vote

    favorite












    I would like to do something like CellularAutomaton[10, 1, 0, 0, 0, 0, 2^5], but instead of running for 2^5, it should stop as soon as a configuration has been seen twice, and report the number of such steps taken. Is it possible to do this?










    share|improve this question







    New contributor




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





















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I would like to do something like CellularAutomaton[10, 1, 0, 0, 0, 0, 2^5], but instead of running for 2^5, it should stop as soon as a configuration has been seen twice, and report the number of such steps taken. Is it possible to do this?










      share|improve this question







      New contributor




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











      I would like to do something like CellularAutomaton[10, 1, 0, 0, 0, 0, 2^5], but instead of running for 2^5, it should stop as soon as a configuration has been seen twice, and report the number of such steps taken. Is it possible to do this?







      cellular-automata






      share|improve this question







      New contributor




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











      share|improve this question







      New contributor




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









      share|improve this question




      share|improve this question






      New contributor




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









      asked 4 hours ago









      theQman

      1111




      1111




      New contributor




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





      New contributor





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






      theQman 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

















          up vote
          3
          down vote













          NestWhileList[CellularAutomaton[30, #] &, 1, 0, 0, 0, 0, UnsameQ, All]



          1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0,
          0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1




          For the number of steps taken until a configuration repeats:



          Length @ %



          7







          share|improve this answer


















          • 1




            One could use UnsameQ instead of DuplicateFreeQ @ ## & in the third argument.
            – J. M. is computer-less♦
            2 hours ago










          • @J.M. Right; much better. Thank you.
            – kglr
            1 hour ago










          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: "387"
          ;
          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: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          theQman 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%2fmathematica.stackexchange.com%2fquestions%2f184054%2fhow-to-run-a-cellularautomaton-until-a-configuration-is-repeated%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote













          NestWhileList[CellularAutomaton[30, #] &, 1, 0, 0, 0, 0, UnsameQ, All]



          1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0,
          0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1




          For the number of steps taken until a configuration repeats:



          Length @ %



          7







          share|improve this answer


















          • 1




            One could use UnsameQ instead of DuplicateFreeQ @ ## & in the third argument.
            – J. M. is computer-less♦
            2 hours ago










          • @J.M. Right; much better. Thank you.
            – kglr
            1 hour ago














          up vote
          3
          down vote













          NestWhileList[CellularAutomaton[30, #] &, 1, 0, 0, 0, 0, UnsameQ, All]



          1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0,
          0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1




          For the number of steps taken until a configuration repeats:



          Length @ %



          7







          share|improve this answer


















          • 1




            One could use UnsameQ instead of DuplicateFreeQ @ ## & in the third argument.
            – J. M. is computer-less♦
            2 hours ago










          • @J.M. Right; much better. Thank you.
            – kglr
            1 hour ago












          up vote
          3
          down vote










          up vote
          3
          down vote









          NestWhileList[CellularAutomaton[30, #] &, 1, 0, 0, 0, 0, UnsameQ, All]



          1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0,
          0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1




          For the number of steps taken until a configuration repeats:



          Length @ %



          7







          share|improve this answer














          NestWhileList[CellularAutomaton[30, #] &, 1, 0, 0, 0, 0, UnsameQ, All]



          1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0,
          0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1




          For the number of steps taken until a configuration repeats:



          Length @ %



          7








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 1 hour ago

























          answered 4 hours ago









          kglr

          166k8188388




          166k8188388







          • 1




            One could use UnsameQ instead of DuplicateFreeQ @ ## & in the third argument.
            – J. M. is computer-less♦
            2 hours ago










          • @J.M. Right; much better. Thank you.
            – kglr
            1 hour ago












          • 1




            One could use UnsameQ instead of DuplicateFreeQ @ ## & in the third argument.
            – J. M. is computer-less♦
            2 hours ago










          • @J.M. Right; much better. Thank you.
            – kglr
            1 hour ago







          1




          1




          One could use UnsameQ instead of DuplicateFreeQ @ ## & in the third argument.
          – J. M. is computer-less♦
          2 hours ago




          One could use UnsameQ instead of DuplicateFreeQ @ ## & in the third argument.
          – J. M. is computer-less♦
          2 hours ago












          @J.M. Right; much better. Thank you.
          – kglr
          1 hour ago




          @J.M. Right; much better. Thank you.
          – kglr
          1 hour ago










          theQman is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          theQman is a new contributor. Be nice, and check out our Code of Conduct.












          theQman is a new contributor. Be nice, and check out our Code of Conduct.











          theQman 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%2fmathematica.stackexchange.com%2fquestions%2f184054%2fhow-to-run-a-cellularautomaton-until-a-configuration-is-repeated%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          Long meetings (6-7 hours a day): Being “babysat” by supervisor

          Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

          Confectionery