pmi=0.5;


pmit=[0.8,0.4,0.8,0.8,0.8;0.8,0.8,0.4,0.4,0.8;0.4,0.4,0.4,0.4,0.4;0.4,0.8,0.4,0.8,0.4]
pmiz=[]

for j=1:size(pmit,1)
    j
    pmizl=pmit(j,1);
    for i = 2:size(pmit,2)
        i
        pmizc= 1/(1+((1-pmit(j,i))/(pmit(j,i))*(1-pmizl)/(pmizl)* pmi/(1-pmi)));
        pmizl= pmizc
    end
    pmiz(j)=pmizl;
end
pmiz