Use the rejection method to find an efficient way to generate a random variable having density function f(x)={ 2
1

(1+x)e −x
,
0,

0 elsewhere ​
Please use the rejection method (Simulation)