# Bayesian Analysis on why you aren’t getting that job.

## It really is them not you. Math says so.

You had that great interview for a position you think you’re perfect for. You have all the right skills, you hit it off with your interviewer, and he even liked that joke about the llamas from that time you went to the Andes. All you’re waiting for now is, but when you check back later all you have left to show is an automated rejection letter.

What happened? Could someone have one up’d your llamas? How could you have had a better interview?

Bayes’ Theorem might offer an explanation. Bayes’ Theorem is one of the most powerful insights in probability. It’s been employed in fields from medicine, to physics, to machine learning for creating better explanations of the world.

**Bayes’ Theorem Explained**

Bayes’s Theorem is a very simple equation that can be summed up mathematically as:

What does this mean and how do we use it? Bayes’ Theorem is a way to structure a problem that adapts to new information. You will encounter a lot of problems in the world where you hear bad news and you just feel devastated, or if you’re a different kind of person, you dismiss the news as wrong out of hand. And from experience you know that sometimes the optimist is right and sometimes the pessimist is right. The way people choose can feel arbitrary.

But what if there was a way to mathematically make the choice, optimism or pessimism. All you need is a thought experiment and some idea of how likely certain things are. Let’s try a test; a drug test.

Your drug test came back positive. The drug test is 99% reliable. That means 99 out of 100 true testers are indeed taking drugs. On the flip side let’s say the test also has very few false negatives as well, 90 out of 100 negative testers are truly not taking drugs. How confident should your company be in the test results? Obviously, since the test is 90%+ true either way, your company should be super confident that if your drug test come back positive you’re a junkie that should be thrown out on your ass.

But you know you’re not taking anything but weak tea though. Being a cunning mathematical mind you come back with a piece of information that was missing to the company. You know in your city only 1 in 50 people are actually users. This information is your *prior*, how likely a random person will be expected to do drugs out of a population of people like you. Armed with this information and with the help of Bayes Theorem you show that your actual chances of taking drugs are:

P(Actually Using Drugs | Tested Positive) = P(True Positive) / P(All Positives) where the probability of all positives is the sum of true positives and false positives: 0.0198 + 0.098 = 0.1178. The True Positive rate divided into that is 16.8%. That means even with a positive test result you only have about a *1 in 6 chance* that you actually take drugs. Much less than the 90+% confidence they originally had in the test. You demand a retest, pass and get hired rightfully.

Does this make sense? But how could our initial confidence in the test be so wrong. That is the magic of Bayesian thinking. If you start with the information that only 1 in 50 people will be expected to have used drugs, you can use evidence, the positive test results, to only incrementally change your priors. Even many doctors make this mental mistake, being too confident in their test results. All tests have some chance of being wrong.

**Think Bayesian**

Yeah, but I’m not going to do fractional mathematics every time I get a bit of bad news. That’s the beauty of Bayes. It’s a way to think of the likelihood of events with information you already know or with good estimates. Bayesian Inference is easier to think about in populations so let’s go back to our ‘great first interview problem’ and put some numbers on these bones.

Let’s say you estimate that the company gave about 100 people a first interview. Furthermore you expect that for the one position open they will only want to call back 20 people for the second round.

You expect that almost everyone who got a second interview was also killed it at the first interview, maybe 95% had a ‘great first interview’

You ask around with your classmates who also were interviewed getting an idea of how it went for them and they report back 75% had a ‘great first interview’ but did not get called back for a second interview.

How much should you expect a second interview given you had a great first interview?

This time we’re going to think about these percentages as populations. Out of 100 people who were interviewed only 20 will move on to the second interview. Of the second round 19 out of 20 had a ‘great first interview’. Out of the 80 people who didn’t move on in the process, 75ish% or 60 people also had a ‘great first interview.’ So your expectations are that 19 out of the total 79 people who had a ‘great first interview’ will get to move on. Thats only 24% of candidates with a great first interview. Looks like you have a lot of friends on automated rejection island.

Thinking about it as populations is a great way to get your head around the math. ThreeBlueOneBrown made a great visual representation in the first part of his series about probability (the rest has yet to come):

But the most important takeaway from this is stop beating yourself up over every set back. It’s not that your llama story isn’t top notch. It’s the fact that so few people can actually move on to the next round. You can’t be the top candidate every time. But with enough interviews you will be the top candidate one of these times. It’s just a numbers game.