Compute the linear programming bound on the sizes of M-codes in H(d,q).

d=16;
q=2;
M={1,2,3,4,5};

K=Sum[(-1)^h*(q-1)^(#1-h)*Binomial[#2,h]*Binomial[d-#2,#1-h],{h,0,#1}]&;

K[i,j] gives the value at j of the Krawtchouk polynomial of degree i, which is the (j,i)-entry of the second eigenmatrix Q.

m=Table[K[i,j],{i,1,d},{j,Complement[Range[d],M]}];
b=Table[K[i,0],{i,1,d}];
c=ConstantArray[1,Length[Complement[Range[d],M]]];

LinearProgramming[-c,m,-b]

c.%+1