Equation about generating functions and subfactorial

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











up vote
13
down vote

favorite
3












Suppose $G_n(w)$ is a formal power series (really a probability generating function, see the following explanation) of variable $w$, try to solve out $G_n(w)$ for all $nge0$ from the formal-power-series equation of variable $z$:
$$sum_nge0z^nG_n(w)=we^zsum_nge0frac!nn!z^nG_n(w)+1-wtag1$$
where $!n$ is $n$-subfactorial which satisifies
$$frac!nn!=sum_k=0^nfrac(-1)^kk!$$
Any help? Thanks!




The problem is introduced from a google code jam problem named after Gorosort.
$p_n,m$ denotes the probability that sort the $n$-derangement with no more than $m$ steps, and $X_n$ is the random variable for the steps. We have
$$p_n,m=Pr(X_nle m)=sum_k=0^nfracdbinom nk,(!(n-k))n!p_n-k,m-1+[m=n=0]$$
where $p_n,m=0$ for $n<0$ or $m<0$, and $[P]$ is Iverson bracket. Let $G_n(w)=Eleft(w^X_nright)=sum_mge0(p_n,m-p_n,m-1)w^m$ is the probability generating function where $[w^m]G_n(w)$ is the probability sorting with exact $m$ steps. So $G_n(1)=1$, and we get equation (1).




I want to solve equation (1) generally, really beyond $G_n!!'(1)$, which is the expected number, not difficult to solve out:



First we have
$$sum_nge0frac!nn!z^n=sum_nge0sum_0le kle nfrac(-1)^kk!z^n=sum_kge0frac(-1)^kk!z^ksum_nge0z^n=frace^-z1-ztag2$$
Differentiating both sides of equation (1) and let $w=1$, we have
$$sum_nge0z^nG_n!!'(1)=e^zsum_nge0frac!nn!z^nG_n(1)+e^zsum_nge0frac!nn!z^nG_n!!'(1)-1$$
Notice that $G_n(1)=1$, we have
$$sum_nge0z^nG_n!!'(1)=e^zsum_nge0frac!nn!z^nG_n!!'(1)+frac z1-ztag3$$
We claim that $G_n!!'(1)=n$ satisfies equation (3), and it's not hard to show the uniqueness of $G_n!!'(1)$ of equation (3), thus we solve out the $G_n!!'(1)$.
Differentiating both sides of equation (2), we have
$$sum_nge0frac!nn!nz^n-1=fracze^-z(1-z)^2$$
and the right side of equation (3) becomes
$$fracz^2(1-z)^2+frac z1-z=frac z(1-z)^2=sum_nge0nz^n$$
Okay. Finally, $mathrmMean(G_n)=G_n!!'(1)=n$, and this is the expected number.










share|cite|improve this question























  • Since !n/n! ~ 1/e, can you solve the modified equation with this substituted?
    – marty cohen
    Jun 15 '12 at 5:40










  • @martycohen I think this substitution is illegal.
    – Frank Science
    Jun 15 '12 at 5:42















up vote
13
down vote

favorite
3












Suppose $G_n(w)$ is a formal power series (really a probability generating function, see the following explanation) of variable $w$, try to solve out $G_n(w)$ for all $nge0$ from the formal-power-series equation of variable $z$:
$$sum_nge0z^nG_n(w)=we^zsum_nge0frac!nn!z^nG_n(w)+1-wtag1$$
where $!n$ is $n$-subfactorial which satisifies
$$frac!nn!=sum_k=0^nfrac(-1)^kk!$$
Any help? Thanks!




The problem is introduced from a google code jam problem named after Gorosort.
$p_n,m$ denotes the probability that sort the $n$-derangement with no more than $m$ steps, and $X_n$ is the random variable for the steps. We have
$$p_n,m=Pr(X_nle m)=sum_k=0^nfracdbinom nk,(!(n-k))n!p_n-k,m-1+[m=n=0]$$
where $p_n,m=0$ for $n<0$ or $m<0$, and $[P]$ is Iverson bracket. Let $G_n(w)=Eleft(w^X_nright)=sum_mge0(p_n,m-p_n,m-1)w^m$ is the probability generating function where $[w^m]G_n(w)$ is the probability sorting with exact $m$ steps. So $G_n(1)=1$, and we get equation (1).




I want to solve equation (1) generally, really beyond $G_n!!'(1)$, which is the expected number, not difficult to solve out:



