Partitioning values in a sequenceOrdering the elements in a list and separate them into sublists for plottingFinding all partitions of a setPartitioning an image based on featuresPartition list into a given number of sub-listsPartitioning List Into Sublists of Length 2 With The Pairing Being RandomCluster numbers into n partitions so that each partitions sum is closest to total/nEfficient lazy weak compositionsTiming and memory use is critical:fast partitioning of binary sparse arrayVariable iterator in Do Loop (splitting a list)Non-Constant Partitioning of a List with Order AnalysisTotally orderless partition

How to have a sharp product image?

What is the unit of time_lock_delta in LND?

Extracting Dirichlet series coefficients

What is the term for a person whose job is to place products on shelves in stores?

Can someone publish a story that happened to you?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

Should the Product Owner dictate what info the UI needs to display?

Is there a better way to say "see someone's dreams"?

What makes accurate emulation of old systems a difficult task?

Older movie/show about humans on derelict alien warship which refuels by passing through a star

Can a level 2 Warlock take one level in rogue, then continue advancing as a warlock?

How to not starve gigantic beasts

How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?

Mistake in years of experience in resume?

How do I reattach a shelf to the wall when it ripped out of the wall?

Nails holding drywall

How long after the last departure shall the airport stay open for an emergency return?

What is the best way to deal with NPC-NPC combat?

Is Diceware more secure than a long passphrase?

Can a stored procedure reference the database in which it is stored?

Is Electric Central Heating worth it if using Solar Panels?

Creating a chemical industry from a medieval tech level without petroleum

Why do games have consumables?

Magical attacks and overcoming damage resistance



Partitioning values in a sequence


Ordering the elements in a list and separate them into sublists for plottingFinding all partitions of a setPartitioning an image based on featuresPartition list into a given number of sub-listsPartitioning List Into Sublists of Length 2 With The Pairing Being RandomCluster numbers into n partitions so that each partitions sum is closest to total/nEfficient lazy weak compositionsTiming and memory use is critical:fast partitioning of binary sparse arrayVariable iterator in Do Loop (splitting a list)Non-Constant Partitioning of a List with Order AnalysisTotally orderless partition













2












$begingroup$


I have a sequence that forms visible lines when plotted as a graph, what would be a good way to automatically partition the sequence to create a list of sequences, one for each line that is visible when the sequence is plotted?



Here is the start of the sequence:



list = 2,3,5,11,7,23,13,29,41,17,53,37,83,43,89,19,113,131,67,47,73,31,79,173,179,61,191,97,233,239,251,127,139,281,71,293,101,103,107,163,59,359,193,199,137,419,431,443,151,491,509,181,109,277,593,149,307,641,653,659,683,719,241,743,373,761,257,157,263,809,271,409,283,433,911,311,313,953,487,331,499,1013,1019,1031,347,1049,211,269,367,1103,577,167,397,1223,1229,619,1289,223,673,229,461,467,1409,709,1439,1451,727,739,1481,1499,503,1511,1559,1583,1601,401,557,337,853,1733,349,883,197;


Thanks.



cheers,
Jamie










share|improve this question











$endgroup$











  • $begingroup$
    Possible duplicate of ordering-the-elements-in-a-list-and-separate-them-into-sublists-for-plotting
    $endgroup$
    – MelaGo
    5 hours ago















2












$begingroup$


I have a sequence that forms visible lines when plotted as a graph, what would be a good way to automatically partition the sequence to create a list of sequences, one for each line that is visible when the sequence is plotted?



Here is the start of the sequence:



list = 2,3,5,11,7,23,13,29,41,17,53,37,83,43,89,19,113,131,67,47,73,31,79,173,179,61,191,97,233,239,251,127,139,281,71,293,101,103,107,163,59,359,193,199,137,419,431,443,151,491,509,181,109,277,593,149,307,641,653,659,683,719,241,743,373,761,257,157,263,809,271,409,283,433,911,311,313,953,487,331,499,1013,1019,1031,347,1049,211,269,367,1103,577,167,397,1223,1229,619,1289,223,673,229,461,467,1409,709,1439,1451,727,739,1481,1499,503,1511,1559,1583,1601,401,557,337,853,1733,349,883,197;


Thanks.



cheers,
Jamie










share|improve this question











