Find number of permutations with 2 inversions












0












$begingroup$


Suppose $sigma=(a_1,a_2,a_3...,a_n)$ be a permutation of $(1,2,3,...n)$. A pair $(a_i,a_j)$ is said to correspond to an inversion of $sigma$, if $i<j$ but $a_i > a_j$. How many permutations of $(1,2,3...n)$, $(ngeq 3)$, have exactly $2$ inversions?



Example: In the permutation $(2,4,5,3,1)$, there are 6 inversions corresponding to the pairs $(2,1),(4,3), (4,1), (5,3), (5,1), (3,1)$.



Can anyone give a recursive proof for this one? I tried to get one, but I dont get a proper solution..










share|cite|improve this question









$endgroup$












  • $begingroup$
    What is the answer for $n=3?$ For $n=4?$
    $endgroup$
    – saulspatz
    Jan 14 at 16:54










  • $begingroup$
    Does it have to be recursive? I think a direct proof is easier
    $endgroup$
    – Ross Millikan
    Jan 14 at 17:06










  • $begingroup$
    I thought recursive proofs were easier, but if there is an easier proof than a recursive one, I am still OK with it.
    $endgroup$
    – Yellow
    Jan 14 at 17:15










  • $begingroup$
    They can be, but not always. Have you done the $n=3$ and $n=4$ cases like saulspatz suggested?
    $endgroup$
    – Ross Millikan
    Jan 14 at 17:20










  • $begingroup$
    Nope,( as I said earlier, I was trying to get a recursive one without knowing there were other easier proofs, so I left that computation part halfway...) I am doing it.
    $endgroup$
    – Yellow
    Jan 14 at 17:26
















0












$begingroup$


Suppose $sigma=(a_1,a_2,a_3...,a_n)$ be a permutation of $(1,2,3,...n)$. A pair $(a_i,a_j)$ is said to correspond to an inversion of $sigma$, if $i<j$ but $a_i > a_j$. How many permutations of $(1,2,3...n)$, $(ngeq 3)$, have exactly $2$ inversions?



Example: In the permutation $(2,4,5,3,1)$, there are 6 inversions corresponding to the pairs $(2,1),(4,3), (4,1), (5,3), (5,1), (3,1)$.



Can anyone give a recursive proof for this one? I tried to get one, but I dont get a proper solution..










share|cite|improve this question









$endgroup$












  • $begingroup$
    What is the answer for $n=3?$ For $n=4?$
    $endgroup$
    – saulspatz
    Jan 14 at 16:54










  • $begingroup$
    Does it have to be recursive? I think a direct proof is easier
    $endgroup$
    – Ross Millikan
    Jan 14 at 17:06










  • $begingroup$
    I thought recursive proofs were easier, but if there is an easier proof than a recursive one, I am still OK with it.
    $endgroup$
    – Yellow
    Jan 14 at 17:15










  • $begingroup$
    They can be, but not always. Have you done the $n=3$ and $n=4$ cases like saulspatz suggested?
    $endgroup$
    – Ross Millikan
    Jan 14 at 17:20










  • $begingroup$
    Nope,( as I said earlier, I was trying to get a recursive one without knowing there were other easier proofs, so I left that computation part halfway...) I am doing it.
    $endgroup$
    – Yellow
    Jan 14 at 17:26














0












0








0





$begingroup$


Suppose $sigma=(a_1,a_2,a_3...,a_n)$ be a permutation of $(1,2,3,...n)$. A pair $(a_i,a_j)$ is said to correspond to an inversion of $sigma$, if $i<j$ but $a_i > a_j$. How many permutations of $(1,2,3...n)$, $(ngeq 3)$, have exactly $2$ inversions?



Example: In the permutation $(2,4,5,3,1)$, there are 6 inversions corresponding to the pairs $(2,1),(4,3), (4,1), (5,3), (5,1), (3,1)$.



Can anyone give a recursive proof for this one? I tried to get one, but I dont get a proper solution..










share|cite|improve this question









$endgroup$




Suppose $sigma=(a_1,a_2,a_3...,a_n)$ be a permutation of $(1,2,3,...n)$. A pair $(a_i,a_j)$ is said to correspond to an inversion of $sigma$, if $i<j$ but $a_i > a_j$. How many permutations of $(1,2,3...n)$, $(ngeq 3)$, have exactly $2$ inversions?



Example: In the permutation $(2,4,5,3,1)$, there are 6 inversions corresponding to the pairs $(2,1),(4,3), (4,1), (5,3), (5,1), (3,1)$.



