distribution of maximum random walk distance Related to this question.
Suppose I flip a fair coin $N$ times and keep track of the difference between the total number of heads and tails as I am doing it. At the end of the $N$ coin flips, I have the random variable defined as the maximum absolute value of the difference between the number of heads and tails during the entire experiment.
This sounds similar to the law of interated logarithm, but not exactly. It doesn't really help with this problem, it's just a related topic.
I conjecture based on many simulations in scenarios including $N$ up to $10$ million that this random variable has mean approximately $1.25 \sqrt{N}$ and variance approximately equal to $0.26 N$.  The linked post above gives some bounds on the mean, but they are pretty wide. Are there any other things known about the distribution of this random variable?
 A: The difference can be viewed as the sum of $2 B_i-1$ where $B_i$ are iid Bernoulli random variables.  After $n$ flips, the difference is approximately $N(0,n)$.
See here for the distribution of the running maximum of a Weiner process and here for the distribution of the running maximum of the absolute value of a Wiener process.
For example, with $N=1000$ the mean and variance are approximately 39.63 and 260.75 using the provided formula from the link for the distribution according to numerical calculations in Mathematica.
Num = 1000.;

NIntegrate[
 1 - (4/Pi) NSum[
    Exp[-(2 n + 1)^2 Pi^2 Num/(8 r^2)] ((-1)^n )/(2 n + 1), {n, 0, 
     Infinity}], {r, 0, 120}]

NIntegrate[
 1 - (4/Pi) NSum[
    Exp[-(2 n + 1)^2 Pi^2 Num/(8 r)] ((-1)^n )/(2 n + 1), {n, 0, 
     Infinity}], {r, 0, 120^2}]

1831.371532331003` - (39.631070838003225`)^2

Now, notice that $P[\frac{max}{\sqrt{N}}<t]=P[max<t \sqrt{N}]$ and therefore the mean and variance of $\frac{max}{\sqrt{N}}$ is the same as the mean and variance of the running maximum of the absolute value of the Wiener process when $t=1$. That is, mean of approximately 1.253 and variance of 0.26. I don't know if there is any way to evaluate those analytically, I evaluated them numerically in Mathematica.
Update: I found a formula for the asymptotic value of the mean by interchanging the integration with the sum above (using Cesaro summation). $\sqrt{\frac{\pi}{2}}\sqrt{N}\approx 1.25331\sqrt{N}$. That doesn't work for the variance though because the integral doesn't converge.