First we have
$$sum_nge0frac!nn!z^n=sum_nge0sum_0le kle nfrac(-1)^kk!z^n=sum_kge0frac(-1)^kk!z^ksum_nge0z^n=frace^-z1-ztag2$$
Differentiating both sides of equation (1) and let $w=1$, we have
$$sum_nge0z^nG_n!!'(1)=e^zsum_nge0frac!nn!z^nG_n(1)+e^zsum_nge0frac!nn!z^nG_n!!'(1)-1$$
Notice that $G_n(1)=1$, we have
$$sum_nge0z^nG_n!!'(1)=e^zsum_nge0frac!nn!z^nG_n!!'(1)+frac z1-ztag3$$
We claim that $G_n!!'(1)=n$ satisfies equation (3), and it's not hard to show the uniqueness of $G_n!!'(1)$ of equation (3), thus we solve out the $G_n!!'(1)$.
Differentiating both sides of equation (2), we have
$$sum_nge0frac!nn!nz^n-1=fracze^-z(1-z)^2$$
and the right side of equation (3) becomes
$$fracz^2(1-z)^2+frac z1-z=frac z(1-z)^2=sum_nge0nz^n$$
Okay. Finally, $mathrmMean(G_n)=G_n!!'(1)=n$, and this is the expected number.










share|cite|improve this question























  • Since !n/n! ~ 1/e, can you solve the modified equation with this substituted?
    – marty cohen
    Jun 15 '12 at 5:40










  • @martycohen I think this substitution is illegal.
    – Frank Science
    Jun 15 '12 at 5:42













up vote
13
down vote

favorite
3









up vote
13
down vote

favorite
3






3





Suppose $G_n(w)$ is a formal power series (really a probability generating function, see the following explanation) of variable $w$, try to solve out $G_n(w)$ for all $nge0$ from the formal-power-series equation of variable $z$:
$$sum_nge0z^nG_n(w)=we^zsum_nge0frac!nn!z^nG_n(w)+1-wtag1$$
where $!n$ is $n$-subfactorial which satisifies
$$frac!nn!=sum_k=0^nfrac(-1)^kk!$$
Any help? Thanks!




The problem is introduced from a google code jam problem named after Gorosort.
$p_n,m$ denotes the probability that sort the $n$-derangement with no more than $m$ steps, and $X_n$ is the random variable for the steps. We have
$$p_n,m=Pr(X_nle m)=sum_k=0^nfracdbinom nk,(!(n-k))n!p_n-k,m-1+[m=n=0]$$
where $p_n,m=0$ for $n<0$ or $m<0$, and $[P]$ is Iverson bracket. Let $G_n(w)=Eleft(w^X_nright)=sum_mge0(p_n,m-p_n,m-1)w^m$ is the probability generating function where $[w^m]G_n(w)$ is the probability sorting with exact $m$ steps. So $G_n(1)=1$, and we get equation (1).




I want to solve equation (1) generally, really beyond $G_n!!'(1)$, which is the expected number, not difficult to solve out:



First we have
$$sum_nge0frac!nn!z^n=sum_nge0sum_0le kle nfrac(-1)^kk!z^n=sum_kge0frac(-1)^kk!z^ksum_nge0z^n=frace^-z1-ztag2$$
Differentiating both sides of equation (1) and let $w=1$, we have
$$sum_nge0z^nG_n!!'(1)=e^zsum_nge0frac!nn!z^nG_n(1)+e^zsum_nge0frac!nn!z^nG_n!!'(1)-1$$
Notice that $G_n(1)=1$, we have
$$sum_nge0z^nG_n!!'(1)=e^zsum_nge0frac!nn!z^nG_n!!'(1)+frac z1-ztag3$$
We claim that $G_n!!'(1)=n$ satisfies equation (3), and it's not hard to show the uniqueness of $G_n!!'(1)$ of equation (3), thus we solve out the $G_n!!'(1)$.
Differentiating both sides of equation (2), we have
$$sum_nge0frac!nn!nz^n-1=fracze^-z(1-z)^2$$
and the right side of equation (3) becomes
$$fracz^2(1-z)^2+frac z1-z=frac z(1-z)^2=sum_nge0nz^n$$
Okay. Finally, $mathrmMean(G_n)=G_n!!'(1)=n$, and this is the expected number.










share|cite|improve this question















Suppose $G_n(w)$ is a formal power series (really a probability generating function, see the following explanation) of variable $w$, try to solve out $G_n(w)$ for all $nge0$ from the formal-power-series equation of variable $z$:
$$sum_nge0z^nG_n(w)=we^zsum_nge0frac!nn!z^nG_n(w)+1-wtag1$$
where $!n$ is $n$-subfactorial which satisifies
$$frac!nn!=sum_k=0^nfrac(-1)^kk!$$
Any help? Thanks!




The problem is introduced from a google code jam problem named after Gorosort.
$p_n,m$ denotes the probability that sort the $n$-derangement with no more than $m$ steps, and $X_n$ is the random variable for the steps. We have
$$p_n,m=Pr(X_nle m)=sum_k=0^nfracdbinom nk,(!(n-k))n!p_n-k,m-1+[m=n=0]$$
where $p_n,m=0$ for $n<0$ or $m<0$, and $[P]$ is Iverson bracket. Let $G_n(w)=Eleft(w^X_nright)=sum_mge0(p_n,m-p_n,m-1)w^m$ is the probability generating function where $[w^m]G_n(w)$ is the probability sorting with exact $m$ steps. So $G_n(1)=1$, and we get equation (1).




