« All Episodes

Decision-making Skills: Two Types of Probabilistic Thinking

Published 6/21/2021

When you think about probabilities, you likely think in one of two ways. We'll talk about both of these models for probabilistic analysis, their drawbacks, and decision-making in the face of uncertainty.

✨ Sponsor: Square

Payment acceptance can be one of the most painful parts of building a web app for a business. When implementing checkout, you want it to be simple to build, secure, and slick to use. Square’s new Web Payment SDK raises the bar in payment acceptance developer experience and provides a best-in-class interface for merchants and buyers.

Learn more about integrating with Square’s Web Payments SDK at http://squ.re/developertea

📮 Ask a Question 

If you enjoyed this episode and would like me to discuss a question that you have on the show, drop it over at: developertea.com. 

📮 Join the Discord

If you want to be a part of a supportive community of engineers (non-engineers welcome!) working to improve their lives and careers, join us on the Developer Tea Discord community by visiting https://developertea.com/discord today!

🧡 Leave a Review

If you're enjoying the show and want to support the content head over to iTunes and leave a review! It helps other developers discover the show and keep us focused on what matters to you.

Transcript (Generated by OpenAI Whisper)

Decision making is one of the most critical skills that you'll use basically your whole life. If I had to sum up what I hope for the listeners of this show, it is to learn how to make better decisions. Yes, of course, finding clarity, perspective, and purpose is the goal of Developer Team. But the point of finding those things is ultimately to be able to use them to make tangible differences in your life through decision making. The vast majority of what you will experience in your life, for the most part, for most people listening to this show, there are certainly experiences. There are certainly exceptions, but for most people listening to the show, the majority of what you experience will be at least influenced heavily by your decisions. Now, I do want to make it clear that not everybody would experience the same things given the same decisions. There are problems that we have to face at a higher level as a society, as a culture. But your decisions make a huge difference in your life. Given two paths, you can have wildly different outcomes based on your decisions. So, because of the importance of decision making, it makes sense for us to spend basically all of our time on this show talking about different ways to make better decisions. But one of the most important things to understand about decision making is that decision making is about guessing. Decision making is about predicting. It's about imagining a future after the decision is made. Unless you are making decisions based on pure chaos. If you're trying to incite a chaotic response, or perhaps... Perhaps even if you are trying to incite a chaotic response, you're still having to predict that your decision in that moment will actually incite that response. So, all decision making really is about trying to predict what will happen in the future. And the most reasonable ways to predict what will happen in the future... Well, this is covered by a lot of the things that we talked about in the past on this show. But I want to talk... I want to talk about a specific set of two ways of thinking about prediction. And specifically, when we say prediction in this case, we're talking about running some kind of predictive probability. Alright? So, there's two different branches of probabilistic thinking that I want to talk about on today's show. And again, the whole point of this... Why to refine our decision making? To be clear, nobody can actually predict the future. But, some guesses are better than others. If you had perfect clarity on what would happen in the future, then decision making wouldn't even really be a problem. You would know exactly what decisions to make in order to get certain things to happen. In order to change some future state. If you could see all of those... If you could see all of those possible outcomes, then you would make... You know, whatever decision you want to make to affect whatever change you want to affect. So, because we can't... Because we can't see the future. We can't predict the future perfectly. We have to use some kind of way... Some method to determine our future. And this is one thing that sets humans apart from other animals, other species. You know, there are some species that can run a few kind of probability. They can be trained into believing or understanding that if they do a particular action, then a particular response will occur. But, not any other species can understand multivariate possibilities. The decision tree. This is a uniquely human thing that we can imagine. In a different reality. Alright, our imagination sets us apart. And this is a part of how we are able to survive. This is critical for us to understand where this comes from. We're able to survive because we can predict with some level of slightly better accuracy than another version of us that couldn't predict. We can predict... A bad outcome and avoid it. Or we can predict a good outcome and seek it. Again, not perfectly, but better than someone who doesn't have imagination... A species that doesn't have imagination. Okay. So, let's talk about these two different kinds of probability. And we're going to talk about them through the lens of fatherhood. For many people who are listening to this podcast right now, Father's Day was yesterday. And when my wife and I were expecting both of our children, people would often ask us, Do you think your child will be a male or female? Do you think you're going to have a boy or a girl? I want to give you some time to think about this question. And imagine how you would answer the question yourself, given the knowledge that you have. And try to answer it however you would. While you're doing that, we're going to take a quick break. And talk about today's sponsor, Square. Having built a lot of web apps myself, one of the most painful parts of building a web app is taking payments. When you're implementing a checkout, you want it to be simple to build and maintain. You want it to be secure and slick to use. Square's new web payment SDK raises the bar in payment acceptance developer experience. And provides a best-in-class interface for merchants and ultimately for customers. You can build a customized branded payment experience with the web payments SDK and never miss a sale. Deliver a highly responsive payments flow across web and mobile that integrates with credit and debit cards, digital wallets like Apple Pay and Google Pay, ACH bank payments, and even gift cards. For more complex transactions, follow-up actions by the customer can include completing a payment authentication step, filling a credit line, application form, or doing background risk checks on the buyer device. Developers don't even need to know if a payment method requires verification and if so, what type. Square hides all of that complexity from the seller and guides buyers through the necessary steps. You can get started with the new web payments SDK easily. Simply include the web payments SDK JavaScript, flag an element on the page where you want the payment form to appear, and then attach hooks for your customer. Learn more about integrating with Square's web payments SDK at squ.re. A huge thank you to Square for their support of DeveloperT. Of course, it can be exciting to try to answer this question, to try to influence the outcome, and toension the players evolution of your platform and platform evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution evolution and talk about this from a very calculated and cold perspective, the statistical perspective or probabilistic perspective. Really, there are two schools of thought. The first is thinking in a vacuum of sorts, looking purely at the data that you have available about the specific event that you're trying to predict. This idea is very simple. We look at enough iterations of a given question, enough occurrences of that specific event, and we look at the outcomes of those occurrences, and we use that to inform what we guess about the future. If, let's say, we had already had three children and all of those children were female, then we might use this approach to predict that we're going to have a fourth female. Another version of this, very similar to this, let's imagine that we hadn't had any children, we might use the same concept to inform us by broadening that to say that all humans are included in this particular question. We'll use the rate or the probability of having a boy versus a girl that is common to us, that's common to humans. The critical factor here is that we're looking at some number of samples. We're using some previously collected information and we're basing our probabilities off of the probabilities found in that collection of information, in the data that we already have. Importantly, in this case, in the data about the same event, the same kind of measurement that we're looking at. In statistics, this is called a frequentist approach. In other words, how frequently does outcome A, occur versus outcome B? It turns out that on a global scale, humans tend to have slightly more boys than girls. So if you were to have no other information available, and if you were taking the frequentist approach specifically, then your most rational answer is that it's likely to be a boy. However, if you were to take in more information, for example, a quick Google search led me to this article that says that men are more likely to father female offspring during high-level soccer training. And I'm sure there's about a thousand or maybe a million more articles like this one that you may use to try to predict what sex your baby is going to be. So we can imagine that if I, as the father, was an intense soccer player, then there's some percentage more likelihood that I could have a female offspring rather than a male offspring. All right, so if we were to take in, let's say, a female, let's say three or four or five of these different studies, we may be able to predict differently what the baby's sex is going to be, even in the absence, and here's the critical thing, even in the absence of the original data. This is called Bayesian statistics, and without getting into the math of the difference between these two, really what we're talking about is, in one case, in the frequentist statistics approach, you have only the information about the event that you're measuring, and then in the Bayesian statistics approach, you're taking in all relevant information that you can. So we're going to set aside the kind of fatherhood story here, and instead we're going to look at other stories that might be relevant to our jobs as software engineers or other kind of predictions. For example, will this language catch on? Will this language catch on? Well, if we look at all of the languages that have caught on versus all the ones that haven't, we might have trouble finding the information about that. But maybe we can use some other information to predict this. Maybe we can use theory rather than observation. This is the critical point that I want you to take away. Theory and observation, both, both approaches are trying to get to the same level. Answer. Both approaches are trying to get to the same answer. If you were to use perfect theory, if you were to not have any kind of bias, and we'll talk about that in a moment, in any of your measures on the Bayesian side, and all of your modifiers and all of the prior knowledge that you have is accurate and you have all the right inputs, and then if you were to have a clean set of data that perfectly represents the key to success, cases that your Bayesian information represents, then both of those should reflect the same information because both of these are trying to guess the truth. Both of these approaches are trying to get to the same thing. But here's the critical point that we need to understand, right? Because we're trying to get to the same thing, we have two different approaches. Why do these two different approaches exist? Sometimes one approach is better than the other. Based on the information that you have available, for example, maybe you have a question that you want to answer, or maybe you don't have a large number of data points to glean your information from, right? Or maybe you don't have a lot of domain-specific knowledge to use in your prior understanding. There are times when both of these approaches are necessary. And when your real data is showing a divergence, in other words, when one approach is working and another approach is not, one approach is guessing properly and the other approach is not guessing properly, then one of two things is happening. Either there's an anomaly in the data, or an anomaly that your frequentist approach is picking up on but that your Bayesian approach can't pick up on, or your Bayesian approach has some kind of distortion in it. Your ability to... your ability to predict based on theory is using the wrong theory. And why is this critical? Why is it important to understand what happens when these two things diverge? And the fact that they're trying to get to the same place. This is critical because we need to understand how to refine these systems. These statistically driven ways of thinking about future events, if we're going to use them, if we have a broken set of priors, a broken set of prior information that we're using to make decisions, we should be able to inspect that. If we are experiencing an anomaly that our frequentist approach is able to to kind of change along with, because we're just measuring the data that we have, that diverges, it diverges away from our theory, then we should probably investigate why is this diverging? Perhaps we need to update our theory to understand the anomalies better. No matter what approach you take to decision making, and more specifically, predicting the outcomes of those decisions, keep in mind that there is no perfect system. And that you make decisions based on the information you have available. If you make a decision based on certain information, then you've made the right decision despite the outcome. We can't control the future with our decisions. We can only influence it. Thanks so much for listening to today's episode of Developer Tea. Thank you again to today's sponsor, Square. Get started with the Web Payments SDK JavaScript by heading over to squ.re slash developer tea right now. Thanks so much for listening to this episode. If you enjoyed this discussion on Developer Tea, then you'll probably enjoy our community as well. Head over to developertea.com slash discord to join the Discord community. That's developertea.com slash discord. This show can only thrive and continue to exist because of you, the listener. So first, thank you. Thank you for listening to this show. Week in and week out, we've done approaching a thousand episodes. We should hit a thousand episodes this year, which is mind boggling to me. But we also can only thrive if we're able to live our lives. So thank you so much for listening to this show. We'll see you next time. Bye. Bye. Bye. Bye. Bye. Bye. Bye. Bye. Bye. Bye. Goodbye. Goodbye Camp Camp to go and leave a rating and review in whatever platform that you use that supports ratings and reviews. The biggest one, of course, is iTunes. And there are others as well. Thank you so much for supporting the show. And until next time, enjoy your tea.