Coin Problem (Generating Functions)

80 Views Asked by At

Previously, I asked the following question below.

Here $\mathbb{N}=\{ 0, 1, 2, 3, \dots\}$.

What is the cardinality of the following set?

$A=\{(N, D, Q) \mid \text{$0.05N+0.1D+0.25Q=3$ and $N,D, Q\in \mathbb N$}\}$

Looking at the PDF here on page 18, it states that $[x^n]C(x)=c_n$ (i.e. $c_n=|A|$) where $C(x)=\frac{1}{1-x}\cdot \frac{1}{1-x^2}\cdot \frac{1}{1-x^5}$ and $[x^n]$ is the $60^{th}$ term of the power series of $C(x)$.

Question: How do you determine the $60^{th}$ term of the power series of $C(x)=\frac{1}{1-x}\cdot \frac{1}{1-x^2}\cdot \frac{1}{1-x^5}$? I want to know how $[x^n]$ is defined so I can figure out what $|A|$ is.

1

There are 1 best solutions below

2
On BEST ANSWER

The standard approach is to write this in terms of partial fractions:

$$\begin{align}f(x)&=\frac{1}{1-x}\cdot \frac{1}{1-x^2}\cdot\frac1{1-x^5}\\&=\frac{a}{(1-x)^3}+\frac{b}{(1-x)^2}+\frac{c}{1-x}+\frac{d}{1+x}+\sum \frac{e_i}{1-w_ix}\end{align}$$ where the $w_i$ are the four non-trivial roots of $x^5-1.$

But that is messy. Wolfram Alpha gives a partial solution, yielding $a=\frac1{10},b=\frac{1}{4},c=\frac{13}{40},d=\frac{1}{8}.$

The remaining term is $\frac15\frac{1+x+2x^2+x^3}{1+x+x^2+x^3+x^4}=\frac15\frac{1+x^2-x^3-x^4}{1-x^5}.$

It gets messy from there, but the $[x^n]f(x)$ is $$\frac{1}{10}\binom{n+2}{2}+\frac{1}{4}\binom{n+1}{1}+\frac{13}{40}+\frac{(-1)^n}{8}+c_n\tag{1}$$

where $c_n=\frac{1}{5},0,\frac15,-\frac15,-\frac 15$ depending on whether $n\equiv 0,1,2,3,4\pmod{5}.$

When $n=60,$ the value returns is $205.$

You can get the general formula that $[x^n]f(x)$ is the nearest integer to $$\frac{n^2+8n+13}{20}$$


Another approach is to write:

$$\begin{align}f(x)&=\frac{1}{1-x}\cdot \frac{1}{1-x^2}\cdot \frac{1}{1-x^5}\\&=\frac{1+x+\cdots+x^9}{1-x^{10}}\cdot\frac{1+x^2+x^4+x^6+x^8}{1-x^{10}}\cdot \frac{1+x^5}{1-x^{10}}\\ &=\frac{(1 + x + x^2 + \cdots + x^9) (1 + x^2 + x^4 + x^6 + x^8) (1 + x^5)}{(1-x^{10})^3} \end{align}$$

The numerator is (thanks to Wolfram Alpha) equal to $$1 + x + 2 x^2 + 2 x^3 + 3 x^4 + 4 x^5 + 5 x^6 + 6 x^7 + 7 x^8 + 8 x^9 + 7 x^{10} + 8 x^{11} + 7 x^{12} \\+ 8 x^{13} + 7 x^{14} + 6 x^{15} + 5 x^{16} + 4 x^{17} + 3 x^{18} + 2 x^{19} + 2 x^{20} + x^{21} + x^{22}$$

And $$\frac{1}{(1-x^{10})^3}=\sum_{k=0}^{\infty} \binom{k+2}{2}x^{10k}$$

So the coefficient of $x^{10k}$ in the product is $$\binom{k+2}{2} + 7\binom{k+1}{2}+2\binom{k}{2}=5 k^2 + 4 k + 1.$$

This gives a separate formula for the coefficient of $x^{10k+i}$ for each $i=0,1,\dots,9.$

Specifically:

$$\begin{align}[x^{10k+1}]f(x)&=\binom{k+2}{2}+8\binom{k+1}{2}+\binom{k}{2}=5k^2+5k+1\\ [x^{10k+2}]f(x)&=2\binom{k+2}{2}+7\binom{k+1}{2}+\binom{k}{2}=5k^2+6k+2\\ [x^{10k+3}]f(x)&=2\binom{k+2}{2}+8\binom{k+1}{2}\\ [x^{10k+4}]f(x)&=3\binom{k+2}{2}+7\binom{k+1}{2}\\ [x^{10k+5}]f(x)&=4\binom{k+2}{2}+6\binom{k+1}{2}\\ [x^{10k+6}]f(x)&=5\binom{k+2}{2}+5\binom{k+1}{2}\\ [x^{10k+7}]f(x)&=6\binom{k+2}{2}+4\binom{k+1}{2}\\ [x^{10k+8}]f(x)&=7\binom{k+2}{2}+3\binom{k+1}{2}\\ [x^{10k+9}]f(x)&=8\binom{k+2}{2}+2\binom{k+1}{2}\\ \end{align}$$

As you can see, there's a pattern for $i=3,\dots,9,$ namely:

$$\begin{align}[x^{10k+i}]f(x)&=(i-1)\binom{k+2}{2}+(11-i)\binom{k+1}{2}\\&=5k^2+(4+i)k+(i-1)\end{align}$$

This gives the close formula $$[x^{10k+i}]f(x)=5k^2+(4+i)k+(i-1)+c_i$$

where $$(c_i)_{i=0,\dots,9}=(2,1,1,0,0,0,0,0,0,0)$$