I want to solve equation (1) generally, really beyond $G_n!!'(1)$, which is the expected number, not difficult to solve out:



First we have
$$sum_nge0frac!nn!z^n=sum_nge0sum_0le kle nfrac(-1)^kk!z^n=sum_kge0frac(-1)^kk!z^ksum_nge0z^n=frace^-z1-ztag2$$
Differentiating both sides of equation (1) and let $w=1$, we have
$$sum_nge0z^nG_n!!'(1)=e^zsum_nge0frac!nn!z^nG_n(1)+e^zsum_nge0frac!nn!z^nG_n!!'(1)-1$$
Notice that $G_n(1)=1$, we have
$$sum_nge0z^nG_n!!'(1)=e^zsum_nge0frac!nn!z^nG_n!!'(1)+frac z1-ztag3$$
We claim that $G_n!!'(1)=n$ satisfies equation (3), and it's not hard to show the uniqueness of $G_n!!'(1)$ of equation (3), thus we solve out the $G_n!!'(1)$.
Differentiating both sides of equation (2), we have
$$sum_nge0frac!nn!nz^n-1=fracze^-z(1-z)^2$$
and the right side of equation (3) becomes
$$fracz^2(1-z)^2+frac z1-z=frac z(1-z)^2=sum_nge0nz^n$$
Okay. Finally, $mathrmMean(G_n)=G_n!!'(1)=n$, and this is the expected number.







power-series generating-functions functional-equations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jun 21 '12 at 7:24

























asked Jun 14 '12 at 12:39









Frank Science

4,64011154




4,64011154











  • Since !n/n! ~ 1/e, can you solve the modified equation with this substituted?
    – marty cohen
    Jun 15 '12 at 5:40










  • @martycohen I think this substitution is illegal.
    – Frank Science
    Jun 15 '12 at 5:42

















  • Since !n/n! ~ 1/e, can you solve the modified equation with this substituted?
    – marty cohen
    Jun 15 '12 at 5:40










  • @martycohen I think this substitution is illegal.
    – Frank Science
    Jun 15 '12 at 5:42
















Since !n/n! ~ 1/e, can you solve the modified equation with this substituted?
– marty cohen
Jun 15 '12 at 5:40




Since !n/n! ~ 1/e, can you solve the modified equation with this substituted?
– marty cohen
Jun 15 '12 at 5:40












@martycohen I think this substitution is illegal.
– Frank Science
Jun 15 '12 at 5:42





@martycohen I think this substitution is illegal.
– Frank Science
Jun 15 '12 at 5:42











1 Answer
1






active

oldest

votes

















up vote
0
down vote













Expanding my comment, since comments are lousy for math,
if we replace !n/n! by 1/e and let H be the LHS,
$H = Hwe^z-1+ 1-w$
or
$H = frac1-w1-we^z-1$.



You can then substitute, differentiate, and mutilate to your heart's desire.



As to how well this fits your original problem,
I don't know.






share|cite|improve this answer




















    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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f158232%2fequation-about-generating-functions-and-subfactorial%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Expanding my comment, since comments are lousy for math,
    if we replace !n/n! by 1/e and let H be the LHS,
    $H = Hwe^z-1+ 1-w$
    or
    $H = frac1-w1-we^z-1$.



    You can then substitute, differentiate, and mutilate to your heart's desire.



    As to how well this fits your original problem,
    I don't know.






    share|cite|improve this answer
























      up vote
      0
      down vote













      Expanding my comment, since comments are lousy for math,
      if we replace !n/n! by 1/e and let H be the LHS,
      $H = Hwe^z-1+ 1-w$
      or
      $H = frac1-w1-we^z-1$.



      You can then substitute, differentiate, and mutilate to your heart's desire.



      As to how well this fits your original problem,
      I don't know.






      share|cite|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Expanding my comment, since comments are lousy for math,
        if we replace !n/n! by 1/e and let H be the LHS,
        $H = Hwe^z-1+ 1-w$
        or
        $H = frac1-w1-we^z-1$.



        You can then substitute, differentiate, and mutilate to your heart's desire.



        As to how well this fits your original problem,
        I don't know.






        share|cite|improve this answer












        Expanding my comment, since comments are lousy for math,
        if we replace !n/n! by 1/e and let H be the LHS,
        $H = Hwe^z-1+ 1-w$
        or
        $H = frac1-w1-we^z-1$.



        You can then substitute, differentiate, and mutilate to your heart's desire.



        As to how well this fits your original problem,
        I don't know.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jun 15 '12 at 5:49









        marty cohen

        70k446122




        70k446122



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f158232%2fequation-about-generating-functions-and-subfactorial%23new-answer', 'question_page');

            );

            Post as a guest













































































            這個網誌中的熱門文章

            How to combine Bézier curves to a surface?

            Why am i infinitely getting the same tweet with the Twitter Search API?

            Carbon dioxide