Take the derivative of a Hamming Weight Enumerator Background: The Hamming weight enumerator can be written as such:
$$A(z) = A_0 + A_1z + A_2z^2 + ... + A_nz^n$$
With $A_i$ being equal to the number of code words of weight i in the code book for an (n,k) code.
Thus, A(1) for an (n,k) code should be equal to $$\sum_{i=0}^n A_i = 2^k$$
Because we are essentially counting every code word in the code book. If that is incorrect, please correct me.
My question is as follows:
Suppose I wanted to find A'(1), where A'(z) is the derivative of A(z) wrt z, how would I go about solving that?
This is what I have so far:
$$A'(1) = \sum_{i = 0}^n iA_i$$
But I have no idea how to solve that for an (n,k) linear code. Any ideas?
 A: I think it's correct to have
$$ A'(z) = \sum_{i=1}^{n}iA_{i}z^{i-1}$$ and
$$ A'(1) = \sum_{i=0}^{n}iA_{i}$$
However, I don't think there's a solution with $(n, k)$ to this, since the weight enumerators differ with generation matrices.
Take these two simple $(4,2)$ code for exmaple. The first one is with
$$ G_{1} = \left[
\begin{array}{clr}
 1 & 0 & 1 & 0 \\
 0 & 1 & 0 & 1 \\
\end{array}\right] $$
Thus has codewords $0000$, $0101$, $1010$, $1111$ and
weight enumerator $A_{1}(z) = 1+2z^{2}+z^{4}$ 
That gives $A'_{1}(z) = 4z+4z^{3}$ and $ A'_{1}(1)=8$.

The second one is with
$$ G_{2} = \left[
\begin{array}{clr}
 1 & 0 & 0 & 1 \\
 0 & 1 & 0 & 1 \\
\end{array}\right] $$
Thus has codewords $0000$, $0101$, $1001$, $1100$ and
weight enumerator $A_{2}(z) = 1+3z^{2}$. 
That gives $A'_{2}(z) = 6z$ and $ A'_{2}(1)=6$. 
Though they're both $(4,2)$ codes, they lead to different result of $A'(1)$.
A: 
Claim: $A'(1) = N 2^{k-1}$, where $N$ is the number of nonzero columns in the generator matrix.

Let $G$ be the generator matrix.
Let $B_i$ denote the number of codewords with a $1$ in the $i^\text{th}$ position.


*

*Suppose the $i^\text{th}$ column of $G$ is zero.
Then every codeword has a $0$ in the $i^\text{th}$ position, so $B_i = 0$.

*Suppose the $i^\text{th}$ column of $G$ is nonzero.
Then half the codewords will have a $1$ in the $i^\text{th}$ position, so $B_i = 2^{k-1}$.


As Dilip explained in his comment: $i A_i$ is the total number of $1$s in all the codewords of weight $i$, so $\sum_i i A_i$ is the total number of $1$s in the code.
This can alternately be viewed as the number of codewords with a $1$ in the $i^\text{th}$ position, summed over $i$ (i.e., $\sum_i B_i$).
Therefore
$$
A'(1) = \sum_i i A_i = \sum_i B_i = N 2^{k-1}.
$$
