Sharing a bicycle (part 5)

Over the past four posts, I developed a simulation of a bicycle sharing problem that appeared in Parade Magazine’s Ask Marilyn column a few years ago. For what I hope will be the final post in this series, I’m going to derive some analytical results.

First of all, the graphs of completion time vs. distance ahead showed that in both the simple case (rA = rB and wA = wB) and the general case with all velocities different, there was a distinct minimum completion time. In order to determine that time, begin by defining the following quantities:

s_{wA} = total distance A walks
s_{rA} = total distance A rides the bicycle
s_{wB} = total distance B walks
s_{rB} = total distance B rides the bicycle

and as before,

wA = A’s walking speed
wB = B’s walking speed
rA = A’s speed on the bicycle
rB = B’s speed on the bicycle

Continue reading “Sharing a bicycle (part 5)”

Sharing a bicycle (part 2)

The last post described a problem in which two friends share a bicycle to go from one friend’s house to the other’s. In this post, I’ll describe my analysis of the problem. Then in the next post I’ll turn this analysis into R code and present some graphics to describe the results.

Recall that there are four basic steps to this problem:

  1. A rides the bike and B walks, until A is a distance h ahead of B, at which time A dismounts and leaves the bike on the sidewalk.
  2. A and B walk until B comes to the bike, at which time B picks it up.
  3. B rides the bike and A walks, until B is a distance h ahead of A, at which time B dismounts and leaves the bike on the sidewalk.
  4. A and B walk until A gets to the bike, at which time A picks it up.

Continue reading “Sharing a bicycle (part 2)”

Sharing a bicycle (part 1)

The following question appeared in Parade Magazine’s Ask Marilyn column for Sunday, May 2, 2010:

A friend and I once went from his house to mine with one bicycle. I started walking and he rode the bike. When he got a couple of blocks ahead, he left the bike on the sidewalk and started walking. When I got to the bike, I started riding, passing him, and then left the bike a couple of blocks ahead. When he got to the bike, he started riding. We did this the whole way.

At least one of us was always walking. At times, one was riding; at other times, we were both walking. I’m sure this was faster than if we had no bike. But some people insist that it was no faster because somebody was always walking. Who’s right?

Marilyn’s answer was: “The reader is right. It’s true that someone was always walking. But neither friend walked the whole distance. Both biked part of the way. This increased their average speed, so they saved time.”

As with the Monty Hall problem, several readers wrote in to disagree with her response, insisting that since someone was always walking, the journey could be no faster than if both had walked the entire distance. What do you think?

The problem statement is somewhat ambiguous, but it seems that what happens is the following (assuming A rides the bike first):

  1. A rides the bike and B walks, until A is a distance h ahead of B, at which time A dismounts and leaves the bike on the sidewalk.
  2. A and B walk until B comes to the bike, at which time B picks it up.
  3. B rides the bike and A walks, until B is a distance h ahead of A, at which time B dismounts and leaves the bike on the sidewalk.
  4. A and B walk until A gets to the bike, at which time A picks it up.

These four steps repeat in sequence until both friends get to the other house.

In his book Number-Crunching: Taming Unruly Computational Problems from Mathematical Physics to Science Fiction, Paul Nahin presents a discrete-time-step solution for the case where both friends share the same walking speed and the same — but higher — bike-riding speed. Over the next couple of posts I’m going to develop an event-driven simulation to determine the travel time in the more general case where all four speeds are different. By event-driven, I mean that instead of discretizing time, I’ll model each of the above four steps as discrete events; the length of the time step will vary.

Stay tuned for the program.