Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Something for the (Christmas) weekend : A statistician's error

Status
Not open for further replies.

Mike Lewis

Programmer
Jan 10, 2003
17,516
Scotland
My apologies for the lengthy post, but this week's brain exerciser is a bit more complicated than usual. It's not really a VFP problem, but it does require a logical and numerical approach. For those of you for whom Christmas is a holiday, it will give you something to think about over for the long weekend.

The background

Some years ago, I worked on a FoxPro project in central London. One of the team-members was a statistician named Hugo. Hugo was a bachelor, but he had two girlfriends. One of these ladies lived in the north London suburb of Edgware. The other resided in Barnet, which is also in the north of the city. He liked both of these women equally, but he didn't want to fully commit himself to either one. He always found it hard decide which one to spend time with.

So he adopted a simple plan. Every day, he would leave our office in Wigmore Street at about 5 pm. If we weren't busy – and especially if the boss wasn't around – he would leave several minutes early. When we had a lot of work on, he would stay for an extra five or ten minutes, or sometimes more.

On leaving the office, he would walk to Goodge Street station, which is on the Northern Line of the London Underground. If the weather was bad, he would go straight there, which typically took 12 to 15 minutes. At other times, he would take his time. He might stop to buy a newspaper, and perhaps chat with the vendor. Sometimes, he would stroll along Oxford Street, and look in the windows of the big department stores. If he had some bread left over from his sandwich lunch, he might stop to feed the pigeons in Soho Square.

On arrival at the station, he would head for the northbound platform – and then always take the first train out.

Now, northbound trains from Goodge Street all go to Camden Town, where the line splits. One branch goes to Edgware, the other to Barnet. Passengers don't use a timetable on the Underground: trains are very frequent, and you never have to wait more than a few minutes. On this part of the Northern Line, trains run in a strictly alternating sequence: Edgware, Barnet, Edgware, Barnet.

Hugo reasoned that his arrival time on the platform was – to all intents and purposes – random. Therefore there was an equal chance that the next train would be for either of the two destinations. So he always took the first train out, stayed on board to the end of the line, then always went to whichever girlfriend lived at that destination. That way, he would have an equal chance of seeing either of the young ladies, and so wouldn't have to choose between them.

The denouement

After our project finished, I lost touch with Hugo. But a few years later, I met him walking on Hampstead Heath. He was accompanied by a lady whom he introduced as his wife. She was pushing a pram, which contained Hugo Junior.

We walked together for a few minutes. When Mrs. Hugo was out of earshot, Hugo told me that his wife was the former girlfriend from Edgware. I asked him what made him choose her, rather than the girl from Barnet. He said that Ms Barnet had ditched him because she was fed up with him neglecting her. He only came to see her once or twice a week, she had said. By contrast, Ms Edgware was delighted that he was spending three or four evening a week with her; the relationship developed, and they eventually got married.

What went wrong?

But what happened to the 50-50 plan, I asked. Surely, if his arrival time at Goodge Street really was random, and if he always took the first train out, he would have expected to spend an equal number of evenings with each girlfriend. He replied that he couldn't understand why that hadn't worked.

So what went wrong with Hugo's plan?

By the way, you don't need to know the geography of London or of the Underground to come up with an answer. Some of you might object that Edgware trains occasionally terminate early at Golders Green, or that some Barnet trains branch off at Finchley Central to serve Mill Hill East. But you can ignore those factors, because at the time this story took place, they only affected trains from the Bank loop of the Northern Line, not the Charing Cross loop which is the one that Hugo used.

It took me a while to come up with a possible explanation for what had gone wrong with Hugo's plan. Let's see if you can do better.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I know the solution, but won't reveal it right now, that would be too early.

I'll mail you, Mike.
 
In the good old days London Transport had a train along this line every ten minutes, regular as clockwork; you could set your watch by it. I wonder if the service is still so good.
 
So ... nobody could see the flaw in Hugo's reasoning (nobody except Olaf, that is).

Was this because: (i) The problem was too easy, and nobody bothered to reply; (ii) The problem was too difficult (unlikely); or (iii) you couldn't be bothered to read the whole thing (and who would blame you?).

In case anyone is still thinking about it, the clue lies in these two statemenents:

Passengers don't use a timetable on the Underground.

On this part of the Northern Line, trains run in a strictly alternating sequence: Edgware, Barnet, Edgware, Barnet.


Both of those statements are true, but ....

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
There was a young brunette from Barnet
Whose tube times irregular were offset
She complained that the train
was really to blame
For Hugo dating that Edgewarian coquette


