N=4;
for(ii=1:N+1)
    for(jj=1:N+1)
        i=ii-1;
        j=jj-1;
        if((j<=2*i)&(N-j<=2*N-2*i))
        P(ii,jj)=nchoosek(2*i,j)*nchoosek(2*N-2*i,N-j)/nchoosek(2*N,N);
        else
            P(ii,jj)=0;
        end
    end
end
P
p=[0 0 1 0 0];
   p=p*P^50 