$endgroup$











  • $begingroup$
    Possible duplicate of ordering-the-elements-in-a-list-and-separate-them-into-sublists-for-plotting
    $endgroup$
    – MelaGo
    5 hours ago













2












2








2





$begingroup$


I have a sequence that forms visible lines when plotted as a graph, what would be a good way to automatically partition the sequence to create a list of sequences, one for each line that is visible when the sequence is plotted?



Here is the start of the sequence:



list = 2,3,5,11,7,23,13,29,41,17,53,37,83,43,89,19,113,131,67,47,73,31,79,173,179,61,191,97,233,239,251,127,139,281,71,293,101,103,107,163,59,359,193,199,137,419,431,443,151,491,509,181,109,277,593,149,307,641,653,659,683,719,241,743,373,761,257,157,263,809,271,409,283,433,911,311,313,953,487,331,499,1013,1019,1031,347,1049,211,269,367,1103,577,167,397,1223,1229,619,1289,223,673,229,461,467,1409,709,1439,1451,727,739,1481,1499,503,1511,1559,1583,1601,401,557,337,853,1733,349,883,197;


Thanks.



cheers,
Jamie










share|improve this question











$endgroup$




I have a sequence that forms visible lines when plotted as a graph, what would be a good way to automatically partition the sequence to create a list of sequences, one for each line that is visible when the sequence is plotted?



Here is the start of the sequence:



list = 2,3,5,11,7,23,13,29,41,17,53,37,83,43,89,19,113,131,67,47,73,31,79,173,179,61,191,97,233,239,251,127,139,281,71,293,101,103,107,163,59,359,193,199,137,419,431,443,151,491,509,181,109,277,593,149,307,641,653,659,683,719,241,743,373,761,257,157,263,809,271,409,283,433,911,311,313,953,487,331,499,1013,1019,1031,347,1049,211,269,367,1103,577,167,397,1223,1229,619,1289,223,673,229,461,467,1409,709,1439,1451,727,739,1481,1499,503,1511,1559,1583,1601,401,557,337,853,1733,349,883,197;


Thanks.



cheers,
Jamie







partitions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 16 mins ago









user64494

3,65311122




3,65311122










asked 5 hours ago









Jamie MJamie M

475




475











  • $begingroup$
    Possible duplicate of ordering-the-elements-in-a-list-and-separate-them-into-sublists-for-plotting
    $endgroup$
    – MelaGo
    5 hours ago
















  • $begingroup$
    Possible duplicate of ordering-the-elements-in-a-list-and-separate-them-into-sublists-for-plotting
    $endgroup$
    – MelaGo
    5 hours ago















$begingroup$
Possible duplicate of ordering-the-elements-in-a-list-and-separate-them-into-sublists-for-plotting
$endgroup$
– MelaGo
5 hours ago




$begingroup$
Possible duplicate of ordering-the-elements-in-a-list-and-separate-them-into-sublists-for-plotting
$endgroup$
– MelaGo
5 hours ago










2 Answers
2






active

oldest

votes


















1












$begingroup$

You could for instance fit a mean polynomial function through the data:



fun = NonlinearModelFit[list, a x^2 + b x + c , a, b, c, x] //Normal



-48.3941 + 6.86017 x + 0.0161064 x^2




This will separarate the upper line from the lower line that you can see in the plot:



Show[
ListLinePlot[list, PlotRange -> All],
Plot[fun, x, 0, 125, PlotRange -> All, PlotStyle -> Red],
PlotRange -> All]


enter image description here



Then you can simply run through the list and separate it into two lists based on whether the value is above or below the mean fit:



upperLine = ;
lowerLine = ;
Do[
If[list[[x]] > fun,
AppendTo[upperLine, x, list[[x]]],
AppendTo[lowerLine, x, list[[x]]]];
, x, 1, Length[list]]


The upperLine and lowerLine data sets then look like:



ListLinePlot[upperLine], ListLinePlot[lowerLine]


enter image description here



Repeat the process on the lowerLine data to separate the sequences further.






share|improve this answer