Can anyone give a recursive proof for this one? I tried to get one, but I dont get a proper solution..







combinatorics






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 14 at 16:52









YellowYellow

16011




16011












  • $begingroup$
    What is the answer for $n=3?$ For $n=4?$
    $endgroup$
    – saulspatz
    Jan 14 at 16:54










  • $begingroup$
    Does it have to be recursive? I think a direct proof is easier
    $endgroup$
    – Ross Millikan
    Jan 14 at 17:06










  • $begingroup$
    I thought recursive proofs were easier, but if there is an easier proof than a recursive one, I am still OK with it.
    $endgroup$
    – Yellow
    Jan 14 at 17:15










  • $begingroup$
    They can be, but not always. Have you done the $n=3$ and $n=4$ cases like saulspatz suggested?
    $endgroup$
    – Ross Millikan
    Jan 14 at 17:20










  • $begingroup$
    Nope,( as I said earlier, I was trying to get a recursive one without knowing there were other easier proofs, so I left that computation part halfway...) I am doing it.
    $endgroup$
    – Yellow
    Jan 14 at 17:26


















  • $begingroup$
    What is the answer for $n=3?$ For $n=4?$
    $endgroup$
    – saulspatz
    Jan 14 at 16:54










  • $begingroup$
    Does it have to be recursive? I think a direct proof is easier
    $endgroup$
    – Ross Millikan
    Jan 14 at 17:06










  • $begingroup$
    I thought recursive proofs were easier, but if there is an easier proof than a recursive one, I am still OK with it.
    $endgroup$
    – Yellow
    Jan 14 at 17:15










  • $begingroup$
    They can be, but not always. Have you done the $n=3$ and $n=4$ cases like saulspatz suggested?
    $endgroup$
    – Ross Millikan
    Jan 14 at 17:20










  • $begingroup$
    Nope,( as I said earlier, I was trying to get a recursive one without knowing there were other easier proofs, so I left that computation part halfway...) I am doing it.
    $endgroup$
    – Yellow
    Jan 14 at 17:26
















$begingroup$
What is the answer for $n=3?$ For $n=4?$
$endgroup$
– saulspatz
Jan 14 at 16:54




$begingroup$
What is the answer for $n=3?$ For $n=4?$
$endgroup$
– saulspatz
Jan 14 at 16:54












$begingroup$
Does it have to be recursive? I think a direct proof is easier
$endgroup$
– Ross Millikan
Jan 14 at 17:06




$begingroup$
Does it have to be recursive? I think a direct proof is easier
$endgroup$
– Ross Millikan
Jan 14 at 17:06












$begingroup$
I thought recursive proofs were easier, but if there is an easier proof than a recursive one, I am still OK with it.
$endgroup$
– Yellow
Jan 14 at 17:15




$begingroup$
I thought recursive proofs were easier, but if there is an easier proof than a recursive one, I am still OK with it.
$endgroup$
– Yellow
Jan 14 at 17:15












$begingroup$
They can be, but not always. Have you done the $n=3$ and $n=4$ cases like saulspatz suggested?
$endgroup$
– Ross Millikan
Jan 14 at 17:20




$begingroup$
They can be, but not always. Have you done the $n=3$ and $n=4$ cases like saulspatz suggested?
$endgroup$
– Ross Millikan
Jan 14 at 17:20












$begingroup$
Nope,( as I said earlier, I was trying to get a recursive one without knowing there were other easier proofs, so I left that computation part halfway...) I am doing it.
$endgroup$
– Yellow
Jan 14 at 17:26




$begingroup$
Nope,( as I said earlier, I was trying to get a recursive one without knowing there were other easier proofs, so I left that computation part halfway...) I am doing it.
$endgroup$
– Yellow
Jan 14 at 17:26










1 Answer
1






active

oldest

votes


















1












$begingroup$

Consider the following method of building a permutation. For each number in ${1,2,dots,n}$ in increasing order, insert it anywhere in the line of the previously made numbers. The $i^{th}$ number can be inserted in $i$ places, and the number of inversions that insertion will add is anywhere between $0$ and $i-1$. For example, there is only one place to put $1$, effectively creating the list. There are $2$ places to put $2$, either before or after the $1$.



How many ways are there to end up with two inversions? There are two ways this can happen; either there were two steps which each created one inversion (and every other step made zero), or there was only one step which created two inversions. In the former case, there are $binom{n-1}2$ ways to choose the two steps which created the inversions (as the first step, where $1$ is inserted into an empty list, cannot create any inversions), and there is are $n-2$ ways to choose a step where two inversions are created (as this cannot happen on the first or second steps). Therefore, the total number of ways is
$$
binom{n-1}2+n-2 = frac{(n+1)(n-2)}2
$$






