Probability and Statistics


Probability and Statistics

Anna
Welcome. Today we’re connecting descriptive statistics with probability—the tools data scientists use to summarize data and make decisions when outcomes are uncertain. We’ll begin with a case study, then build probability from its basic definitions through conditional probability and Bayes’ theorem, and finish with the normal distribution.

Michael
The case study is a useful reminder that statistics is not just calculation. You’re given a dataset and asked to draw insights from it, using measures such as mode, mean, standard deviation, and coefficient of variation, along with histograms and box plots. You can calculate by hand, with a calculator, or in Excel; the goal is to interpret what the results say.

Anna
Here are some of the reported findings. The distribution of work scores was bimodal, with modes of 72 and 84. The coefficient of variation was reported as about 10.38 percent for work and 27.35 percent for promotion. A histogram of promotion scores had its greatest concentration in the 50-to-60 and 60-to-70 score intervals.

Michael
And box plots let you ask different questions of the same data. The work-score box plot was described as left-skewed, and the promotion box plot showed two outliers. Comparing work scores across hospital types, the veterinary administration group was identified as having the highest median, about 82. When promotion box plots for the groups were shown together, the reported total was four outliers.

Anna
The broader lesson is to say exactly what a graph or summary answers. A median describes the middle score; a histogram shows where observations are concentrated; a box plot helps compare medians, spread, skew, and outliers. Calling a median ‘best’ only makes sense if higher scores mean better performance, as they do in this score example.

Michael
Now we move from describing observed data to decision-making under uncertainty. We regularly face questions about what may happen next, even when we cannot know the outcome for certain. Probability gives us a structured way to express how likely an event is, and data can help us estimate that likelihood.

Anna
There are several ways to arrive at a probability. Empirical probability uses observed data or relative frequencies: for example, if a machine’s operating records show how often it broke down, those records can help estimate the chance of a breakdown. The estimate depends on the evidence available, and new observations can lead us to revise it.

Michael
Subjective probability is based on judgment, such as an expert’s assessment when relevant data are not yet available. Experts can provide a useful starting point, but their opinions can also reflect biases or mistaken assumptions. As more objective information arrives, we can update that initial judgment.

Anna
Classical, or a priori, probability applies when we can specify the possible outcomes and treat them as equally likely. Drawing a card from a well-shuffled deck is the standard kind of example. In practice, the important thing is to understand what evidence or assumptions support a probability—not just to quote a number.

Michael
The basic definition is a ratio: the number of outcomes favorable to an event divided by the total number of possible outcomes, when those outcomes are equally likely. A probability is a pure number from zero to one. Zero represents an impossible event and one represents certainty; values in between express degrees of likelihood.

Anna
Probability also has a useful vocabulary. An experiment is the process we use to observe a phenomenon, an outcome is a result of that process, and the sample space is the set of all possible outcomes. An event is the outcome or group of outcomes we’re interested in. Being clear about the sample space is essential before counting favorable outcomes.

Michael
Two events are mutually exclusive if they cannot happen at the same time. Drawing one card, for instance, cannot produce a card that is both a king and a queen. For mutually exclusive events, the probability of A or B is the probability of A plus the probability of B.

Anna
But many events overlap, so simply adding their probabilities would count the shared outcomes twice. The general addition rule is probability of A or B equals probability of A plus probability of B minus the probability of both A and B. With a deck of cards, there are four kings and thirteen diamonds, but one card is both a king and a diamond. So the number of cards that are kings or diamonds is 4 plus 13 minus 1, or 16 out of 52.

Michael
That overlap correction is the key idea. Another way to see it is to count outcomes in non-overlapping groups: kings that aren’t diamonds, diamonds that aren’t kings, and the king of diamonds. Each card is then counted exactly once.

Anna
Independence is a different relationship. Two events are independent when the occurrence of one does not change the probability of the other. For independent events, the probability that both occur is the product of their probabilities. If the events are dependent, we need to account for how the first event changes the possibilities for the second.

Michael
That leads to conditional probability: the probability of B given A. Once A has occurred, we restrict our attention to the outcomes in A and ask what fraction of those also satisfy B. In symbols, when the probability of A is greater than zero, that is the probability of A and B divided by the probability of A.

Anna
A two-way table can make this reasoning easier. Think of its rows and columns as combinations of attributes, such as drinks or does not drink, and smokes or does not smoke. The margins give totals for each attribute, while the interior cells show combinations. This lets you work with counts or proportions without losing track of what population a probability refers to.

Michael
Consider the class example: there are 37 men and 33 women, for 70 people total. Thirty-six are teetotalers, so 34 drink. Of those who drink, 13 men and 7 women do not smoke, giving 20 drinkers who do not smoke. The remaining 14 drinkers both drink and smoke, so the probability that a randomly selected person both drinks and smokes is 14 out of 70, or 0.20.

