So, previously we talked about understanding not only the expected level of variables, but also the amount of variation that exists within those variables. And that's what really the focus if going to be in this session on randomness and probability. So the plan is let's make sure we're on the same page as far as why these concepts matter. And why they matter from a specifically from a marketing standpoint. We'll go into some background just to make sure that the probability foundations are clear. I'm going to pull a couple of examples from casino games because that seems to be the clearest way of being able to explain probability. And then we're going to relate that back to decision making in marketing consulting contexts. The framework that I had laid out previously. First we want to examine the relationships among variables whether those are categorical variables, whether those are quantitative variables. And we want to have a good understanding of how much uncertainty there is in those relationships. Because uncertainty is caused by a couple of factors. It could be things that we don't know about but it could also be things that are beyond our control. So, different sources of uncertainty we want to factor that into the decision making that we have and tie that to our evaluation model. For example, the level of demand, we might have a best guess for how popular products are going to be. But we don't know with 100% certainty what the level of demand is going to be for product. When we target customers with direct marketing. We've got the best guess as far as which customers are going to be receptive to our marketing materials. But we don't know with certainty which of those customers are actually going to respond to those marketing materials. So those are a couple of the places where we can see uncertainty affecting our decisions. To give you a few other contexts, maybe it's in the context of customer evaluation and we're trying to have a prediction for how much revenue are we going to be bringing in. Well that's going to depend on how many customers we sign up and how many customers we retain. And when we're making these forecasts, especially when we're making forecasts in the long run we don't know how many customers we're going to keep. Maybe we're going to have some months when a lot more customers drop out than we predicted. Maybe we're going to have some months where retention is better than we expected. So we've gotta deal with uncertainty when we're doing customer evaluation and net present value analysis. From an inventories management standpoint and forecasting. Again we don't know what demand is going to look like we don't know where interruptions in the supply chain might come in. If we're dealing with online advertising. Online advertising is typically done in an auction format. Whoever is willing to pay the most for a particular key phrase when we're dealing with search advertising well they're the ones who are going to get it. Which means it's all dependent on how much your competitors are going to pay for those key phrases. So your competitors' reactions may have an impact on your success in that context. If we're dealing with managing a project, what's going to affect the timeline until completion? If we've got a series of stages of a project that need to be completed, there's going to be a ripple effect if we have delays in one of those stages. So how much confidence do we have that the project is completed at each stage on time? So to give you a couple of specific context, the number of hits on a website on a given day. The conversion rates, so the number of people exposed to an ad. Of those people what fraction actually click on the ad? Investment returns, you have the lifetime of products, these are all just context where we have a best guess. But even though that's our best guess it doesn't mean that that is exactly the value that we're going to get every single time. You buy a new car, you buy a new phone. And how long until you have to take it in for repairs? Well hopefully it's a couple years, hopefully you don't have any problems. But, you might have problems with it. You might have to take that phone in two or three times for service. You might have bought a lemon off the used car lot, and now you gotta put more money into the repairs than you had anticipated. So, that's what we need, not just the understanding of what's our average return or what's our average lifetime. We also need to understand how much uncertainty is there around that best guess. Just to familiarize you with some of the jargon that we're going to use. Each observation or trial that we have can yield a different potential outcome. And what the probability refers to is if I were to run or if I were able to collect millions and millions of observations the probability is telling us the long-run frequency. Again, think of it as an average. But how likely is it that we are going to observe different values? Or how likely is it that we're going to observe different outcomes? Well the probability gives us that long-run frequency. How many outcomes do I actually observe meeting a criteria divided by the total number of outcomes I observed. Mathematically that's how we go about calculating probability is the number of outcomes that fit a particular criteria. So lets say event A, so how many of those outcomes correspond to event A divided by the total number of outcomes. So again calculated if we counting up the observations very similar to calculating an average. According to the Law of Large Numbers, assuming all of these outcomes are independent of each other. The more we collect observations, the closer and closer and closer that we're going to get to the probability of event A. So that longer on frequency corresponding to the probability of event A. What I mean by when I say independent outcomes. What I mean is that the outcome of event A being unrelated to the outcome of event B. So, for example your decision to purchase Coca Cola versus your decision to buy shredded cheese at the grocery store. Are the outcomes related to each other? If they're related to each other, I have an increased tendency to buy Coca Cola when I buy shredded cheese. Then these events are going to be dependent on each other. If they're unrelated then going to be said to be independent of each other. When we're interested in calculating the likelihood of two events happening. So how frequently do people buy Coca Cola and buy shredded cheese, that's the joint probability. The notation that we're going to use for the joint probability, it's going to be a probability of A and B occurring, or the intersection of A and B. That is what the upside down U is indicating. The intersection of event A and event B happening. Another term that you may come across is conditional probability. Given that an event has occurred. Given that I am buying Coca Cola on this trip. How likely is it that I'm going to buy shredded cheese? The notation we're going to use there, B with a vertical slash and then A, or being pronounced as the probability of event B given event A. Couple of rules, and this may be a little bit of a refresher for you. For any event A probability is going to fall somewhere between zero and one. If we have an exhaustive set of possible outcomes, the sum of those probabilities has to add up to one. All right. So if I only have two brands in the grocery store for soda, I've got Coca Cola and I've got Pepsi. What's the probability of buying Coca Cola plus the probability of buying Pepsi. And I've said I'm buying soda on this trip. That's going to add up to 100%. We might also talk about the complement, or what's the probability of A not occurring. Well, the notation for A not occurring would be a probability of A with a superscript c, can be calculated as one minus the probability of A. So if we think about this as what's the probability that somebody submits a complaint versus not submitting a complaint after bad customer service? What's the probability of a product being successful in one launch versus the probability of it being a failure? These are examples where they're the complements of each other. Either you choose to submit a complaint or you do not. Either the product is a success or it's deemed a failure. Well since they're the flip side of each other and the probabilities have to add up to one, that's where we get one minus the probability being the complement. Just to give a visual representation of this, one of the rules of probability is the probability of A or B occurring. And A or B, the notation for that, is the union of A and B or A then what looks like a U. And so how can this happen? Either event A can occur, or event B can occur. And that's what these first two pieces are indicated for us in this equation. But then if you think about the likelihood of A occurring. The likelihood of B occurring. Sometimes when A happens, B also happens. So, we're also double counting the probability of both of these events happening together. And so we actually have to subtract out the joint probability. So what this looks like visually is I've got the probability of A, I've got the probability of B. And the overlap between those circles, that's the probability of A and B. So what we want to calculate is how likely it is that A occurs? So that's the first sphere. How likely B occurs, so that's our second sphere. And that's the probability of A plus the probability B. But what we've ended up doing is double counting this shaded region, which is the joint probability of A and B. So that's why we've got to subtract that out. And then what we're left with is. The overall shaded area that's the probability of A or B occurring. All right so here just a couple of examples. You buy a particular brand at least once on your last two shopping trips. So either you bought it on the first trip or you bought it on the second trip. You also could have bought it, on both of those trips. You make a late, another example, you're late paying at least one of your bills. So, could be late on your mortgage, could be late on your car loan. Could be late on your student loans. Well, being late on any one of them. So we're just, all that we're interested is that you're late on at least one bill. Or if we look at the political context, what are the chances that the democrats control at least one chamber of congress? Could be that they control the house, could be that they control the senate, they could control both. Don't see that as being likely in the near future. So that's looking at addition, looking at the probability of A or B. We might also look at two events happening together, probability of A and B. And so that's where the multiplication rule comes into play. If A and B are independent of each other, the joint probability, the probability of A and B occurring. That's just going to be given by the product of A multiplied by the product of B. But what if there is a relationship between these? When A occurs, that changes the probability of B. Or when B occurs, that changes the probability of A. If you're looking for a more general multiplication rule. It can be phrased in terms of the probability of A occurring multiplied by the probability of event B given that A has occurred. It can also be phrased as the probability of B occurring multiplied by the probability of A given B. Both of these are going to be equivalent to each other. In fact, this is going to give us the basis for some of the work that we're going to do with what is referred to us as Bayes rule or Bayes theorem. So, if we're looking at events jointly occurring, being late on multiple bills, being late on two bills, or custom for a loan provider. The likelihood of multiple customers defaulted, well customer one default and costumer two default. And if you think about the multiplication rule of being about joint events, really the tip off to be using the multiplication rule is the phrase and, right. So probability of event A occurring and event B occurring. Whereas the addition rule, they keyword there is going to be or. So, either event A occurs or event B occurs. So let's work through just a short example. This is in the context of promotions in the workplace. We have the promotion broken down by gender. And if we wanted to calculate a couple of these probabilities. One probability would be the probability of promotion overall. So we can take the 324 people who are promoted, out of a total of 1200. It's going to give us 27%. In our dataset what fraction are women? So the probability of selectings of woman if we were selecting a person at random probability of selecting a woman would be the 240 So the probability of selecting a woman would be 240 divided by the 1200. And then the last piece being, given that we've selected a woman, what's the probability that she's promoted? Well, now we're saying, okay we'll we're focused out of the 240 women, only 36 are promoted. Tells us that given that an employee is a woman there's only a 15% chance of promotion.