Where Black Mirror’s “Hang the DJ” Goes Wrong

Charlie Brooker’s Black Mirror offers an incisive perspective on how the human struggle adapts as technology progresses. The episode, “Hang the DJ,” (HtDJ) is a story about what happens when an algorithm can predict love.

Wait a second … that’s what Nanaya does!

In my last post, I described how the algorithm in HtDJ works. This time, I’ll describe why the HtDJ doesn’t work in terms of the computer science and human psychology, as well as how Nanaya compares to HtDJ.

What HtDJ and its Algorithm Get Wrong

While much of the HtDJ’s app algorithm is feasible to code there’s a lot about it that could be done better, or simply would not work in a reasonable way. For example, the bots in the simulation are exposed to a limited set of interactions.

Real Life is More Complex

Consider that we never see Frank (Joe Cole) go to work, Amy (Georgina Campbell) deal with her parents, Frank deal with Amy’s parents – and so on. We also never see Amy and Frank experience non-monogamy. These sorts of interactions happen in real life and indicate a lot about who people are both in and out of relationships.

To generalize, the characters never dealt with the concept of scarcity, except, notably, the scarcity of time. In the real world one can imagine a scenario if Frank were to come back from work disappointed by not getting a raise. It would inject a real-life interaction into the relationship. Frank is providing less money, a planned vacation may not be taken, and resulting with Amy to also be disappointed and to perhaps harbor resentment for Frank’s middling ambition.

A weak way to resolve this gap without significantly burdening the simulation would be “fabricating” emotional memories based on what the dating app observes from the user in their real life. This could be done by appending to a user’s emotional memory during a non-interacting period (like the bot’s simulated sleep).

Even simpler, and possibly more impactful, is taking time off from relationships. In HtDJ, the user’s bot is paired with another bot immediately after their previous relationship ends. In reality, people learn a lot during durations of singledom as they reflect on who they are and what they want from their next relationship. So, if we assume that the app can accurately evolve people such that they learn from experiences, it really, really needs to model being single.

To add these types of interactions in the simulation would be to fundamentally assume the way in which bot individuality evolves is representative of how a real-life user would evolve.

Modeling Real-Life Dynamics is Tough

There are several reasons why this is essentially impossible. One reason that I’ve already described before on the blog is chaos. Or maybe Ian Malcolm can summarize it:


Specifically, a computer simulation describing evolving human behavior is almost guaranteed to diverge dramatically from real-life behavior to the point that artificial patterns of behaviors will emerge leading to significant error.

In other words, if bots in the simulation evolve identically to people in real life – the simulation could still be completely off-base just because someone’s individuality was measured within some standard measurement error. For instance, Amy was scored to be an extrovert with a score of 50±2. If her true, real-life extroversion were actually 52 divergences can be expected. Moreover, because how you define simulated individuality will vary based on convention, there is no fundamentally correct mapping to real-life individuality – the predictive power of such a time-variable approach is significantly limited even if the core nature of the simulation and real life are identical.

As it is unlikely the simulation can accurately describe individuality, interactions, and memory completely, synthetic patterns of interactions and emotions will be created. These synthetic emotions would then be used in the rebellion scoring routine in a manner that would simply not be accurate.

So, if a simulation can’t be expected to model real-life evolution of human behaviors, what’s the value of a system simulating dynamic behavior? I believe that the dynamic modeling is a waste given the vast computation required. In general, it’s highly unlikely that any of HtDJ’s simulations would have rendered graphics and simulate the environment because you would have to write code and pay for processing time that isn’t required to arrive at the solution.

HtDJ’s Similarities to the Nanaya Algorithm

At the core of both algorithms is the notion of matching individuals, evolving their relationships in some manner, and comparing scores of romantic options to determine an optimal solution. No other dating apps do this: only Nanaya in real life and HtDJ’s system in fiction.

Simulated Partners

HtDJ featured a lot of nameless partners that Amy and Frank had. Were these based on real people? Were they made up by the algorithm? I think it’s pretty safe to assume HtDJ picks partners based on who is on the app in your area. However, it’s unclear if the partners it picks are actually those a user might date.

For instance, Frank’s first partner after Amy was not only uninterested in Frank but also didn’t seem to share any compatibility whatsoever. In real life, it’s hard to imagine there would even be a first date between them.

On the other hand, the Nanaya algorithm generates fake partners that are those who you have enough in common with such that you might end up dating but later find an incompatibility with. This approach is not just more realistic but also reduces wasteful computation.