and besides everyone knows that the Edgeware girl (with her tiny little moustache) was both cuter, knew much more about VFP API calls AND loved using recno() in PRINTING routines... much more than the Barnet babe ever did.

Although I personally would NEVER use RECNO() as a marriage criteria.

JF





Sydney, Australia
 
I see that the trains run on a strict alternating sequence, but what I don't see is that they run on a strict equal time sequence between trains. If the trains average two trains per 15 minutes, for example, but one train is 5 minutes behind the other train on average, then the odds of him getting on one train as opposed to the other would be 2:1 which is appears to be the case.

mmerlinn


Poor people do not hire employees. If you soak the rich, who are you going to work for?

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Raymond
 
Aha ! Wizard man...

That is what I said too.. albeit in a bad Australian Limerick...

"Whose tube times irregular were offset"

Happy NY
JF

Sydney, Australia
 
Mr Merlinn's explanation is correct.

To explain further:

I said "Passengers don't use a timetable on the Underground". That's true. But that doesn't mean that a timetable doesn't exist. On the contrary, it would be impossible to run a hugely complex system like the London Underground without a very strict timetable.

I also said "... trains run in a strictly alternating sequence". That's true too. But that doesn't mean that the trains are evenly spaced. In fact, the timetable dictates that there is a get a gap of one minute between each Barnet and the following Edgware, and then a gap of three minutes between that Edgware and the following Barnet. So it is three times as likely that, at any given instant, the next train will be an Edgware rather than a Barnet.

John, thanks for your limerick. I have to say that it's not the greatest limerick I've ever seen. In fact, the scanning and rhyme is rather dubious. But it is definitely the best limerick I've seen on Tek Tips.

Andrew, I was brought up on the Northern Line (and I'm old enough to remember whan parts of it were the LNER), but I don't remember there ever being a regular-as-clockwork headway of ten minutes. It's always been closer to five minutes. And I think the frequency today is better than it has ever been before.

So, thank you all for your contributions. I hope that at least some of you learned something from it. I'll try to make the next brain exerciser a bit more challenging.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
In fact, the scanning and rhyme is rather dubious. But it is definitely the best limerick I've seen on Tek Tips.

Yeah, yeah ! ! the only one ever on Tek-Tips ....

I wanted to use iambic pentameter... but my Shakespeare is worse than my Irish.

My line "Whose tube times irregular were offset" was the answer you wanted.

No glory !!! Just 'dubious scanning and rhyme'

OK OK Next year when the Xmas problem rears its ugly head... no sonnet, no clever witty rhyme.... Just cruel Merlin-esque prose...

But that is OK... At least Merlin can conjur up how to populate a Grid...

Anyway, what is Merlin's prize ? A one week trip to the UK in WINTER ? Or second prize...Two weeks in UK in Winter ?

Foxy

PS Mike, genuine thanks for all your assistance over the years...for me and for the others who occasionally may forget to say 'thanks'


BTW I was thinking...

"There was a young programmer called Lewis"
....


Sydney, Australia
 
Being a very poor English speaker, I was very amused by the verses.

"...and besides everyone knows that the Edgeware girl (with her tiny little moustache) was both cuter, knew much more about VFP API calls ...", inspired me an alternative solution :

The Edgeware girl took the initiative (the train) and waited Hugo in London :)

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
Love those Romanians !!!

There once was a young Roman from Resita"
Whose love of VF was obscener
than the logic of course
of a underground line going North
That he would rather write code than rhyming meter


OR as my daughter once wrote in a moment of literary brilliance

"Roses are Red
Violets are Blue
Poetry is hard
Bacon"


Sydney, Australia
 
FoxEgg said:
Anyway, what is Merlin's prize ? A one week trip to the UK in WINTER ? Or second prize...Two weeks in UK in Winter ?

Either would be fine by me. I don't like the sun and I don't like the snow. My preference would be overcast and drizzle 24/7/365, which I believe pretty much fits UK weather because of the Gulf Stream.

I hate temperatures above 65 and prefer the lows to be 40 or higher, which is one of the main reasons I live where I do as temperatures here usually hover in that neighborhood year round. I have seen years where the lows never got much below freezing and the highs never got above 80.

Around here it is overcast and drizzle pretty much 10 months out of the year, with the ugly sun poking thru only for a few weeks in the summer and ice/snow seldom more than a few days in the winter, and often none at all.

mmerlinn


Poor people do not hire employees. If you soak the rich, who are you going to work for?

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Raymond
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top