I am trying to rigorously derive the diffusion equation, given by $$ \frac{\partial u}{\partial t} = D\,\frac{\partial^2 u}{\partial x^2}, \qquad D = \frac{h^2}{2\tau}. $$ from a simple one-dimensional random walk model, and I would like to confirm whether my probabilistic reasoning is correct.
Consider a lattice with sites indexed by position $x$, separated by a distance $h$. Each site can contain an integer number of particles. Time is discrete, with time steps of size $\tau$. During each time step, every particle moves independently either one site to the left or one site to the right with equal probability $p = \tfrac12$. No particle remains in place, and particles do not interact.
Let $N(x,t)$ denote the (random) number of particles at site $x$ and time $t$, and let $u(x,t) = \mathbb{E}[N(x,t)]$ denote its expected value. The goal is to express $u(x,t+\tau)$ in terms of $u(x,t)$ and its neighbouring sites, from first noticing that $$ u(x,t+\tau) = \frac{1}{2}\big[u(x+h,t) + u(x-h,t)\big]\tag{1} $$ and to verify that in the continuum limit this process leads to the diffusion equation.
Below is my derivation. I would appreciate feedback on whether the formulation of the random variables and the use of the law of total expectation are correct, particularly in the step where $N(x\pm h,t)$ are themselves random variables.
Derivation:
Suppose that at time $t=0$, the sites at $x-h$ and $x+h$ contain $N(x-h,0)$ and $N(x+h,0)$ particles, respectively. During one time step of length $\tau$, each particle independently moves towards $x$ with probability $p=\tfrac12$. For simplicity, we assume a deterministic distribution of particles at $t=0$, for all $x$.
Let $N_l(x,t+\tau)$ and $N_r(x,t+\tau)$ denote the random numbers of particles that arrive at $x$ from the left and from the right, respectively, within the interval $[t,t+\tau]$. After one time step $\tau$, we have $$ N_l(x,\tau) \sim \mathrm{Bin}\big(N(x-h,0),\,\tfrac12\big), \qquad N_r(x,\tau) \sim \mathrm{Bin}\big(N(x+h,0),\,\tfrac12). $$ Therefore, the total number of particles at position $x$ after one time step is \begin{equation} N(x,\tau) = N_l(x,\tau) + N_r(x,\tau). \end{equation} Recall that, for a random variable $X\sim \mathrm{Bin}(n,p)$, we have $\mathbb{E}[X]=np$. Then, taking expectations and using the linearity of expectation, \begin{align} u(x,\tau) = \mathbb{E}[N(x,\tau)] = \mathbb{E}[N_l(x,\tau)] + \mathbb{E}[N_r(x,\tau)]= \tfrac12 N(x+h,0) + \tfrac12 N(x-h,0). \end{align} Thus, after a single time step $\tau$, the expected number of particles at $x$ is the sum of the incoming contributions from the neighbouring sites, each weighted by the probability $\tfrac12$ of moving towards $x$.
Following the same logic, the total number of particles at position $x$ at $t+\tau$ is then \begin{equation}\label{eqexp2step} N(x,t+\tau) = N_l(x,t+\tau) + N_r(x,t+\tau). \end{equation} However, now $N_l(x,t+\tau)$ and $N_r(x,t+\tau)$ depend on how many particles arrived at either lateral position in the previous step, $N(x\pm h,t)$, which are themselves random variables. So, in fact, what we know is that \begin{align} N_l(x,t+\tau)\mid N(x-h,t)&\sim \mathrm{Bin}\big(N(x-h,t),\,\tfrac12\big),\\ N_r(x,t+\tau)\mid N(x+h,t)&\sim \mathrm{Bin}\big(N(x+h,t),\,\tfrac12\big). \end{align} To compute the expectation of $N(x,t+\tau)$, we use the law of total expectation, which states that for random variables $X$ and $Y$, \begin{equation} \mathbb{E}[X] = \mathbb{E}\big[\mathbb{E}[X \mid Y]\big]. \end{equation} Then, \begin{align} u(x,t+\tau)&=\mathbb{E}[N(x,t+\tau)]\\ &=\mathbb{E}[N_l(x,t+\tau)] + \mathbb{E}[N_r(x,t+\tau)]\\ &= \mathbb{E}\big[\mathbb{E}[N_l(x,t+\tau) \mid N(x-h,t)]\big]+\mathbb{E}\big[\mathbb{E}[N_r(x,t+\tau) \mid N(x+h,t)]\big]\\ &=\tfrac12\mathbb{E}[N(x-h,t)]+ \tfrac12\mathbb{E}[N(x+h,t)]\\ &=\tfrac12 [u(x-h,t)+u(x+h,t)] \end{align} which is the discrete evolution equation used in the derivation of the diffusion equation.
Expanding $u(x \pm h, t)$ in a Taylor series about $x$, \begin{align} u(x+h,t) &= u(x,t) + h\,u_x(x,t) + \tfrac{1}{2}h^2\,u_{xx}(x,t) + O(h^3),\\ u(x-h,t) &= u(x,t) - h\,u_x(x,t) + \tfrac{1}{2}h^2\,u_{xx}(x,t) + O(h^3), \end{align} and substituting into the discrete update gives \begin{equation} u(x,t+\tau) - u(x,t) = \frac{1}{2}h^2\,u_{xx}(x,t) + O(h^4), \end{equation} since the odd powers cancel.
Dividing by $\tau$ and taking the limit as $h, \tau \to 0$ while setting \begin{equation} D = \frac{h^2}{2\tau} \end{equation} constant, we obtain \begin{equation} \frac{\partial u}{\partial t} = D\,\frac{\partial^2 u}{\partial x^2}, \end{equation} the one-dimensional diffusion equation with diffusion coefficient $D$.
Is this correct? I'm particularly unsure about my derivation of equation (1).
