edges=8% 10 edges ---> go to nodes-1*2 nodes=5%6 nodes ---> start on nodes+1 termedges=2 falsepositives=[]; for T=6 B=T-nodes+1 E=edges+1-T% really e-(T-1) d = [0:E-termedges+1] [b1,b2] = ndgrid(d,d) X = [b1(:),b2(:)] X_good = []; for i = 1:size(X,1) if sum(X(i,:))==E-termedges+1 X_good=[X_good;X(i,:)]; end end X_good(:,B)=X_good(:,B)+termedges-1 X_good A=factorial(X_good) falses=sum(prod(A')) falsepositives(T)=falses*2^E end for T=7 B=T-nodes+1 E=edges+1-T d = [0:E-termedges+1] [b1,b2,b3] = ndgrid(d,d,d) X = [b1(:),b2(:),b3(:)] X_good = []; for i = 1:size(X,1) if sum(X(i,:))==E-termedges+1 X_good=[X_good;X(i,:)]; end end X_good(:,B)=X_good(:,B)+termedges-1 X_good A=factorial(X_good) falses=sum(prod(A')) falsepositives(T)=falses*2^E end for T=8 B=T-nodes+1 E=edges+1-T d = [0:E-termedges+1] [b1,b2,b3,b4] = ndgrid(d,d,d,d) X = [b1(:),b2(:),b3(:),b4(:)] X_good = []; for i = 1:size(X,1) if sum(X(i,:))==E-termedges+1 X_good=[X_good;X(i,:)]; end end X_good(:,B)=X_good(:,B)+termedges-1 X_good A=factorial(X_good) falses=sum(prod(A')) falsepositives(T)=falses*2^E end