<<GraphicsSetUp.m

Figure 1

lines = 
Table[Line[{{0,0},{Random[],Random[]}}],{100}];
Show[Graphics[lines],Axes->True,AspectRatio->1];

Figure 2

Input["Give number of trials n"];s=0;y={};
Do[z=Sqrt[Random[]^2+Random[]^2];s=s+z;
AppendTo[y,z],{n}];Print["n=",n];Print["Mean =",s/n];
ListPlot[y,PlotJoined->True];

Figure 3

Input["Give number of trials"];s=0;y={};i=0;
Do[z=Sqrt[Random[]^2+Random[]^2];s=s+z;i++;
AppendTo[y,s/i],{n}];
Print["n=",n];Print["Mean=",s/n];
ListPlot[y,PlotJoined->True,PlotRange->All];

Figure 5

F[x_] := Pi x^2/4 /; (x >=0 && x <= 1);
F[x_] := Sqrt[x^2 - 1] + Pi x^2/4 - x^2 ArcCos[1/x] /;
	(x > 1 && x <= N[Sqrt[2]])

Plot[F[x],{x,0,Sqrt[2]}];

f1[x_] := Pi x^2/4
f2[x_] := Sqrt[x^2 - 1] + Pi x^2/4 - x^2 ArcCos[1/x]

Integrate[1 - f1[x],{x,0,1}] + 
	Integrate[1 - f2[x],{x,1,Sqrt[2]}]

% /. ArcCos[1/Sqrt[2]] -> Pi/4

N[%,20]