Stirling numbers of second kind, but no two adjacent numbers in same part. Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Stirling numbers of the second kind with constraintsBall Colouring problem clarificationSolving inequalities regarding Stirling numbersIf $S(n, n - 3) = a binom n 4 + b binom n 5 + c binom n 6$, find $a, b, c$ (where $S(n, k)$ denotes a Stirling number of the second kind)stirling numbers of second kindStirling Number of Second kind.Stirling numbers of the second kind: How to obtain a recurrence relation from a generating function?How to use bijective proof to prove $S(n+1, m+1) = sumlimits_k=m^n S(k, m) × binomnk$Find number of occurrences of $n$ in a combinationProbability of matching exactly 1 number if 3 unique numbers are picked from a set of 4 numbers, but the order of the numbers matters

How to recreate this effect in Photoshop?

How do I stop a creek from eroding my steep embankment?

Why does Python start at index 1 when iterating an array backwards?

How to pronounce "criar"?

Why is there no army of Iron-Mans in the MCU?

Check which numbers satisfy the condition [A*B*C = A! + B! + C!]

How can I fade player when goes inside or outside of the area?

The logistics of corpse disposal

What LEGO pieces have "real-world" functionality?

cpython3 different behavior between running a file line by line in interpreter mode and "python3 file"

List *all* the tuples!

Sorting numerically

Is 1 ppb equal to 1 μg/kg?

How does a biquinary adder work?

How should I respond to a player wanting to catch a sword between their hands?

Why is the black pepper both grey and black?

Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?

How is the internal pullup resistor in a microcontroller wired?

Stars Make Stars

If Jon Snow became King of the Seven Kingdoms what would his regnal number be?

Letter Boxed validator

ListPlot join points by nearest neighbor rather than order

What causes the vertical black lines in my photo?

How much radiation do nowadays nuclear physics experiments impose on researcher



Stirling numbers of second kind, but no two adjacent numbers in same part.



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Stirling numbers of the second kind with constraintsBall Colouring problem clarificationSolving inequalities regarding Stirling numbersIf $S(n, n - 3) = a binom n 4 + b binom n 5 + c binom n 6$, find $a, b, c$ (where $S(n, k)$ denotes a Stirling number of the second kind)stirling numbers of second kindStirling Number of Second kind.Stirling numbers of the second kind: How to obtain a recurrence relation from a generating function?How to use bijective proof to prove $S(n+1, m+1) = sumlimits_k=m^n S(k, m) × binomnk$Find number of occurrences of $n$ in a combinationProbability of matching exactly 1 number if 3 unique numbers are picked from a set of 4 numbers, but the order of the numbers matters










4












$begingroup$


Update: The problem has been solved. @Phicar and I individually give two transformation from $hrightarrow S$ and $Srightarrow h$, and they are inverse of each other. Any other explanation or bijective is still welcomed!



We know that the number of ways to put $n$ distinct balls (indexed $1,2,ldots,n$) into $m$ non-empty non-distinct boxes ($mleq n$) is the Stirling number of second type $S(n,m)$



We have the formula $S(n,m)=S(n-1,m-1)+mS(n-1,m)$ as well as the initial value $S(n,n)=S(n,1)=1$



Now we add the restriction that the adjacent balls should not be put into the same box(here we define $1$ and $n$ is non-adjacent),and the number of ways is $h(n,m)$



Similarly, we have $h(n,m)=h(n-1,m-1)+(m-1)h(n-1,m)$ and $h(n,n)=1,h(n,2)=1​$. The only thing change here is the coefficient of the second term.



In fact, we can easily get the result that $h(n,m)=S(n-1,m-1)$



But I cannot figure out a more intuitive explanation or a bijective to show this equivalent relationship. Here I provides some basic example



$h(4,3)=S(3,2)=3​$$4,2,3​$ and $3,2,1​$



$h(5,3)=S(4,2)=7$,



$4,25,25,2,15,35,13$ and



$3,34,2,13,14,234,123$










share|cite|improve this question









New contributor




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







