function sev = paradox(N)
%PARADOX: MATLAB function M-file that simulates 
%the St. Petersburg paradox N times and computes the 
%sample expected value
clear P;
for k=1:N
    count = 1;  %One flip minimum
    while rand <= .5    %while tails
        count = count + 1;
    end
    P(k)=2^count;   %Payout
end
sev=mean(P);