share|cite|improve this answer









$endgroup$













    Your Answer





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

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

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

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


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3073450%2ffind-number-of-permutations-with-2-inversions%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1












    $begingroup$

    Consider the following method of building a permutation. For each number in ${1,2,dots,n}$ in increasing order, insert it anywhere in the line of the previously made numbers. The $i^{th}$ number can be inserted in $i$ places, and the number of inversions that insertion will add is anywhere between $0$ and $i-1$. For example, there is only one place to put $1$, effectively creating the list. There are $2$ places to put $2$, either before or after the $1$.



    How many ways are there to end up with two inversions? There are two ways this can happen; either there were two steps which each created one inversion (and every other step made zero), or there was only one step which created two inversions. In the former case, there are $binom{n-1}2$ ways to choose the two steps which created the inversions (as the first step, where $1$ is inserted into an empty list, cannot create any inversions), and there is are $n-2$ ways to choose a step where two inversions are created (as this cannot happen on the first or second steps). Therefore, the total number of ways is
    $$
    binom{n-1}2+n-2 = frac{(n+1)(n-2)}2
    $$






    share|cite|improve this answer









    $endgroup$


















      1












      $begingroup$

      Consider the following method of building a permutation. For each number in ${1,2,dots,n}$ in increasing order, insert it anywhere in the line of the previously made numbers. The $i^{th}$ number can be inserted in $i$ places, and the number of inversions that insertion will add is anywhere between $0$ and $i-1$. For example, there is only one place to put $1$, effectively creating the list. There are $2$ places to put $2$, either before or after the $1$.



      How many ways are there to end up with two inversions? There are two ways this can happen; either there were two steps which each created one inversion (and every other step made zero), or there was only one step which created two inversions. In the former case, there are $binom{n-1}2$ ways to choose the two steps which created the inversions (as the first step, where $1$ is inserted into an empty list, cannot create any inversions), and there is are $n-2$ ways to choose a step where two inversions are created (as this cannot happen on the first or second steps). Therefore, the total number of ways is
      $$
      binom{n-1}2+n-2 = frac{(n+1)(n-2)}2
      $$






      share|cite|improve this answer









      $endgroup$
















        1












        1








        1





        $begingroup$

        Consider the following method of building a permutation. For each number in ${1,2,dots,n}$ in increasing order, insert it anywhere in the line of the previously made numbers. The $i^{th}$ number can be inserted in $i$ places, and the number of inversions that insertion will add is anywhere between $0$ and $i-1$. For example, there is only one place to put $1$, effectively creating the list. There are $2$ places to put $2$, either before or after the $1$.



        How many ways are there to end up with two inversions? There are two ways this can happen; either there were two steps which each created one inversion (and every other step made zero), or there was only one step which created two inversions. In the former case, there are $binom{n-1}2$ ways to choose the two steps which created the inversions (as the first step, where $1$ is inserted into an empty list, cannot create any inversions), and there is are $n-2$ ways to choose a step where two inversions are created (as this cannot happen on the first or second steps). Therefore, the total number of ways is
        $$
        binom{n-1}2+n-2 = frac{(n+1)(n-2)}2
        $$






        share|cite|improve this answer









        $endgroup$



        Consider the following method of building a permutation. For each number in ${1,2,dots,n}$ in increasing order, insert it anywhere in the line of the previously made numbers. The $i^{th}$ number can be inserted in $i$ places, and the number of inversions that insertion will add is anywhere between $0$ and $i-1$. For example, there is only one place to put $1$, effectively creating the list. There are $2$ places to put $2$, either before or after the $1$.



        How many ways are there to end up with two inversions? There are two ways this can happen; either there were two steps which each created one inversion (and every other step made zero), or there was only one step which created two inversions. In the former case, there are $binom{n-1}2$ ways to choose the two steps which created the inversions (as the first step, where $1$ is inserted into an empty list, cannot create any inversions), and there is are $n-2$ ways to choose a step where two inversions are created (as this cannot happen on the first or second steps). Therefore, the total number of ways is
        $$
        binom{n-1}2+n-2 = frac{(n+1)(n-2)}2
        $$







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jan 14 at 19:06









        Mike EarnestMike Earnest

        25.8k22151




        25.8k22151






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


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

            But avoid



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

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


            Use MathJax to format equations. MathJax reference.


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




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3073450%2ffind-number-of-permutations-with-2-inversions%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Human spaceflight

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

            File:DeusFollowingSea.jpg