BBO Discussion Forums: A Puzzle - BBO Discussion Forums

Jump to content

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

A Puzzle

#21 User is offline   helene_t 

  • The Abbess
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 17,089
  • Joined: 2004-April-22
  • Gender:Female
  • Location:UK

Posted 2014-May-16, 03:43

 lamford, on 2014-May-16, 01:38, said:

The trains do not have to be always 20 minutes apart for the requirement in the problem to be met, they just have to be at the same time past the hour.

ok, I took it as meaning three times per clock hour. 0h20 0h40 0h50 1h10 1h15 1h35 2h... would be permissible

It doesn't matter, though. As long as the condition stands that we just missed a train, i.e. we are talking about average interval length, the answer will always be 20 minutes.
The world would be such a happy place, if only everyone played Acol :) --- TramTicket
0

#22 User is offline   StevenG 

  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 626
  • Joined: 2009-July-10
  • Gender:Male
  • Location:Bedford, England

Posted 2014-May-16, 03:44

 gwnn, on 2014-May-16, 03:35, said:

Shouldn't this be three numbers in (0,60]?

Indeed it should. That radically changes the answer to 12.2 seconds :)
0

#23 User is offline   kenberg 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 11,066
  • Joined: 2004-September-22
  • Location:Northern Maryland

Posted 2014-May-16, 10:59

Edit: It is clear that I have completely misunderstood the problem and I still do. Ignmore this post and all other posts by me on this.


 helene_t, on 2014-May-16, 02:15, said:

15 minutes is correct if you went to the tube station at a random time and weren't told how long time elapsed since the previous train. On average, there will be a 30 minutes interval and you will arrive 15 minutes after the last one, 15 minutes before the next one.

It may sound contraintuitive that the average interval length is 20 minutes if you arrive at the beginning of the interval while 30 minutes if you arrive at some random time. But think of it this way: some intervals will be longer than others. Arriving at the beginning of an interval, all intervals are equally likely, so you get the unbiased average which is 20 minutes. But if you arrive at a random time, you are more likely to arrive at a long interval.

Here is a similar (easier) classical puzzle: A man works in Manhattan and he has two lovers, one living in Brooklyn and one in Bronx. There are 6 trains per hour in each direction, at regular intervals. He goes to the tube station at random time points and take the train that comes first, in whichever direction it happens to go. He ends up visting his Bronx lover four times as frequently as his Brooklyn lover. Why?


Note: From the post 25 below i guess I misunderstood the arrival time. He is assumed to arrive at the top of the hour. Then the answer is 15 minutes. I was thinking of a random arrival time, uniformly distributed over the hour. I'll leave this up anyway.

I need to think a bit about this unbiased average. Between 2 and 3 there are four intervals. If you arrive before the first intereval you have to wait on average half the length og the interva. Same with arriving between the first and second, or second and third. But if you arrive after the third, it's different. You certainly have to wait until 3, you have missed the last train in the 2-3 period, and then you have to woit some random time for the first train after.3. I take it that "random intervals", however this is to be understood, means that the arrival time of the first train after 3 is independent of the arrival time of the first train after 2.

So at least it doesn't seem to me that the various intervals are similar enough to look at an unbiased. average.

Simpler case: One train each hour at a random time, uniformly distributed throughout the hour.

X = arrival time of the train between 2 and 3
Y=arrival time of train between 3 and 4
Z = arrival time of the passenger between 2 and 3.
All uniform distributions.

F(X,Y,Z) = time he must wait. This is X-Z if Z<X and Y-Z if Z>X. We want the expected value of F

Is this the way you understand the (simplified) problem?

We can make the obvious modifcations

X1 = arrival time of the first train between 2 and 3
X 2= arrival time of the second train between 2 and 3
X3 = arrival time of the third train between 2 and 3
Y=arrival time of first train between 3 and 4
Z = arrival time of the passenger between 2 and 3.
Then modify F, and we need the expected value, is that right?
Ken
0

#24 User is offline   Vampyr 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 10,611
  • Joined: 2009-September-15
  • Gender:Female
  • Location:London

