function [ Y ] = Pabs(k,d )

nabs=0;
for m=1:500
X=k;
while (X>0 & X<d)
    X=grand(1,'bin',d,X/d);
    end;
if X==d
    nabs=nabs+1;
end;
end;
Y=nabs/500;
endfunction

