Let a_n be the number of solutions of x + 2y = n where x and y are non-negative integers. By using the genera?

2009-12-04 10:39 am
Let a_n be the number of solutions of x + 2y = n where x and y are non-negative integers. By using the generating function A(x) for a_n, find the general formula for a_n.

回答 (2)

2009-12-04 6:34 pm
✔ 最佳答案
Remember the exponents in a generating function reflect the domain allowed for each quantity/variable in question.

The generating function for x is
(z^0 + z^1 + z^2 + ...) = 1/(1 - z).

The generating function for 2y is
(z^0 + z^2 + z^4 + ...) = 1/(1 - z^2).

Thus, the generating function for the equation is
A(z) = [1/(1 - z)] * [1/(1 - z^2)].

Now, we find the coefficient of x^n from this.
A(z) = [1/(1 - z)] * [1/(1 - z^2)]
= (1 - z)^(-2) * (1 + z)^(-1)
= [sum(k=0 to infinity) C(1+k,k)z^k] * [sum(k=0 to infinity) (-1)^k z^k]
= [sum(k=0 to infinity) (1+k) z^k] * [sum(k=0 to infinity) (-1)^k z^k]

By using the distributive property, the coefficient of z^n is
a_n = sum(i = 0 to n) (-1)^i * (1 + (n - i))
= sum(i = 0 to n) (-1)^i * ((n + 1) - i).
= (n + 1) * [sum(i = 0 to n) (-1)^i] + [sum(i = 0 to n) (-1)^(i+1) * i].

If n is even, then a_n = (n+1) + [1 - 2 + 3 - ... + (-1)^(n+1) * n].

However, writing n = 2k,
1 - 2 + 3 - ... + (-1)^(2k+1) * (2k)
= (1 + 3 + 5 + ... + (2k - 1)) - (2 + 4 + ... + 2k)
= k^2 - 2 * (1 + 2 + ... + k)
= k^2 - (k(k+1))
= -k
= -n/2

Thus, a_n = (n+1) + (-n/2) = (n+2)/2 if n is even.
---------
If n is odd, we get 0 + [1 - 2 + 3 - ... + (-1)^(n+1) * n]

However, writing n = 2k+1,
1 - 2 + 3 - ... + (-1)^(2k+2) * (2k+1)
= 1 - 2 + 3 - ... + (2k+1)
= (1 + 3 + 5 + ... + (2k + 1)) - (2 + 4 + ... + 2k)
= (k+1)^2 - 2 * (1 + 2 + ... + k)
= (k+1)^2 - (k(k+1))
= k+1.
= (n-1)/2 + 1
= (n+1)/2

Thus, a_n = 0 + (n+1)/2 = (n+1)/2 if n is odd.
--------
In summary,
a_n = (n+2)/2 if n is even.
a_n = (n+1)/2 if n is odd.

I hope this helps!
2009-12-04 11:24 am
I am sorry to say, that I don't know the concept "generating function". All I know is that

a_n = (n+1+(-1)ⁿ)/2

This can be recovered from the inequalities 0≤x≤n <=> 0≤y≤n/2. If n is even this gives y n/2+1=(n+2)/2 possible values. If n is odd there is (n-1)/2+1=(n+1)/2 possible values of y. These formulas can be assembled in the above expression using (-1)ⁿ as a tool for the change due to the parity of n.


收錄日期: 2021-05-01 12:52:51
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20091204023952AAB3WDs

檢視 Wayback Machine 備份