Advanced maths

Linear code covering radius calculator with deep hole coset witnesses

Enumerate code cosets to find global Hamming covering radius and deepest coset leaders.

Your numbers

Valid JSON; preserve the shown array or object structure.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The covering radius of a linear code is the greatest distance from an ambient word to its nearest codeword. It measures worst-case coverage of the entire word space, not the distance of one supplied received word and not the minimum distance between codewords.

THE FORMULARREFgeneratorGoverGF(p); constructparitycheckHspanningorthogonalcomplement. Enumerateallambientwords(includingzero) and theirsyndromes,retainminimumHammingweightleaderpersyndrome. Radius=maxofallminimumcosetleaderweights. Recorddeep-holeleader,syndromeandleaderweighthistogram; checknumberofsyndromes=p^(n−k). Ambientcount≤60000andspanboundneeded,but pairwiseambient×codeenumerationcanexceedbudget; syndromeleaderenumerationavoidsnaiveproduct.

A worked example

With the prefilled inputs, coveringRadius = 1.

Good to know

Complete syndrome coset leaders; radius covers EVERY ambient word, not just one received word.

Covering radius asks about every possible received word

The covering radius of a linear code is the greatest distance from an ambient word to its nearest codeword. It measures worst-case coverage of the entire word space, not the distance of one supplied received word and not the minimum distance between codewords.

A deep hole is a word attaining that greatest nearest-codeword distance. Returning a deep-hole witness makes the maximum concrete. The same code can have many such words, so the selected example is generally not a uniquely distinguished vector.

Complete coset-leader weight distributionCoset leaders of the binary length-three repetition code1weight 03weight 1Four cosets: 1 leader of weight 0 and 3 of weight 1.R = 1
Scroll across to see the full diagram.
The binary code {000,111} has four cosets with minimum leader weights 0,1,1,1, so its covering radius is one.

Compare with the Linear code syndrome decoding calculator with all nearest codewords. Maximize nearest-codeword distance across the entire ambientspace and identifydeepcosets; one receivedword decoding supplies no globalcoveringradius.

Use the selected finite field throughout

Use the prefilled input structure and preserve the declared column or index order. Rows of the generator matrix span the code over the chosen prime field. Dependent generator rows are normalized by exact modular elimination, and the resulting rank determines code dimension. Enter integers from zero through p−1; the parser rejects other values. Rank uses the selected prime field rather than real arithmetic or a composite modulus masquerading as a field.

The ambient length includes every declared column, even a zero coordinate column. Changing the generator basis does not change the code or its covering radius. Appending a new coordinate, however, can change the ambient coverage problem and must not be silently discarded during normalization.

Syndromes organize words into distance-equivalent cosets

Construct a parity-check matrix H whose kernel is the code. Ambient words sharing the same syndrome belong to the same coset, and their minimum distance to the code equals the minimum weight among words in that coset. Enumerating minimum-weight coset leaders therefore computes the radius.

After every syndrome has its minimum leader weight, take the largest such weight. Check that the number of discovered syndromes is the field size raised to n minus k. Missing a syndrome would leave part of the ambient space uncovered and invalidate the global maximum claim.

The binary length-three repetition code covers radius one

Use the generator row one, one, one, so the code contains only zero-zero-zero and one-one-one. Words of weight one are one step from zero-zero-zero, while words of weight two are one step from one-one-one. The two codewords themselves have distance zero.

Thus every ambient word is within one symbol change of the code, and some words require that change. The covering radius is one. The four cosets have one zero-weight leader and three weight-one leaders, which supplies a complete small histogram check.

Plot coset-leader distances instead of codeword spacing

The SVG should show the number of syndromes at each minimum leader weight, with the rightmost nonzero class marking the radius. A displayed deep-hole word and its nearest-codeword distance connect that histogram to an explicit worst-case example.

Do not label the bars as counts of all ambient words unless the coset-size factor is applied and stated. Every coset has the same number of words for a linear code, but a leader histogram and a word histogram are different quantities with different total counts.

Minimum distance answers a different question

Minimum code distance describes separation between distinct codewords and supports guaranteed unique-error correction bounds. Covering radius describes the farthest ambient word from the code. Neither quantity can simply replace the other in a result card.

For the repetition example, minimum code distance is three while covering radius is one. In other codes the distinction is less visually obvious. The calculator should state both only when each has actually been computed, avoiding an unsupported inference from one to the other.

Global enumeration needs complete syndrome coverage

The proposed limits keep the ambient word count bounded, and syndrome grouping avoids comparing every ambient word with every codeword. The implementation must still track its work and refuse an exact radius if enumeration stops before every needed minimum is certified.

Test the zero code, the full ambient code and equivalent generator bases. Their radii are n, zero and an invariant value respectively. These boundary cases catch parity-check rank errors and reversed max/min operations that a mid-sized example might not expose. The public prefill uses the same binary repetition generator. The returned leaderWeightDistribution is indexed by Hamming weight and includes trailing zero counts through length n. The deepCosets list supplies a syndrome string, minimum weight and representative leader for every deepest coset within the display cap; it is not a list of every ambient deep-hole word. Complete syndrome coset leaders; radius covers EVERY ambient word, not just one received word.

A few questions, answered

Is covering radius the distance of my received word?

No. It is the worst nearest-codeword distance over the entire ambient word space.

Why are only syndrome leaders needed?

Each syndrome identifies a coset, and its minimum leader weight equals the nearest-codeword distance for every word in that coset.

Does changing generator row basis change the radius?

No. An invertible change of generator basis leaves the spanned code and its covering radius unchanged.

What radius does the full ambient code have?

Zero, because every possible received word is already a codeword.

Find your calculator

Start typing to explore the library.