Describe an error pattern as a matrix of n rows by k columns. Each of the
correct bits is a 0, and each of the incorrect bits is a 1. With four errors per
block, each block will have exactly four 1s. How many such blocks are
there? There are nk ways to choose where to put the first 1 bit, nk − 1 ways
to choose the second, and so on, so the number of blocks is
nk(nk − 1)(nk − 2)(nk − 3). Undetected errors only occur when the four 1
bits are at the vertices of a rectangle. Using Cartesian coordinates, every 1 bit
is at a coordinate (x, y), where 0 ≤ x < k and 0 ≤ y < n. Suppose that the bit
closest to the origin (the lower-left vertex) is at (p, q). The number of legal
rectangles is (k − p − 1)(n − q − 1). The total number of rectangles can be
found by summing this formula for all possible p and q. The probability of an
undetected error is then the number of such rectangles divided by the number
of ways to distribute the 4 bits:
k-2 n-2
Σ Σ (k − p − 1)(n − q − 1)
p =0 q=0
------------------------------------------------------------
nk(nk-1)(nk-2)(nk-3)