| % Linear programming bound on the size of a nonlinear q-ary code % of length n and minimum distance d % Inputs: q = 2; % alphabet size n = 16; % code length d = 6; % minimum distance % Compute the values of Krawtchouck polynomial K = zeros(n-1,n); c = zeros(n-1,1); for k = 1:(n-1) for w = 1:n for j = max(0,(k-n+w)):min(w,k) K(k,w) = K(k,w)+(-1)^j*(q-1)^(k-j)*nchoosek(w,j)*nchoosek(n-w,k-j); end end c(k) = (q-1)^(k)*nchoosek(n,k); end % Linear Programming x = linprog(-ones(1,n-d+1),-K(:,d:end),c,[],[],zeros(1,n-d+1)); % Output: upper bound on number of codewords 1+floor(sum(x+1e-8))
============================== Nordstrom-Robinson code's parameters q=2, n=16, d=6 are used in the example. |