Digitalisiere[wort_] := ToCharacterCode[wort] - 64

liste = Digitalisiere["WORT"]

Verbalisiere[liste_] := FromCharacterCode[liste + 64]

Verbalisiere[liste]

a[2] = 23;  a[3] = 15;  a[4] = 18;  a[5] = 20;

Solve[{(∑_(k = 0)^5) a[k] == 0, (∑_(k = 0)^5) k a[k] == 
          0, Modulus == 31}, {a[0], a[1]}]

Clear[ReedSolomon]
\(ReedSolomon[wort_, p_] := 
      Module[{liste, n, a0, a1, k, sol}, 
liste = 
          Digitalisiere[wort]; 
n = Length[liste]; 
        sol = Solve[{a0 + a1 + Apply[Plus, liste] == 0, 
              a1 + Sum[\((k + 1)\)*liste[\([k]\)], {k, n}] == 0, 
              Modulus == p}, {a0, a1}]; 
        liste = Prepend[Prepend[liste, a1], a0] /. 
            sol[\([1]\)]; 
Verbalisiere[
          liste]
	]\)

ReedSolomon["WORT", 31]

wort = "APWIRT"

liste = Digitalisiere[wort]

e = Mod[Apply[Plus, liste], 31]

s = Mod[(∑_(k = 1)^6)(k - 1) liste[[k]], 31]

x = Mod[s*PowerMod[e, -1, 31], 31]

liste[[x + 1]] = Mod[liste[[x + 1]] - e, 31]

Verbalisiere[liste]

Clear[InverseReedSolomon]
InverseReedSolomon[wort_, p_] := 
      Module[{liste, n, e, s, x, k}, 
liste = 
          Digitalisiere[wort]; 
n = 
          Length[liste]; 
e = 
          Mod[Apply[Plus, liste], p]; 
s = 
          Mod[Sum[(k - 1)*liste[[k]], {k, 1, n}], 
            p]; 
x = 
          Mod[s*PowerMod[e, -1, p], 
            p]; 
liste[[x + 1]] = 
          Mod[liste[[x + 1]] - e, p]; 
liste = 
          Rest[Rest[liste]]; 
Verbalisiere[
          liste]
]

InverseReedSolomon["APWIRT", 31]

code = ReedSolomon["MATHEMATIK", 31]

code = StringReplace[code, "H" -> "S"]

InverseReedSolomon[code, 31]

code = StringReplace[code, "K" -> "J"]

InverseReedSolomon[code, 31]

w = (∑_(k = 2)^6) Binomial[6, 
            k] (0.002^k) (0.998^(6 - k))

w*1.5*(10^6)

w = (∑_(k = 3)^12) Binomial[12, 
            k] (0.002^k) (0.998^(12 - k))

w*1.5*10^6