How can estimate $\pi$ with differential equation?

562 Views Asked by At

I know some method for estimation of $\pi$ .We can use Monte Carlo method to estimate $\pi $.We can use series to estimate $\pi $.

And my question is : Is there exist a (1 st order) differential equation or stochastic differential equation that can estimate $\pi $ ? or $\pi $ is a part of the solution, When we are implementing numerical iteration the solution close to $\pi $ ?

I tried some Matlab codes for Monte Carlo method like this below:

clear;  
N=100000; % the experiment event number  
r=1; %the circle radius  
n=0; % sucessful event number   
for i=1:N  
  x=-r+2*r*rand();  
  y=-r+2*r*rand();  
  if ((x^2+y^2)<=r^2)  
    n = n+1;
  end
end
pi_sim=4*n/N 

How can I make a relation between $\pi$ and diff. equations ? Thanks in advanced for any hint.

$$\textit{Specially, I am looking for Stochastic diff. Eq.}$$ Remark:

For example:If we solve this SDE $dx_t=(\mu-x_t)dt+\alpha dw_t$ we will see $\mathbb{E}[x_t] \to \mu $ so $$dx_t=(\pi-x_t)dt+\alpha dw_t \to (\mathbb{E}[x_t] \to \pi) $$ but this Non-interesting example (I made it by self)

3

There are 3 best solutions below

4
On BEST ANSWER

As you know, any probability distribution sums up to zero. So, you can invoke gaussian distribution, where,

$\int_{x=-\infty}^{x=\infty} \frac{1}{\sqrt{2\pi}}e^{\frac{-x^2}{2}} dx = 1$

To obtain $\pi$. You need to use estimated e though, if you want to calculate it numerically.

2
On

For a first-order solution, you could use:

Proposition 0. If $$f'(x) = \sqrt{1-x^2}, \qquad f(-1)=0$$

then $2f(1) = \pi$.

However, I think a second-order solution is a bit more conceptually satisfying. You could use:

Proposition 1. $$\pi = \min_{\theta > 0} \,\left(\sin\theta \leq 0\right).$$

So just write a program that numerically approximates $\sin$ via the second order DE $$f'' = -f, f(0) = 0, f'(0)=1.$$ The moment $f(x)$ drops below $0$, return $x$ and it will be near to $\pi.$

6
On

Inspired by goblin's answer, but first order. Note that $\sin'(x)=\cos(x)$ and that $$\cos(x)=\sqrt{1-\sin^2(x)}.$$ Hence we can use the first order differential equation $$f'(x)=\sqrt{1-f^2(x)},\qquad f(0)=0$$ which has the solution $f(x)=\sin(x)$. As soon as this function reaches $1$ (or tends to exceed $1$), you abort the computation and your estimation is $x\approx \pi/2$ as this is where sine has its first maximum.