Ultimately the core difference is precisely that HtDJ’s system’s bots exist and evolve in scaled time. If you accept the reasons discussed above, then dynamic simulation of bot individuality is not computational efficient. You will spend a lot of effort simulating the dynamics of relationships in a way that has no bearing on reality. So why bother?

Simulation Decisions

A scoring solution based on static variables is Nanaya’s alternative method. In other words, the Nanaya algorithm uses simple equations to estimate value of a relationship based on the initial conditions of your identity. There would be no point having bots grow and learn in the simulation because it’s just not accurate enough. As soon as it’s not worth it for bots to learn – there’s no point in simulating a timeline!

Now instead of 1,000 timelines, you simulate 5,000, or even 10,000, possible partners in addition to the matched partner. Without timelines and dynamically evolving bots, the “rebellions” in HtDJ are unnecessary and can be simplified to comparing scores from a utility function.

This leads to another key difference. HtDJ’s system only cares about the compatibility with the match for a match score. Nanaya does this but it does two other equally important things. First, it estimates your likelihood of meeting other people you would be compatible with if you choose to not date the prospective or existing partner. Second, it also considers how willing you actually are to settle into a relationship. For instance, a user might have a very compatible match lined up, but what’s does it matter if the user is also content being single?

In summary, Nanaya uses a far simpler way to estimate relationship satisfaction while at the same time does more to account for real-life situations.


Black Mirror’s “Hang the DJ” Explained

Even if you haven’t seen it, there’s a pretty good chance you’ve heard of Charlie Brooker’s series, Black Mirror. In its first two seasons, Black Mirror used its standalone episodes to explore the dark side of upcoming and speculative technologies. New seasons, however, have included more uplifting episodes that depicts technology actually helping peoples’ lives such as Emmy-award winning San Junipero’s time traveling lesbian tryst or Season 4’s Hang the DJ (HtDJ).

If you haven’t seen it, you should. Otherwise, the Verge has a decent recap of it here and you can watch the trailer below:

As HtDJ came to an end with its twist ending, it dawned on me: the app in HtDJ is very much like the algorithm behind Nanaya! Nanaya’s algorithm was published during January 2015 and publicized by the New Scientist. Maybe it’s wishful thinking, but just maybe it was one of many different things that  inspired the script.

Nanaya and the system’s algorithm in HtDJ seemed like they had some similarities. But to actually understand what those similarities are I needed to reverse engineer the HtDJ’s algorithm.

This post offers an overview of how the algorithm behind HtDJ’s system and Nanaya work. Next week, I’ll post the issues with the HtDJ. In the following week I’ll post an even more detailed interpretation of how the HtDJ algorithm works.

How HtDJ’s algorithm works

To really evaluate the effectiveness of the HtDJ system, we need to understand a little bit about how the system’s algorithm works. In short, the algorithm creates matches real-life virtual profiles to see which two matches are most likely to lead to a successful relationship, while comparing it to other possible relationships. That’s not too different from how Nanaya works! The figure below shows the general steps of the HtDJ algorithm.


But to understand how Nanaya’s and HtDJ’s algorithms are different, we need to go into more detail.

For starters, HtDJ’s algorithm creates 1,000 simulations, each one a timeline starting with a 12-hour date between the real-life matches. These real-life users are represented by bots, like virtual Amy and Frank, in a scaled time simulation. After that first date with their real-life matches, both bots are assigned new relationships with different bots for a different duration. Here, the algorithm can be pretty complex – finding the right pairings that force bots to evolve and react the most.

In this way, the simulation can learn more from each relationship and improve accuracy. For any of this to be realistic, the bots need to accurately represent how the real-life user behaves and changes their behavior based on interactions.

After a series of relationships, a certain condition in the algorithm is reached and “pairing day” arrives. That morning, both real-life matches’ bots are given a final opportunity to meet again.  Interestingly, at least in HtDJ, the coach said both Amy and Frank would be matched with a “perfect match” they didn’t know. Essentially they have a choice: rebel against the system (which could conceivably be not accepting Frank and giving up on relationships!) or accept a random relationship. This choice as presented in HtDJ is something that is evaluated in Nanaya as well.

Ironically, their decision to be paired or rebel is a simulated emotional decision. Every dating service that uses numerical matchmaking or the Nanaya algorithm, which uses economic, modeling, defines a consistent and absolute standard of what is a good match. Typically, a good match is one that’s close in the highly dimensional matchmaking space (read more about that here). But in HtDJ’s algorithm, a good match is one that your simulated bot “feels” really good about. This is a paradigm shift in dating apps – emphasizing the emotional sensation of good than what is abstractly considered to be good.

But again, it’s simulated emotion. The emotional decision needs to be mathematically calculated. Some theory of decision-making needs to have been coded or numerically achieved such that a finite set of parameters can be fed into its machinery to come to a single, binary decision.

So how would you even go about attempting to simulation emotions? That’s:

The complicated part

In each relationship, the bots’ personalities can remember, evolve, and learn based on the experiences they have within the simulation, leading to the variability between timelines as different types and durations of relationships occur in each one.

These bot identities and personalities must be explicitly defined in a way that accounts for what we understand as identity and personality in real-life. For instance, there’s inevitably some parameter like extroversion. Imagine the designers of the app in HtDJ have found a way to relate your phone conversations, cell phone photos, text messages, and even biometric data like heart rate relate to extroversion. By snooping in, the app can find out how extroverted you are in a bar after a long day of work or at a public park on a sunny day.

Going deeper, the algorithm can do more if their ex’s are also users. With more information about their past relationship, it’s possible to start classifying what combinations of identities and circumstances just don’t result in healthy, long-term partnerships.

After some time, the app can build a very rich profile of not just how you’re extroverted but many other traits, values, and how it defines emotions. To account for all aspects of personality needed for the simulation, more than tens of thousands of variables are needed (The Nanaya algorithm on the site uses about 1,000 variables, depending on the user).

But this fabric of identity and emotion has to evolve in the simulation. Otherwise Amy and Frank would have rebelled at the start. To evolve all these parameters, many equations or numerical routines, like based on machine learning algorithm, would have to define how any interaction changes identity and emotion.

Between tens and thousands of variables and non-linear equations that relate them and how they change, there’s a lot of room for error. There’s also a lot of computation required, which runs up server bills!

In the next post, I’ll talk about the impacts of these errors and server bills as I describe the issues in the algorithm and what solutions exist.


Nanaya News for 2018

Happy 2018 from Nanaya! As it’s been almost two years since the last blog post, it’s about time for an update.

Over the past two years, almost 250,000 users have tried Nanaya to help understand what their romantic and social futures will look like and what they can do to help live happier and fuller lives. Based on what we’ve learned by analyzing user data over the past few years, we’re planning several great updates for 2018.

Free Nanaya!

Starting Summer 2018, we will be offering a free version of Nanaya that will be based on a shorter version of the existing questionnaire. Specifically, the questionnaire will cover city, friend, work, education, and online dating social networks and rely on a simpler personality test assessment.

People who use the free version of Nanaya will be able to pay for the premium report while keeping all the same answers, shortening the time it takes to fill out the premium questionnaire.

Questions for all users will be updated based on our analysis on data to-date and will help complete how users define their identity, personality, and values.

What makes Nanaya truly unique will stay true: with every new user who tries Nanaya – everyone’s results become more accurate.

The Nanaya Blog and Studies

Sex and companionship might be one of the most universal human needs but the way in which it’s experienced varies dramatically. One of my personal goals when I started Nanaya was to use our database for what it means to have sex, date, and marry in modern society and how it varies for different groups and types of individuals.

The first several studies have been completed and will be posted in the summer, starting with “Does Money Buy Sex?”, investigating the impact of income on romantic life.

Before then, I’ll be publishing several posts on Black Mirror’s Hang the DJ, which seems curiously similar to Nanaya.

Wait, what about Nanaya for couples?

When I first started Nanaya, it was based on my algorithm for predicting whether or not two people should stay together. However, only a portion of this algorithm is actually being used currently in Nanaya!

So when are we going to release it? Unfortunately, it will not be this year but we are getting ready to do the testing required to release the full algorithm. In this year’s Nanaya release we’ll offer discounted or free premium reports to couples that have been together for over 10 years. At this point, we will be constantly evaluating the effectiveness of the algorithm until we are satisfied with its accuracy.

Personal Note

For anyone following Nanaya, I do want to apologize for the very long delay in Nanaya updates.

Since launching Nanaya, I finished my doctorate in physics* and have returned to NASA JPL as a systems engineer where I am busy on several amazing projects, including HabEx, a mission to image earth-like exoplanets to detect signs of alien life, and “self-driving” spacecraft.

Now that I’m settled down and rested, it’s time to get back to Nanaya!

Probability and Nanaya’s Predictive Power

When you get your Nanaya Romance report, one of the first things you’ll see is a chart predicting your odds of finding love over the next seven years. For everyone, this is a line that starts at 0% as we calculate odds based on the moment you take the test. As you meet people in time, your odds increase.

But what do these odds even mean? For instance, if you see your odds of finding a match are 50% three years from now, what does that actually mean for finding love? Is it actually a coin flip? How can we even test that this is accurate when the future hasn’t happened?

