Equation about generating functions and subfactorial
Clash Royale CLAN TAG#URR8PPP
up vote
13
down vote
favorite
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
add a comment |Â
up vote
13
down vote
favorite
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
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
add a comment |Â
up vote
13
down vote
favorite
up vote
13
down vote
favorite
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
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
power-series generating-functions functional-equations
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
add a comment |Â
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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered Jun 15 '12 at 5:49
marty cohen
70k446122
70k446122
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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