A question from Herbert Wilf's generatingfunctionology book (part (d) of the question):
Just for illustration: $$0010 \,\, 0100 \,\, 0001 \,\, 1000$$ Would be an example where we have 4 codewords (each of length $n=4$), where if we take any two distinct codewords above we have only one position where the bit differs. Easily this means $A(4,1) \geq 4$.
The color of a codeword is defined as $\sum _{j=1} ^{n} j\epsilon_j \mod{2n}$. For example, the 6-length codeword $101101$ would have the color: $$1*1 + 2*0 + 3*1 + 4*1 + 5*0 + 6*1 \equiv 14 \equiv 2 \mod 12$$
Working out:
For question $(c)$ I have found that $$f(z) = \sum_{j\geq 0} a_j z^j = \prod_{k=1} ^{n} (1+z^k) \tag{0}$$.
I have that (assuming $r \in \{ 0, 1, ..., 2n-1 \}$): $$\beta_r = \sum_{k\geq 0} a_{r+2nk} \tag{1}$$
And I define: $$g_r(x) = \frac{1}{x^r}\left(f(x) - \sum_{k=0} ^{r-1} a_k x_k \right) = \sum_{j\geq 0} a_{r+j} \, x^j$$
Using the fact that ('roots of unity' method; $m \in \mathbb{N}$): $$\frac{1}{m}\sum _{k=0} ^{m-1} f(e^{(2 \pi i k)/m} x) = \sum_{k\geq 0} a_{mk} (x^{m})^{k}$$
Applying it to $g_r(x)$ this time, and if we let $\omega_k = e^{(2 \pi i k)/(2n)}$ we have: $$\frac{1}{2n}\sum _{k=0} ^{2n-1} g_r(\omega_k x) = \sum_{k\geq 0} a_{r+2nk} (x^{2n})^{k} \tag{2}$$
So if we let $x=1$ from $(2)$ we have: $$\begin{align*} \beta_r &= \sum_{k\geq 0} a_{r+2nk} \\ &= \frac{1}{2n}\sum _{k=0} ^{2n-1} g_r(\omega_k) \\ &=\frac{1}{2n}\sum _{k=0} ^{2n-1} \frac{1}{(\omega_k)^r}\left(\prod_{p=1} ^{n} (1+(\omega_k)^p) - \sum_{p=0} ^{r-1} a_p (\omega_p)^k \right) \\ &=\frac{1}{2n}\sum _{k=0} ^{2n-1} \frac{1}{\omega_{kr}}\left(\prod_{p=1} ^{n} (1+\omega_{kp}) - \sum_{p=0} ^{r-1} a_p \,\omega_{pk} \right) \tag{3} \end{align*}$$
I am unsure how to proceed from here, or if this approach is even the way to go about it (considering it says to use the 'roots of unity' method). Firstly, I am unsure how to deal with $f(z) = \sum_j a_j z^j = \prod_{k=1} ^{n} (1+z^k)$, especially what to do with the product of $(1+z^k)$ in equation $(3)$.
Thus, I'd like to ask (more preferably hints) help on how to approach this question, or if the working out above is even correct.
Thank you in advance.
EDIT 2 (more working out):
With help from WolframAlpha, I find that (regardless of the values of $a_p$): $$\sum _{k=0} ^{2n-1} \omega_{-kr} \sum_{p=0} ^{r-1} a_p \,\omega_{pk} = \sum_{p=0} ^{r-1} a_p \sum _{k=0} ^{2n-1} \exp{\left(\frac{2\pi i k(p-r)}{2n}\right)} = \sum_{p=0} ^{r-1} a_p \frac{1-\exp{(2 \pi i (p-r))}}{1 - \exp{\left(-\frac{2\pi i (r-p)}{2n}\right)}} = 0$$
Since $1 \leq r-p \leq r$ and $1 \leq r \leq 2n - 1$, the denominator is never 0 but numerator equals zero since $p-r \in \mathbb{Z}$.
This makes the sum easier (but still have to deal with the product sum): $$\begin{align*} \beta_r &= \frac{1}{2n}\sum _{k=0} ^{2n-1} \frac{1}{\omega_{kr}}\left(\prod_{p=1} ^{n} (1+\omega_{kp}) \right) \\ &= \frac{1}{2n}\sum _{k=0} ^{2n-1} \exp{\left( -\frac{2\pi i kr}{2n} \right)} \prod_{p=1} ^{n} \left(1 + \exp{\left( \frac{2\pi i kp}{2n} \right)} \right) \end{align*}$$
But note at the $n$'th product (when $p=n$): $$1 + \exp{\left( \frac{2\pi i kn}{2n} \right)} = 1 + (-1)^k$$
So if $k$ is odd, the product equals $0$. So we can just sum the ones with even $k$, and since $2n - 1$ is odd then we sum when $k=0, 2, ..., 2(n-1)$. Thus:
$$\begin{align*} \beta_r &= \frac{1}{2n}\sum _{k=0} ^{n-1} \exp{\left( -\frac{2\pi i (2k)r}{2n} \right)} \prod_{p=1} ^{n} \left(1 + \exp{\left( \frac{2\pi i (2k)p}{2n} \right)} \right) \\ &= \frac{1}{2n}\sum _{k=0} ^{n-1} \exp{\left( -\frac{2\pi i kr}{n} \right)} \prod_{p=1} ^{n} \left(1 + \exp{\left( \frac{2\pi i kp}{n} \right)} \right) \tag{4} \end{align*}$$
EDIT 3: (more working out)
Right now I'm working through simplifying the product $\prod_{p=1} ^{n} \left(1 + \exp{\left( \frac{2\pi i kp}{n} \right)}\right)$ to reach to the desired answer.
- If $n$ is even, note that the $n$'th roots of unity $\{e^{2\pi i t/n}\}_{t=1}^{n} = \{e^{2\pi i t/n}\}_{t=1}^{n/2} \cup \{e^{-2\pi i t/n}\}_{t=1}^{n/2}$ since roots of $1-x^n$ come in conjugate pairs.
- If $n$ is odd, then similarly $\{e^{2\pi i t/n}\}_{t=1}^{n} = \{1\} \cup \{e^{2\pi i t/n}\}_{t=1}^{n-1} = \{1\} \cup \{e^{2\pi i t/n}\}_{t=1}^{(n-1)/2} \cup \{e^{-2\pi i t/n}\}_{t=1}^{(n-1)/2}$.
For the time being, I will work on the case when $n$ is odd since the answer desires $n = 2^\alpha n''$ and if $n$ is odd then $n = n''$ with $\alpha = 0$ (makes this case the easier one compared to when $n$ is even).
Thus, assume $n$ is odd with $n\geq 1$ and $k=0,1,...,n-1$:
$$\begin{align*} \prod_{p=1} ^{n} \left(1 + \exp{\left( \frac{2\pi i kp}{n} \right)}\right) &= 2 \prod_{p=1} ^{n-1} \left(1 + \exp{\left( \frac{2\pi i kp}{n} \right)}\right) \\ &= 2 \prod_{p=1} ^{\frac{n-1}{2}} \left(1 + \exp{\left( \frac{2\pi i kp}{n} \right)}\right) \left(1 + \exp{\left( -\frac{2\pi i kp}{n} \right)}\right) \\ &= 2 \prod_{p=1} ^{\frac{n-1}{2}} \left(2 + \exp{\left( \frac{2\pi i kp}{n}\right)} + \exp{ \left( - \frac{2\pi i kp}{n}\right)} \right) \\ &= 2^{\frac{n+1}{2}}\prod_{p=1} ^{\frac{n-1}{2}} \left(1 + \cos{\left( \frac{2\pi kp}{n}\right)} \right) \\ &= 2^{\frac{n+1}{2}}\prod_{p=1} ^{\frac{n-1}{2}} \left(2 \cos^2{\left( \frac{\pi kp}{n}\right)} \right) \tag{A1} \\ &= 2^{n} \left( \prod_{p=1} ^{\frac{n-1}{2}} \cos{\left( \frac{\pi kp}{n}\right)} \right)^2 \end{align*}$$
Where in $(A1)$ I used the trig identity $\cos^2(x) = \frac{1+\cos(2x)}{2}$. Now, according to the answer, I am hoping there will be a $gcd(k,n)$ in it somewhere.
About the bit where $\left. \prod_{p=1}^{n''/\gcd(j, n'')} (1+z^p) \right|_{z=\exp(j 2\pi i/n'')}$, I am unsure how this is actually a permutation of the roots of unity of $n''/\gcd(j, n'')$. Is there an explanation or reason for this?
– user246678 Jan 09 '18 at 05:18