Posted 2014-May-16, 11:18

 helene_t, on 2014-May-16, 02:15, said:

He ends up visting his Bronx lover four times as frequently as his Brooklyn lover. Why?


It is because girls who grow up in the Bronx turn out to be interesting, intelligent, witty and beautiful.
I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones -- Albert Einstein
1

#25 User is offline   lamford 

  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 6,420
  • Joined: 2007-October-15

Posted 2014-May-16, 11:45

 gwnn, on 2014-May-16, 01:58, said:

I think you are just double-counting trains, lamford. It's a bit like how there is only 1 vertex/volume element in a cubic grid, but each cube itself "has" 8 vertices. However, each vertex is shared by 8 different cubes so in fact cubes "have" only eight times one-eighth of a vertex. I suspect that's what you are missing, the train at 12:00 cannot be a part of both 11:00-12:00 and 12:00-13:00. As a sloppy physicist I often scoff at very carefully crafted definitions, but they can be very useful to avoid off-by-one errors. :)

Let us define the (edited: second part of the problem exactly). The person arrives at 11 pm, say (although it does not matter what time he arrives) and knows that between 11:00:00 pm and 11:59:59 pm inclusive there will be three trains, not an average of three trains, which is an entirely different problem. Their times from that station have indeed been set randomly, and the first in my simulation happens to be 29.78, 7.82, 49.75. The person will have 7.82 minutes to wait on that occasion, the minimum of three random numbers between 0 and 1 in hours. For completeness, I extended my Monte Carlo simulation to 1099509530625 trials, by looping through 1048575 sets of 1048575 tube journeys. The average for those was 14.99996 minutes waiting. I think I was rather lucky, in that I would have expected to wait 0.00004 minutes more, but not as lucky as in a backgammon game I once won where I was under 10^-27 to win a race. Consider the minutes being rounded down. Now those sets of three beginning with 0 are more frequent than those beginning with 1, which are more frequent than those beginning with 2. You may already know that three-card suits headed by the ace are more frequent than three-card suits headed by the king and these are more frequent than three-card suits headed by the queen, etc. The distribution of earliest departure times by minute rounded down is as follows:
0 0.049017953
1 0.047888801
2 0.046009108
3 0.044521374
4 0.042689364
5 0.040990869
6 0.039846458
7 0.038291014
8 0.036938703
9 0.035310779
10 0.034066233
11 0.032547982
12 0.031503707
13 0.03007987
14 0.028824834
15 0.027377155
16 0.026376749
17 0.02490809
18 0.023915314
19 0.022685073
20 0.021656057
21 0.020590802
22 0.019369144
23 0.018569964
24 0.017516153
25 0.016484276
26 0.015553489
27 0.014978423
28 0.013684286
29 0.01294328
30 0.011911404
31 0.01138116
32 0.010547648
33 0.009656915
34 0.008959779
35 0.008337983
36 0.007797249
37 0.007145888
38 0.006352431
39 0.005821234
40 0.005325322
41 0.004804616
42 0.004326824
43 0.00368214
44 0.003322604
45 0.002941134
46 0.002514842
47 0.002120974
48 0.001779558
49 0.001597406
50 0.001202584
51 0.001039506
52 0.000739098
53 0.000585557
54 0.00038147
55 0.000303269
56 0.00015831
57 9.72749E-05
58 2.67029E-05
59 3.8147E-06
We can trivially see that we are 51.9294% to wait 12 minutes, and if we were betting with someone at even money that a train would arrive within x minutes, we should choose a number of 12 or greater. This also answers a different puzzle, but I am now confident enough to bet on my (and SteveGs) original answer of 15 minutes for the problem as stated, that there are three trains per hour, randomly, not poissonly, distributed, but in any hour there are always exactly three trains, not three on average. The waiting time paradox deals with the "three on average" case correctly, but that assumes the times are distributed poissonly, not randomly. And I will have nothing to add to the above, which will be my last post on this subject.
I prefer to give the lawmakers credit for stating things for a reason - barmar
0

