Encontré una pregunta de entrevista:
Hay un tren rojo que viene cada 10 minutos. Hay un tren azul que viene cada 15 minutos. Ambos comienzan desde un momento aleatorio, por lo que no tiene ningún horario. Si llega a la estación a una hora aleatoria y toma un tren que viene primero, ¿cuál es el tiempo de espera esperado?
probability
random-variable
expected-value
Shengjie Zhang
fuente
fuente
Respuestas:
Una forma de abordar el problema es comenzar con la función de supervivencia. Para tener que esperar al menost minutos, debe esperar al menos t minutos tanto para el tren rojo como para el azul. Por lo tanto, la función de supervivencia general es solo el producto de las funciones de supervivencia individuales:
que, para0 ≤ t ≤ 10 , es la probabilidad de que tenga que esperar al menos t minutos para el próximo tren. Esto tiene en cuenta la aclaración de la OP en un comentario de que los supuestos correctos a tomar son que cada tren tiene un horario fijo, independiente del otro y de la hora de llegada del viajero, y que las fases de los dos trenes están distribuidas uniformemente ,
Entonces el pdf se obtiene como
Y el valor esperado se obtiene de la manera habitual:
,E[t]=∫100tp(t)dt=∫100t10(1−t15)+t15(1−t10)dt=∫100(t6−t275)dt
que funciona a minutos359
fuente
La respuesta es
Here's the MATLAB code to simulate:
fuente
Assuming each train is on a fixed timetable independent of the other and of the traveller's arrival time, the probability neither train arrives in the firstx minutes is 10−x10×15−x15 for 0≤x≤10 , which when integrated gives 359≈3.889 minutes
Alternatively, assuming each train is part of a Poisson process, the joint rate is115+110=16 trains a minute, making the expected waiting time 6 minutes
fuente
I am probably wrong but assuming that each train's starting-time follows a uniform distribution, I would say that when arriving at the station at a random time the expected waiting time for:
As pointed out in comments, I understood "Both of them start from a random time" as "the two trains start at the same random time". Which is a very limiting assumption.
fuente
Suppose that red and blue trains arrive on time according to schedule, with the red schedule beginningΔ minutes after the blue schedule, for some 0≤Δ<10 . For definiteness suppose the first blue train arrives at time t=0 .
Assume for now thatΔ lies between 0 and 5 minutes. Between t=0 and t=30 minutes we'll see the following trains and interarrival times: blue train, Δ , red train, 10 , red train, 5−Δ , blue train, Δ+5 , red train, 10−Δ , blue train. Then the schedule repeats, starting with that last blue train.
IfWΔ(t) denotes the waiting time for a passenger arriving at the station at time t , then the plot of WΔ(t) versus t is piecewise linear, with each line segment decaying to zero with slope −1 . So the average wait time is the area from 0 to 30 of an array of triangles, divided by 30 . This gives
IfΔ is not constant, but instead a uniformly distributed random variable, we obtain an average average waiting time of
fuente
This is a Poisson process. The red train arrives according to a Poisson distribution wIth rate parameter 6/hour.
The blue train also arrives according to a Poisson distribution with rate 4/hour. Red train arrivals and blue train arrivals are independent. Total number of train arrivals Is also Poisson with rate 10/hour. Since the sum of The time between train arrivals is exponential with mean 6 minutes. Since the exponential mean is the reciprocal of the Poisson rate parameter. Since the exponential distribution is memoryless, your expected wait time is 6 minutes.
fuente