%mingling trees
%(a) 
[ex varx] = geostat(1/3)
ey = ex+1  %E(Y)=1/(1/3)=3
vary = varx  %Var(Y)=((1-1/3)/((1/3)^2)=6
%P(Y>5|Y>2)=P(Y>5)/P(Y>2)=P(X>=5)/P(X>=2)
(1-geocdf(4, 1/3))/(1-geocdf(1, 1/3))   % 0.2963
% memoryles
%P(Y>5-2)=P(Y>3)=P(X>=3)
1-geocdf(2, 1/3)    %0.2963

%(b) empirical counterparts to (a)
Y=1:12;
freq   =[21  20  21   4   6   6  2   3   3   1   0   1];
n=sum(freq)      %88
ybar = sum(Y .* freq)/n  %3.3295
s2y = sum((Y -ybar).^2  .* freq)/(n-1)  %5.9936
sum(freq(Y >5))/sum(freq(Y>2))    %0.3404
sum(freq(Y>3))/n    %0.2955
