Sunday, May 22, 2016

My Ten Million Dollar Robot was written on May 18th, 2016, it can be found it's entirety below.


My Ten Million Dollar Robot
Thoughts on expected value and probabilistic thinking.
Andrew Slack


I began to explore the idea of expected value in 2007 when I began a relatively short foray into online poker (Black Friday in April 2011 was the day the U.S. government shutdown the three largest poker websites, sidelining any pipe dreams of playing cards for a living I had once had).  Many people assume that poker is a game of psychological warfare, with a player’s poker face, or lack thereof, being the key to his success or downfall.  While poker does dictate a need for a steady demeanor and a lack of physical tells, it is a player’s ability to calculate expected value and make decisions based on well forecasted ideas of how their opponents play that actually decides who goes home with the money and who leaves the table broke over the long run.  If you were given the choice to invest in a player that has a knack for picking up physical tells or to back a player with a background in game theory, probability, or economics, your money should be given with haste to the intellectual. In poker, and in much of life, math reigns supreme.
Expected value is a term used a lot in the poker world and at this point it’s important we give it a definition.  In the most basic sense, “expected value is a predicted value of a variable, calculated as the sum of all possible values each multiplied by the probability of its occurrence”1.  Let’s look at an example, I offer to flip a fair coin with you and the following rules apply:
  1. If the coin lands on heads I will give you 110 dollars
  2. If the coin lands on tails you will give me 100 dollars
To calculate your expected value (EV) we take the sum of all possibilities values.  Since a fair coin offers a 50% chance of landing on either heads or tails, we assign (.5) as the probability for each result and input the value that each result has been assigned (+110 for heads, -100 for tails) and end up with an equation like this:


(.5)(110) + (.5)(-100)= 5


Our expected value of this experimental coin flip is a net gain of five dollars.  In simpler terms we may write EV = 5.  
The coin flip is a simplistic example of expected value, most ev calculations in life will be much more nuanced and will require accounting for extraneous factors.  Most situations will not offer a 50/50 shot, and there may be an overlay of money or value at stake.  Let’s look at a slightly more complicated example, a poker hand in which we are drawing to a flush with one card to come.  We will assume the following:
  1. There is already 200 dollars in the pot
  2. We are being asked to call 50 dollars to see the final card
  3. We have 9 cards that will give us a winning hand, this has a probability of roughly 18%
  4. If we do not catch one of those cards we will lose the hand, an 82% chance of loss
The calculation looks very similar to the coin flip example, when we call 50 we have an 18% chance to win 200 dollars, and an 82% chance to lose 50 dollars.


(.18)(200) + (.82)(-50) = -5


This wager would net us a theoretical loss of 5 dollars and would be what we deem -EV, a wager to be avoided.
Calculating expected value on coin flips and poker hands is interesting, and if done with enough mindful practice could turn you into a winning poker player, but this paper aims to focus on EV as a broader concept that can be applied to all aspects of your life.  Whether to spank your child or not, buy new tires, or eat the candy bar in your desk drawer can all be put through EV calculations.
Expected value is only one of the keys you will need to create these calculations. Learning to think probabilistically is just as important.  Probabilistic thinking is simply using all the information you know in a rational way to come up with the probabilities of various results to a variable.  A probabilistic thinker would not tell her spouse “It is going to rain today” because they saw a forecast that said there was a 75% chance of rain.  Instead they would understand that three out of every four days that the region is under these conditions we can expect rain, and one out of four we will not.  A probabilistic thinker would not be all that surprised to look outside and find that it never began to rain, though he expected it was much more likely that it would.  Thinking in terms of “It will rain/it won’t rain” when given a probabilistic scenario is far too simple.  Probabilistic thinkers are not ashamed of uncertainty, they simply use the probabilities of various results to come to a conclusion that offers them the most value given the circumstance.
Homo Economicus (Econ) is the idea of a person who acts completely rationally, without any bias, when making decisions.  By definition a true Homo Economicus is completely rational and also narrowly self-interested2, but for the purpose of this experiment we will focus on their completely rational nature.  When coming up with calculations that will affect the value of your life, it may behoove you to learn about the various biases that affect human thought processes and attempt to counteract them, to think more like an Econ would.
To demonstrate the idea of EV and probabilistic thinking on a larger scale I have proposed the idea of the ten million dollar robot which may or may not require a one million dollar software patch. This robot is the product of a technology company and is worth exactly 10 million dollars.  Recently it has come to the attention of the lead engineer that there is the possibility of a catastrophic malfunction that would destroy the robot entirely, creating a 10 million dollar loss for the company.  The probability of this malfunction is currently being assessed by a group of analysts.  He has also discovered that this problem can be resolved with 100% certainty for one million dollars.  Should the company invest one million dollars to ensure their robot does not have an irreparable meltdown?  
I hope at this point you realize you don’t have nearly enough information to make that decision.  If the probability of the malfunction is deemed to be less than 1% then committing 1 million dollars to patching it would be an incredible blunder.  On the other hand if it is discovered that this malfunction will take place with 99% certainty than not patching it immediately would be a much larger blunder, by a magnitude of nearly ten.  It’s now time to calculate the EV of patching our robot under a variety of different malfunction probabilities.  To do so we will use the following rules:
  1. If we do not patch the robot and it malfunctions it will cost our company exactly 10 million dollars
  2. If we decide to patch the robot it costs exactly 1 million dollars
  3. We are not considering any extraneous factors (loss aversion, likelihood of job loss for each decision, etc.)  We are looking at pure EV as an Econ.


