function out = prob_expt(n)
% tests n times if a random triangle is acute angled
count = 0;
for j = 1:n
 a = rand(); b = rand(); c = rand();
 %fprintf('%d', a); fprintf('  '); fprintf('%d', b); fprintf('  '); fprintf('%d', c);
 if acute_angle_test(a, b, c) 
     count = count + 1;
 end;
end;
out = count/n;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function out = acute_angle_test(a, b, c)
% tests if a triangle with sides a, b and c forms an acute angle triangle

d = sort([a, b, c])
a = d(1); b = d(2); c = d(3);
if c*c < a*a + b * b 
    out = true;
else
    out = false;
end;

% analytical estimate:
% let q1, q2, q3 qnd q4 be four successive quadrants
% assume WLOG that a is in q1 at one end of the quadrant just touching q2.
% prob(b in q1) = 1/4
% prob(acute | b in q1) = 3/4
% prob(acute | b in q2) = 