function v = invariantSIM(rigaP,N)
%
% v = invariantSIM(rigaP,N)
%
i = 1;
v(1) = 0;
for k = 1:N
    if (length(v) >= i)
       v(i) = v(i)+1;    
    else
       v(i) = 1;
    end
    i = randdisc(rigaP(i));
end
v = v/N;