It’s a jungle out there. But at the end of the day, it’s just a game of numbers. 

So here’s the scenario.

You walk into a metro coach, tired after a long day’s work. It’s rush hour, and all seats are taken. In fact, there are quite a few other commuters (all of them as tired as you are) dotting the aisles. You let out a sigh, and carry yourself grudgingly along the coach, trying to spot an ’empty zone’. You know that the next station is an interchange, so one of the seated folks is bound to disembark. You keep an eye out, scanning each face, looking for that slightest hint – someone wrapping up their earphones, or reaching for their bags. The train begins to enter the platform. You’re as alert as ever. And then boom. Someone does get up. Within a fraction of a second, you’re darting towards the empty seat. But alas! You’re not the only one who had their eyes set on the coveted throne. Before you’re halfway there, the seat is taken. You had a competitor. And he was closer to the seat. You give him the death stare, and he smirks back triumphantly. You attempt to mask your frustration by pretending to read the advert by the window. The doors close again, and the train is on its way.

Its a jungle out there, and you just weren’t fast enough.

Well, to be fair, the rules of the jungle are quite straightforward. If you’re nearest to an empty seat, you get there first. And if you’re there first, the seat is yours. The goal is simple. And so is the math. You want to be that person in the coach who has the highest probability of getting a seat. To do that you have to be that person who is closest to the maximum number of seats. A typical coach in the Delhi metro, for example, consists of 46 seats. 3 aisles of 14 seats each and 4 single seats near the vestibules. Now, assuming all seats are taken, each seat has at least one standing commuter who is closest to it. And he/she will get the seat when it is vacated. So how does one position oneself so as to be closest to most seats?

image_default

Let’s get into a little bit of spatial analytics. Consider the diagram above, depicting the positions of 16 standing commuters. For any particular spatial configuration of standing commuters, there will be at least one commuter who is closest to most seats. Finding out who that is, is simple. We first compute the distances between each seat and each numbered commuter (competitor). So for 46 seats, we get a list of 46 ‘nearest competitors’.

dists

We then do a quick tally to figure out which competitor id occurs most frequently in this list. The winning competitor is the one that gets the seat. In case there are more than one who have the same frequency of occurrence, we calculate which one of them have the lowest sum total of distances to the nearest seat.

The graphic below illustrates this particular commuter configuration. The shortest paths between each commuter and their nearest seats are shown in grey. The winning commuter has most such lines (in red).

image

We can now code this logic as a simple algorithm to find the winning competitor for any spatial configuration of standing commuters. The animated graphic below shows the winning competitor for various commuter configurations.

prob_med_cropped

So far so good. Now we come to our central question. For any given configuration of competing commuters, where should one stand so as to maximize his/her chances of getting a seat?

Well, to answer this question, one would first need to identify all the possible positions in a metro coach where one can stand. There are an infinite number of points within the coach, and thus, technically, also an infinite number of possible standing positions. For the sake of simplicity, however, we can divide the aisles within the coach into a very dense grid of 5 x 100 points. This will allow us to work with a finite number of 500 possible positions. The graphic below shows the grid of possible positions.

grid_1

Now, to be able to assess the best possible position for a particular configuration of competitors, one would have to find out which of these 500 possible positions will have the highest probability score when analysed using the algorithm discussed above. To do this, one would need to repeat the algorithm for each of the points, with the same competitor configuration.  For each of the 500 cycles, one would need to keep a count of the probability score of the corresponding point on the grid, and at the end of it, the point with the highest score wins.

The graphic below shows the probability score for each grid point, for the competitor configuration discussed earlier. Green positions have the highest score. Reds have the lowest.

heatmap

Again, we can code this logic as a simple algorithm to generate probability heat maps for any spatial configuration of standing commuters. The animated graphic below such heat-maps for various commuter configurations.

heatmap

Okay. So now what? 

Yes. So how do we make sense of all this probability analysis to actually build some thumb rules that can help us the next time we walk into a packed metro coach? One doesn’t get a chance to run probability algorithms on a typical ride to work!

Let’s first get some other questions out of the way. Even though proximity to a particular seat is assumed to guarantee actually getting that seat, that is not always the case. For example, we haven’t taken into account directions of gaze. We may be standing close to a seat, but looking away from it. And boom. It’s taken by someone who was further away. Similarly, we’ve not accounted for reserved seats, or, for that matter, children/elderly ‘competitors’ standing nearby, for whom we may voluntarily give up a nearby seat. Moreover, we’ve also not accounted for the body language of seated commuters, which often give us valuable hints which alter probability dynamics.

Now in a case where there are a large number of competitors, the absolute probability value for even the best possible position will be quite low. And thus many of these other factors become significant. So if we have, say, 25 competitors, even the best possible position may be ‘closest’ to only 2-3 seats. In such a case, proximity alone may not play the strongest role in determining seating probability.

