Hamming distance - Prove that equation describes amount of elements for given Hamming distance

159 Views Asked by At

I have a problem understanding following task:

Given a block code $C$ of length $n$ over an alphabet $K$ with $q$ elements. Given an $e\in \mathbb{N}$, $C$ has the minimal distance of $d(C) = 2e+1 $

With $i \in \mathbb{N}_0$ with $0 \leq i \leq n.$ Prove that for every $v \in K^n$ there's exactly $ {n \choose i}(q-1)^i $ $ w \in K^n $ elements with a Hamming distance of $d(v,w)=i$

Can anybody give me a hint on how to interpret the equation?

1

There are 1 best solutions below

0
On BEST ANSWER

Let $v \in K^n$ be fixed. Then what is meant by $d(v,w)=i$ is that the vectors $v$ and $w$ differ in $i$ positions.

There are ${n \choose i}$ ways to pick the positions where $v$ and $w$ differ. Now given a position, since $|K|=q$, there are $q-1$ to change the element corresponding to that position. Since you want to change $i$ given positions, there are $(q-1)^i$ ways to do this.

In total there are ${n \choose i}(q-1)^i$ ways to change $i$ positions, or in other words, ${n \choose i}(q-1)^i$ $w \in K^n$ such that $d(v,w)=i$.