function [f]=acceptance(trials);

%Acceptance.m: The input argument to this function is a function 
%This function uses acceptance-rejection to generate the distribution
%P(x)=.75*(1-x^2) where -1<=x<=1

%Largest value the probability will reach

for i=1: trials
    
xtry=2*rand(1)-1;

j=1;
while j~=0
    
if (1-xtry^2) > =rand(1),
    f=xtry;
else dd;
    
end