# Monte Carlo methods

#### 8614smith

here is the background information before the question:

For a function of x, y(x), the two probability distributions must satisfy $$\left|p_{y}(y)dy\right|=\left|p_{x}(x)dx\right|$$ and therefore

$$p_{y}(y)=p_{x}(x)\left|\frac{dx}{dy}\right|$$ where $$\int^{y_{max}}_{y_{min}}p_{y}(y)dy=\int^{x_{max}}_{x_{min}}p_{x}(x)dx=1$$

Now, if we want to generate a particular probability distribution, $$p_{y}(y)=f(y)$$, and for simplicity let us assume that y(x) is a monotonically increasing function of x, then since x is a uniform deviate this implies

1$$x=\int^{y(x)}_{y(0)}f(y)dy=F[y(x)]$$ $$\frac{dF}{dy}=f(y)$$ $$F[y(0)]=0$$ $$F[y(1)]=1$$

so that,

$$y(x)=F^{-1}(x)$$ $$y(x_{max})=y(1)=F^{-1}(1)=y_{max}$$ $$F[y(x_{max})]=F(y_{max})=x_{max}=1$$

Given a uniform deviate x (as described above) find y(x) such that the distribution function for y, $$p_{y}(y)$$, will be equal to f(y), and find the value of either $$y_{max}$$ or the normalization constant A for which $$p_{y}(y)$$ will be properly normalized in the range $$y_{min}<y<y_{max}$$.

(a) $$f(y)=Ay+1$$ $$y_{min}=0$$ $$y_{max}=2$$; find A and y(x)

(b)$$f(y)=2y+4y^{3}$$ $$y_{min}=0$$; find $$y_{max}$$ and y(x)

Attempt at the answer;

(a)
using 1 i have $$x=\frac{Ay(x)^{2}}{2}+y(x)$$

substituting for $$x_{max}$$, which i guessed must be 1? as its the max probability which is unity.

$$1=\frac{Ay(x)^{2}}{2}+y(x)$$

putting in the limits of $$y_{min}=0$$ and $$y_{max}=2$$ into the integral gives;

$$-1=2A\Rightarrow{A=-0.5}$$

is that correct? and how do i find y(x)??

(b)
using 1 and substituting the lower limit of $$y_{min}=0$$ i have $$x=y^{2}+y^{4}$$

how do i go to find $$y_{max}$$ from here? i can put x = 1, but then i get stuck again as i can't get y(x) on its own to get a value for it.
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

Related Calculus and Beyond Homework News on Phys.org

### Want to reply to this thread?

"Monte Carlo methods"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving