A busy gym is a motivating environment, but a very busy gym is a frustrating problem. When I returned to campus for my senior year, I discovered that the school gym had fallen into this latter category.
For one thing, it closed a few hours earlier in the evening. And it was now much busier overall compared to before the pandemic. I was now spending a lot of time waiting for equipment – either because it was already occupied, or because I was sharing it.
The solution to this problem is supposedly simple: if you don’t want to wait for things in the gym, then you must work out when the gym isn’t busy.
So I’ll just have to work out at a weird time nobody else would think of!
Well, this strategy often backfired: my perception of the gym’s busiest hours was far too predictable, and the gym’s busiest hours on any given day was far too unpredictable. I would like to think that my planning was often so predictable that a bunch of people had the same idea, and we ironically ended up converging at the same time to work out anyways.
What could the gym do to solve these problems? There are some naïve, blunt approaches that technically work but actually suck. Let’s examine and eliminate these options:
The gym operates like an art gallery, drastically lowering the maximum occupancy limit and refusing to admit anybody beyond the limit.
The gym operates like a movie theater, assigning students “tickets” that permit entry during a specific time slot.
The gym operates like a nightclub, employing a student-bouncer to only let in those who workout quickly and to kick out laggards.
The gym operates like a taxi company, selling a fixed quantity of transferable gym permits to constrain the gym population.
The gym operates like a medieval craft guild, offering the exclusivity and prestige of a gym membership to select Dean’s list recipients who, in return, donate a hefty sum to the university.
But I digress. The point is that the gym should be a freely available resource, and people should be empowered to make smarter decisions about when to go. Unfortunately, there isn’t a way at Carnegie Mellon to know if the gym is busy unless somebody is there to tell you, or you observe the gym yourself. If there was a 24/7 livestream of the gym, then it would be easy to remotely check if the gym is busy or not with just a glance. But there are glaring security and privacy sacrifices with this livestream proposal, so we need to think of other methods.
If we distill this problem, then we understand that the gym’s busyness is tightly correlated with a single metric: the number of people in the gym. So if we can count the people in the gym, then we can infer the probability of having to wait for equipment.
So with our goal of counting people established, we can consider many technical approaches:
There’s always a student stationed in the gym as a desk attendant. We can task this student with digitally recording the current gym population into as people entered and exited. But doing this for hours is extremely tedious and liable to inaccuracy or misreporting. This kind of brute force approach is inappropriate for such a readily automated task.
Install special cameras in the gym that use a sophisticated AI algorithm to recognize and count people in a privacy-friendly manner. But these cameras are generally incredibly expensive and often charge a monthly subscription fee. Also consider the difficulty of installation — how would these cameras be supplied with power and an Internet connection?
Mount sensors on top of doors to track the number of people entering and exiting the gym. But this suffers from the same problems listed above regarding cameras.
Count the taps on the ID readers outside the gym doors. But without additional equipment we would have no idea when somebody leaves the gym, or if somebody enters the gym without tapping (such as when somebody holds the door open for them).
Measure the airborne carbon dioxide concentration to estimate the number of people inside. I’m skeptical this would work well because physical exertion can make a human’s carbon dioxide output highly variable.
But there is a far cheaper approach we can use. We can make two specific and critical assumptions about our situation that simplifies the problem greatly.
Let’s illustrate this from a CMU perspective:
- A CMU student carries their phone in a pocket or bag. This phone is connected to the campus Wi-Fi network.
- The CMU student enters the gym. The phone’s Wi-Fi antenna roams to one of the wireless access points (WAPs)1 in the gym.
Therefore, if you know the number of clients connected to the WAPs in the gym, you can approximate the number of people in the gym.
The number of clients connected to a particular WAPs is most likely already available to CMU network admins. Getting this number published as an API is the hard part. This step will probably require a few emails and meetings with university administrators. Once you have client population figures, the fun begins.
You could browse to a website like cmugyms.com2 and see a live figure of estimated people in the gym. As people workout en masse, the number of devices connected to the gym’s WAPs surges. And as they leave, the number of devices decreases. We would need to calibrate the initial count by observing the number of persistent devices connected to gym WAPs, such as printers or office computers, that do not belong to gymgoers. We would also need to account for some individuals carrying more than a single Wi-Fi device into the gym: people not only carry their phones, but also their backpacks containing laptops or tablets. The average number of Wi-Fi devices somebody brings into the gym is likely greater than one.
The advantage of this ‘Wi-Fi heuristic’ is how technically simple it is. This not only makes it cheap, but also universal. This method could work at any institution and at any specific location with WAPs nearby, like dining halls, libraries, or lounges.
At this point, I would have continued on with a proof-of-concept. But I am sadly forced to leave this proof as an exercise for the reader.
You see, I unfortunately thought of this idea about a week before I graduated this past May. But fortunately for you, this idea remains plausible and awaits a proper implementation.
cmugyms.com could be for tracking campus gyms as cmueats.com is for tracking campus food