## Search in the document preview

**M.Phil Physics
Course: Computational Physics (Stochastic Methods)
**

**Home Work # 3
**
This assignment is based on Random Sampling of pdfs
*Due date: One Week after this distribution in class.
***
Question 1
**

(a) Suppose that a given pdf for y is shown below:
10)2exp(4)( 2 <<−= *yyyyf
*
Then first normalize this pdf and then using Direct sampling method find out
a proper formula to sample this distribution.

(b) Use MATLAB program and sample the pdf for N = 10000. Draw both the

exact and sampled distribution functions as histograms. (c) What happens when N is increased to 100000? Show results as graphs

and give some sort of comparison.

**Question 2 **

(a) For above pdf use rejection method and sample randomly for N = 10000. Draw both the exact and sampled distribution function.

(a) Find out the efficiency of this technique. What happens when N is

increased to 100000? Show results as graphs and give some sort of comparison.

**Question 3
**

(b) For above pdf use Metropolis Algorithm and sample randomly for N = 10000. Draw both the exact and sampled distribution function.

(c) Find out the efficiency of this technique. What happens when N is

increased to 100000? Show results as graphs and give some sort of comparison.

*Home Work # 3
*

1

Docsity.com