#26 User is offline   kenberg 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 11,066
  • Joined: 2004-September-22
  • Location:Northern Maryland

Posted 2014-May-16, 12:09

Edit: It is clear that I have completely misunderstood the problem and I still do. Ignmore this post and all other posts by me on this.




He arrives at 11:00? Who knew?

I had misread and thought he arrived randomly, which is not what you said, but you also did not say, or I did not understand you to say, that he arrived at the top of the hour.


Let me try again at understanding this. Suppose that X, Y, Z are three independent random variables uniformly distributed on [0,1] You are saying that the expected value of Min(X,Y,Z) is 1/4? I don't know if this is a fact but I could check it. It isn't what I understood the problem to be.

Edit: yes, the expected value of min(X,Y,Z) is 1/4 when X, Y, Z are three independent random variables uniformly distributed on [0,1], at least that's what I got by direct calculation.

But this does not match my understanding of the original question.
Ken
0

#27 User is offline   kenberg 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 11,066
  • Joined: 2004-September-22
  • Location:Northern Maryland

Posted 2014-May-16, 12:36

Edit: It is clear that I have completely misunderstood the problem and I still do. Ignmore this post and all other posts by me on this.



For anyone interested in the direct calculation of the expected value of min(X,Y,Z) it goes as follows:

For t in [0,1] let F(t) be the probability that min(X,Y,Z)<t. This happens if and only if X,Y,Z all greater than or equal to t does not happen, and the probability that all three are greater or equal to t is (1-t)^3 by independence (and by the fact that the distribution is uniform). The probability that something happens is 1 minus the probability that it doesn't happen, so F(t)=1-(1-t)^3. The expected value is obtained by integrating t dF(t) from t=0 to t=1, and you get 1/4.

So if he arrives at the top of the hour it's easy enough. If he arrives at some (uniformly distributed) random time between the top of the hour and the end of the hour, the way I mistakenly interpreted the question, I think the problem is more complicated but can be done in essentially the same way. Integrate some polynomials from somewhere to somewhere.It will be multiple integrals.
Ken
0

#28 User is offline   gwnn 

  • Csaba the Hutt
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 13,027
  • Joined: 2006-June-16
  • Gender:Male
  • Location:Göttingen, Germany
  • Interests:bye

Posted 2014-May-16, 14:01

 lamford, on 2014-May-16, 11:45, said:

Let us define the problem exactly. The person arrives at 11 pm, and knows that between 11:00:00 pm and 11:59:59 pm inclusive there will be three trains, not an average of three trains, which is an entirely different problem.

Wrong. He got to the station at 11:00:01 and knows that there was a train at 11:00:00, which he missed. As per StevenG's argument, he knows that there is a train at 12:00:00, so there will be exactly two trains between 11:00:01 and 11:59:59, at some unknown time (equivalently: there are three trains between 11:00:00 and 11:59:59, but the first one just left at 11:00:00! He saw it with his own eyes!). That is the double counting I meant, or more accurately, a non-counting. You can define an hour to be between 11:00:00-11:59:59, or 11:00:01-12:00:00, but not 11:00:01-11:59:59, which you insist on doing, especially if you ignore a whole train in the process (technically, two half trains)!!

I repeat my other question: do you really think that if there is only one train per hour and you just missed one, you have to wait only 30 minutes on average to get the next one? How would that work? Oh, OK, now I see what the answer is:

Quote

And I will have nothing to add to the above, which will be my last post on this subject.

Thanks, that's a very mature way of handling the situation. I hope if you realise that you are wrong you will find it in you to admit it.
... and I can prove it with my usual, flawless logic.
      George Carlin
0

#29 User is offline   broze 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 1,001
  • Joined: 2011-March-08
  • Gender:Male
  • Location:UK

Posted 2014-May-16, 14:41

 lamford, on 2014-May-16, 11:45, said:

And I will have nothing to add to the above, which will be my last post on this subject.


This should be your signature Lamford!
'In an infinite universe, the one thing sentient life cannot afford to have is a sense of proportion.' - Douglas Adams
1

#30 User is offline   kenberg 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 11,066
  • Joined: 2004-September-22
  • Location:Northern Maryland

Posted 2014-May-16, 15:53

Having now read the problem, I want to briefly try again.

If we are asking how long, a person must wait if he has just missed the train, then we don't really need the person, is that right? We are just asking how long, on average, is the time between trains.

Let's start at 1 am and look at all three trains. There is a wait from the time the first train arrives to the time the second train arrives, a time from the second to the third, and a time from the third trani to the first train that arrives after 2. If we add these expected times we get the expected time from the first train after 1 to the first train after 2. That, I trust, is 60 minutes. Not all three of these expected times are the same, but their average values is 20 minutes, no?

So if we assume that his arrival is such that he is as likely to just miss one of these trains as any other, then I guess it's 20 minutes, right? This is not one of those things where he is more likely to arrive during a longer interval because we are stipulating that he comes right at the beginning of an interval.

Obviously I was way off base before, working with uniformly distributed arrival times. I just didn't read carefully. But if we prescribe that he arrives at the beginning of one of the intervals then I see no reason he would be more like to arrive at the beginning of one interval instead of another, so we just take the average of the lengths of the intervals I guess.

I find the problem a little confusing, if what I am saying is still nuts I will be happy to hear why.
Ken
0

#31 User is offline   nige1 

  • 5-level belongs to me
  • PipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 9,128
  • Joined: 2004-August-30
  • Gender:Male
  • Location:Glasgow Scotland
  • Interests:Poems Computers

Posted 2014-May-16, 16:17

 lamford, on 2014-May-16, 11:45, said:

And I will have nothing to add to the above, which will be my last post on this subject.
Thank you Paul, for another interesting puzzle :)
1

#32 User is offline   lamford 

  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 6,420
  • Joined: 2007-October-15

Posted 2014-May-16, 16:37

 StevenG, on 2014-May-15, 11:17, said:

Edit: If you have just missed one, you know there will only be two in the next 60 minutes, so the question is equivalent to "what is the expected value of the lowest of two random numbers in the range [0,60)." This is 20 minutes.

That is indeed the trivial answer to the first part, which I thought was not in dispute. Just for completeness, I wanted to clarify that the simulation and long explanation was for the second part only. That should have been apparent, but obviously I did not explain myself properly!
I prefer to give the lawmakers credit for stating things for a reason - barmar
0

#33 User is offline   helene_t 

  • The Abbess
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 17,089
  • Joined: 2004-April-22
  • Gender:Female
  • Location:UK

Posted 2014-May-16, 16:48

 lamford, on 2014-May-16, 16:37, said:

That is indeed the trivial answer to the first part, which I thought was not in dispute. Just for completeness, I wanted to clarify that the simulation and long explanation was for the second part only. That should have been apparent, but obviously I did not explain myself properly!

Ah right, so we all agreed all the way, we were just discussing different things. Merry christmas everyone:)
The world would be such a happy place, if only everyone played Acol :) --- TramTicket
0

#34 User is offline   lamford 

  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 6,420
  • Joined: 2007-October-15

Posted 2014-May-16, 17:00

 helene_t, on 2014-May-16, 16:48, said:

Ah right, so we all agreed all the way, we were just discussing different things. Merry christmas everyone:)

Indeed, I should have heeded the following advice:

Don't write so that you can be understood, write so that you can't be misunderstood - William Howard Taft
I prefer to give the lawmakers credit for stating things for a reason - barmar
0

#35 User is offline   kenberg 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 11,066
  • Joined: 2004-September-22
  • Location:Northern Maryland

Posted 2014-May-16, 17:26

Man am I having problems following this. OK, I gather we are working on the second problem. Descibed as "And what would my average wait have been if I had not just missed one?" This only says what the passenger did not do, we need to pin down what he did do.

May I then go back to my assumption that the passenger arrives between the top of the hour and the end of the hour and his arrival time is uniformly distributed over that hour, say between 2 and 3?