$endgroup$
















    4












    $begingroup$


    Update: The problem has been solved. @Phicar and I individually give two transformation from $hrightarrow S$ and $Srightarrow h$, and they are inverse of each other. Any other explanation or bijective is still welcomed!



    We know that the number of ways to put $n$ distinct balls (indexed $1,2,ldots,n$) into $m$ non-empty non-distinct boxes ($mleq n$) is the Stirling number of second type $S(n,m)$



    We have the formula $S(n,m)=S(n-1,m-1)+mS(n-1,m)$ as well as the initial value $S(n,n)=S(n,1)=1$



    Now we add the restriction that the adjacent balls should not be put into the same box(here we define $1$ and $n$ is non-adjacent),and the number of ways is $h(n,m)$



    Similarly, we have $h(n,m)=h(n-1,m-1)+(m-1)h(n-1,m)$ and $h(n,n)=1,h(n,2)=1​$. The only thing change here is the coefficient of the second term.



    In fact, we can easily get the result that $h(n,m)=S(n-1,m-1)$



    But I cannot figure out a more intuitive explanation or a bijective to show this equivalent relationship. Here I provides some basic example



    $h(4,3)=S(3,2)=3​$$4,2,3​$ and $3,2,1​$



    $h(5,3)=S(4,2)=7$,



    $4,25,25,2,15,35,13$ and



    $3,34,2,13,14,234,123$










    share|cite|improve this question









    New contributor




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







    $endgroup$














      4












      4








      4





      $begingroup$


      Update: The problem has been solved. @Phicar and I individually give two transformation from $hrightarrow S$ and $Srightarrow h$, and they are inverse of each other. Any other explanation or bijective is still welcomed!



      We know that the number of ways to put $n$ distinct balls (indexed $1,2,ldots,n$) into $m$ non-empty non-distinct boxes ($mleq n$) is the Stirling number of second type $S(n,m)$



      We have the formula $S(n,m)=S(n-1,m-1)+mS(n-1,m)$ as well as the initial value $S(n,n)=S(n,1)=1$



      Now we add the restriction that the adjacent balls should not be put into the same box(here we define $1$ and $n$ is non-adjacent),and the number of ways is $h(n,m)$



      Similarly, we have $h(n,m)=h(n-1,m-1)+(m-1)h(n-1,m)$ and $h(n,n)=1,h(n,2)=1​$. The only thing change here is the coefficient of the second term.



      In fact, we can easily get the result that $h(n,m)=S(n-1,m-1)$



      But I cannot figure out a more intuitive explanation or a bijective to show this equivalent relationship. Here I provides some basic example



      $h(4,3)=S(3,2)=3​$$4,2,3​$ and $3,2,1​$



      $h(5,3)=S(4,2)=7$,



      $4,25,25,2,15,35,13$ and



      $3,34,2,13,14,234,123$










      share|cite|improve this question









      New contributor




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







      $endgroup$




      Update: The problem has been solved. @Phicar and I individually give two transformation from $hrightarrow S$ and $Srightarrow h$, and they are inverse of each other. Any other explanation or bijective is still welcomed!



      We know that the number of ways to put $n$ distinct balls (indexed $1,2,ldots,n$) into $m$ non-empty non-distinct boxes ($mleq n$) is the Stirling number of second type $S(n,m)$



      We have the formula $S(n,m)=S(n-1,m-1)+mS(n-1,m)$ as well as the initial value $S(n,n)=S(n,1)=1$



      Now we add the restriction that the adjacent balls should not be put into the same box(here we define $1$ and $n$ is non-adjacent),and the number of ways is $h(n,m)$



      Similarly, we have $h(n,m)=h(n-1,m-1)+(m-1)h(n-1,m)$ and $h(n,n)=1,h(n,2)=1​$. The only thing change here is the coefficient of the second term.



      In fact, we can easily get the result that $h(n,m)=S(n-1,m-1)$



      But I cannot figure out a more intuitive explanation or a bijective to show this equivalent relationship. Here I provides some basic example



      $h(4,3)=S(3,2)=3​$$4,2,3​$ and $3,2,1​$



      $h(5,3)=S(4,2)=7$,



      $4,25,25,2,15,35,13$ and



      $3,34,2,13,14,234,123$







      combinatorics recurrence-relations stirling-numbers






      share|cite|improve this question









      New contributor




      VicaYang 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




      VicaYang 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








      edited 43 mins ago







      VicaYang













      New contributor




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









      asked 7 hours ago









      VicaYangVicaYang

      1336




      1336




      New contributor




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





      New contributor





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






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




















          3 Answers
          3






          active

          oldest

          votes


















          3












          $begingroup$

          I will denote $[n]brace k=pi$ the partitions of $[n]$ into $k$ blocks and i will denote $mathbbH(n,k)=pi in [n]brace k: pi text has no adjacent elements$ so that $|mathbbH(n,k)|=h(n,k).$
          Consider the following function
          $$varphi :[n-1]brace k-1longrightarrow mathbbH(n,k),$$
          given by $varphi (pi)=gamma$ where if $pi = B_1,cdots ,B_k$ then
          $gamma$ is taking each block $B$ of $pi$ and applying the algorithm find biggest $iin B$ such that $i,i-1 in B$ take $Bsetminus i-1$ and add $i$ to a new block that contains $n.$
          in other words you send the elements that contradict your assumption of being adjacent to a block that contains $n.$
          Example:
          $$varphi (3)=colorred15|24|3$$
          $$varphi (colorred12)=colorred135|2|4$$
          $$varphi (2)=14|2|colorred35$$
          $$varphi(4)=13|colorred25|4$$
          $$varphi(1)=1|24|colorred35$$
          Show that this and yours are inverse of each other.






          share|cite|improve this answer











          $endgroup$




















            2












            $begingroup$

            I will illustrate Phicar's bijection in more detail and explain why it is invertible.



            You start with a partition of $[n-1]$ into $m-1$ non-distinct parts. Let us focus on a single part. For example, when $n=12$, one part could be
            $$
            1,2,3,5,6,8,9,10,11
            $$

            Now, break this into chains of consecutive integers.
            $$

            1,2,3quad 5,6quad 8,9,10,11

            $$

            Within each chain, we will keep the highest element, remove the second highest, keeps the third highest, remove the fourth highest, etc. The removed elements will all be put into a new part with the added element, $n$.
            $$

            1,colorred2,3quad colorred5,6quad colorred8,9,colorred10,11
            \Downarrow\1,3quad6quad
            9,11quad,quad 2,5,8,10,12$$

            We do this for every part. It is easy to see the result will have no consecutive integers in the same part.



            Now, why is this invertible? Given a partition of $[n]$ into $m$ distinct parts with no two adjacent elements in the same part, look at the part containing $n$. Everything in that part was moved there from a different part. But it is easy to see where it was moved from; the number $k$ must have come from the part containing $k+1$. After moving all these elements back, and deleting $n$, we get a partition of $[n-1]$ into $[m-1]$ parts.






            share|cite|improve this answer









            $endgroup$












            • $begingroup$
              Yes, I realize that Phicar’s construction and mine are mutually inverse to each other.
              $endgroup$
              – VicaYang
              52 mins ago



















            1












            $begingroup$

            My friend HHT gives a transformation.



            I use the python code to verify that my construction and @Phicar 's construction is bijective. But I still cannot provide the proof now



            In $h(n,m)$, consider the boxes with $n^textth$ ball. The box contains $a_1^textth,a_2^textthldots,n^textth$. Move all the ball $a_i^textth$ to the box containing $a_i+1^textth$ until the box contains $n^textth$ ball only. Then remove the box as well as the $n^textth$ ball.



            But I still cannot prove it is a bijective yet



            The example:



            $4,25,25,2,15,35,13$



            Move balls:



            $5,123,14,5,124,5,13$



            Remove $5$



            $34,123,14,2,3,234,13$





            # assert n <= 10 for convenience, otherwise the str will be too long
            # and my brute force algorithm will be too slow

            import copy

            def sort(arr):
            for elem in arr:
            elem = sorted(elem)
            arr = sorted(arr, key=lambda x:x[0])
            return arr

            def is_valid_S(arr):
            return all(arr)

            def is_valid_H(arr):
            if not is_valid_S(arr):
            return False
            for elem in arr:
            for i in range(len(elem)-1):
            if elem[i] + 1 == elem[i+1]:
            return False
            return True

            # generate(5, 3, is_valid_H) or generate(4, 2, is_valid_S)
            def generate(n, m, is_valid):
            res = []
            for i in range(m**n):
            val = i
            tmp = []
            for i in range(m):
            tmp.append([])
            for idx in range(n):
            tmp[val % m].append(idx+1)
            val //= m
            if is_valid(tmp) and sort(tmp) not in res:
            res.append(sort(tmp))
            return res


            def H2S(m_h_arr):
            h_arr = copy.deepcopy(m_h_arr)
            n = max(map(max, h_arr))
            idx = 0
            while n not in h_arr[idx]:
            idx += 1
            h_arr[idx].remove(n)
            for elem in h_arr[idx]:
            _idx = 0
            while elem + 1 not in h_arr[_idx]:
            _idx += 1
            h_arr[_idx].insert(h_arr[_idx].index(elem+1),elem)
            del h_arr[idx]
            return h_arr

            def remove_adjacent(elem):
            idx = len(elem) - 2
            removed = []
            while idx != -1:
            if elem[idx] + 1 == elem[idx + 1]:
            removed.append(elem[idx])
            del elem[idx]
            idx -= 1
            return elem, removed

            def S2H(m_s_arr):
            s_arr = copy.deepcopy(m_s_arr)
            n = max(map(max, s_arr))
            removed = []
            for i in range(len(s_arr)):
            e, r = remove_adjacent(s_arr[i])
            s_arr[i] = e
            for val in r:
            removed.append(val)
            removed.append(n+1)
            s_arr.append(sorted(removed))
            return sort(s_arr)

            def is_bijective(n, m, H2S, S2H):
            if n > 9:
            print("please set n < 10")
            return
            hs = generate(n, m, is_valid_H)
            ss = generate(n-1, m-1, is_valid_S)
            ss_ = list(map(H2S, hs))
            hs_ = list(map(S2H, ss))
            return all(map(lambda x:x in hs, hs_))
            and all(map(lambda x:x in hs_, hs))
            and all(map(lambda x:x in ss, ss_))
            and all(map(lambda x:x in ss_, ss))

            is_bijective(8,4,H2S,S2H)
            ```





            share|cite|improve this answer










            New contributor




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






            $endgroup$













              Your Answer








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



              );






              VicaYang 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%2f3188517%2fstirling-numbers-of-second-kind-but-no-two-adjacent-numbers-in-same-part%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3












              $begingroup$

              I will denote $[n]brace k=pi$ the partitions of $[n]$ into $k$ blocks and i will denote $mathbbH(n,k)=pi in [n]brace k: pi text has no adjacent elements$ so that $|mathbbH(n,k)|=h(n,k).$
              Consider the following function
              $$varphi :[n-1]brace k-1longrightarrow mathbbH(n,k),$$
              given by $varphi (pi)=gamma$ where if $pi = B_1,cdots ,B_k$ then
              $gamma$ is taking each block $B$ of $pi$ and applying the algorithm find biggest $iin B$ such that $i,i-1 in B$ take $Bsetminus i-1$ and add $i$ to a new block that contains $n.$
              in other words you send the elements that contradict your assumption of being adjacent to a block that contains $n.$
              Example:
              $$varphi (3)=colorred15|24|3$$
              $$varphi (colorred12)=colorred135|2|4$$
              $$varphi (2)=14|2|colorred35$$
              $$varphi(4)=13|colorred25|4$$
              $$varphi(1)=1|24|colorred35$$
              Show that this and yours are inverse of each other.






              share|cite|improve this answer











              $endgroup$

















                3












                $begingroup$

                I will denote $[n]brace k=pi$ the partitions of $[n]$ into $k$ blocks and i will denote $mathbbH(n,k)=pi in [n]brace k: pi text has no adjacent elements$ so that $|mathbbH(n,k)|=h(n,k).$
                Consider the following function
                $$varphi :[n-1]brace k-1longrightarrow mathbbH(n,k),$$
                given by $varphi (pi)=gamma$ where if $pi = B_1,cdots ,B_k$ then
                $gamma$ is taking each block $B$ of $pi$ and applying the algorithm find biggest $iin B$ such that $i,i-1 in B$ take $Bsetminus i-1$ and add $i$ to a new block that contains $n.$
                in other words you send the elements that contradict your assumption of being adjacent to a block that contains $n.$
                Example:
                $$varphi (3)=colorred15|24|3$$
                $$varphi (colorred12)=colorred135|2|4$$
                $$varphi (2)=14|2|colorred35$$
                $$varphi(4)=13|colorred25|4$$
                $$varphi(1)=1|24|colorred35$$
                Show that this and yours are inverse of each other.






                share|cite|improve this answer











                $endgroup$















                  3












                  3








                  3





                  $begingroup$

                  I will denote $[n]brace k=pi$ the partitions of $[n]$ into $k$ blocks and i will denote $mathbbH(n,k)=pi in [n]brace k: pi text has no adjacent elements$ so that $|mathbbH(n,k)|=h(n,k).$
                  Consider the following function
                  $$varphi :[n-1]brace k-1longrightarrow mathbbH(n,k),$$
                  given by $varphi (pi)=gamma$ where if $pi = B_1,cdots ,B_k$ then
                  $gamma$ is taking each block $B$ of $pi$ and applying the algorithm find biggest $iin B$ such that $i,i-1 in B$ take $Bsetminus i-1$ and add $i$ to a new block that contains $n.$
                  in other words you send the elements that contradict your assumption of being adjacent to a block that contains $n.$
                  Example:
                  $$varphi (3)=colorred15|24|3$$
                  $$varphi (colorred12)=colorred135|2|4$$
                  $$varphi (2)=14|2|colorred35$$
                  $$varphi(4)=13|colorred25|4$$
                  $$varphi(1)=1|24|colorred35$$
                  Show that this and yours are inverse of each other.






                  share|cite|improve this answer











                  $endgroup$



                  I will denote $[n]brace k=pi$ the partitions of $[n]$ into $k$ blocks and i will denote $mathbbH(n,k)=pi in [n]brace k: pi text has no adjacent elements$ so that $|mathbbH(n,k)|=h(n,k).$
                  Consider the following function
                  $$varphi :[n-1]brace k-1longrightarrow mathbbH(n,k),$$
                  given by $varphi (pi)=gamma$ where if $pi = B_1,cdots ,B_k$ then
                  $gamma$ is taking each block $B$ of $pi$ and applying the algorithm find biggest $iin B$ such that $i,i-1 in B$ take $Bsetminus i-1$ and add $i$ to a new block that contains $n.$
                  in other words you send the elements that contradict your assumption of being adjacent to a block that contains $n.$
                  Example:
                  $$varphi (3)=colorred15|24|3$$
                  $$varphi (colorred12)=colorred135|2|4$$
                  $$varphi (2)=14|2|colorred35$$
                  $$varphi(4)=13|colorred25|4$$
                  $$varphi(1)=1|24|colorred35$$
                  Show that this and yours are inverse of each other.







                  share|cite|improve this answer














                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited 3 hours ago

























                  answered 3 hours ago









                  PhicarPhicar

                  2,9101915




                  2,9101915





















                      2












                      $begingroup$

                      I will illustrate Phicar's bijection in more detail and explain why it is invertible.



                      You start with a partition of $[n-1]$ into $m-1$ non-distinct parts. Let us focus on a single part. For example, when $n=12$, one part could be
                      $$
                      1,2,3,5,6,8,9,10,11
                      $$

                      Now, break this into chains of consecutive integers.
                      $$

                      1,2,3quad 5,6quad 8,9,10,11

                      $$

                      Within each chain, we will keep the highest element, remove the second highest, keeps the third highest, remove the fourth highest, etc. The removed elements will all be put into a new part with the added element, $n$.
                      $$

                      1,colorred2,3quad colorred5,6quad colorred8,9,colorred10,11
                      \Downarrow\1,3quad6quad
                      9,11quad,quad 2,5,8,10,12$$

                      We do this for every part. It is easy to see the result will have no consecutive integers in the same part.



                      Now, why is this invertible? Given a partition of $[n]$ into $m$ distinct parts with no two adjacent elements in the same part, look at the part containing $n$. Everything in that part was moved there from a different part. But it is easy to see where it was moved from; the number $k$ must have come from the part containing $k+1$. After moving all these elements back, and deleting $n$, we get a partition of $[n-1]$ into $[m-1]$ parts.






                      share|cite|improve this answer









                      $endgroup$












                      • $begingroup$
                        Yes, I realize that Phicar’s construction and mine are mutually inverse to each other.
                        $endgroup$
                        – VicaYang
                        52 mins ago
















                      2












                      $begingroup$

                      I will illustrate Phicar's bijection in more detail and explain why it is invertible.



                      You start with a partition of $[n-1]$ into $m-1$ non-distinct parts. Let us focus on a single part. For example, when $n=12$, one part could be
                      $$
                      1,2,3,5,6,8,9,10,11
                      $$

                      Now, break this into chains of consecutive integers.
                      $$

                      1,2,3quad 5,6quad 8,9,10,11

                      $$

                      Within each chain, we will keep the highest element, remove the second highest, keeps the third highest, remove the fourth highest, etc. The removed elements will all be put into a new part with the added element, $n$.
                      $$

                      1,colorred2,3quad colorred5,6quad colorred8,9,colorred10,11
                      \Downarrow\1,3quad6quad
                      9,11quad,quad 2,5,8,10,12$$

                      We do this for every part. It is easy to see the result will have no consecutive integers in the same part.



                      Now, why is this invertible? Given a partition of $[n]$ into $m$ distinct parts with no two adjacent elements in the same part, look at the part containing $n$. Everything in that part was moved there from a different part. But it is easy to see where it was moved from; the number $k$ must have come from the part containing $k+1$. After moving all these elements back, and deleting $n$, we get a partition of $[n-1]$ into $[m-1]$ parts.






                      share|cite|improve this answer









                      $endgroup$












                      • $begingroup$
                        Yes, I realize that Phicar’s construction and mine are mutually inverse to each other.
                        $endgroup$
                        – VicaYang
                        52 mins ago














                      2












                      2








                      2





                      $begingroup$

                      I will illustrate Phicar's bijection in more detail and explain why it is invertible.



                      You start with a partition of $[n-1]$ into $m-1$ non-distinct parts. Let us focus on a single part. For example, when $n=12$, one part could be
                      $$
                      1,2,3,5,6,8,9,10,11
                      $$

                      Now, break this into chains of consecutive integers.
                      $$

                      1,2,3quad 5,6quad 8,9,10,11

                      $$

                      Within each chain, we will keep the highest element, remove the second highest, keeps the third highest, remove the fourth highest, etc. The removed elements will all be put into a new part with the added element, $n$.
                      $$

                      1,colorred2,3quad colorred5,6quad colorred8,9,colorred10,11
                      \Downarrow\1,3quad6quad
                      9,11quad,quad 2,5,8,10,12$$

                      We do this for every part. It is easy to see the result will have no consecutive integers in the same part.



                      Now, why is this invertible? Given a partition of $[n]$ into $m$ distinct parts with no two adjacent elements in the same part, look at the part containing $n$. Everything in that part was moved there from a different part. But it is easy to see where it was moved from; the number $k$ must have come from the part containing $k+1$. After moving all these elements back, and deleting $n$, we get a partition of $[n-1]$ into $[m-1]$ parts.






                      share|cite|improve this answer









                      $endgroup$



                      I will illustrate Phicar's bijection in more detail and explain why it is invertible.



                      You start with a partition of $[n-1]$ into $m-1$ non-distinct parts. Let us focus on a single part. For example, when $n=12$, one part could be
                      $$
                      1,2,3,5,6,8,9,10,11
                      $$

                      Now, break this into chains of consecutive integers.
                      $$

                      1,2,3quad 5,6quad 8,9,10,11

                      $$

                      Within each chain, we will keep the highest element, remove the second highest, keeps the third highest, remove the fourth highest, etc. The removed elements will all be put into a new part with the added element, $n$.
                      $$

                      1,colorred2,3quad colorred5,6quad colorred8,9,colorred10,11
                      \Downarrow\1,3quad6quad
                      9,11quad,quad 2,5,8,10,12$$

                      We do this for every part. It is easy to see the result will have no consecutive integers in the same part.



                      Now, why is this invertible? Given a partition of $[n]$ into $m$ distinct parts with no two adjacent elements in the same part, look at the part containing $n$. Everything in that part was moved there from a different part. But it is easy to see where it was moved from; the number $k$ must have come from the part containing $k+1$. After moving all these elements back, and deleting $n$, we get a partition of $[n-1]$ into $[m-1]$ parts.







                      share|cite|improve this answer












                      share|cite|improve this answer



                      share|cite|improve this answer










                      answered 1 hour ago









                      Mike EarnestMike Earnest

                      27.9k22152




                      27.9k22152











                      • $begingroup$
                        Yes, I realize that Phicar’s construction and mine are mutually inverse to each other.
                        $endgroup$
                        – VicaYang
                        52 mins ago

















                      • $begingroup$
                        Yes, I realize that Phicar’s construction and mine are mutually inverse to each other.
                        $endgroup$
                        – VicaYang
                        52 mins ago
















                      $begingroup$
                      Yes, I realize that Phicar’s construction and mine are mutually inverse to each other.
                      $endgroup$
                      – VicaYang
                      52 mins ago





                      $begingroup$
                      Yes, I realize that Phicar’s construction and mine are mutually inverse to each other.
                      $endgroup$
                      – VicaYang
                      52 mins ago












                      1












                      $begingroup$

                      My friend HHT gives a transformation.



                      I use the python code to verify that my construction and @Phicar 's construction is bijective. But I still cannot provide the proof now



                      In $h(n,m)$, consider the boxes with $n^textth$ ball. The box contains $a_1^textth,a_2^textthldots,n^textth$. Move all the ball $a_i^textth$ to the box containing $a_i+1^textth$ until the box contains $n^textth$ ball only. Then remove the box as well as the $n^textth$ ball.



                      But I still cannot prove it is a bijective yet



                      The example:



                      $4,25,25,2,15,35,13$



                      Move balls:



                      $5,123,14,5,124,5,13$



                      Remove $5$



                      $34,123,14,2,3,234,13$





                      # assert n <= 10 for convenience, otherwise the str will be too long
                      # and my brute force algorithm will be too slow

                      import copy

                      def sort(arr):
                      for elem in arr:
                      elem = sorted(elem)
                      arr = sorted(arr, key=lambda x:x[0])
                      return arr

                      def is_valid_S(arr):
                      return all(arr)

                      def is_valid_H(arr):
                      if not is_valid_S(arr):
                      return False
                      for elem in arr:
                      for i in range(len(elem)-1):
                      if elem[i] + 1 == elem[i+1]:
                      return False
                      return True

                      # generate(5, 3, is_valid_H) or generate(4, 2, is_valid_S)
                      def generate(n, m, is_valid):
                      res = []
                      for i in range(m**n):
                      val = i
                      tmp = []
                      for i in range(m):
                      tmp.append([])
                      for idx in range(n):
                      tmp[val % m].append(idx+1)
                      val //= m
                      if is_valid(tmp) and sort(tmp) not in res:
                      res.append(sort(tmp))
                      return res


                      def H2S(m_h_arr):
                      h_arr = copy.deepcopy(m_h_arr)
                      n = max(map(max, h_arr))
                      idx = 0
                      while n not in h_arr[idx]:
                      idx += 1
                      h_arr[idx].remove(n)
                      for elem in h_arr[idx]:
                      _idx = 0
                      while elem + 1 not in h_arr[_idx]:
                      _idx += 1
                      h_arr[_idx].insert(h_arr[_idx].index(elem+1),elem)
                      del h_arr[idx]
                      return h_arr

                      def remove_adjacent(elem):
                      idx = len(elem) - 2
                      removed = []
                      while idx != -1:
                      if elem[idx] + 1 == elem[idx + 1]:
                      removed.append(elem[idx])
                      del elem[idx]
                      idx -= 1
                      return elem, removed

                      def S2H(m_s_arr):
                      s_arr = copy.deepcopy(m_s_arr)
                      n = max(map(max, s_arr))
                      removed = []
                      for i in range(len(s_arr)):
                      e, r = remove_adjacent(s_arr[i])
                      s_arr[i] = e
                      for val in r:
                      removed.append(val)
                      removed.append(n+1)
                      s_arr.append(sorted(removed))
                      return sort(s_arr)

                      def is_bijective(n, m, H2S, S2H):
                      if n > 9:
                      print("please set n < 10")
                      return
                      hs = generate(n, m, is_valid_H)
                      ss = generate(n-1, m-1, is_valid_S)
                      ss_ = list(map(H2S, hs))
                      hs_ = list(map(S2H, ss))
                      return all(map(lambda x:x in hs, hs_))
                      and all(map(lambda x:x in hs_, hs))
                      and all(map(lambda x:x in ss, ss_))
                      and all(map(lambda x:x in ss_, ss))

                      is_bijective(8,4,H2S,S2H)
                      ```





                      share|cite|improve this answer










                      New contributor




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






                      $endgroup$

















                        1












                        $begingroup$

                        My friend HHT gives a transformation.



                        I use the python code to verify that my construction and @Phicar 's construction is bijective. But I still cannot provide the proof now



                        In $h(n,m)$, consider the boxes with $n^textth$ ball. The box contains $a_1^textth,a_2^textthldots,n^textth$. Move all the ball $a_i^textth$ to the box containing $a_i+1^textth$ until the box contains $n^textth$ ball only. Then remove the box as well as the $n^textth$ ball.



                        But I still cannot prove it is a bijective yet



                        The example:



                        $4,25,25,2,15,35,13$



                        Move balls:



                        $5,123,14,5,124,5,13$



                        Remove $5$



                        $34,123,14,2,3,234,13$





                        # assert n <= 10 for convenience, otherwise the str will be too long
                        # and my brute force algorithm will be too slow

                        import copy

                        def sort(arr):
                        for elem in arr:
                        elem = sorted(elem)
                        arr = sorted(arr, key=lambda x:x[0])
                        return arr

                        def is_valid_S(arr):
                        return all(arr)

                        def is_valid_H(arr):
                        if not is_valid_S(arr):
                        return False
                        for elem in arr:
                        for i in range(len(elem)-1):
                        if elem[i] + 1 == elem[i+1]:
                        return False
                        return True

                        # generate(5, 3, is_valid_H) or generate(4, 2, is_valid_S)
                        def generate(n, m, is_valid):
                        res = []
                        for i in range(m**n):
                        val = i
                        tmp = []
                        for i in range(m):
                        tmp.append([])
                        for idx in range(n):
                        tmp[val % m].append(idx+1)
                        val //= m
                        if is_valid(tmp) and sort(tmp) not in res:
                        res.append(sort(tmp))
                        return res


                        def H2S(m_h_arr):
                        h_arr = copy.deepcopy(m_h_arr)
                        n = max(map(max, h_arr))
                        idx = 0
                        while n not in h_arr[idx]:
                        idx += 1
                        h_arr[idx].remove(n)
                        for elem in h_arr[idx]:
                        _idx = 0
                        while elem + 1 not in h_arr[_idx]:
                        _idx += 1
                        h_arr[_idx].insert(h_arr[_idx].index(elem+1),elem)
                        del h_arr[idx]
                        return h_arr

                        def remove_adjacent(elem):
                        idx = len(elem) - 2
                        removed = []
                        while idx != -1:
                        if elem[idx] + 1 == elem[idx + 1]:
                        removed.append(elem[idx])
                        del elem[idx]
                        idx -= 1
                        return elem, removed

                        def S2H(m_s_arr):
                        s_arr = copy.deepcopy(m_s_arr)
                        n = max(map(max, s_arr))
                        removed = []
                        for i in range(len(s_arr)):
                        e, r = remove_adjacent(s_arr[i])
                        s_arr[i] = e
                        for val in r:
                        removed.append(val)
                        removed.append(n+1)
                        s_arr.append(sorted(removed))
                        return sort(s_arr)

                        def is_bijective(n, m, H2S, S2H):
                        if n > 9:
                        print("please set n < 10")
                        return
                        hs = generate(n, m, is_valid_H)
                        ss = generate(n-1, m-1, is_valid_S)
                        ss_ = list(map(H2S, hs))
                        hs_ = list(map(S2H, ss))
                        return all(map(lambda x:x in hs, hs_))
                        and all(map(lambda x:x in hs_, hs))
                        and all(map(lambda x:x in ss, ss_))
                        and all(map(lambda x:x in ss_, ss))

                        is_bijective(8,4,H2S,S2H)
                        ```





                        share|cite|improve this answer










                        New contributor




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






                        $endgroup$















                          1












                          1








                          1





                          $begingroup$

                          My friend HHT gives a transformation.



                          I use the python code to verify that my construction and @Phicar 's construction is bijective. But I still cannot provide the proof now



                          In $h(n,m)$, consider the boxes with $n^textth$ ball. The box contains $a_1^textth,a_2^textthldots,n^textth$. Move all the ball $a_i^textth$ to the box containing $a_i+1^textth$ until the box contains $n^textth$ ball only. Then remove the box as well as the $n^textth$ ball.



                          But I still cannot prove it is a bijective yet



                          The example:



                          $4,25,25,2,15,35,13$



                          Move balls:



                          $5,123,14,5,124,5,13$



                          Remove $5$



                          $34,123,14,2,3,234,13$





                          # assert n <= 10 for convenience, otherwise the str will be too long
                          # and my brute force algorithm will be too slow

                          import copy

                          def sort(arr):
                          for elem in arr:
                          elem = sorted(elem)
                          arr = sorted(arr, key=lambda x:x[0])
                          return arr

                          def is_valid_S(arr):
                          return all(arr)

                          def is_valid_H(arr):
                          if not is_valid_S(arr):
                          return False
                          for elem in arr:
                          for i in range(len(elem)-1):
                          if elem[i] + 1 == elem[i+1]:
                          return False
                          return True

                          # generate(5, 3, is_valid_H) or generate(4, 2, is_valid_S)
                          def generate(n, m, is_valid):
                          res = []
                          for i in range(m**n):
                          val = i
                          tmp = []
                          for i in range(m):
                          tmp.append([])
                          for idx in range(n):
                          tmp[val % m].append(idx+1)
                          val //= m
                          if is_valid(tmp) and sort(tmp) not in res:
                          res.append(sort(tmp))
                          return res


                          def H2S(m_h_arr):
                          h_arr = copy.deepcopy(m_h_arr)
                          n = max(map(max, h_arr))
                          idx = 0
                          while n not in h_arr[idx]:
                          idx += 1
                          h_arr[idx].remove(n)
                          for elem in h_arr[idx]:
                          _idx = 0
                          while elem + 1 not in h_arr[_idx]:
                          _idx += 1
                          h_arr[_idx].insert(h_arr[_idx].index(elem+1),elem)
                          del h_arr[idx]
                          return h_arr

                          def remove_adjacent(elem):
                          idx = len(elem) - 2
                          removed = []
                          while idx != -1:
                          if elem[idx] + 1 == elem[idx + 1]:
                          removed.append(elem[idx])
                          del elem[idx]
                          idx -= 1
                          return elem, removed

                          def S2H(m_s_arr):
                          s_arr = copy.deepcopy(m_s_arr)
                          n = max(map(max, s_arr))
                          removed = []
                          for i in range(len(s_arr)):
                          e, r = remove_adjacent(s_arr[i])
                          s_arr[i] = e
                          for val in r:
                          removed.append(val)
                          removed.append(n+1)
                          s_arr.append(sorted(removed))
                          return sort(s_arr)

                          def is_bijective(n, m, H2S, S2H):
                          if n > 9:
                          print("please set n < 10")
                          return
                          hs = generate(n, m, is_valid_H)
                          ss = generate(n-1, m-1, is_valid_S)
                          ss_ = list(map(H2S, hs))
                          hs_ = list(map(S2H, ss))
                          return all(map(lambda x:x in hs, hs_))
                          and all(map(lambda x:x in hs_, hs))
                          and all(map(lambda x:x in ss, ss_))
                          and all(map(lambda x:x in ss_, ss))

                          is_bijective(8,4,H2S,S2H)
                          ```





                          share|cite|improve this answer










                          New contributor




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






                          $endgroup$



                          My friend HHT gives a transformation.



                          I use the python code to verify that my construction and @Phicar 's construction is bijective. But I still cannot provide the proof now



                          In $h(n,m)$, consider the boxes with $n^textth$ ball. The box contains $a_1^textth,a_2^textthldots,n^textth$. Move all the ball $a_i^textth$ to the box containing $a_i+1^textth$ until the box contains $n^textth$ ball only. Then remove the box as well as the $n^textth$ ball.



                          But I still cannot prove it is a bijective yet



                          The example:



                          $4,25,25,2,15,35,13$



                          Move balls:



                          $5,123,14,5,124,5,13$



                          Remove $5$



                          $34,123,14,2,3,234,13$





                          # assert n <= 10 for convenience, otherwise the str will be too long
                          # and my brute force algorithm will be too slow

                          import copy

                          def sort(arr):
                          for elem in arr:
                          elem = sorted(elem)
                          arr = sorted(arr, key=lambda x:x[0])
                          return arr

                          def is_valid_S(arr):
                          return all(arr)

                          def is_valid_H(arr):
                          if not is_valid_S(arr):
                          return False
                          for elem in arr:
                          for i in range(len(elem)-1):
                          if elem[i] + 1 == elem[i+1]:
                          return False
                          return True

                          # generate(5, 3, is_valid_H) or generate(4, 2, is_valid_S)
                          def generate(n, m, is_valid):
                          res = []
                          for i in range(m**n):
                          val = i
                          tmp = []
                          for i in range(m):
                          tmp.append([])
                          for idx in range(n):
                          tmp[val % m].append(idx+1)
                          val //= m
                          if is_valid(tmp) and sort(tmp) not in res:
                          res.append(sort(tmp))
                          return res


                          def H2S(m_h_arr):
                          h_arr = copy.deepcopy(m_h_arr)
                          n = max(map(max, h_arr))
                          idx = 0
                          while n not in h_arr[idx]:
                          idx += 1
                          h_arr[idx].remove(n)
                          for elem in h_arr[idx]:
                          _idx = 0
                          while elem + 1 not in h_arr[_idx]:
                          _idx += 1
                          h_arr[_idx].insert(h_arr[_idx].index(elem+1),elem)
                          del h_arr[idx]
                          return h_arr

                          def remove_adjacent(elem):
                          idx = len(elem) - 2
                          removed = []
                          while idx != -1:
                          if elem[idx] + 1 == elem[idx + 1]:
                          removed.append(elem[idx])
                          del elem[idx]
                          idx -= 1
                          return elem, removed

                          def S2H(m_s_arr):
                          s_arr = copy.deepcopy(m_s_arr)
                          n = max(map(max, s_arr))
                          removed = []
                          for i in range(len(s_arr)):
                          e, r = remove_adjacent(s_arr[i])
                          s_arr[i] = e
                          for val in r:
                          removed.append(val)
                          removed.append(n+1)
                          s_arr.append(sorted(removed))
                          return sort(s_arr)

                          def is_bijective(n, m, H2S, S2H):
                          if n > 9:
                          print("please set n < 10")
                          return
                          hs = generate(n, m, is_valid_H)
                          ss = generate(n-1, m-1, is_valid_S)
                          ss_ = list(map(H2S, hs))
                          hs_ = list(map(S2H, ss))
                          return all(map(lambda x:x in hs, hs_))
                          and all(map(lambda x:x in hs_, hs))
                          and all(map(lambda x:x in ss, ss_))
                          and all(map(lambda x:x in ss_, ss))

                          is_bijective(8,4,H2S,S2H)
                          ```






                          share|cite|improve this answer










                          New contributor




                          VicaYang 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 1 hour ago





















                          New contributor




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









                          answered 3 hours ago









                          VicaYangVicaYang

                          1336




                          1336




                          New contributor




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





                          New contributor





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






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




















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









                              draft saved

                              draft discarded


















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












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











                              VicaYang 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%2f3188517%2fstirling-numbers-of-second-kind-but-no-two-adjacent-numbers-in-same-part%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

                              Bett Inhaltsverzeichnis Geschichte | Bettformen | Bettgrößen | Andere Bezeichnungen | Bettenmangel | Betten in der bildenden Kunst | Schlafmedizinische Gesichtspunkte | Siehe auch | Literatur | Weblinks | Einzelnachweise | NavigationsmenüBett, Bettstatt, BettstelleCommons: BettBabybetten: Anwendung, Ausstattungsmerkmale und VergleichskriterienWasserbetten. Vorurteile im TestHapfnNursch10.1007/s11818-012-0584-74006250-8AKS4329276-8

                              Luksemburg Sisukord Nimi | Asend | Loodus | Riigikord | Haldusjaotus | Rahvastik | Riigikaitse | Majandus | Taristu | Ajalugu | Eesti ja Luksemburgi suhted | Haridus | Kultuur | Vaata ka | Viited | Välislingid | Navigeerimismenüü50° N, 6° EÜlevaade Luksemburgi kaitsealadest.Luksemburgi rahvaarv. Statistikaamet.World Bank'i andmebaasÜlevaade Luksemburgi loodusest.Ülevaade Luksemburgi metsadest.Guy Colling. "Red List of the Vascular Plants of Luxembourg." Travaux scientifiques du Musée national d’histoire naturelle Luxembourg. 2005.Luxembourg’s biodiversity at risk.Maailma kahepaiksete andmebaas.Denis Lepage. "Luxembourg." Avibase.Ülevaade temperatuuridest. Luksemburgi meteoroloogiateenistus.Ülevaade Luksemburgist. Euroopa Liidu esinduse koduleht.Système politique. TerritoireÜlevaade Luksemburgi rahvastikust. Luksemburgi statistikaamet.Luksemburgi rahvastik. Luksemburgi statistikaamet.The World FactbookMonique Borsenberger, Paul Dickes. "Religions au Luxembourg. Quelle évolution entre 1999-2008". Luksemburgi statistikaamet. 2011.Luksemburgi peapiiskopkond. Catholic-Hierarchy.Luksemburgi armee koduleht.Luksemburgi armee relvastus.Eesti Välisministeerium.Luksemburgi rahvastik. Luksemburgi statistikaamet.Luksemburgi Eesti Seltsi koduleht.Helen Eelrand. "Raadio, mis muutis maailma." Eesti Päevaleht. 13. märts 2004.Ülevaade Luksemburgi haridussüsteemist.Ülevaade Luksemburgi keskkoolidest.Luksemburgr

                              Valle di Casies Indice Geografia fisica | Origini del nome | Storia | Società | Amministrazione | Sport | Note | Bibliografia | Voci correlate | Altri progetti | Collegamenti esterni | Menu di navigazione46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)Sito istituzionaleAstat Censimento della popolazione 2011 - Determinazione della consistenza dei tre gruppi linguistici della Provincia Autonoma di Bolzano-Alto Adige - giugno 2012Numeri e fattiValle di CasiesDato IstatTabella dei gradi/giorno dei Comuni italiani raggruppati per Regione e Provincia26 agosto 1993, n. 412Heraldry of the World: GsiesStatistiche I.StatValCasies.comWikimedia CommonsWikimedia CommonsValle di CasiesSito ufficialeValle di CasiesMM14870458910042978-6