randnum := rand(1..100000); r := proc() x := randnum(); evalf(x/50000 + 1); end; generate:= proc(n) x:= array(1..2*n); icount:=0; inside := 0; for i from 1 by 1 to n do icount:=icount+1; y := r(); x[icount] := y; temp:=(x[icount]-2)^2; icount:=icount+1; y := r(); x[icount] := y; temp:= temp +4*(x[icount]-2)^2; if (temp <=1) then inside:=inside+1; fi; od; print(evalf(4*inside/n)); end;