10 분과 15 분마다 운행하는 두 버스 중 첫 번째 버스의 대기 시간에 대한 예상 값


19

인터뷰 질문을 받았습니다.

매 10 분마다 빨간 열차가 운행됩니다. 15 분마다 파란 열차가 운행됩니다. 둘 다 임의의 시간에서 시작하므로 일정이 없습니다. 무작위 시간에 역에 도착하여 처음으로 오는 기차를 타면 예상 대기 시간은 얼마입니까?


3
열차가 정시에 도착하지만 알려지지 않은 단계로 알려 지거나 평균 10 분과 15 분의 포아송 프로세스를 수행합니까?
Tilefish Poele

1
포아송이 아닌 전자.
Shengjie Zhang

7
@Tilefish는 모두가 주목해야 할 중요한 의견을 제시합니다. 확실한 대답은 없습니다. "임의의 시간에서 시작"의 의미를 가정해야합니다. (동시에 시작하거나 다른 미지의 시간에 시작한다는 의미입니까? "알려지지 않은"을 알려진 알려진 분포를 갖는 임의의 변수로 취급하는 것은 무엇입니까?) 위상차의 함수 (모듈로 5 분에만 해당), 대답이 다를 수 15/425/6 . 위상차의 균일 한 분포를 수득 할 35/9 .
whuber

@whuber 모두는 두 개의 버스가 두 개의 다른 임의 시간에 시작된 것처럼 OP의 의견을 해석하는 것처럼 보였습니다. 그들이 같은 임의의 시간에 시작하는 것은 특이한 것으로 보인다
Aksakal

1
@Aksakal. 모두가 아닙니다 : 나는이 스레드에서 적어도 하나의 답변이 그렇지 않습니다. 그래서 우리는 다른 숫자 답변을보고 있습니다. 또한 답을 얻기 위해 질문에 대해 그러한 해석을해야한다는 사실을 거의 아무도 인정하지 않습니다.
whuber

답변:


15

문제에 접근하는 한 가지 방법은 생존 함수로 시작하는 것입니다. 최소 분을 대기 하려면 빨간색 파란색 기차 모두에 대해 최소 t 분 을 기다려야합니다 . 따라서 전체 생존 함수는 개별 생존 함수의 곱입니다.tt

S(t)=(1t10)(1t15)

에있는, , 당신은 적어도 기다려야하는 확률 t은0t10t 다음 기차 분. 이것은 각 열차가 다른 열차와 여행자의 도착 시간과 독립적으로 고정 된 시간표에 있고 두 열차의 단계가 균일하게 분포되어 있다는 올바른 가정이 OP에 대한 설명을 고려합니다. ,

그런 다음 pdf는 다음과 같이 얻습니다.

p(t)=(1S(t))=110(1t15)+115(1t10)

그리고 예상 값은 일반적인 방법으로 얻습니다.

,E[t]=010tp(t)dt=010t10(1t15)+t15(1t10)dt=010(t6t275)dt

35 점으로359


데이브, p (t) = (1- s (t)) '를 어떻게 설명 할 수 있습니까?
Chef1075

나는 당신에게 S (t) = 1-F (t), p (t)는 단지 f (t) = F (t) '라고 설명 할 수 있습니다.
딥 노스

4
The survival function idea is great. But why derive the PDF when you can directly integrate the survival function to obtain the expectation? In effect, two-thirds of this answer merely demonstrates the fundamental theorem of calculus with a particular example. And what justifies using the product to obtain S? There's a hidden assumption behind that.
whuber

2
@whuber I prefer this approach, deriving the PDF from the survival function, because it correctly handles cases where the domain of the random variable does not start at 0.
Dave

2
(1) Your domain is positive. (2) The formula is readily generalized..
whuber

9

The answer is

E[t]=xymin(x,y)110115dxdy=x(y<xydy+y>xxdy)110115dx
Get the parts inside the parantheses:
y<xydy=y2/2|0x=x2/2
y>xxdy=xy|x15=15xx2
So, the part is:
(.)=(y<xydy+y>xxdy)=15xx2/2
E[t]=x(15xx2/2)110115dx=(15x2/2x3/6)|010110115=(1500/21000/6)110115=510/93.89

