# Hitting time of Brownian motion past a given point in time

The random variable whose distribution I am interested in is defined as follows:

$$\tau := \inf\{u > 1: W_u = 0\}$$ where $$W$$ is Brownian motion.

I derive the distribution below but it doesn't match the estimates I get from Monte Carlo even with a very large number of samples.

By reflection, $$\tau \stackrel{d}{=} \inf\{u > 1: 2W_1 - W_u = 0\}$$

By change of variables and dropping the distributional equality sign, $$\tau = 1 + \inf\{u > 0: W_{u+1} - W_1 = W_1\}$$

$$\left(W_{u+1} - W_1\right)_{u \geq 0}$$ is Brownian motion and it is independent of $$W_1$$.

For ease of notation, I write $$B_u := W_{u+1} - W_1$$ and $$X := W_1$$ and define

$$\sigma := \inf\{u > 0: B_u = X\}$$

where $$B$$ is Brownian motion, $$X$$ is std normal and they are independent.

$$P\{\sigma \leq t\} = P\{\sigma \leq t, X \geq 0\} + P\{\sigma \leq t, X < 0\}$$

$$P\{\sigma \leq t, X \geq 0\} = P\{M_t \geq X, X \geq 0\} = P\{\lvert B_t \rvert \geq X, X \geq 0\}$$

where $$M$$ is the running supremum of $$B$$. By symmetry,

$$P\{\sigma \leq t\} = 2P\{\lvert B_t \rvert \geq X, X \geq 0\}$$

The distribution of $$\tau$$ follows from this obviously. I estimated $$P\{\sigma \leq t\}$$ with Monte Carlo for various values of $$t$$ but it doesn't quite match the expression I derived above. Not sure where the error is.

For $$t>1$$ we have \begin{aligned}P(\tau\leq t)&=P(\inf\{u>1:W_u=0\}\leq t)\\ &=P(\inf\{u>1:W_u-W_1=-W_1\}\leq t)\\ &=E[P(\inf\{u>1:W_u-W_1=-w\}\leq t)|_{w=W_1}]\\ &=E[P(\inf\{v>0:W_{v}=-w\}\leq t-1)|_{w=W_1}]\\ &=E\bigg[\int_0^{t-1}\frac{|W_1|}{\sqrt{2\pi}s^{3/2}}\exp\bigg(-\frac{W_1^2}{2s}\bigg)ds\bigg]\\ &=\int_{\mathbb{R}}\int_0^{t-1}\frac{|x|}{(2\pi)s^{3/2}}\exp\bigg(-\frac{x^2}{2s}-\frac{x^2}{2}\bigg)dsdx\\ &=\int_0^{t-1}\frac{1}{\pi s^{1/2}(s+1)}ds\\ &=\frac{2}{\pi}\arctan(\sqrt{t-1}) \end{aligned} and the density is $$f_{\tau}(t)=\frac{1}{\pi t(t-1)^{1/2}},\,t>1$$.