As an example let’s assume our engineers analyze the data and tell us that their best forecasting model calculates that there is a 40% chance of the malfunction occurring.  We now have two choices: pay one million to patch the robot, or do nothing.  
Our expected value of doing nothing looks like this:


(.4)(-10,000,000) + (.6)(0) = -4,000,000

While our cost of fixing the robot looks like this:


(1)(-1,000,000) = -1,000,000


Neglecting to patch our robot would theoretically cost us the difference between these two values, or $3,000,000.  Making our decision to invest in the one million dollar patch incredibly easy, even though the chance of the malfunction was less than 50%.
But what if the malfunction is relatively rare, say somewhere between .5% and 15%? Table 1 calculates all the expected values for every probability between those two values to show us exactly at what point we should shift from a preference to forego the patch to a preference to invest in it.
Table 1
Probability
Cost of Robot Malfunction
Expected Value Calculation
Cost of Patch
Difference
.5%
-$10,000,000
-$50,000
-$1,000,000
$950,000
1%
-$10,000,000
-$100,000
-$1,000,000
$900,000
2%
-$10,000,000
-$200,000
-$1,000,000
$800,000
3%
-$10,000,000
-$300,000
-$1,000,000
$700,000
4%
-$10,000,000
-$400,000
-$1,000,000
$600,000
5%
-$10,000,000
-$500,000
-$1,000,000
$500,000
6%
-$10,000,000
-$600,000
-$1,000,000
$400,000
7%
-$10,000,000
-$700,000
-$1,000,000
$300,000
8%
-$10,000,000
-$800,000
-$1,000,000
$200,000
9%
-$10,000,000
-$900,000
-$1,000,000
$100,000
10%
-$10,000,000
-$1,00,000
-$1,000,000
$0
11%
-$10,000,000
-$1,100,000
-$1,000,000
-$100,000
12%
-$10,000,000
-$1,200,000
-$1,000,000
-$200,000
13%
-$10,000,000
-$1,300,000
-$1,000,000
-$300,000
14%
-$10,000,000
-$1,400,000
-$1,000,000
-$400,000
15%
-$10,000,000
-$1,500,000
-$1,000,000
-$500,000