Anna
Notice that some other facts in the problem—such as the number of non-smoking women or men who smoke but do not drink—aren’t needed for that particular answer. A good solution identifies which information answers the question, rather than trying to use every number provided.

Michael
Here’s another overlap example. In a group of 600 people, suppose 100 are single, 400 have college degrees, and 60 are both single and degree holders. The probability of being single or having a degree is based on 100 plus 400 minus 60, which is 440 people. So the probability is 440 divided by 600.

Anna
The same addition rule works with probabilities rather than counts. Suppose the probability that sales increase is 0.25, the probability that interest rates increase is 0.74, and the probability that at least one of those events happens is 0.89. Rearranging the addition rule gives the probability that both happen: 0.25 plus 0.74 minus 0.89, which is 0.10.

Michael
Bayes’ theorem is especially useful when we want to reverse a conditional probability. We might know the chance of a test result given a true condition, but want the chance of the condition given the test result. Those are not the same question, because the test result can also occur when the condition is absent.

Anna
Take the oil-well example. The prior probability that a well will be successful is 0.40, so the probability it will be unsuccessful is 0.60. Historically, 60 percent of successful wells had a detailed test, while 20 percent of unsuccessful wells had one. Out of a notional 100 wells, that gives 24 successful wells with a test and 12 unsuccessful wells with a test.

Michael
So 36 wells would have received a detailed test, and 24 of those would be successful. The probability of success given that a well received the test is therefore 24 divided by 36, or two-thirds—about 0.667. That is higher than the prior success probability of 0.40, so the test result changes our assessment.

Anna
The same reasoning applies to defective products. Suppose an old machine makes one quarter of the output and has a defect rate of 23 percent, while a new machine makes three quarters of the output and has a defect rate of 8 percent. If an item is known to be defective, the chance it came from the new machine is the new machine’s defective output divided by all defective output: 0.08 times 0.75 divided by that amount plus 0.23 times 0.25.

Michael
That works out to 0.06 divided by 0.1175, or about 0.511. Even though the new machine has the lower defect rate, it produces more items, so the answer depends on both the machine’s defect rate and its share of production. That’s why the base rates matter in Bayes-style reasoning.

Anna
Next is the normal distribution, often called the bell curve. It is a continuous, symmetric distribution with its mean, median, and mode at the same central value. Its shape is determined by two parameters: the mean, which sets the center, and the standard deviation, which describes spread.

Michael
The curve’s symmetry means matching distances to the left and right of the mean have equal areas. Its tails get closer and closer to the horizontal axis without meeting it. For a continuous distribution, probability over an interval is represented by the area under the curve over that interval—not by the height of the curve at a single point.

Anna
A convenient way to compare values across normal distributions is to standardize. The z-score is the observed value minus the mean, divided by the standard deviation. After that transformation, the distribution has mean zero and standard deviation one, so problems measured in kilograms, dollars, or other units can be handled on the same standard scale.

Michael
Let’s apply that to cereal packages. Suppose package weight is normally distributed with mean 0.295 kilograms and standard deviation 0.025 kilograms. For a weight of 0.280 kilograms, the z-score is 0.280 minus 0.295, divided by 0.025, which is negative 0.6.

Anna
The area to the left of that value is about 0.274, so roughly 27.4 percent of packages weigh less than 0.280 kilograms. For a weight of 0.350 kilograms, the z-score is 2.2. The probability of weighing more than that is the upper-tail area, about 0.014, or 1.4 percent.

Michael
For the probability of a package weighing between 0.260 and 0.340 kilograms, the z-scores are negative 1.4 and positive 1.8. Subtract the cumulative probability to the left of negative 1.4 from the cumulative probability to the left of positive 1.8. The resulting area is about 0.883, or 88.3 percent.

Anna
The inverse question is useful too: what package weight would 80 percent of packages exceed? If 80 percent are above the weight, then 20 percent are below it. The 20th percentile of the normal distribution with this mean and standard deviation is about 0.274 kilograms, or 274 grams.

Michael
Software such as Excel can evaluate these normal probabilities or find a percentile directly. When you use a cumulative normal function, it gives the area to the left of the specified value. For an upper-tail question, subtract that cumulative area from one; for a probability between two values, subtract the lower cumulative area from the higher one.

Anna
And it’s worth checking the graph as well as the calculation. Sketching the curve and marking the mean, cutoff values, and shaded area makes it easier to catch a reversed tail or a mistaken interval. The standardization is helpful, but understanding which area answers the question is the real skill.

Michael
So we’ve moved from summarizing a dataset with descriptive statistics to reasoning about uncertainty. Define the event and sample space, choose the probability approach that fits the evidence, account for overlap and conditions, and interpret the area under a normal curve carefully. Those habits make probability and statistics far more useful for data-driven decisions.

Ask anything
We've read this whole study set, so questions about it get the best answers.