Train station optimization 
I found the following discussion in the comments section of the blog below started by the commenter "gowers"
Blog: https://terrytao.wordpress.com/2008/12/09/an-airport-inspired-puzzle/
The problem can be stated as:
Suppose the next train to your destination leaves at 12 pm, however, when leaving your house you are completely unaware of when the next train leaves. All you know, as of 11am, is that a train will leave the station sometime in the next hour. What is the average time saved by mixing in intervals of running and walking while going to the station as opposed to just walking the entire way?

My solution would be:
Suppose the train leaves at 12pm. Suppose your trip to the station takes $x$ minutes if you walk and $x - y$ minutes if you mix walking and running. Then take $n$ = $60$ to be the number of minutes in an hour and $D$ the length of intervals between 12pm train and the next train after it. Supposing we run an experiment and leave from each minute around the clock between 11pm and 12pm we would have the average time saved as:
$$\frac{D(y)}{60}$$
The $D(y)$ comes from: There are $60$ possible minutes we can leave from. We compute for each minute in the hour, how much of a gain walking/running as opposed to only walking to gives us in our total time to destination. The only possible minutes where walking can fail to reach the 12pm train are if we leave after 12pm - $x$ minutes. Since running decreases the time to the station by $y$ minutes, we have $y$ cases (each case being a minute on the clock) where running is superior to walking. In each of these cases, we gain $D$ amount of time compared to if we had chosen to walk. Hence we gain $D(y)$ in terms of total gained time over walking. Dividing this over the total number of minutes sampled we have $\frac{D(y)}{60}$. Note that D(y) is D $\cdot$ y, not a function.
If we suppose the person could leave their house not at every minute but every second or some smaller unit of time then this would not change the above as both the numerator and denominator would change by the same factor when considering units saved and total units in an hour.
Edit: It appears Gowers is referring to expected value, not average as I compute it.
However, "Gowers" answers:
"since the average time you save is equal to the time you save on that leg of it by running rather than walking."
Thanks!
 A: Here I think is a translation into mathematical terms of what T. Gowers posted. I think the difference from your approach is to recognize the problem as a probabilistic one: since you don't know the time the train leaves, from your point of view it's random (his 'average' is a probabilistic expectation).
Let $M$ be a uniformly random integer between 0 and 60, and say that there's a train out there which leaves $M$ minutes past every hour. You don't know $M$, and you're leaving to head to the train. Let's say that it takes $0<x<60$ minutes to walk to the station and that you save $0<y<x$ minutes by running. Let's fix a duration for the train trip, call it $D$ (this can be any amount of time, but let's express it in minutes). Finally, let's say that you leave your house at 11:00.
Now, let's compute some probabilities. The probability that you miss the 11:$M$ train without running is the same as the probability that $M\leq x$, and since $M$ was uniformly distributed
\begin{align*}
P(\text{miss train without running})&=\frac{x}{60}\\\\
P(\text{make train without running})&=1-\frac{x}{60}.
\end{align*}
Similarly,
\begin{align*}
P(\text{miss train with running})&=\frac{x-y}{60}\\\\
P(\text{make train with running})&=1-\frac{x-y}{60}.
\end{align*}
Now that we have probabilities, we can compute expectations. We leave the house at 11:00, and either make the 11:$M$ train or miss it and take the 12:$M$ train, and then get there $D$ minutes after we get on the train. If we make the 11:$M$ train, then our total trip duration is $D+M$ minutes. If we make the 12:$M$ train, our trip duration is $D+M+60$ minutes (we lost an hour from missing the train and catching the next one).
So, if we don't run, our expected trip duration is:
\begin{align*}
\mathbb{E}[\text{trip duration without running}]&=\frac{x}{60}\cdot(D+M+60) + \left(1-\frac{x}{60}\right)\cdot(D+M)\\\\
&=D+M + x.
\end{align*}
If we do run,
\begin{align*}
\mathbb{E}[\text{trip duration with running}]&=\frac{x-y}{60}\cdot(D+M+60) + \left(1-\frac{x-y}{60}\right)\cdot(D+M)\\\\
&=D+M+x-y.
\end{align*}
We can see that running saves $y$ minutes on average. (Hopefully this gives some insight into why trip duration does not matter. It's easy to extend this into train intervals other than 1 hour as long as $0<y<x<$ interval. If $x$ is larger than the interval, the answer can change, but let's not worry about that here.)
