function a = Aijn(x,y,i,j,n) % counting the number of semi-automata % on n states % s.t. delta(1,x) = i % and delta(1,y) = j % this is a LOWER BOUND on the real thing if n==1 % there is only 1 semi-automaton w/1 state! a = 1; return end if (isempty(x)& ~isempty(y)) % must have i=1 % how many n-state semi-automata % have delta(1,y) = j ? if i>1 a = 0; return end for k=1:n-1 ak = Aijn('',y(1:end-1),1,k,n-1); end end return