In the case of a fewer number of competitors, however, location plays a major role. And standing in a ‘less gainful’ position may easily cost us a seat. And that’s a situation where we would want to be a little careful about where we stand.

In many cases, our ‘common sense’ is quite accurate, and the positions that we intuitively gravitate towards, are in fact those positions which offer the mathematically highest seating probability. Take for example the graphic below. Without getting into any probability analysis, most commuters would tend to naturally gravitate towards the green zones anyways, simply because those zones appear emptier, and thus allow us to create our own ‘sphere of influence’ near a bunch of empty seats. We know that those seats, in a way, ‘belong to us’.

2

Our intuitions with respect to ’empty zones’ don’t, however’ always hold true. In fact, the seating probabilities of these empty zones depend critically on the configurations of competitors around these empty zones. It is interesting to note how, in many cases, seating probability patterns may be counter-intuitive. And that’s where we can learn from such mathematical analyses. Take for example the competitor configuration shown below.

1_A

Intuitively, many commuters would tend to spread out evenly and thus move towards the ’emptier’ zones, away from their nearest competitors. They would want to create their own spheres of influence, while targeting the seats within these empty zones.

That’s however not actually the case. Because in the case of a fewer number of competitors, not only would you want to retain control over the seats near your empty zone, you would also want to stake claim over the seats within your competitor’s sphere of influence. Thus, to maximize seating probability, you would want your sphere of influence to overlap as much as possible with that of your competitor, without relinquishing control over the seats near you. The graphic below illustrates this point. The green zones indicate the most gainful positions in this case.

1So for individual competitors laying claim over large zones of influence, you would always want to stand in-between these people and their respective empty zones, and as close as possible to them. This principle becomes all the more obvious in the case below.

2_B

Intuitively, most commuters would tend to occupy the third ’empty’ aisle to the right. One would want to lay claim over an entire section of the coach. However by doing so, one would also be relinquishing control over the seats that fall within the nearest competitor’s zone of influence. The most gainful position would actually be the green zone right next to the nearest competitor, near the center of the coach (see graphic below). In-fact, assuming that only one seat in the coach is vacated at the next stop, standing near in the green zone will lead to a ~1.6 times higher probability of getting that seat, as compared to standing in the yellow zone within the empty aisle.

2

Now let’s take a more crowded scenario as shown below. Intuitively, one would tend to gravitate towards either of the two empty zones marked in red. Because both zones would appear to give us control over roughly the same number of seats. And using the thumb rule learnt above, one would want to stand nearest to an adjacent competitor.

3_B

But when we do the math, we’ll see that the zone to the right will give us a much higher probability score than the one to the left. That’s because the zone to the left falls in-between the zones of influence of two competitors, as opposed to only one competitor to the right.

3

In-fact, as shown below, standing right next to the sole competitor in the right zone (nearest to 9 seats) will give us a probability score 1.5 times that of what we would get by standing right next to either of the competitors in the left zone (nearest to 6 seats). Standing in the center of the left zone will in fact be the worst of all these cases (nearest to 5 seats).
animate

So let’s summarize what we’ve gathered from the above simulations:

  • If you walk into a relatively empty coach (competitors<~5), don’t straightaway head towards an empty zone. First identify the competitor who’s standing near the largest empty zone, and then stand right next to him, blocking his access to the empty zone. The easy way to do this is to identify a competitor that is laying claim to many seats, but is standing away from the geometric center of his influence zone.
  • If you walk into a slightly more crowded coach (competitors~8-12), you will most likely have more than one competitor for every empty zone. In this case, first identify those empty zones where the nearest competitors are concentrated asymmetrically on any one side of the zone. Then stand right next to the nearest competitor, blocking her access to the zone.
  • If you walk into a coach that is even more crowded (competitors>~15), the absolute probability value for any position will fall to a point where many other factors over and above strategic location will become equally dominant. Moreover, all empty zones will most likely have competitors on either side (and not asymmetrically located). Nevertheless, the most gainful position in such a least gainful situation would be as far away as possible within the empty zone from all nearest competitors. This is the the intuitive logic that most people anyway use to position themselves within a coach, even if it works against them (as seen in the previous scenarios).

So there you have it. The mathematics of weather you get a place to sit, or weather you spend your journey glaring disapprovingly at your fellow (luckier) passengers. Will all this analysis actually help you the next time you are drained after a hard day’s work, and walk into a crowded coach? Well, yes, if you’re able to apply the thumb rules discussed above. But, let’s also remind ourselves that there are so many other factors involved. Physical proximity to seats is just one of them.

Most importantly, a probability, no matter how high, is not a certainty. You may be have everything worked out –  standing at the most gainful position, alert as ever, poised for the kill. And yet, you may lose your throne to a random carefree creature with headphones. All because they were at the right place, at the right time.

Yes it’s a game of numbers. But at the end of the day, it’s also a jungle out there.