Mike Lewis
Programmer
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
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