After \(N\) steps of size \(\pm\Delta x\) with equal probability, the net displacement is the sum of the individual steps,
\[x_N = \sum_{i=1}^N \Delta X_i, \qquad \Delta X_i = \pm\Delta x \text{ with equal probability, independent}.\]
Squaring and taking the expectation,
\[\langle x_N^2 \rangle = \left\langle \left(\sum_{i=1}^N \Delta X_i\right)^2 \right\rangle
= \sum_{i=1}^N \langle \Delta X_i^2 \rangle + \sum_{i \neq j} \langle \Delta X_i \Delta X_j \rangle.\]
Each step satisfies \(\Delta X_i^2 = \Delta x^2\) regardless of sign, so the first sum is \(N\,\Delta x^2\). The steps are independent with \(\langle \Delta X_i \rangle = 0\), so \(\langle \Delta X_i \Delta X_j \rangle = \langle \Delta X_i \rangle \langle \Delta X_j \rangle = 0\) for every \(i \neq j\), and the second sum vanishes. This leaves
\[\langle x^2 \rangle = N\,\Delta x^2 .\]
Writing the step count as \(N = t/\Delta t\) and defining the diffusion coefficient \(D \equiv \Delta x^2 / (2\Delta t)\) so that \(\Delta x^2 = 2D\Delta t\),
\[\langle x^2 \rangle = \frac{t}{\Delta t}\cdot 2D\Delta t = 2Dt.\]