XOR of pairs stuff

phi[e_]  :=  2 e (1  -  e)

h[e_]  :=  
      (- e  Log[e]  -  (1 - e) Log[1 - e])/Log[2]

cap[e_]  :=  1  -  h[e]

pairs[k_, e_] := Sum[Binomial[k, i]*(e^i*(1 - e)^(-i + k + 1) + e^(-i + k + 1)*(1 - e)^i)*
    h[(e^i*(1 - e)^(-i + k + 1))/(e^i*(1 - e)^(-i + k + 1) + e^(-i + k + 1)*(1 - e)^i)], {i, 0, k}]

pairs[k, e]

Plot[{1  -  pairs[0,  e], 1  -  pairs[1,  e], 
        1  -  pairs[2,  e]},  {e,  0.01,  0.5}]

pairslist[j_, e_, inc_]  :=  
      Table[1 - pairs[k,  e],  {k, 0, j - 1, inc}]

ListPlot[ pairslist[100, 0.40, 10]]

Parity-related stuff

parity[j_, k_, e_]  :=  
      Sum[Binomial[k,  2 i  +  j] e^(2 i  +  j) 
          (1 - e)^(k  -  2 i  - j), 
         {i, 0, Floor[(k - j)/2]}]

parity [1, k, e]

parity[0, k, e]

Out[58 ]  +  Out[59]

Simplify[ Out[60]]

parity[1, 10, 0.3]  +  parity[0, 10, 0.3]

Table[ parity[1,  k ,  0.3],  {k, 2,  10}]

parity[ 0,  11.3,  0.3]

Plot[ parity[0, k, 0.15],  {k, 1.5, 2.55}]