Integration using Monte-Carlo method

Pzi
Messages
26
Reaction score
0

Homework Statement


Integrate using Monte-Carlo method and evaluate absolute error.
\int\limits_1^{ + \infty } {\frac{{\sqrt {\ln (x)} }}{{{x^5}}}dx}

Homework Equations


Everything about Monte-Carlo integration I guess.

The Attempt at a Solution


I = \int\limits_1^{ + \infty } {\frac{{\sqrt {\ln (x)} }}{{{x^5}}}dx} = \int\limits_{\pi /4}^{\pi /2} {\frac{{\sqrt {\ln (\tan (t))} }}{{{{(\tan (t))}^5} \cdot {{(\cos (t))}^2}}}dt}

I define random variable Y so that its mean would be equal to my integral I.
{y_k} = \left( {\frac{\pi }{2} - \frac{\pi }{4}} \right) \cdot \frac{{\sqrt {\ln (\tan ({t_k}))} }}{{{{(\tan ({t_k}))}^5} \cdot {{(\cos ({t_k}))}^2}}} = \frac{{\pi \sqrt {\ln (\tan ({t_k}))} }}{{4{{(\tan ({t_k}))}^5} \cdot {{(\cos ({t_k}))}^2}}}
{t_k} = \left( {\frac{\pi }{2} - \frac{\pi }{4}} \right) \cdot {r_k} + \frac{\pi }{4} = \frac{\pi }{4}\left( {{r_k} + 1} \right)
r_k - equally likely random numbers between 0 and 1.

I then proceed using 55 random numbers to calculate my approximation.
{\hat I_n} = \frac{1}{n}\sum\limits_{k = 1}^n {{y_k}}
I \approx {\hat I_{55}} = \frac{1}{{55}}\sum\limits_{k = 1}^{55} {{y_k}} = 0.{\rm{113481}}

What about absolute error? It is meant to be like "it is very likely (probability over 0.9 or whatever) that our approximation missed the actual value by no more than *ERROR NUMBER*".
 
Physics news on Phys.org
<br /> t = \sqrt{\ln x} \Rightarrow x = e^{t^2}, dx = 2 \, t \, e^{t^2} \, dt<br />
<br /> \frac{\sqrt{\ln x}}{x^5} \, dx = t \, e^{-5 t^2} \, 2 \, t \, e^{t^2} \, dt = 2 \, t^2 \, e^{-4 t^2} \, dt<br />
<br /> x = 1 \Rightarrow t = 0, \ x \rightarrow \infty \Rightarrow t \rightarrow \infty<br />
So, your integral is equivalent to:
<br /> I = 2 \, \int_{0}^{\infty}{t^2 \, e^{-2 t^2} \, dt} = -2 \, \frac{d}{d a} \left(\int_{0}^{\infty}{e^{-a t^2} \, dt} \right) \vert_{a = 4} = - 2 \, \frac{d}{d a} \left( \frac{1}{2} \, \pi^{\frac{1}{2}} \, a^{-\frac{1}{2}} \right) \vert_{a = 4} = \frac{1}{2} \, \pi^{\frac{1}{2}} \, 4^{-\frac{3}{2}} = \frac{\sqrt{\pi}}{16} \approx 0.110778\ldots<br />

EDIT:
See exact result:
http://www.wolframalpha.com/input/?i=Integrate[Sqrt[Log[x]]%2Fx^5%2C{x%2C1%2CInfinity}]
 
Last edited:
Dickfore said:
<br /> t = \sqrt{\ln x} \Rightarrow x = e^{t^2}, dx = 2 \, t \, e^{t^2} \, dt<br />
<br /> \frac{\sqrt{\ln x}}{x^5} \, dx = t \, e^{-5 t^2} \, 2 \, t \, e^{t^2} \, dt = 2 \, t^2 \, e^{-4 t^2} \, dt<br />
<br /> x = 1 \Rightarrow t = 0, \ x \rightarrow \infty \Rightarrow t \rightarrow \infty<br />
So, your integral is equivalent to:
<br /> I = 2 \, \int_{0}^{\infty}{t^2 \, e^{-2 t^2} \, dt} = -2 \, \frac{d}{d a} \left(\int_{0}^{\infty}{e^{-a t^2} \, dt} \right) \vert_{a = 4} = - 2 \, \frac{d}{d a} \left( \frac{1}{2} \, \pi^{\frac{1}{2}} \, a^{-\frac{1}{2}} \right) \vert_{a = 4} = \frac{1}{2} \, \pi^{\frac{1}{2}} \, 4^{-\frac{3}{2}} = \frac{\sqrt{\pi}}{16} \approx 0.110778\ldots<br />

EDIT:
See exact result:
http://www.wolframalpha.com/input/?i=Integrate[Sqrt[Log[x]]%2Fx^5%2C{x%2C1%2CInfinity}]

It is necessary for me to use Monte-Carlo method for this one.
However I appreciate your observation about the precise value!
 
Because your integrand is given by the estimation of the mean:
<br /> I = \mu_{Y}<br />
of a random variable:
<br /> Y(X) = \frac{\sqrt \ln \tan X}{\tan^{5} X \, \cos^{2} X}<br />
when X \in \mathcal{U}(\pi/4, \pi/2) is uniformly distributed, by taking the arithmetic average:
<br /> \mu_{Y} \approx \frac{1}{n} \, \sum_{k = 1}^{n}{f(X_k)}<br />
you may esitmate your error by the error propagation formula:
<br /> \sigma^{2}_{\mu_Y} = \sum_{k = 1}^{n}{\left( \frac{\partial \mu_Y}{\partial X_k} \right)^{2} \, \sigma^{2}_{X_k}}<br />
where the derivative is:
<br /> {\partial \mu_Y}{\partial X_k} = \frac{1}{n} \, f&#039;(X_k)<br />

1. Find the derivative dY/dX, and estimate it at E(X) = \frac{\frac{\pi}{4} + \frac{\pi}{2}}{2} = \frac{3 \pi}{8}. Let us call it A;

2. What is the variance of X \sigma^{2}_{X}, when X \in \mathcal{U}(\pi/4, \pi/2) is uniformly distributed with the given limits. Let us call this number \sigma^2.

3. Then, using the above values, your error propagation formula becomes:
<br /> \sigma^{2}_{\mu_Y} = \sum_{k = 1}^{n}{\left( \frac{A}{n} \right)^{2} \, \sigma^{2}} = \frac{A^2 \, \sigma^2}{n}<br />

The error in the mean is then \sigma_{\mu_Y}. This is a very general formula that holds for any Monte-Carlo evaluation. Notice that it is inversely proportional to the square root of the number of sample points. It is proportional to both the absolute value of the derivative A = \vert Y&#039;(X = E X) \vert, and the standard deviation of the independent variable \sigma_{X}.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top