The Difference column displays the cost of patching the robot given every probability listed.  In the first row, with a malfunction probability of .5% the patch theoretically costs our company $950,000.  At the bottom of the table, when our probability of malfunction reaches 15% the patch theoretically saves our company $500,000.  As the probability of disaster rises, neglecting the patch costs our company $100,000 for every rise in probability of 1% (and can be calculated for any value, i.e. a probability of rise of .1% offering $10,000 of value to the patch).
If our analysts came to us with a malfunction probability of 10% we would be completely indifferent as to whether to invest in the patch or not.  A truly rational thinker, looking only at the numbers, would in fact support the patch fully at a 10.1% chance of failure and vehemently oppose it at 9.9%
This chart looks nice and our robot issue seems to be fairly easily solved, but in the real world losses hurt much more than saving money, by a factor of two or more3.  Kahneman, Knetsch, and Thaler conducted an experiment in which half the students in a group are given a mug with their university’s logo on it, and half the students are given nothing.  The two groups of students then take a survey in which they indicate how much money they would need to be given to sell the mug (for the mug havers) or how much they would be willing to pay to attain the mug (for the mug wanters).  This experiment can be easily replicated at your local college’s psych department and the results are pretty clear: people require close to twice as much money to lose something than they are willing to pay to gain the same thing.  We can see the same phenomenon when asking people how much they would have to stand to win to risk $100 on a coin flip.  How much would you require?  If you answered a number close to $200 you are not alone, in fact you are in the vast majority.  An Econ would happily take this bet being offered $101 to their $100 assuming they had no risk of ruin and were not incurring an opportunity cost to take the wager.  They would be overjoyed to be offered $110 (as in our previous example, this would theoretically be worth five dollars to them).  Yet real people are not Econs, and they require substantially more money to be willing to risk $100, this is the Loss Aversion Bias in it’s most basic form.
How can we account for the pangs of loss in our robot experiment?  If we create a hypothetical loss aversion value (2), or LAC (loss aversion coefficient) to account for this phenomenon we could recreate the equations so that they look something like this


(%)(-$10,000,000)(2) - (-$1,000,000)


Plugging any probability value into this equation simply doubles the EV calculated value for the catastrophic malfunction.  Some new values are listed in table 2 below:









Table 2
Probability
Cost of Robot Malfunction
Loss Averse Expected Value Calculation
Cost of Patch
Difference
3%
-$10,000,000
-$600,000
-$1,000,000
-$400,000
4%
-$10,000,000
-$800,000
-$1,000,000
-$200,000
5%
-$10,000,000
-$1,000,000
-$1,000,000
0
6%
-$10,000,000
-$1,200,000
-$1,000,000
$200,000
7%
-$10,000,000
-$1,400,000
-$1,000,000
$400,000


In a company with unlimited funding, being ran by completely rational thinkers, this table would never be used, it gives up way too much value and tells us that we should be happy to implement the patch at a 6% probability of malfunction, even though in the real world this would have a theoretical cost of $400,000.  Recreating the equation with a loss aversion value does have it’s merits though, a company can place any value in that spot after coming to their own conclusion about how loss averse they want to be.
There is also a theoretical scenario in which you may want to give up some EV and place a value less than one in the risk aversion value place.  If patching the robot will take up time or resources from other projects it is possible that an engineering group would want to give up some theoretical value to avoid patching the robot.  Opportunity costs are the theoretical losses we take by investing funds or time into one project or opportunity instead of another.  If we invest one million dollars to patch the robot that could have been invested into a financial instrument with a return on investment of 10% over the same time period we are really paying $1,100,000 to patch the robot and thus our breakeven point would be 11% chance of malfunction.  
In the real world we have to account for more unknown variables than a simple  monetary calculation provides.  A chief engineer would be far more likely to be fired from his job (and possibly blackballed from his industry) by a catastrophic failure of the robot than if he happened to spend $1,000,000 fixing it even if it didn’t really need it.  How much value he would find in “overpaying” for the patch to ensure he didn’t have to face the board of directors with a $10,000,000 paperweight would depend on his real world circumstances, but I imagine many real world, naturally irrational, engineers calling for the patch at a probability of 1%, and as much as I’d like to, I really can’t blame them.
If you assume that the robot also has some potential for future earnings or funding assuming it does not malfunction, then we can replace the ten million dollar cost with any reasonable number we come up with and change the equation.  If our potential earnings are forecasted to be $100,000,000 then patching the robot at a 1.01% chance of malfunction would be +EV.  If the robot is the cornerstone of a multibillion dollar round of funding for our company, then patching the robot at almost any non-zero value becomes a necessity.
I mentioned earlier you could start thinking probabilistically, and creating EV calculations for almost any scenario in life in which probabilities are involved and values differ for various outcomes.  EV does not always have to be put in monetary terms, if we can come up with a reasonable life expected value (lifeEV, or LEV) number we can calculate EV for everyday decisions.  This requires abstract and honest thought when assigning life value points to different decisions or outcomes.  Let’s look at a hypothetical scenario in which we are deciding whether or not to eat the candy bar in our desk drawer assuming the following conditions:
  1. We create an assume a life value (LV) maximum of 100 in which a self reported 100 means a state of pure bliss in which a person could not possibly be any happier and a reported LV of 0 means complete and utter despair.
  2. We come upon our candy bar decision when we are self-reporting a LV of 50.
  3. We are on a calorie restricted diet in which we are not supposed to be eating junk food.  We feel guilty when breaking our diet and it has a negative effect on our LV.  How negative we feel depends on our current mood, if the calories for the candy still kept us within our diet or not, and any other factors affecting our guilt.
  4. We enjoy candy and, at least momentarily, it adds value to our life.  Depending on how hungry, bored, or emotional we are it may add more or less value.