$endgroup$




















    2












    $begingroup$

    list = 2, 3, 5, 11, 7, 23, 13, 29, 41, 17, 53, 37, 83, 43, 89, 19, 
    113, 131, 67, 47, 73, 31, 79, 173, 179, 61, 191, 97, 233, 239, 251,
    127, 139, 281, 71, 293, 101, 103, 107, 163, 59, 359, 193, 199,
    137, 419, 431, 443, 151, 491, 509, 181, 109, 277, 593, 149, 307,
    641, 653, 659, 683, 719, 241, 743, 373, 761, 257, 157, 263, 809,
    271, 409, 283, 433, 911, 311, 313, 953, 487, 331, 499, 1013, 1019,
    1031, 347, 1049, 211, 269, 367, 1103, 577, 167, 397, 1223, 1229,
    619, 1289, 223, 673, 229, 461, 467, 1409, 709, 1439, 1451, 727,
    739, 1481, 1499, 503, 1511, 1559, 1583, 1601, 401, 557, 337, 853,
    1733, 349, 883, 197;

    upper = FindPeaks[list];

    lower = 1, -1 # & /@ FindPeaks[-list];

    ListLinePlot[list, lower, upper,
    PlotStyle -> LightGray, Blue, Red]


    enter image description here






    share|improve this answer









    $endgroup$













      Your Answer








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



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f197055%2fpartitioning-values-in-a-sequence%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1












      $begingroup$

      You could for instance fit a mean polynomial function through the data:



      fun = NonlinearModelFit[list, a x^2 + b x + c , a, b, c, x] //Normal



      -48.3941 + 6.86017 x + 0.0161064 x^2




      This will separarate the upper line from the lower line that you can see in the plot:



      Show[
      ListLinePlot[list, PlotRange -> All],
      Plot[fun, x, 0, 125, PlotRange -> All, PlotStyle -> Red],
      PlotRange -> All]


      enter image description here



      Then you can simply run through the list and separate it into two lists based on whether the value is above or below the mean fit:



      upperLine = ;
      lowerLine = ;
      Do[
      If[list[[x]] > fun,
      AppendTo[upperLine, x, list[[x]]],
      AppendTo[lowerLine, x, list[[x]]]];
      , x, 1, Length[list]]


      The upperLine and lowerLine data sets then look like:



      ListLinePlot[upperLine], ListLinePlot[lowerLine]


      enter image description here



      Repeat the process on the lowerLine data to separate the sequences further.






      share|improve this answer











      $endgroup$

















        1












        $begingroup$

        You could for instance fit a mean polynomial function through the data:



        fun = NonlinearModelFit[list, a x^2 + b x + c , a, b, c, x] //Normal



        -48.3941 + 6.86017 x + 0.0161064 x^2




        This will separarate the upper line from the lower line that you can see in the plot:



        Show[
        ListLinePlot[list, PlotRange -> All],
        Plot[fun, x, 0, 125, PlotRange -> All, PlotStyle -> Red],
        PlotRange -> All]


        enter image description here



        Then you can simply run through the list and separate it into two lists based on whether the value is above or below the mean fit:



        upperLine = ;
        lowerLine = ;
        Do[
        If[list[[x]] > fun,
        AppendTo[upperLine, x, list[[x]]],
        AppendTo[lowerLine, x, list[[x]]]];
        , x, 1, Length[list]]


        The upperLine and lowerLine data sets then look like:



        ListLinePlot[upperLine], ListLinePlot[lowerLine]


        enter image description here



        Repeat the process on the lowerLine data to separate the sequences further.






        share|improve this answer











        $endgroup$















          1












          1








          1





          $begingroup$

          You could for instance fit a mean polynomial function through the data:



          fun = NonlinearModelFit[list, a x^2 + b x + c , a, b, c, x] //Normal



          -48.3941 + 6.86017 x + 0.0161064 x^2




          This will separarate the upper line from the lower line that you can see in the plot:



          Show[
          ListLinePlot[list, PlotRange -> All],
          Plot[fun, x, 0, 125, PlotRange -> All, PlotStyle -> Red],
          PlotRange -> All]


          enter image description here



          Then you can simply run through the list and separate it into two lists based on whether the value is above or below the mean fit:



          upperLine = ;
          lowerLine = ;
          Do[
          If[list[[x]] > fun,
          AppendTo[upperLine, x, list[[x]]],
          AppendTo[lowerLine, x, list[[x]]]];
          , x, 1, Length[list]]


          The upperLine and lowerLine data sets then look like:



          ListLinePlot[upperLine], ListLinePlot[lowerLine]


          enter image description here



          Repeat the process on the lowerLine data to separate the sequences further.






          share|improve this answer











          $endgroup$



          You could for instance fit a mean polynomial function through the data:



          fun = NonlinearModelFit[list, a x^2 + b x + c , a, b, c, x] //Normal



          -48.3941 + 6.86017 x + 0.0161064 x^2




          This will separarate the upper line from the lower line that you can see in the plot:



          Show[
          ListLinePlot[list, PlotRange -> All],
          Plot[fun, x, 0, 125, PlotRange -> All, PlotStyle -> Red],
          PlotRange -> All]


          enter image description here



          Then you can simply run through the list and separate it into two lists based on whether the value is above or below the mean fit:



          upperLine = ;
          lowerLine = ;
          Do[
          If[list[[x]] > fun,
          AppendTo[upperLine, x, list[[x]]],
          AppendTo[lowerLine, x, list[[x]]]];
          , x, 1, Length[list]]


          The upperLine and lowerLine data sets then look like:



          ListLinePlot[upperLine], ListLinePlot[lowerLine]


          enter image description here



          Repeat the process on the lowerLine data to separate the sequences further.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 5 hours ago

























          answered 5 hours ago









          KagaratschKagaratsch

          4,87531348




          4,87531348





















              2












              $begingroup$

              list = 2, 3, 5, 11, 7, 23, 13, 29, 41, 17, 53, 37, 83, 43, 89, 19, 
              113, 131, 67, 47, 73, 31, 79, 173, 179, 61, 191, 97, 233, 239, 251,
              127, 139, 281, 71, 293, 101, 103, 107, 163, 59, 359, 193, 199,
              137, 419, 431, 443, 151, 491, 509, 181, 109, 277, 593, 149, 307,
              641, 653, 659, 683, 719, 241, 743, 373, 761, 257, 157, 263, 809,
              271, 409, 283, 433, 911, 311, 313, 953, 487, 331, 499, 1013, 1019,
              1031, 347, 1049, 211, 269, 367, 1103, 577, 167, 397, 1223, 1229,
              619, 1289, 223, 673, 229, 461, 467, 1409, 709, 1439, 1451, 727,
              739, 1481, 1499, 503, 1511, 1559, 1583, 1601, 401, 557, 337, 853,
              1733, 349, 883, 197;

              upper = FindPeaks[list];

              lower = 1, -1 # & /@ FindPeaks[-list];

              ListLinePlot[list, lower, upper,
              PlotStyle -> LightGray, Blue, Red]


              enter image description here






              share|improve this answer









              $endgroup$

















                2












                $begingroup$

                list = 2, 3, 5, 11, 7, 23, 13, 29, 41, 17, 53, 37, 83, 43, 89, 19, 
                113, 131, 67, 47, 73, 31, 79, 173, 179, 61, 191, 97, 233, 239, 251,
                127, 139, 281, 71, 293, 101, 103, 107, 163, 59, 359, 193, 199,
                137, 419, 431, 443, 151, 491, 509, 181, 109, 277, 593, 149, 307,
                641, 653, 659, 683, 719, 241, 743, 373, 761, 257, 157, 263, 809,
                271, 409, 283, 433, 911, 311, 313, 953, 487, 331, 499, 1013, 1019,
                1031, 347, 1049, 211, 269, 367, 1103, 577, 167, 397, 1223, 1229,
                619, 1289, 223, 673, 229, 461, 467, 1409, 709, 1439, 1451, 727,
                739, 1481, 1499, 503, 1511, 1559, 1583, 1601, 401, 557, 337, 853,
                1733, 349, 883, 197;

                upper = FindPeaks[list];

                lower = 1, -1 # & /@ FindPeaks[-list];

                ListLinePlot[list, lower, upper,
                PlotStyle -> LightGray, Blue, Red]


                enter image description here






                share|improve this answer









                $endgroup$















                  2












                  2








                  2





                  $begingroup$

                  list = 2, 3, 5, 11, 7, 23, 13, 29, 41, 17, 53, 37, 83, 43, 89, 19, 
                  113, 131, 67, 47, 73, 31, 79, 173, 179, 61, 191, 97, 233, 239, 251,
                  127, 139, 281, 71, 293, 101, 103, 107, 163, 59, 359, 193, 199,
                  137, 419, 431, 443, 151, 491, 509, 181, 109, 277, 593, 149, 307,
                  641, 653, 659, 683, 719, 241, 743, 373, 761, 257, 157, 263, 809,
                  271, 409, 283, 433, 911, 311, 313, 953, 487, 331, 499, 1013, 1019,
                  1031, 347, 1049, 211, 269, 367, 1103, 577, 167, 397, 1223, 1229,
                  619, 1289, 223, 673, 229, 461, 467, 1409, 709, 1439, 1451, 727,
                  739, 1481, 1499, 503, 1511, 1559, 1583, 1601, 401, 557, 337, 853,
                  1733, 349, 883, 197;

                  upper = FindPeaks[list];

                  lower = 1, -1 # & /@ FindPeaks[-list];

                  ListLinePlot[list, lower, upper,
                  PlotStyle -> LightGray, Blue, Red]


                  enter image description here






                  share|improve this answer









                  $endgroup$



                  list = 2, 3, 5, 11, 7, 23, 13, 29, 41, 17, 53, 37, 83, 43, 89, 19, 
                  113, 131, 67, 47, 73, 31, 79, 173, 179, 61, 191, 97, 233, 239, 251,
                  127, 139, 281, 71, 293, 101, 103, 107, 163, 59, 359, 193, 199,
                  137, 419, 431, 443, 151, 491, 509, 181, 109, 277, 593, 149, 307,
                  641, 653, 659, 683, 719, 241, 743, 373, 761, 257, 157, 263, 809,
                  271, 409, 283, 433, 911, 311, 313, 953, 487, 331, 499, 1013, 1019,
                  1031, 347, 1049, 211, 269, 367, 1103, 577, 167, 397, 1223, 1229,
                  619, 1289, 223, 673, 229, 461, 467, 1409, 709, 1439, 1451, 727,
                  739, 1481, 1499, 503, 1511, 1559, 1583, 1601, 401, 557, 337, 853,
                  1733, 349, 883, 197;

                  upper = FindPeaks[list];

                  lower = 1, -1 # & /@ FindPeaks[-list];

                  ListLinePlot[list, lower, upper,
                  PlotStyle -> LightGray, Blue, Red]


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 1 hour ago









                  Bob HanlonBob Hanlon

                  61.9k33598




                  61.9k33598



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Mathematica 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%2fmathematica.stackexchange.com%2fquestions%2f197055%2fpartitioning-values-in-a-sequence%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

                      How to create a command for the “strange m” symbol in latex? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How do you make your own symbol when Detexify fails?Writing bold small caps with mathpazo packageplus-minus symbol with parenthesis around the minus signGreek character in Beamer document titleHow to create dashed right arrow over symbol?Currency symbol: Turkish LiraDouble prec as a single symbol?Plus Sign Too Big; How to Call adfbullet?Is there a TeX macro for three-legged pi?How do I get my integral-like symbol to align like the integral?How to selectively substitute a letter with another symbol representing the same letterHow do I generate a less than symbol and vertical bar that are the same height?

                      Българска екзархия Съдържание История | Български екзарси | Вижте също | Външни препратки | Литература | Бележки | НавигацияУстав за управлението на българската екзархия. Цариград, 1870Слово на Ловешкия митрополит Иларион при откриването на Българския народен събор в Цариград на 23. II. 1870 г.Българската правда и гръцката кривда. От С. М. (= Софийски Мелетий). Цариград, 1872Предстоятели на Българската екзархияПодмененият ВеликденИнформационна агенция „Фокус“Димитър Ризов. Българите в техните исторически, етнографически и политически граници (Атлас съдържащ 40 карти). Berlin, Königliche Hoflithographie, Hof-Buch- und -Steindruckerei Wilhelm Greve, 1917Report of the International Commission to Inquire into the Causes and Conduct of the Balkan Wars

                      Category:Tremithousa Media in category "Tremithousa"Navigation menuUpload media34° 49′ 02.7″ N, 32° 26′ 37.32″ EOpenStreetMapGoogle EarthProximityramaReasonatorScholiaStatisticsWikiShootMe