To better answer that question, let’s consider the odds of roulette. For those who have seen the move Run Lola Run, it’s hard to forget the scene at the casino. Lola, the movie’s protagonist, needs to raise 100,000 Deutsche Marks to save her boyfriend. She goes into a casino with hardly enough cash to enter and places everything on Black 20…

She wins, but why stop? She doubles down on Black 20…and wins again.

What are the odds? On a standard European roulette wheel there are 37 numbers, from 0 to 36. So the odds of a bet are 1/37. For a successful double-or-nothing wager those odds are (1/37)2. I could have told her that as she was walking in that it’s all but impossible to save her boyfriend in a casino. After all, casinos make money because are odds are always on their side.

It’s easy to make that argument. I can look at a roulette table and know how many choices there are. For any spin of the wheel, there are 37 possible outcomes and only one number will be picked. If you play an infinite number of games, you start to see what the odds 1/37 actually mean in practical terms. To some extent, the Nanaya algorithm works like this. We look at our database to determine the odds of the person you run into at work, through your friends, around town, etc. being the sort of person you would be compatible with and with which there may be mutual attraction. So these odds can be interpreted like the odds in roulette – if you play the game many times (i.e. meet a lot of people), you’ll start to see the effect of those odds.

The Nanaya algorithm predicts the number of people you’ll actually meet and how often you’ll meet them to create a probability distribution based on all those interactions and single-event probabilities. This tells us in time what the net odds are of finding love. But interpreting that probability is a lot trickier than a game of roulette.

Imagine Lola placing her first bet. She knows the odds are 1/37 – but does that practically matter when she can either win or lose. The odds can be 50% or even 99.9% and she can still lose. If you’re only playing one game – how you interpret odds becomes rather subjective.

Like a single game of roulette, we only live one life. So when Nanaya says your odds of finding love are, for instance, 75% four years from now – what does that mean? How can it even be confirmed?

One of the most famous examples of this is how Nate Silver applied statistical simulations to the presidential election of 2008. Even though there can only be one presidential election, he used poll data and their margins of error to simulate 10,000 virtual elections to see what all possible outcomes would look like. He took the average of all those possible outcomes to assess some prediction of the winner. So a result may look like Obama winning 5,800 of those virtual elections, thus giving Obama a 58% chance of winning the election.

“The most important thing to remember in reviewing your Nanaya results is that it’s not about the number itself, it’s about what you do with the number.”

But there’s a lot of subjectivity in this calculation and how it’s interpreted. This is a fundamental problem in the philosophy of probability. What odds mean to practical, subjective human beings has always been contested. After all there can only be one election. The paper The Probabilities of Unique Events by Khemlani, et al. has a great discussion of interpretation of probabilities and how subjective reasoning and belief plays into prediction and decision-making. For an overview of the entire subject, Wikipedia provides a glimpse into the rabbit hole of the philosophy of probabilities.

The way I personally perceive our Nanaya predicts is as a propensity. The odds indicate a degree of likelihood that an event will happen. Otherwise, living only a single life, it’s impossible to perceive the odds meaningfully. It gives us a basis for suggestions as how to improve odds and perform other calculations, so long as probabilities are treated consistently. Nate Silver’s guide to how he predicts senate campaigns is rather similar to how we’ve gone about what we’re doing. While for any person the odds are immediately unverifiable – the model is well-behaved, probabilistically determined*, and incredibly responsive to inputs. Because of this, we expect that no two Nanaya reports will be identical. Our model for predicting the odds of finding love was validated by people’s past decisions to leave and enter relationships.

To validate our modeling, there’ll be an extra question in our “Final Questions” portion of the questionnaire that asks if we can follow up for research. For those that select yes, we may send an email in the future to see if you’ve entered a long-term relationship by clicking “yes” or “no.” It’s by checking in on the many thousands lives of users that be certain Nanaya is calculating probabilities the way it should.

Love may come easily, but predicting love and interpreting probabilities is a tricky subject. The most important thing to remember in reviewing your Nanaya results is that it’s not about the number itself, it’s about what you do with the number. Our goal is that Nanaya helps you reflect on what makes you truly happy and your life goals – and that’s a whole lot more than a single number.

Odds & Ends

*The way we currently model sociological interactions is wholly deterministic, based on the inputs from the questionnaire. We have ideas for how to modify this in the future, but given the complexity of human interactions it’s unclear if probabilistically-derived social modeling using our data set will yield better results than our deterministic models.

As always, direct all questions, media inquiries, mathematical and metaphysical objections, and invectives to info@nanaya.co. Don’t worry, we’ll always love you..