function [ area_est, area_conf_int ] = MC_area( alpha,c,n,x1pts,x2pts )

% see nutshell "Monte Carlo Integration" Section 3
% note please refer to V1.2 of this nutshell (and V1.2 of the nutshell
% "Random Variables") as in V1.1 there is a typo in the confidence interval

% **note you should not call rand in your function**
% the random sample realization of darts is given by the function
% inputs x1pts, x2pts


inside=( (?) ? (?) ) ; % create logical array which indicates whether
% ith dart is outside (assign a 0) or inside (assign a 1) domain D

theta_hat = ?(inside) ? % calculate number of darts inside D

area_est = theta_hat*? % scale to obtain area

z2on = (1.96*1.96)/n; % z_gamma^2/n (for gamma = 0.95)
% appears in several places in confidence interval, with appropriate
% multiplicative factors

area_conf_int=[?, ?]; % for debugging purposes, you should break the expression into several substeps
% (i.e., intermediate results); for example, first calculate the sqrt(   ), then...

if(n*theta_hat< 10||n*(1-theta_hat)<10) % normal-approximation criterion
 
   area_conf_int=?; 
end

    
    
    
end

