Probability when arranging $N$ different numbers in a line











up vote
1
down vote

favorite












we would like to arrange the numbers: $ 1, 2, ldots , N$ in a line.




  1. what is the probability that digits $1, 2$ are not arranged next to each other?


  2. what is the probability that digits $1, 2$ are not arranged next to each other, and also the digits $3, 4$ are arranged next to each other?



my attempt:



This is mostly a combinatorics question, as the "Probability", meaning: $$Omega = N!$$




  1. I treated $1, 2$ as a unit, looking for the number of different ways to arrange them next to each other - which would be the Complementary event.
    $$P(A)^C = frac{(N-1)! cdot 2 }{N!}$$
    where there's in fact $N-1$ needed to be arranged, ans 2 is the number of permutations.


so that $$P(A) = 1- frac{(N-1)! cdot 2 }{N!} = 1 - frac{2}{N}$$



for the second sections - I'm not sure.
suppose I'd be looking the number of different ways to arrange $1, 2, ldots N$ in a line so that the digits $1, 2$ and $ 3, 4$ are always arranged next to each other, then that will be:
$$frac{(N-2)! cdot 2 cdot 2}{N!}$$ where 4 is the number of permutations (2 for each unit of digits)
but does that mean that there's $$left(N! - {(N-2)! cdot 2 cdot 2}right) cdot left((N-2)! cdot 2 right)$$ ways to arrange the numbers?



that doesn't seem right.










