I am applying the Feynman-Kac theory for solving a PDE with boundary conditions. 


For the SDE simulation I use the Euler-approximation, which introduces a time-step $h$ for the Brownian Motion, and since the PDE has some boundary conditions, we need to compute its hitting time $\tau$.


Numerically speaking, I start with $\tau = 0$ and increase it progressively.


So at each step:


* the process position is increased by a normal depending (also) on $h$ (the SDE);
* the variable $\tau$ is increased by some $k$;
* the hitting condition is checked.


My question is: is there a specific connection between $h$ and $k$? Below my reasoning.


***EDIT***: I am adding more details with the hope of expressing better my question.


Consider the 1-dimensional heat on $[0,1]$, $u\_t = u\_{xx}$ with zero boundary conditions. So $u\_0$ a known initial state, and $v(t,0)=v(t,1)=0$ for each time. Suppose we want to compute the solution at time $T=0.05$.


The stopping time to insert into Feynman-Kac expectation is:


$ \tau = \inf \{ k \geq 0 : T-k \leq 0,$ or $X\_s\geq 1$, or $X\_s \leq 0 \} $


where with $X\_t$ solves $dX\_t = \sqrt{2} {dB}\_t$.


I approximate the SDE say with a time-step $h=0.01$, so if we start from $x \in [0,1]$ (point on which we are going to compute the PDE solution) and set $k=0$ (hitting time approximation), at every step we:


1. move by adding a normal $N(0, 2h)$
2. increase $k$ by $\sqrt{h}$


Again: when (1) goes to 0 or 1, or $T - k$ goes to 0, the hit is considered done. 


Now, (1) works great: the process take its time for hitting the boundary. Conversely, since $\sqrt(0.01)=0.1$, $T - \sqrt{h} = 0.05-0.1 = -0.05$ so the boundary is immediately hit!


As a result, in the simulation the boundary is hit always after one step and I obtain just a small shift of my initial condition $u\_0$.


If, conversely, in (2) I subtract something like $h^{1.8}$, rather than $\sqrt{h}$, the results are pretty nice...



Time discretization in the Feynman-Kac formula with boundary conditions
[Computing Exit Times with the Euler Scheme](https://www.sam.math.ethz.ch/sam_reports/reports_final/reports2003/2003-02.pdf) by F. Buchmann addresses this problem in detail. 


For a random walk with position $x\_{k+1}=x\_k+\delta x\_k$, incremented by a normally distributed stochastic variable $\delta x\_k$ with variance $h$, the simplest hitting time estimate is $\tau=Kh$ with $K$ the smallest $k$ such that $x\_k$ is outside of the boundary. This is an overestimate, because it is possible that both $x\_k$ and $x\_{k+1}$ are inside of the boundary, and yet the Brownian motion crossed the boundary between times $kh$ and $(k+1)h$. Buchmann constructs interpolants that test for this intermediate excursion.


