Leaving New York City to get my PhD on the other side of the country was one of the loneliest things I’ve ever done. It meant leaving my whole life behind, Brooklyn, my friends, and a relationship with a woman I cared about. But I’d gotten into Berkeley’s theoretical physics grad program, and even if Berkeley was the cold, white, sparse cousin of New York, I had to go.

After orientation, I got to work finding a warm body. Online dating proved to be a rote, tedious process. I would click around aimlessly for a few hours after a long day spent grading. When I actually did stumble across a woman I liked, she usually hadn’t been online for months, had a full mailbox, or would simply ignore my message.

Whenever I came to him with a particularly sticky physics problem, my adviser Mike was fond of saying: “Getting a PhD in physics doesn’t mean anything, really. Ultimately what you’re doing here is earning a degree in quantitative problem solving. Any kind of problem.” With that spirit and a notebook, I did what any physicist would do. I fired up MATLAB, and started building my model.

My model visualized online dating as a series of Bernoulli trials, a type of randomized experiment where two people’s first impressions of each other could be modeled via a pair of biased coin flips. Only if both parties land on heads (ie “you’re hot!”) do they go out. The problem is that the likelihood of a successful pairing decreases quadratically with the pickiness of the participants. A quick self-survey found that I messaged only one in 20 ( or 5% ) of the women I browsed. Assuming these women were as selective as I was, that meant my chances of meeting anyone were much lower, down from 5% to .0025. That’s about 400 messages sent to get a date.

Using census data, I had estimated that of the Bay Area’s 4 million adults, about 900,000 were single, straight women. Of that greater pool, thousands were signing up for online dating, getting flooded with creepy, single word “messages”, and abandoning their profiles only to re-sign up again later.

I fiddled with the model for a week, and it finally finished running late one Sunday night. Seated alone at a cold metal desk in my TA office, eagerly looking over these first results at 3am, I mouthed a silent curse under my breath. After arriving at realistic estimates for “female pickiness” (fem_Pck) and “creepiness tolerance” (creep_Tol), my model had determined I’d have to look through 600-700 profiles a night to have any hope of being exposed to Ms Right before she got fed up, burnt out and sequestered herself off in a nunnery, or at least got back with her ex. For someone who needed to spend every waking moment buried under an avalanche of quantum mechanics preprints, this wasn’t going to cut it.

Disgusted, I set the model to aimlessly auto-browse profile information overnight, and left the lab. The next day I woke up and found that everything had changed.

My profile had exploded. Twenty-three women had written messages to me unsolicited, and nearly 100 had visited my profile. This was more than three months’ worth of attention, concentrated into a single night.

I realized that when I stormed out of the lab, I’d accidentally left off my search criteria during the auto-browse, and inadvertently discovered an incredibly powerful hack, a way to make the attention pyramid work for me. Over the course of 18 hours, my algorithm – logged in as me – had browsed thousands of active profiles, across all segments of women. These views didn’t pay attention to body type, race, or age, and mostly visited women that had just joined the site, or women that were high matches for me, many of them left wanting for attention by the usual online meat market.

On OkCupid, for example, two-thirds of all male messages are written to the same one-third of women. Women rated as highly attractive get 28 times more messages than women rated on the lower end of the hotness curve. If you’re short, overweight, black, an Asian man, or a woman over 35, you are the needle in the haystack. Not because there’s no one out there who wants to date you – actually there are plenty – but because online dating sites are built on this perverse, inverted pyramid of desirability.

Just by simply showing a little interest in the women who I would’ve otherwise ignored, or ruled out based on demographics, I’d primed the pump and gotten them to show some interest in me.

After that, my romantic life changed. I started going on three or four dates a week. Soon I hit a glut, and my problem was not how to get dates, but how to bankroll all those dinners for two at Mission Chinese on my paltry grad student’s stipend. Obviously, I kept my bot a secret from my dates. But from that day forward, I never ventured on to a dating site without first using my algorithm on it.

The first friend I shared it with was my roommate Will, a short, straight Filipino man who’d never had any luck online (or for that matter, offline). The first night I ran the algorithm on his profile, he received more visits than he had in months, and his first unsolicited message ever.

The next people were Brad and Max, my friends from graduate school.

“This is why we as black people will never win a Nobel prize,” my friend Max quipped, as he surveyed his newly overflowing inbox with awe. “Because this is what you’re doing with your life.”

“Whoa,” said Brad, “You hacked the shit out of dating. Apparently, nurses have a thing for me. Who would’ve known?”

I put it online at YayDating.com, my charitable contribution to those undervalued people who wouldn’t get noticed otherwise.

On my first date with my now girlfriend, as we bonded over Giovanni’s Room by James Baldwin, I could hardly suppress my pride at how well my hack had turned out. That is, until she said “so I think you know my roommate … I thought you were obsessed with me, checking out my profile like a hundred times a day. But then she told me you’re checking hers too!”

I froze, realizing that the bot must have a bug in its code, a rather embarrassing tic which meant it had been caught in an infinite loop; repeatedly, pathologically checking out the same few profiles every few minutes for hours, wearing my face while robo-courting with the dogged perseverance of a T-1000.

Outed, I explained myself to my date. I can’t say she was impressed, but she laughed.

Toward the end of the night, walking her home past familiar brownstones, I realized she lived on my street, two blocks down. She knew a bunch of my friends, too, and she’d worked at the coffee shop around the corner. A pesky little voice pointed out that if I had gone outside once in a while instead of staying in my bed and coding maybe I would’ve run into her.

The chances were pretty good, I guess. But I’d rather leave it to science.