function percentage = pollingpercentage(p,pop,n,N, error)


phat = zeros(1,N);
check = 0;

for i = 1:N
    phat(i) = polling(p,pop,n);
    if abs(phat(i)-p)<=error
        check=check+1;
    end
end



percentage = 100*check/N;