<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[DE's Notes & Thoughts: Coding Theory]]></title><description><![CDATA[A place for coding theory notes. Will dive into Hamming distance, parity checks, linear codes, Reed-Solomon codes to BCH and maybe go beyond]]></description><link>https://blog.diana-enache.com/s/coding-theory</link><image><url>https://substackcdn.com/image/fetch/$s_!R5Si!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa6b4625c-aab8-4926-be6c-35b6b1b5b802_500x500.png</url><title>DE&apos;s Notes &amp; Thoughts: Coding Theory</title><link>https://blog.diana-enache.com/s/coding-theory</link></image><generator>Substack</generator><lastBuildDate>Mon, 04 May 2026 21:02:21 GMT</lastBuildDate><atom:link href="https://blog.diana-enache.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Diana Darie]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[theengineeringcompass@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[theengineeringcompass@substack.com]]></itunes:email><itunes:name><![CDATA[Diana Darie]]></itunes:name></itunes:owner><itunes:author><![CDATA[Diana Darie]]></itunes:author><googleplay:owner><![CDATA[theengineeringcompass@substack.com]]></googleplay:owner><googleplay:email><![CDATA[theengineeringcompass@substack.com]]></googleplay:email><googleplay:author><![CDATA[Diana Darie]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Coding Theory: Hamming Distance, Code, and Bound]]></title><description><![CDATA[Attempting to dive into the basics of coding theory]]></description><link>https://blog.diana-enache.com/p/coding-theory-hamming-distance-code</link><guid isPermaLink="false">https://blog.diana-enache.com/p/coding-theory-hamming-distance-code</guid><dc:creator><![CDATA[Diana Darie]]></dc:creator><pubDate>Tue, 14 May 2024 16:10:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Some time ago I wrote an article trying to dive into how <a href="https://thecraftydev.substack.com/p/from-pixels-to-information-a-comprehensive">QR codes actually work</a> by trying to decode a simple one. All went well until I got to the part of understanding how the error correction bits work and how they help restore any lost information. While the pseudocode is available online and it would be doable to write your own text to QR encoder (that&#8217;s what she said), I couldn&#8217;t grasp the maths behind the Reed-Solomon codes and how it helps with error correction. It seems I was missing a lot of concepts and theory. </p><p>So here I am, starting a new series of articles diving into Coding Theory. From Hamming distance, parity checks, linear codes, Reed-Solomon codes to BCH and maybe beyond? We&#8217;ll see how long my curiosity lasts. </p><p>This article will talk about:</p><ul><li><p>what is noise, error detection and error correction</p></li><li><p>definitions - hamming distance, ball, volume, code dimension, rate, weight and hamming bound</p></li></ul><p>And at the end of it, you should be able to: </p><ul><li><p>find and use the Hamming distance for a code</p></li><li><p>understand the trade-off between rate and distance</p></li></ul><p></p><h3>The Goal of Coding Theory</h3><p>One of the main goals of coding theory is developing methods to detect/correct errors caused by the transmission of information through noisy channels.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_t9M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_t9M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_t9M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_t9M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_t9M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_t9M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg" width="1456" height="244" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:244,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:171530,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_t9M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_t9M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_t9M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_t9M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb97df35d-6281-42be-82a4-cafd9ac7382d_4888x818.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><pre><code><strong>message m of length k</strong> &#8594; <em>(encoding)</em> <strong>codeword c</strong>  &#8594; <em>(channel)</em> received <strong>word c&#8217;</strong> &#8594;  <em>(decoding)</em> <strong>message m&#8217; of length n</strong></code></pre><p>Let&#8217;s say we have a message <strong>m</strong> of length <strong>k</strong> which we are going to encode (somehow) and get a word <strong>c</strong> of length <strong>n</strong>. Here <strong>n &gt; k</strong> as we are adding redundancy data to our original message. We transmit the encoded word c through some communication channel but some of the bits get corrupted and so we receive a corrupted codeword <strong>c~</strong> of length n.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tYti!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tYti!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png 424w, https://substackcdn.com/image/fetch/$s_!tYti!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png 848w, https://substackcdn.com/image/fetch/$s_!tYti!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png 1272w, https://substackcdn.com/image/fetch/$s_!tYti!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tYti!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png" width="664" height="153.02057613168725" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:224,&quot;width&quot;:972,&quot;resizeWidth&quot;:664,&quot;bytes&quot;:30109,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tYti!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png 424w, https://substackcdn.com/image/fetch/$s_!tYti!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png 848w, https://substackcdn.com/image/fetch/$s_!tYti!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png 1272w, https://substackcdn.com/image/fetch/$s_!tYti!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa84f4808-969b-467d-a2d9-7c010eec34d9_972x224.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>We are concerned about 4 things:</p><ol><li><p>Handling the communication noise.</p></li><li><p>Recovering the initial message. </p></li><li><p>Minimising overhead, meaning k/n should be large.</p></li><li><p>Being able to do the above through an encoding method that is efficient.</p></li></ol><p></p><h3>Binary bit-error correcting codes</h3><p>To start off, there are a couple of assumptions we&#8217;ll make. All messages that we want to send are binary strings and we will only be transmitting binary strings across the channel and the only errors that occur are bit-errors, which consist of replacing 0 by 1 or 1 by 0.</p><p>Let&#8217;s start by providing the formal definition of what a <strong>codeword c</strong> is.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!b4_k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!b4_k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png 424w, https://substackcdn.com/image/fetch/$s_!b4_k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png 848w, https://substackcdn.com/image/fetch/$s_!b4_k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png 1272w, https://substackcdn.com/image/fetch/$s_!b4_k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!b4_k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png" width="644" height="153.15399610136453" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:244,&quot;width&quot;:1026,&quot;resizeWidth&quot;:644,&quot;bytes&quot;:34475,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!b4_k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png 424w, https://substackcdn.com/image/fetch/$s_!b4_k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png 848w, https://substackcdn.com/image/fetch/$s_!b4_k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png 1272w, https://substackcdn.com/image/fetch/$s_!b4_k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85c7dc42-1657-4ad3-b262-5660fdcacef3_1026x244.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Example 1</strong> An example would be the following where C is a matrix of vectors of length 4 over an alphabet {0,1}. C is a code which has 8 codewords, each of length 4 and all digits are either 0 or 1. Such codes are called <strong>binary codes</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IFQh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IFQh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png 424w, https://substackcdn.com/image/fetch/$s_!IFQh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png 848w, https://substackcdn.com/image/fetch/$s_!IFQh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png 1272w, https://substackcdn.com/image/fetch/$s_!IFQh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IFQh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png" width="580" height="126.67706708268331" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:280,&quot;width&quot;:1282,&quot;resizeWidth&quot;:580,&quot;bytes&quot;:39933,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IFQh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png 424w, https://substackcdn.com/image/fetch/$s_!IFQh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png 848w, https://substackcdn.com/image/fetch/$s_!IFQh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png 1272w, https://substackcdn.com/image/fetch/$s_!IFQh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F558ae65b-d3b8-4311-987c-d517d0ff6e90_1282x280.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Example 2</strong> </p><p>Suppose we have the following code (also known as the <strong>Hamming Code</strong>)</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!42ra!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!42ra!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png 424w, https://substackcdn.com/image/fetch/$s_!42ra!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png 848w, https://substackcdn.com/image/fetch/$s_!42ra!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png 1272w, https://substackcdn.com/image/fetch/$s_!42ra!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!42ra!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png" width="688" height="62.654991243432576" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:104,&quot;width&quot;:1142,&quot;resizeWidth&quot;:688,&quot;bytes&quot;:18486,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!42ra!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png 424w, https://substackcdn.com/image/fetch/$s_!42ra!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png 848w, https://substackcdn.com/image/fetch/$s_!42ra!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png 1272w, https://substackcdn.com/image/fetch/$s_!42ra!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d366ae4-692f-45a5-b718-57e5a78e5517_1142x104.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Then C is a binary code of blocklength 7. There is a nice way to visualise the bove encoding using 3 circles. Our message bits will be at the intersection of any 2 circles and all the other 3 parity bits ((x2,x3,x4)%2, etc) correspond to the remaining empty cells. You can also notice that each circle sums up to 0mod2.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Z-9G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Z-9G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Z-9G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Z-9G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Z-9G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Z-9G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg" width="530" height="279.19642857142856" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:767,&quot;width&quot;:1456,&quot;resizeWidth&quot;:530,&quot;bytes&quot;:123847,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Z-9G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Z-9G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Z-9G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Z-9G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b098c38-bfa4-4b9e-9cac-57eab4316e3d_2756x1451.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The Hamming Code is <em><strong>capable of detecting up to two simultaneous bit errors and correcting single-bit errors. </strong></em>Let&#8217;s say we get the following corrupted code word c~={0111010}. Are we able to figure out c? One way to check which bit got flipped is to use the same circle representation above and use the bits that we got: </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_qOD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_qOD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_qOD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_qOD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_qOD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_qOD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg" width="552" height="290.7857142857143" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:767,&quot;width&quot;:1456,&quot;resizeWidth&quot;:552,&quot;bytes&quot;:113965,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_qOD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_qOD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_qOD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_qOD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6e0b955-c560-46d8-91b8-1b0427c1981f_2756x1451.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We know that the sum of the bits in each circle should sum up to 0mod%2 but the yellow and blue one don&#8217;t, which means the bit at their intersection (aka the 3rd bit) has been corrupted. So now we know the corrected codeword is c={0101010}</p><p>Let&#8217;s continue with some more formal definitions. The <strong>Hamming Distance</strong> between two strings is the number of positions in which they differ.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lv2H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lv2H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png 424w, https://substackcdn.com/image/fetch/$s_!lv2H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png 848w, https://substackcdn.com/image/fetch/$s_!lv2H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png 1272w, https://substackcdn.com/image/fetch/$s_!lv2H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lv2H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png" width="618" height="151.6067415730337" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:262,&quot;width&quot;:1068,&quot;resizeWidth&quot;:618,&quot;bytes&quot;:32085,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lv2H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png 424w, https://substackcdn.com/image/fetch/$s_!lv2H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png 848w, https://substackcdn.com/image/fetch/$s_!lv2H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png 1272w, https://substackcdn.com/image/fetch/$s_!lv2H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f0ace41-9409-4902-9080-acfd235bea0e_1068x262.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>For example &#916;(001, 100) = 2.</p><p> The Relative Hamming Distance and the Minimum Distance are defined as:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8g7U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8g7U!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png 424w, https://substackcdn.com/image/fetch/$s_!8g7U!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png 848w, https://substackcdn.com/image/fetch/$s_!8g7U!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png 1272w, https://substackcdn.com/image/fetch/$s_!8g7U!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8g7U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png" width="618" height="144.51330798479088" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:246,&quot;width&quot;:1052,&quot;resizeWidth&quot;:618,&quot;bytes&quot;:35947,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8g7U!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png 424w, https://substackcdn.com/image/fetch/$s_!8g7U!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png 848w, https://substackcdn.com/image/fetch/$s_!8g7U!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png 1272w, https://substackcdn.com/image/fetch/$s_!8g7U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff73814bc-8d8d-489e-a144-7e64f33ba2df_1052x246.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SOSJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SOSJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png 424w, https://substackcdn.com/image/fetch/$s_!SOSJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png 848w, https://substackcdn.com/image/fetch/$s_!SOSJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png 1272w, https://substackcdn.com/image/fetch/$s_!SOSJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SOSJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png" width="616" height="138.45333333333335" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:236,&quot;width&quot;:1050,&quot;resizeWidth&quot;:616,&quot;bytes&quot;:27199,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SOSJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png 424w, https://substackcdn.com/image/fetch/$s_!SOSJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png 848w, https://substackcdn.com/image/fetch/$s_!SOSJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png 1272w, https://substackcdn.com/image/fetch/$s_!SOSJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6ff3824c-9f79-4bba-ab86-7963a68f3e82_1050x236.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><blockquote><p>The <strong>distance of a code</strong> is the minimum Hamming distance between two distinct codewords in the code.</p></blockquote><p>For example, the distance of {001, 010, 100, 111} is 2.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!p0U5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!p0U5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png 424w, https://substackcdn.com/image/fetch/$s_!p0U5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png 848w, https://substackcdn.com/image/fetch/$s_!p0U5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png 1272w, https://substackcdn.com/image/fetch/$s_!p0U5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!p0U5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png" width="1270" height="338" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:338,&quot;width&quot;:1270,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:55988,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!p0U5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png 424w, https://substackcdn.com/image/fetch/$s_!p0U5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png 848w, https://substackcdn.com/image/fetch/$s_!p0U5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png 1272w, https://substackcdn.com/image/fetch/$s_!p0U5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F55e53945-50f0-43e1-af09-b3ba49c2b7e7_1270x338.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Another definition of the volume of a Hamming Ball can be defined as: </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JrUn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JrUn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png 424w, https://substackcdn.com/image/fetch/$s_!JrUn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png 848w, https://substackcdn.com/image/fetch/$s_!JrUn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png 1272w, https://substackcdn.com/image/fetch/$s_!JrUn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JrUn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png" width="564" height="186.3862660944206" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:308,&quot;width&quot;:932,&quot;resizeWidth&quot;:564,&quot;bytes&quot;:56339,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JrUn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png 424w, https://substackcdn.com/image/fetch/$s_!JrUn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png 848w, https://substackcdn.com/image/fetch/$s_!JrUn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png 1272w, https://substackcdn.com/image/fetch/$s_!JrUn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02d96bf4-1a17-4d31-818c-89e895a4dd84_932x308.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V8Gk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V8Gk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png 424w, https://substackcdn.com/image/fetch/$s_!V8Gk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png 848w, https://substackcdn.com/image/fetch/$s_!V8Gk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png 1272w, https://substackcdn.com/image/fetch/$s_!V8Gk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V8Gk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png" width="550" height="137.7995642701525" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:230,&quot;width&quot;:918,&quot;resizeWidth&quot;:550,&quot;bytes&quot;:22223,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V8Gk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png 424w, https://substackcdn.com/image/fetch/$s_!V8Gk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png 848w, https://substackcdn.com/image/fetch/$s_!V8Gk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png 1272w, https://substackcdn.com/image/fetch/$s_!V8Gk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb832d685-fea5-4e9d-bf90-aed9fb10bf17_918x230.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><strong>Example </strong>Given the following code C = {001,101,100,111} where first 2 bits are information bits, the Hamming Ball can be calculated as follows: </p><ul><li><p><strong>Calculate the Hamming Distance:</strong> For each codeword, calculate the Hamming distance to all other codewords within the specified radius. Let's say we want to calculate the Hamming ball of radius 1.</p><ul><li><p>For codeword 001: Hamming distance of 1 to 010 and 100.</p></li><li><p>For codeword 010: Hamming distance of 1 to 001 and 111.</p></li><li><p>For codeword 100: Hamming distance of 1 to 001 and 111.</p></li><li><p>For codeword 111: Hamming distance of 1 to 010 and 100.</p></li></ul></li><li><p><strong>Count the Codewords within the Radius:</strong> Count the number of codewords that fall within the specified radius from each codeword.</p><ul><li><p>For codeword 001: 2 codewords (010, 100) within radius 1.</p></li><li><p>For codeword 010: 2 codewords (001, 111) within radius 1.</p></li><li><p>For codeword 100: 2 codewords (001, 111) within radius 1.</p></li><li><p>For codeword 111: 2 codewords (010, 100) within radius 1.</p></li></ul></li><li><p><strong>Calculate the Volume:</strong> The volume of the Hamming ball is the sum of the counts of codewords within the radius from each codeword.</p><ul><li><p>Volume = 2 (from 001) + 2 (from 010) + 2 (from 100) + 2 (from 111) = 8.</p></li></ul></li></ul><p></p><h3>Detecting and Correcting Errors</h3><p>The error-correcting capability of a code refers to its ability to detect and correct errors that occur during transmission. A code with a larger minimum distance can correct more errors.</p><p>Detecting errors involves finding out if an error has occurred.</p><blockquote><p>We say a code can<strong> detect d errors</strong> if the following holds: <br><em>Whenever a codeword is transmitted across a channel capable of producing d bit-errors, it is possible to deduce whether an error occurred using only the received word.</em></p><p><strong>If the distance of a code is d, then the code can detect exactly d&#8722;1 errors.</strong></p></blockquote><p><strong>Proof </strong>If a channel can produce at most d&#8722;1 bit-errors, it cannot turn one codeword into another by flipping bits, because the minimum Hamming distance between any two codewords is at least d. Thus, if the received word c&#8217; is not in the code, we can deduce that some errors occurred. The code is not guaranteed to detect d errors, because one codeword can be transformed into another by d bit-errors.</p><blockquote><p>We say a code can <strong>correct d errors</strong> if the following holds: <br><em>Whenever a codeword is transmitted across a channel capable of producing d bit-errors, one can deduce which codeword was sent using only the received word.<br><br></em><strong>If the distance of a code is d, then the code can correct exactly </strong>&#8970;<strong>(d &#8722; 1)/2</strong>&#8971;<strong> errors.</strong></p></blockquote><p><strong>Proof</strong> Suppose <em>C</em> is a code of distance <em>d</em>, and a codeword <em>c</em> is sent across a channel capable of producing at most &#8970;(d &#8722; 1)/2&#8971; bit-errors. Consider we have received the word <em>c&#8217;</em> that is the result of transmitting the codeword <em>c</em> and introducing some errors. We claim that <em>c</em> is the only codeword within distance &#8970;(d &#8722; 1)/2&#8971; of <em>c&#8217;</em>. If there were another codeword, say c&#8217;&#8217;, then it would mean &#916;(c,c&#8217;&#8217;) &#8804; 2&#8970;(d &#8722; 1)/2&#8971; &#8804; d-1 (which is a contradiction based on the properties of non-overlapping neighborhoods)</p><p><strong>Example</strong> The following code C = {001,101,100,111} has distance 2 which means it can detect 1 error, but it can correct 0 errors.</p><blockquote><p><strong>A code with minimum Hamming distance d between its codewords, can:</strong></p><ul><li><p><strong>detect at most d-1 errors</strong></p></li><li><p><strong>correct at most &#8970;(d &#8722; 1)/2&#8971; errors</strong></p></li></ul></blockquote><p></p><h3>How much information can we send: the Rate</h3><p>The rate of a code is defined as the ratio of the number of information bits to the total number of bits in a codeword, which is a value between [0,1]. The closer to 1 the better.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!75Tw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!75Tw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png 424w, https://substackcdn.com/image/fetch/$s_!75Tw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png 848w, https://substackcdn.com/image/fetch/$s_!75Tw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png 1272w, https://substackcdn.com/image/fetch/$s_!75Tw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!75Tw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png" width="1250" height="368" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:368,&quot;width&quot;:1250,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:53292,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!75Tw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png 424w, https://substackcdn.com/image/fetch/$s_!75Tw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png 848w, https://substackcdn.com/image/fetch/$s_!75Tw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png 1272w, https://substackcdn.com/image/fetch/$s_!75Tw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51b4e6e-3765-4ccc-a5ef-6b5776957add_1250x368.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Given the following code <em>C</em>={000,101,011,110} where let&#8217;s say we use an encoding where the 2 bits are the information bits. This means our rate is: <br>R = number of information bits/length of the codeword = 2/3</p><p>In coding theory, higher-rate codes are desirable because they allow more information to be transmitted per unit of time or bandwidth. However, increasing the rate often comes at the cost of reduced error-correction capability, as higher-rate codes typically have shorter minimum distances. Therefore, there is often a trade-off between rate and error-correction performance in code design.</p><p></p><h3>Rate and Distance Trade-off: the Hamming Bound</h3><p>How does rate and distance influence each other?</p><ul><li><p><strong>Higher Rate, Lower Distance:</strong> Increasing the rate of a code often comes at the expense of reducing its distance. This is because increasing the rate typically involves reducing redundancy in the codewords, which means fewer bits are available for error detection and correction. As a result, the distance of the code decreases, making it less capable of correcting errors.</p></li><li><p><strong>Lower Rate, Higher Distance:</strong> Conversely, decreasing the rate of a code allows for more redundancy to be added to the codewords, which increases the distance of the code. This provides better error-correcting capability but at the cost of transmitting fewer information bits per codeword.</p></li></ul><p>Increasing the rate improves efficiency but may reduce error-correcting capability, while increasing the distance enhances error-correcting capability but may reduce efficiency.</p><p>So what is the best trade-off between rate and distance? The Hamming Bound establishes some limitations of how good this trade off can be.</p><p>Let&#8217;s try and visualise this. Let&#8217;s say we have our alphabet &#8721; with codewords c in code C, where C has distance d. All of the codewords neighborhoods are non-overlapping since each ball has radius &#8970;(d &#8722; 1)/2&#8971; and the distance between any 2 codewords is d. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uQhU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uQhU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png 424w, https://substackcdn.com/image/fetch/$s_!uQhU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png 848w, https://substackcdn.com/image/fetch/$s_!uQhU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png 1272w, https://substackcdn.com/image/fetch/$s_!uQhU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uQhU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png" width="1456" height="667" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/efb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:667,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:125382,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uQhU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png 424w, https://substackcdn.com/image/fetch/$s_!uQhU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png 848w, https://substackcdn.com/image/fetch/$s_!uQhU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png 1272w, https://substackcdn.com/image/fetch/$s_!uQhU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fefb8224b-55a1-4829-a01d-4a945860cfc7_2402x1100.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>From this we can get an idea of what the Hamming Bound is all about. We have those |C| disjoint balls of radius &#8970;(d &#8722; 1)/2&#8971;but all of those balls need to fit in &#8721;^n, so we can&#8217;t have too many balls. Therefore, we can&#8217;t have too many codewords and the rate of the code can&#8217;t be too big.  All those disjoint Hamming Balls need to live in &#8721;^n</p><p>Using the definition for the volume of the Hamming Ball, we can define the following:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kTyJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kTyJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png 424w, https://substackcdn.com/image/fetch/$s_!kTyJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png 848w, https://substackcdn.com/image/fetch/$s_!kTyJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png 1272w, https://substackcdn.com/image/fetch/$s_!kTyJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kTyJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png" width="1456" height="1001" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1001,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:236970,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kTyJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png 424w, https://substackcdn.com/image/fetch/$s_!kTyJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png 848w, https://substackcdn.com/image/fetch/$s_!kTyJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png 1272w, https://substackcdn.com/image/fetch/$s_!kTyJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a245bef-8f5b-4ea1-996a-c4e87b9487ed_1716x1180.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The Hamming Bound gives us a bound in terms of the distance and rate and is important in coding theory as it places an upper limit on the number of distinct codewords that can be encoded using a block of symbols of particular length, to provide a specified error-correcting capability.</p><h3>Conclusion</h3><p>As this article is getting quite long and there are still a lot of things to talk about we&#8217;ll stop here. Now that we have most of the definitions and theorems defined, next article will cover more practical examples on how to calculate the Hamming Bound for different codes. We&#8217;ll also discuss what are generator and parity matrixes and how to decode corrupted codewords.</p><h3>Resources:</h3><ul><li><p>Huge appreciation to <a href="https://sites.google.com/site/marywootters">Mary Wootters</a>&#8217; for her free <a href="https://www.youtube.com/playlist?list=PLkvhuSoxwjI_UudECvFYArvG0cLbFlzSr">Algebraic Coding Theory YT Lessons</a></p></li></ul>]]></content:encoded></item></channel></rss>