How to calculate the minimum of the difference between the upper and lower bounds of an interval? Let's say $X$ ~ N(500, $50^2$) and $P(a<X<b)=0.95$. How can I calculate minimum(b-a)?
 A: Suppose that we have an interval $(a,b)$ such that $P(a < X < b)=0.95$ and suppose we move the left endpoint rightwards by a small amount $\delta$ so that the left endpoint is at $a+\delta$. Clearly, $P(a+\delta < X < b)$ is smaller than $0.95$ and so we should move the right endpoint a tad to the right too, to $b+\varepsilon$, say, so that $P(a+\delta < X < b+\varepsilon)$ equals $0.95$. But what is $\varepsilon$ and how does it compare to $\delta$?  Well, and looking at a graph of the normal density $f(x)$ is very helpful here, the move of the left endpoint from $a$ to $a+\delta$ cut off an area $\approx f(a)\cdot \delta$ and so the move of the right endpoint must add back that much area, that is,
$$f(a)\cdot \delta = f(b)\cdot \varepsilon.$$


*

*If $f(a) < f(b)$, then $\delta > \varepsilon$ and the new interval $(a+\delta, b+\varepsilon)$ has length $$b+\varepsilon -(a+\delta) = b-a -(\delta-\varepsilon) < b-a.$$

*If $f(a) > f(b)$, then $\delta < \varepsilon$ and the new interval $(a+\delta, b+\varepsilon)$ has length $$b+\varepsilon -(a+\delta) = b-a +(\varepsilon-\delta) > b-a.$$
So, the shortest interval $(a,b)$ is the one where $a$ and $b$ are chosen such that $f(a) = f(b)$ and, once again looking at the graph of the density function, we wee that $a$ and $b$ must be equally distant from the mean.
A: For the difference to be minimum, it needs to be symmetric around the mean, as also pointed out in the comments. Then, you normalize the RV $X$: $$P(a<X<b)=P\left(\frac{a-500}{50}<Z<\frac{b-500}{50}\right)=0.95$$
The upper tail has 0.025 probability. Using a standard normal table (Z-table) we can find the upper (or lower depending on the table) end as $1.96$. The lower end will be negative of this, leading to $a,b$.
