Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gmcninch-tufts
GitHub Repository: gmcninch-tufts/2024-Sp-Math190
Path: blob/main/course-contents/notebooks/2024-02-22--perfect.ipynb
469 views
Kernel: Python 3 (ipykernel)
def delta(n,q,m): return sum([ binomial(n,j) * (q-1)**j for j in range(m+1) ])

Let CAnC \subset A^n be a code of minimal distance dd and set t=(d1)/2t = (d-1)/2; so that CC "corrects up to tt errors".

CC is perfect if Cδ(t)=qn.|C| \cdot \delta(t) = q^n.

For this to hold, of course, we must have δ(t)qn\delta(t) \mid q^n.

Let's see some possibilities:

def test(n,q,t): return Mod(q^n,delta(n,q,t)) == 0
q = 2 t = 2 list(filter(lambda n: test(n,q,t),range(1,200)))
[1, 2, 5, 90]

In fact, there is no perfect binary code of length 90 with t=2t = 2.

q = 2 t = 3 list(filter(lambda n: test(n,q,t), range(1,200)))
[1, 2, 3, 7, 23]
q=3 t=2 list(filter(lambda n: test(n,q,t),range(1,200)))
[1, 2, 11]