function [result] = generateAllBinaryOucomes(n)
  numofoutcomes=2^n;
  result=zeros(numofoutcomes, n);
  for k=0:numofoutcomes-1
    bin=dec2bin(k);
    for l=1:size(bin,2)
      if (bin(l)=='1')
        result(k+1, size(bin,2)-l+1)=1;
      else
        result(k+1, size(bin,2)-l+1)=-1;
      end
    end
    for l=size(bin,2)+1:n
      result(k+1, l)=-1;
    end
  end
end