Consider a train station to which customers arrive in accordance with a Poisson process having rate λ.
A train is summoned whenever there are N customers waiting in the station, but it takes K units of time for the train to arrive at th station. When it arrives, it picks up all waiting customers.
Assuming that the train station incurs a cost at a rate of nc per unit time whenever there are n customers present, find the long-run average cost.
Defining when each train leaves the station as a cycle:
$\frac{E[incurred\enspace cost\enspace during\enspace cycle]}{E[duration\enspace of\enspace cycle]}$
Im having trouble solving the $E[incurred\enspace cost\enspace during\enspace cycle]$ part, so lets start with $E[duration\enspace of\enspace cycle]$.
The durating of cycle is the amount of time it takes for N customers to arrive and the K time units it takes for the train to arrive to the station. Since customers arrive according to a Poisson process the total amount of time it takes for N customers to arrive is Nλ.
Therefore $E[duration\enspace of\enspace cycle]$ = Nλ + K
As for the $E[incurred\enspace cost\enspace during\enspace cycle]$ part:
If $C_1$ is defined as: cost incurred up to when the N:th person arrives to the station:
$E[C_1]=\sum_{n=0}^{N-1}λcn=\frac{N(N-1)cλ}{2}$
Now since it takes K time units for the train to arrive, more people will arrive to the station.
$C_2$ defined as cost incurred after arrival of N:th customer (including customers arriving after N:th customer).
$E[C_2]=KNc+cE[\int_{0}^{K} N(t) dt] = KNc+\frac{cλK^2}{2}$
$E[cost \enspace incured \enspace during \enspace cycle] =\frac{N(N-1)c}{2} + KNc+\frac{cλK^2}{2} $
Giving the answer $\frac{\frac{N(N-1)cλ}{2} + KNc+\frac{cλK^2}{2}}{Nλ + K}$
Is my train (hehe) of thought correct? Is the answer correct?