Here's the MATLAB code to simulate:

nsim = 10000000;
red= rand(nsim,1)*10;
blue= rand(nsim,1)*15;
nextbus = min([red,blue],[],2);
mean(nextbus)

1
You're making incorrect assumptions about the initial starting point of trains. i.e. Using your logic, how many red and blue trains come every 2 hours? How many trains in total over the 2 hours? etc.
Tilefish Poele

1
Can trains not arrive at minute 0 and at minute 60?
Tilefish Poele

1
what about if they start at the same time is what I'm trying to say. What if they both start at minute 0. How many instances of trains arriving do you have?
Tilefish Poele

1
The simulation does not exactly emulate the problem statement. In particular, it doesn't model the "random time" at which you appear at the bus station. As such it embodies several unstated assumptions about the problem.
whuber

2
@whuber it emulates the phase of buses relative to my arrival at the station
Aksakal

4

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 first x minutes is 10x10×15x15 for 0x10, which when integrated gives 3593.889 minutes

Alternatively, assuming each train is part of a Poisson process, the joint rate is 115+110=16 trains a minute, making the expected waiting time 6 minutes


3
@Dave it's fine if the support is nonnegative real numbers.
Neil G

3
@dave He's missing some justifications, but it's the right solution as long as you assume that the trains arrive is uniformly distributed (i.e., a fixed schedule with known constant inter-train times, but unknown offset). It works with any number of trains. This is the because the expected value of a nonnegative random variable is the integral of its survival function.
Neil G

1
@Dave with one train on a fixed 10 minute timetable independent of the traveller's arrival, you integrate 10x10 over 0x10 to get an expected wait of 5 minutes, while with a Poisson process with rate λ=110 you integrate eλx over 0x< to get an expected wait of 1λ=10 minutes
Henry

1
@NeilG TIL that "the expected value of a non-negative random variable is the integral of the survival function", sort of -- there is some trickiness in that the domain of the random variable needs to start at 0, and if it doesn't intrinsically start at zero(e.g. for a different problem where the inter-arrival times were, say, uniformly distributed between 5 and 10 minutes) you actually have to use a lower bound of 0 when integrating the survival function. (starting at 0 is required in order to get the boundary term to cancel after doing integration by parts)
Dave

3
+1 At this moment, this is the unique answer that is explicit about its assumptions. All the others make some critical assumptions without acknowledging them.
whuber

2

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:

  1. the Red train is E[R]=5 mins
  2. the Blue train is E[B]=7.5 mins
  3. the train that comes the first is E[min(R,B)]=1510(E[B]E[R])=154=3.75 mins


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.


1
Thanks! Your got the correct answer. But 3. is still not obvious for me. Could you explain a bit more?
Shengjie Zhang

1
This is not the right answer
Aksakal

1
I think the approach is fine, but your third step doesn't make sense.
Neil G

2
This answer assumes that at some point, the red and blue trains arrive simultaneously: that is, they are in phase. Other answers make a different assumption about the phase.
whuber

2

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.

If WΔ(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

W¯Δ:=130(12[Δ2+102+(5Δ)2+(Δ+5)2+(10Δ)2])=130(2Δ210Δ+125).
Notice that in the above development there is a red train arriving Δ+5 minutes after a blue train. Since the schedule repeats every 30 minutes, conclude W¯Δ=W¯Δ+5, and it suffices to consider 0Δ<5.

If Δ is not constant, but instead a uniformly distributed random variable, we obtain an average average waiting time of

15Δ=05130(2Δ210Δ+125)dΔ=359.

2

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.


The Poisson is an assumption that was not specified by the OP. But some assumption like this is necessary. The logic is impeccable. +1 I like this solution.
Michael R. Chernick

1
OP said specifically in comments that the process is not Poisson
Aksakal
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.