Now we simply need to calculate honestly and as rationally as possible a value for the negative impact the guilt will have and the positive value that the candy bar will have.  For our example let’s assume that eating a candy bar on average offers 5 LV points, and the guilt we feel from eating it costs us 15 LV points.  This by itself would not require an EV calculation, you could simply look at the difference between the two values and see that eating the candy bar would drop your self reported LV from 50 to 40, an obvious decision to avoid.  But what if we only feel guilt x% of the time we eat a candy bar, or the value candy adds to our life is dependent on extraneous factors that can be placed into a coefficient.  A life EV equations may look like this:


(% chance we feel guilty)(-15) + (Candy value coefficient)(5) =


If we come into work and eat sensibly throughout the day, even planning ahead to eat our candy bar, we will not feel guilty.  Our LEV calculation looks like this:


(.00)(-15) + (1)(5) = 5


Eating the candy has added 5 points of value to your life.  Your coworkers will thank you for taking a snack break as you become more prone to smile and your productivity rises.
Now let’s look at an example on the other end of the spectrum.  You’ve already blown your diet today and even though you are not having a particularly bad day at work you find yourself bored, yet unhungry.  Under these circumstances you find that the candy value coefficient is actually less than 0, it is not even serving the basic need of satiating hunger and we recognize with 100% certainty we will feel guilty, thus we find an equation like this:


(1)(-15) + (.5)(5) = -12.5


Eating the candy bar under these circumstances would be an egregious error, dropping your LV to 37.5.
Finally let’s look at circumstance in which we are not sure if we will feel guilty or not, and the candy bar will both give us a slight sugar rush and satiate some mild hunger.  We have stuck to our diet decently well this day but eaten most of the allotted calories we usually allow ourselves by this point, by eating the candy bar now we know we will have to eat less at dinner later in the day.  We also realize that while we are not starving, we are a little bit hungry and it’s possible it is affecting our mood and work.  We roughly calculate that we will feel -15 points of guilt 40% of the time and that eating the candy bar is 25% more valuable to us than usual given the circumstances.  Our equation looks like this:


(.40)(-15) + (1.25)(5) = .25


Eating the candy bar offers .25 of a point to your life value.  If you felt you had accounted for every factor in your decision and had an accurate idea of how often you would feel guilty, the Econ in you would be wise to eat the candy bar.  If you felt like there was a reasonable margin for error in that you undervalued your guilt percentage or overvalued the candy coefficient, you would be wise to save the calories.


Humans are naturally irrational, and that is ok.  The idea of Homo Economicus is purely theoretical (and thankfully so, a true Econ only cares about their personal EV with complete disregard for everyone else).  But understanding the importance of probabilistic thinking, and how your decisions should change given various probabilities of an event will help you to make more rational decisions in your life and should contribute to your overall Life Value.


























1 Oxford English Dictionary
2 Rittenberg and Trigarthen. Principles of Microeconomics: Chapter 6. pp. 2 [1] Accessed June 20, 2012
3 Kahneman, Knetsch, and Thaler (1991).

No comments:

Post a Comment