And what about the trains arriving at "random intervals"? Trains arrive at times, not at intervals, but from what you said in an earlier paost I take it you mean that the arrival times between 2 and 3 are three independent uniformly distributed random variables, and the arrival times between 3 and 4 are also independent, both of each other and of the arrival times of the earlier trains, and also uniformly distributed. The six arrival times between 2 and 4 are independent, the first three uniformly distributed between 2 and 3, that last three uniformly distributed between 3 and 4.

Is this right?

If it is, I think I can go back to a previous post of mine, one I renounced because I thought that I had misunderstood. It would go:

X1 = arrival time of the first train between 2 and 3
X 2= arrival time of the second train between 2 and 3
X3 = arrival time of the third train between 2 and 3
Y=arrival time of first train between 3 and 4
Z = arrival time of the passenger between 2 and 3.

(Edit: The X1,X2,X3 have distributions as follows: A1, A2,A3 are independent and uniformly distributed, X1 is the min(A1,A2,A3) and so on, similarly Y is the minimum of some unif dist B1,B2,B3))

F(X1,X2,X3,Y,Z) is the time he has to wait given the values of the random variables.

Thus:
F(X1,X2,X3,Y,Z)=
X1-Z if 2<Z<X1
X2-Z if X1<Z<X2
X3--Z if X2<Z<X3
Y- Z - if X3<Z<3

The problem, rather a problem, is to find the expected value of F.

The above is a mathematical problem with a computable solution, although I have not computed it. I had first been thinking that this was the problem then came to understand I was wrong, this was not the problem, now I am getting the idea that maybe this is the problem. Is it?

I am confused.
Ken
0

#36 User is offline   GreenMan 

  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 767
  • Joined: 2005-October-26

Posted 2014-May-16, 21:10

 Vampyr, on 2014-May-16, 11:18, said:

It is because girls who grow up in the Bronx turn out to be interesting, intelligent, witty and beautiful.


Plot twist: The Bronx lover is a man. :rolleyes:
If you put an accurate skill level in your profile, you get a bonus 5% extra finesses working. --johnu
0

#37 User is offline   gwnn 

  • Csaba the Hutt
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 13,027
  • Joined: 2006-June-16
  • Gender:Male
  • Location:Göttingen, Germany
  • Interests:bye

Posted 2014-May-16, 22:38

Sure, then we all agree on everything. A Festivus miracle! For future reference, if one posts two questions and people post only one answer, it is usually because they think the first one has to be settled first or because they didn't see the second question. I will not say which was the case this time.
... and I can prove it with my usual, flawless logic.
      George Carlin
0

#38 User is offline   Fluffy 

  • World International Master without a clue
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 17,404
  • Joined: 2003-November-13
  • Gender:Male
  • Location:madrid

Posted 2014-May-17, 03:20

 lamford, on 2014-May-16, 01:38, said:

It is quite hard to phrase a probability question unambiguously, but SteveG is right that if there are three trains in every hour, at random intervals, then one would wait 15 minutes.


You are not taking into account that you just missed a train.
0

#39 User is offline   hotShot 

  • Axxx Axx Axx Axx
  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,976
  • Joined: 2003-August-31
  • Gender:Male

Posted 2014-May-17, 04:32

As I understand the scenario there started 3 trains in one hour perhaps following a schedule.

Once they started their round, they are randomly delayed or if the distance between them get to short systemically accelerated, because the leading train picked up everybody already allowing the following train to make shorter stops.

So a typical scenario would be that 2 trains will have a short interval (e.g. 6 minutes) between them while the 3rd will have a bigger one (e.g. 27 minutes) .
0

#40 User is offline   kenberg 

  • PipPipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 11,066
  • Joined: 2004-September-22
  • Location:Northern Maryland

Posted 2014-May-17, 04:40

Bringing to mind the olde song The Bear Missed the Train, sung to the tune of Bei Mir Bistu Shein.

The bear missed the train and now he's walking....
Ken
0

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users