share|cite|improve this question


























    up vote
    1
    down vote

    favorite












    we would like to arrange the numbers: $ 1, 2, ldots , N$ in a line.




    1. what is the probability that digits $1, 2$ are not arranged next to each other?


    2. what is the probability that digits $1, 2$ are not arranged next to each other, and also the digits $3, 4$ are arranged next to each other?



    my attempt:



    This is mostly a combinatorics question, as the "Probability", meaning: $$Omega = N!$$




    1. I treated $1, 2$ as a unit, looking for the number of different ways to arrange them next to each other - which would be the Complementary event.
      $$P(A)^C = frac{(N-1)! cdot 2 }{N!}$$
      where there's in fact $N-1$ needed to be arranged, ans 2 is the number of permutations.


    so that $$P(A) = 1- frac{(N-1)! cdot 2 }{N!} = 1 - frac{2}{N}$$



    for the second sections - I'm not sure.
    suppose I'd be looking the number of different ways to arrange $1, 2, ldots N$ in a line so that the digits $1, 2$ and $ 3, 4$ are always arranged next to each other, then that will be:
    $$frac{(N-2)! cdot 2 cdot 2}{N!}$$ where 4 is the number of permutations (2 for each unit of digits)
    but does that mean that there's $$left(N! - {(N-2)! cdot 2 cdot 2}right) cdot left((N-2)! cdot 2 right)$$ ways to arrange the numbers?



    that doesn't seem right.










    share|cite|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      we would like to arrange the numbers: $ 1, 2, ldots , N$ in a line.




      1. what is the probability that digits $1, 2$ are not arranged next to each other?


      2. what is the probability that digits $1, 2$ are not arranged next to each other, and also the digits $3, 4$ are arranged next to each other?



      my attempt:



      This is mostly a combinatorics question, as the "Probability", meaning: $$Omega = N!$$




      1. I treated $1, 2$ as a unit, looking for the number of different ways to arrange them next to each other - which would be the Complementary event.
        $$P(A)^C = frac{(N-1)! cdot 2 }{N!}$$
        where there's in fact $N-1$ needed to be arranged, ans 2 is the number of permutations.


      so that $$P(A) = 1- frac{(N-1)! cdot 2 }{N!} = 1 - frac{2}{N}$$



      for the second sections - I'm not sure.
      suppose I'd be looking the number of different ways to arrange $1, 2, ldots N$ in a line so that the digits $1, 2$ and $ 3, 4$ are always arranged next to each other, then that will be:
      $$frac{(N-2)! cdot 2 cdot 2}{N!}$$ where 4 is the number of permutations (2 for each unit of digits)
      but does that mean that there's $$left(N! - {(N-2)! cdot 2 cdot 2}right) cdot left((N-2)! cdot 2 right)$$ ways to arrange the numbers?



      that doesn't seem right.










      share|cite|improve this question













      we would like to arrange the numbers: $ 1, 2, ldots , N$ in a line.




      1. what is the probability that digits $1, 2$ are not arranged next to each other?


      2. what is the probability that digits $1, 2$ are not arranged next to each other, and also the digits $3, 4$ are arranged next to each other?



      my attempt:



      This is mostly a combinatorics question, as the "Probability", meaning: $$Omega = N!$$




      1. I treated $1, 2$ as a unit, looking for the number of different ways to arrange them next to each other - which would be the Complementary event.
        $$P(A)^C = frac{(N-1)! cdot 2 }{N!}$$
        where there's in fact $N-1$ needed to be arranged, ans 2 is the number of permutations.


      so that $$P(A) = 1- frac{(N-1)! cdot 2 }{N!} = 1 - frac{2}{N}$$



      for the second sections - I'm not sure.
      suppose I'd be looking the number of different ways to arrange $1, 2, ldots N$ in a line so that the digits $1, 2$ and $ 3, 4$ are always arranged next to each other, then that will be:
      $$frac{(N-2)! cdot 2 cdot 2}{N!}$$ where 4 is the number of permutations (2 for each unit of digits)
      but does that mean that there's $$left(N! - {(N-2)! cdot 2 cdot 2}right) cdot left((N-2)! cdot 2 right)$$ ways to arrange the numbers?



      that doesn't seem right.







      probability combinatorics






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Nov 19 at 13:57









      Jneven

      715320




      715320






















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          0
          down vote













          The number of ways that $1$ and $2$ appear next to each other can be calculated by considering both the numbers as a single unit. So the packets will be $$ (1,2),(3),(4),(5) ....... (N) $$
          Number of ways these can be arranged are $(N-1)!$ as there are $(N-1)$ packets. To consider the backward and forward arrangement of 1 and 2 inside the packet we need to multiply by two. So,

          Total ways for 1 and 2 to be arranged together is $2(N-1)!$



          So the numerator will be (Total ways-Undesired ways). $$N! - 2(N-1)!$$.

          Divide this with the total ways we get $$frac{N! - 2(N-1)!}{N!} = 1 - frac 2N$$



          For the second part we consider one packet with 1 and 2. The other packet with 3 and 4. So the packets will be,$$ (1,2),(3,4),(5),(6),(7) ....... (N) $$



          Arrangements in which 1 and 2 are together(like the first part) are $P(X)=2.(N-1)!$

          Arrangements in which 3 and 4 are together are $P(Y)=2.(N-1)!$

          Arrangements in which both groups (1 and 2) and (3 and 4) are together are $P(Z)=2.2.(N-2)!$. The two packets have an internal arrangement of two ways and the total count of packets is $(N-2)!$



          The numerator in the second part is $N! - P(X) - P(Y) + P(Z)$.
          The denominator will be $N!$






          share|cite|improve this answer




























            up vote
            0
            down vote













            Your work on the first part shows there are $2(N-1)!$ ways to arrange the numbers with $3,4$ next to each other. $4(N-2)!$ of those have $3,4$ at one end or the other. If they are at either end you are left with $N-2$ places and have to avoid $1,2$ next to each other, which happens $frac 2{N-2}$ of the time, so this gives $8(N-3)!$ arrangements wwith $3,4$ together at one end and $1,2$ apart. For the $3,4$ are together somewhere in the middle, there are $(2(N-1)-4)(N-2)!=2(N-3)(N-2)!$ arrangements. There are $N-4$ positions that can be the leftmost of the $1,2$, then $2$ ways to arrange $1,2$, and $(N-4)!$ ways to arrange the rest of the numbers, so there are $2(N-4)(N-4)!$ arrangements with $3,4$ together in the middle and $1,2$ apart.



            The chance is then $$frac {8(N-3)!+2(N-4)(N-4)!}{N!}=frac {(10N-36)(N-4)!}{N!}$$






            share|cite|improve this answer




























              up vote
              0
              down vote













              Your answer to the first question is correct.




              If the integers $1, 2, 3, ldots, N$ are arranged in a line, what is the probability that the numbers $3$ and $4$ are arranged next to each other but the numbers $1$ and $2$ are not arranged next to each other.




              As you observed, there are $N!$ ways to arrange the numbers in a row.



              For the favorable cases, we begin by placing the numbers $3$ and $4$ in a box and arranging the $N - 3$ objects consisting of the box and the $N - 4$ numbers larger than $4$ in a row. The objects can be arranged in $(N - 3)!$ ways. Doing so creates $N - 2$ spaces in which we can place the $1$ and $2$, $N - 4$ between successive objects and two at the ends of the row.
              $$square boxed{3, 4} square 5 square 6 square ldots square N - 1 square N square$$
              To separate $1$ and $2$, we must place them in two of these $N - 2$ spaces. There are $N - 2$ ways to place $1$, which leaves $N - 3$ ways to place $2$. The numbers $3$ and $4$ can be arranged within the box in $2!$ ways. Hence, the number of arrangements of the $N$ positive integers $1, 2, 3, ldots, N$ in which $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
              $$(N - 3)!2!(N - 2)(N - 3) = (N - 2)!2!(N - 3)$$
              Therefore, the probability that $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
              $$frac{(N - 2)!2!(N - 3)}{N!}$$






              share|cite|improve this answer




























                up vote
                -1
                down vote













                Regardless of the other numbers in the list, there are $2(N-1)$ ways to position $1$ and $2$ next to each other in a list of size $N$. Assume they take the first position, then you have to sort the other $N-2$ values into a list of size $N-2$. Thus we have that the total ways of satisfying the question is:
                $$2(N-1)cdot (N-2)!=2(N-1)! $$



                The probability follows nicely from this, it is $$frac{2(N-1)!}{N!}=frac 2N $$



                This approach should also work for (b).






                share|cite|improve this answer























                • Ah of course thank you
                  – Rhys Hughes
                  Nov 19 at 15:48











                Your Answer





                StackExchange.ifUsing("editor", function () {
                return StackExchange.using("mathjaxEditing", function () {
                StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
                StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
                });
                });
                }, "mathjax-editing");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "69"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                noCode: true, onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3004962%2fprobability-when-arranging-n-different-numbers-in-a-line%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                0
                down vote













                The number of ways that $1$ and $2$ appear next to each other can be calculated by considering both the numbers as a single unit. So the packets will be $$ (1,2),(3),(4),(5) ....... (N) $$
                Number of ways these can be arranged are $(N-1)!$ as there are $(N-1)$ packets. To consider the backward and forward arrangement of 1 and 2 inside the packet we need to multiply by two. So,

                Total ways for 1 and 2 to be arranged together is $2(N-1)!$



                So the numerator will be (Total ways-Undesired ways). $$N! - 2(N-1)!$$.

                Divide this with the total ways we get $$frac{N! - 2(N-1)!}{N!} = 1 - frac 2N$$



                For the second part we consider one packet with 1 and 2. The other packet with 3 and 4. So the packets will be,$$ (1,2),(3,4),(5),(6),(7) ....... (N) $$



                Arrangements in which 1 and 2 are together(like the first part) are $P(X)=2.(N-1)!$

                Arrangements in which 3 and 4 are together are $P(Y)=2.(N-1)!$

                Arrangements in which both groups (1 and 2) and (3 and 4) are together are $P(Z)=2.2.(N-2)!$. The two packets have an internal arrangement of two ways and the total count of packets is $(N-2)!$



                The numerator in the second part is $N! - P(X) - P(Y) + P(Z)$.
                The denominator will be $N!$






                share|cite|improve this answer

























                  up vote
                  0
                  down vote













                  The number of ways that $1$ and $2$ appear next to each other can be calculated by considering both the numbers as a single unit. So the packets will be $$ (1,2),(3),(4),(5) ....... (N) $$
                  Number of ways these can be arranged are $(N-1)!$ as there are $(N-1)$ packets. To consider the backward and forward arrangement of 1 and 2 inside the packet we need to multiply by two. So,

                  Total ways for 1 and 2 to be arranged together is $2(N-1)!$



                  So the numerator will be (Total ways-Undesired ways). $$N! - 2(N-1)!$$.

                  Divide this with the total ways we get $$frac{N! - 2(N-1)!}{N!} = 1 - frac 2N$$



                  For the second part we consider one packet with 1 and 2. The other packet with 3 and 4. So the packets will be,$$ (1,2),(3,4),(5),(6),(7) ....... (N) $$



                  Arrangements in which 1 and 2 are together(like the first part) are $P(X)=2.(N-1)!$

                  Arrangements in which 3 and 4 are together are $P(Y)=2.(N-1)!$

                  Arrangements in which both groups (1 and 2) and (3 and 4) are together are $P(Z)=2.2.(N-2)!$. The two packets have an internal arrangement of two ways and the total count of packets is $(N-2)!$



                  The numerator in the second part is $N! - P(X) - P(Y) + P(Z)$.
                  The denominator will be $N!$






                  share|cite|improve this answer























                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    The number of ways that $1$ and $2$ appear next to each other can be calculated by considering both the numbers as a single unit. So the packets will be $$ (1,2),(3),(4),(5) ....... (N) $$
                    Number of ways these can be arranged are $(N-1)!$ as there are $(N-1)$ packets. To consider the backward and forward arrangement of 1 and 2 inside the packet we need to multiply by two. So,

                    Total ways for 1 and 2 to be arranged together is $2(N-1)!$



                    So the numerator will be (Total ways-Undesired ways). $$N! - 2(N-1)!$$.

                    Divide this with the total ways we get $$frac{N! - 2(N-1)!}{N!} = 1 - frac 2N$$



                    For the second part we consider one packet with 1 and 2. The other packet with 3 and 4. So the packets will be,$$ (1,2),(3,4),(5),(6),(7) ....... (N) $$



                    Arrangements in which 1 and 2 are together(like the first part) are $P(X)=2.(N-1)!$

                    Arrangements in which 3 and 4 are together are $P(Y)=2.(N-1)!$

                    Arrangements in which both groups (1 and 2) and (3 and 4) are together are $P(Z)=2.2.(N-2)!$. The two packets have an internal arrangement of two ways and the total count of packets is $(N-2)!$



                    The numerator in the second part is $N! - P(X) - P(Y) + P(Z)$.
                    The denominator will be $N!$






                    share|cite|improve this answer












                    The number of ways that $1$ and $2$ appear next to each other can be calculated by considering both the numbers as a single unit. So the packets will be $$ (1,2),(3),(4),(5) ....... (N) $$
                    Number of ways these can be arranged are $(N-1)!$ as there are $(N-1)$ packets. To consider the backward and forward arrangement of 1 and 2 inside the packet we need to multiply by two. So,

                    Total ways for 1 and 2 to be arranged together is $2(N-1)!$



                    So the numerator will be (Total ways-Undesired ways). $$N! - 2(N-1)!$$.

                    Divide this with the total ways we get $$frac{N! - 2(N-1)!}{N!} = 1 - frac 2N$$



                    For the second part we consider one packet with 1 and 2. The other packet with 3 and 4. So the packets will be,$$ (1,2),(3,4),(5),(6),(7) ....... (N) $$



                    Arrangements in which 1 and 2 are together(like the first part) are $P(X)=2.(N-1)!$

                    Arrangements in which 3 and 4 are together are $P(Y)=2.(N-1)!$

                    Arrangements in which both groups (1 and 2) and (3 and 4) are together are $P(Z)=2.2.(N-2)!$. The two packets have an internal arrangement of two ways and the total count of packets is $(N-2)!$



                    The numerator in the second part is $N! - P(X) - P(Y) + P(Z)$.
                    The denominator will be $N!$







                    share|cite|improve this answer












                    share|cite|improve this answer



                    share|cite|improve this answer










                    answered Nov 19 at 14:46









                    SmarthBansal

                    36412




                    36412






















                        up vote
                        0
                        down vote













                        Your work on the first part shows there are $2(N-1)!$ ways to arrange the numbers with $3,4$ next to each other. $4(N-2)!$ of those have $3,4$ at one end or the other. If they are at either end you are left with $N-2$ places and have to avoid $1,2$ next to each other, which happens $frac 2{N-2}$ of the time, so this gives $8(N-3)!$ arrangements wwith $3,4$ together at one end and $1,2$ apart. For the $3,4$ are together somewhere in the middle, there are $(2(N-1)-4)(N-2)!=2(N-3)(N-2)!$ arrangements. There are $N-4$ positions that can be the leftmost of the $1,2$, then $2$ ways to arrange $1,2$, and $(N-4)!$ ways to arrange the rest of the numbers, so there are $2(N-4)(N-4)!$ arrangements with $3,4$ together in the middle and $1,2$ apart.



                        The chance is then $$frac {8(N-3)!+2(N-4)(N-4)!}{N!}=frac {(10N-36)(N-4)!}{N!}$$






                        share|cite|improve this answer

























                          up vote
                          0
                          down vote













                          Your work on the first part shows there are $2(N-1)!$ ways to arrange the numbers with $3,4$ next to each other. $4(N-2)!$ of those have $3,4$ at one end or the other. If they are at either end you are left with $N-2$ places and have to avoid $1,2$ next to each other, which happens $frac 2{N-2}$ of the time, so this gives $8(N-3)!$ arrangements wwith $3,4$ together at one end and $1,2$ apart. For the $3,4$ are together somewhere in the middle, there are $(2(N-1)-4)(N-2)!=2(N-3)(N-2)!$ arrangements. There are $N-4$ positions that can be the leftmost of the $1,2$, then $2$ ways to arrange $1,2$, and $(N-4)!$ ways to arrange the rest of the numbers, so there are $2(N-4)(N-4)!$ arrangements with $3,4$ together in the middle and $1,2$ apart.



                          The chance is then $$frac {8(N-3)!+2(N-4)(N-4)!}{N!}=frac {(10N-36)(N-4)!}{N!}$$






                          share|cite|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            Your work on the first part shows there are $2(N-1)!$ ways to arrange the numbers with $3,4$ next to each other. $4(N-2)!$ of those have $3,4$ at one end or the other. If they are at either end you are left with $N-2$ places and have to avoid $1,2$ next to each other, which happens $frac 2{N-2}$ of the time, so this gives $8(N-3)!$ arrangements wwith $3,4$ together at one end and $1,2$ apart. For the $3,4$ are together somewhere in the middle, there are $(2(N-1)-4)(N-2)!=2(N-3)(N-2)!$ arrangements. There are $N-4$ positions that can be the leftmost of the $1,2$, then $2$ ways to arrange $1,2$, and $(N-4)!$ ways to arrange the rest of the numbers, so there are $2(N-4)(N-4)!$ arrangements with $3,4$ together in the middle and $1,2$ apart.



                            The chance is then $$frac {8(N-3)!+2(N-4)(N-4)!}{N!}=frac {(10N-36)(N-4)!}{N!}$$






                            share|cite|improve this answer












                            Your work on the first part shows there are $2(N-1)!$ ways to arrange the numbers with $3,4$ next to each other. $4(N-2)!$ of those have $3,4$ at one end or the other. If they are at either end you are left with $N-2$ places and have to avoid $1,2$ next to each other, which happens $frac 2{N-2}$ of the time, so this gives $8(N-3)!$ arrangements wwith $3,4$ together at one end and $1,2$ apart. For the $3,4$ are together somewhere in the middle, there are $(2(N-1)-4)(N-2)!=2(N-3)(N-2)!$ arrangements. There are $N-4$ positions that can be the leftmost of the $1,2$, then $2$ ways to arrange $1,2$, and $(N-4)!$ ways to arrange the rest of the numbers, so there are $2(N-4)(N-4)!$ arrangements with $3,4$ together in the middle and $1,2$ apart.



                            The chance is then $$frac {8(N-3)!+2(N-4)(N-4)!}{N!}=frac {(10N-36)(N-4)!}{N!}$$







                            share|cite|improve this answer












                            share|cite|improve this answer



                            share|cite|improve this answer










                            answered Nov 19 at 15:04









                            Ross Millikan

                            289k23195367




                            289k23195367






















                                up vote
                                0
                                down vote













                                Your answer to the first question is correct.




                                If the integers $1, 2, 3, ldots, N$ are arranged in a line, what is the probability that the numbers $3$ and $4$ are arranged next to each other but the numbers $1$ and $2$ are not arranged next to each other.




                                As you observed, there are $N!$ ways to arrange the numbers in a row.



                                For the favorable cases, we begin by placing the numbers $3$ and $4$ in a box and arranging the $N - 3$ objects consisting of the box and the $N - 4$ numbers larger than $4$ in a row. The objects can be arranged in $(N - 3)!$ ways. Doing so creates $N - 2$ spaces in which we can place the $1$ and $2$, $N - 4$ between successive objects and two at the ends of the row.
                                $$square boxed{3, 4} square 5 square 6 square ldots square N - 1 square N square$$
                                To separate $1$ and $2$, we must place them in two of these $N - 2$ spaces. There are $N - 2$ ways to place $1$, which leaves $N - 3$ ways to place $2$. The numbers $3$ and $4$ can be arranged within the box in $2!$ ways. Hence, the number of arrangements of the $N$ positive integers $1, 2, 3, ldots, N$ in which $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
                                $$(N - 3)!2!(N - 2)(N - 3) = (N - 2)!2!(N - 3)$$
                                Therefore, the probability that $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
                                $$frac{(N - 2)!2!(N - 3)}{N!}$$






                                share|cite|improve this answer

























                                  up vote
                                  0
                                  down vote













                                  Your answer to the first question is correct.




                                  If the integers $1, 2, 3, ldots, N$ are arranged in a line, what is the probability that the numbers $3$ and $4$ are arranged next to each other but the numbers $1$ and $2$ are not arranged next to each other.




                                  As you observed, there are $N!$ ways to arrange the numbers in a row.



                                  For the favorable cases, we begin by placing the numbers $3$ and $4$ in a box and arranging the $N - 3$ objects consisting of the box and the $N - 4$ numbers larger than $4$ in a row. The objects can be arranged in $(N - 3)!$ ways. Doing so creates $N - 2$ spaces in which we can place the $1$ and $2$, $N - 4$ between successive objects and two at the ends of the row.
                                  $$square boxed{3, 4} square 5 square 6 square ldots square N - 1 square N square$$
                                  To separate $1$ and $2$, we must place them in two of these $N - 2$ spaces. There are $N - 2$ ways to place $1$, which leaves $N - 3$ ways to place $2$. The numbers $3$ and $4$ can be arranged within the box in $2!$ ways. Hence, the number of arrangements of the $N$ positive integers $1, 2, 3, ldots, N$ in which $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
                                  $$(N - 3)!2!(N - 2)(N - 3) = (N - 2)!2!(N - 3)$$
                                  Therefore, the probability that $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
                                  $$frac{(N - 2)!2!(N - 3)}{N!}$$






                                  share|cite|improve this answer























                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    Your answer to the first question is correct.




                                    If the integers $1, 2, 3, ldots, N$ are arranged in a line, what is the probability that the numbers $3$ and $4$ are arranged next to each other but the numbers $1$ and $2$ are not arranged next to each other.




                                    As you observed, there are $N!$ ways to arrange the numbers in a row.



                                    For the favorable cases, we begin by placing the numbers $3$ and $4$ in a box and arranging the $N - 3$ objects consisting of the box and the $N - 4$ numbers larger than $4$ in a row. The objects can be arranged in $(N - 3)!$ ways. Doing so creates $N - 2$ spaces in which we can place the $1$ and $2$, $N - 4$ between successive objects and two at the ends of the row.
                                    $$square boxed{3, 4} square 5 square 6 square ldots square N - 1 square N square$$
                                    To separate $1$ and $2$, we must place them in two of these $N - 2$ spaces. There are $N - 2$ ways to place $1$, which leaves $N - 3$ ways to place $2$. The numbers $3$ and $4$ can be arranged within the box in $2!$ ways. Hence, the number of arrangements of the $N$ positive integers $1, 2, 3, ldots, N$ in which $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
                                    $$(N - 3)!2!(N - 2)(N - 3) = (N - 2)!2!(N - 3)$$
                                    Therefore, the probability that $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
                                    $$frac{(N - 2)!2!(N - 3)}{N!}$$






                                    share|cite|improve this answer












                                    Your answer to the first question is correct.




                                    If the integers $1, 2, 3, ldots, N$ are arranged in a line, what is the probability that the numbers $3$ and $4$ are arranged next to each other but the numbers $1$ and $2$ are not arranged next to each other.




                                    As you observed, there are $N!$ ways to arrange the numbers in a row.



                                    For the favorable cases, we begin by placing the numbers $3$ and $4$ in a box and arranging the $N - 3$ objects consisting of the box and the $N - 4$ numbers larger than $4$ in a row. The objects can be arranged in $(N - 3)!$ ways. Doing so creates $N - 2$ spaces in which we can place the $1$ and $2$, $N - 4$ between successive objects and two at the ends of the row.
                                    $$square boxed{3, 4} square 5 square 6 square ldots square N - 1 square N square$$
                                    To separate $1$ and $2$, we must place them in two of these $N - 2$ spaces. There are $N - 2$ ways to place $1$, which leaves $N - 3$ ways to place $2$. The numbers $3$ and $4$ can be arranged within the box in $2!$ ways. Hence, the number of arrangements of the $N$ positive integers $1, 2, 3, ldots, N$ in which $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
                                    $$(N - 3)!2!(N - 2)(N - 3) = (N - 2)!2!(N - 3)$$
                                    Therefore, the probability that $3$ and $4$ are next to each other but $1$ and $2$ are not next to each other is
                                    $$frac{(N - 2)!2!(N - 3)}{N!}$$







                                    share|cite|improve this answer












                                    share|cite|improve this answer



                                    share|cite|improve this answer










                                    answered Nov 19 at 17:10









                                    N. F. Taussig

                                    43.1k93254




                                    43.1k93254






















                                        up vote
                                        -1
                                        down vote













                                        Regardless of the other numbers in the list, there are $2(N-1)$ ways to position $1$ and $2$ next to each other in a list of size $N$. Assume they take the first position, then you have to sort the other $N-2$ values into a list of size $N-2$. Thus we have that the total ways of satisfying the question is:
                                        $$2(N-1)cdot (N-2)!=2(N-1)! $$



                                        The probability follows nicely from this, it is $$frac{2(N-1)!}{N!}=frac 2N $$



                                        This approach should also work for (b).






                                        share|cite|improve this answer























                                        • Ah of course thank you
                                          – Rhys Hughes
                                          Nov 19 at 15:48















                                        up vote
                                        -1
                                        down vote













                                        Regardless of the other numbers in the list, there are $2(N-1)$ ways to position $1$ and $2$ next to each other in a list of size $N$. Assume they take the first position, then you have to sort the other $N-2$ values into a list of size $N-2$. Thus we have that the total ways of satisfying the question is:
                                        $$2(N-1)cdot (N-2)!=2(N-1)! $$



                                        The probability follows nicely from this, it is $$frac{2(N-1)!}{N!}=frac 2N $$



                                        This approach should also work for (b).






                                        share|cite|improve this answer























                                        • Ah of course thank you
                                          – Rhys Hughes
                                          Nov 19 at 15:48













                                        up vote
                                        -1
                                        down vote










                                        up vote
                                        -1
                                        down vote









                                        Regardless of the other numbers in the list, there are $2(N-1)$ ways to position $1$ and $2$ next to each other in a list of size $N$. Assume they take the first position, then you have to sort the other $N-2$ values into a list of size $N-2$. Thus we have that the total ways of satisfying the question is:
                                        $$2(N-1)cdot (N-2)!=2(N-1)! $$



                                        The probability follows nicely from this, it is $$frac{2(N-1)!}{N!}=frac 2N $$



                                        This approach should also work for (b).






                                        share|cite|improve this answer














                                        Regardless of the other numbers in the list, there are $2(N-1)$ ways to position $1$ and $2$ next to each other in a list of size $N$. Assume they take the first position, then you have to sort the other $N-2$ values into a list of size $N-2$. Thus we have that the total ways of satisfying the question is:
                                        $$2(N-1)cdot (N-2)!=2(N-1)! $$



                                        The probability follows nicely from this, it is $$frac{2(N-1)!}{N!}=frac 2N $$



                                        This approach should also work for (b).







                                        share|cite|improve this answer














                                        share|cite|improve this answer



                                        share|cite|improve this answer








                                        edited Nov 19 at 15:49

























                                        answered Nov 19 at 14:29









                                        Rhys Hughes

                                        4,6651327




                                        4,6651327












                                        • Ah of course thank you
                                          – Rhys Hughes
                                          Nov 19 at 15:48


















                                        • Ah of course thank you
                                          – Rhys Hughes
                                          Nov 19 at 15:48
















                                        Ah of course thank you
                                        – Rhys Hughes
                                        Nov 19 at 15:48




                                        Ah of course thank you
                                        – Rhys Hughes
                                        Nov 19 at 15:48


















                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Mathematics Stack Exchange!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        Use MathJax to format equations. MathJax reference.


                                        To learn more, see our tips on writing great answers.





                                        Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                        Please pay close attention to the following guidance:


                                        • 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.


                                        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%2f3004962%2fprobability-when-arranging-n-different-numbers-in-a-line%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 change which sound is reproduced for terminal bell?

                                        Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                                        Can I use Tabulator js library in my java Spring + Thymeleaf project?