1. Home
  2. Explore
  3. Statistics
  4. Probability for Data Science

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Probability for Data Science

Speaker 1Speaker 2

Probability for Data Science

20:10
0:00-20:10
  1. Corey

    Welcome to our introduction to Probability for Statistics and Data Science. The course instructor, Viktor, brings a business background and a strong interest in applying mathematics, statistics, and probability to real-life problems. The goal is to build the fundamentals that learners will need before moving on to topics such as machine learning and deep learning.

  2. Maria

    And those fundamentals are useful well beyond a classroom. People face uncertain outcomes all the time, from deciding whether a risk is worth taking to making business choices about research investments, mergers, or buyouts. Probability gives us a way to describe and compare how likely different outcomes are.

  3. Corey

    At its simplest, probability is the chance that something happens. More formally, it is the likelihood of an event occurring. An event can be one specific outcome, like rolling a four, or a collection of outcomes, like rolling a number divisible by three.

  4. Maria

    And an event is defined in relation to a sample space: the set of all possible outcomes. For a coin toss, the sample space is heads and tails. For a standard six-sided die, it is one, two, three, four, five, and six.

  5. Corey

    We usually express probabilities as real numbers from zero to one, rather than as percentages or fractions. A probability of one means the event is certain, and zero means it is certain not to happen. Values between them express different degrees of likelihood: the higher the number, the more likely the event.

  6. Maria

    For example, twenty percent can be written as 0.2, and one fifth is also 0.2. A lottery win is far less likely than winning a coin toss, and probability lets us quantify that difference instead of just saying one seems unlikely and the other seems likely.

  7. Corey

    For equally likely outcomes, the basic theoretical probability rule is: probability of an event equals the number of favourable outcomes divided by the total number of possible outcomes. ‘Favourable’ just means outcomes we want, and the total set of possibilities is the sample space.

  8. Maria

    A coin toss makes that clear. If the event is getting heads, there is one favourable outcome, heads, out of two possible outcomes. So the probability is one half, or 0.5.

  9. Corey

    For a fair six-sided die, the chance of rolling a four is one favourable outcome out of six, or one sixth, approximately 0.167. If the event is rolling a number divisible by three, the favourable outcomes are three and six, so the probability is two sixths, about 0.33.

  10. Maria

    The same favourable-outcomes idea applies to a lottery, even if the sample space is enormous. If there are about 175 million possible outcomes and you buy one ticket, that ticket has a chance of about one in 175 million. Buying more tickets gives you more favourable outcomes, though the exact number of possibilities still matters.

  11. Corey

    There is also a useful rule for independent events: the probability that they happen together is the product of their individual probabilities. For example, the chance of drawing the Ace of Spades can be found by multiplying the chance of drawing an ace by the chance of drawing a spade, when those events are treated as independent. The course will define independence more carefully later.

  12. Maria

    Probability can also come from observation rather than from a known theoretical model. To talk about that, we need the word ‘experiment.’ An experiment is a process we carry out, and each time we carry it out and record an outcome, that is a trial.

  13. Corey

    So if we toss a coin twenty times and record each result, that is one experiment with twenty trials. The probability estimated from the outcomes we actually observe is an experimental probability; the probability calculated from the model of possible outcomes is a theoretical, or true, probability.

  14. Maria

    Experimental probability is especially useful when the true probability is hard to calculate. Suppose you find yourself waiting in line at a local shop on eight out of ten visits. Your observed probability of a queue is 8 divided by 10, or 80 percent, and the observed probability of no queue is 20 percent.

  15. Corey

    The experimental-probability formula resembles the theoretical one: count the successful trials and divide by the total number of trials. The experimental result may not match the true probability exactly, but it can be a useful approximation when the theoretical calculation involves too many factors.

  16. Maria

    That leads to expected values. For a categorical event, the expected number of times it occurs over repeated trials is its theoretical probability multiplied by the number of trials. It tells us what to expect on average across the experiment, not what we are guaranteed to observe.

  17. Corey

    Suppose we draw a card, record its suit, return it to the deck, and shuffle, repeating the process twenty times. The chance of a spade on any draw is one fourth, or 0.25. The expected number of spades is 0.25 times 20, which is 5.

  18. Maria

    But five is not a promise that we will get exactly five spades. We might get four, six, or another number—even twenty. Expected value is a prediction based on probability, not a guarantee about one particular experiment.

  19. Corey

    For numerical outcomes, expected value is calculated differently: multiply each possible numerical value by its probability, then add those products. Picture an archery target with three scoring regions: 10 points with probability 0.5, 20 points with probability 0.4, and 100 points with probability 0.1.

  20. Maria

    The expected score is 0.5 times 10, plus 0.4 times 20, plus 0.1 times 100. That is 5 plus 8 plus 10, for an expected value of 23 points. A single shot cannot score 23, but the value summarizes what we expect across repeated shots.

  21. Corey

    That is why expected values are helpful for making predictions from data, while remembering that the future is uncertain. Forecasts often use intervals rather than a precise outcome—for example, a range for expected snowfall—because a single average or expected value does not tell us exactly what will happen.

  22. Maria

    A classic example is rolling two standard dice and adding the numbers. There are six possibilities for the first die and six for the second, so the sample space contains 6 times 6, or 36, equally likely outcomes. We can lay out the sums in a six-by-six table.

  23. Corey

    In that table, a sum of seven appears six times. So its probability is six out of 36, which reduces to one sixth. The sum seven is the most common individual sum, but one sixth is still not a high enough probability to treat seven as a sure bet.

  24. Maria

    To see how likely every possible sum is, we can build a probability frequency distribution. First, count how often each distinct sum appears in the sample space. That count is the frequency; for instance, a sum that appears in five table entries has frequency five.

  25. Corey

    List the possible sums in order alongside their frequencies, and you have a frequency distribution table. Then divide each frequency by the sample-space size, 36, to get the probability for that sum. The collection of those probabilities is the probability frequency distribution, which can be shown in a table or a graph.

  26. Maria

    On a graph, the horizontal axis can show the dice sums and the vertical axis their probabilities. The tallest bars identify the most probable outcomes. In this example, the bars are highest around the expected value, so an interval centered near that value can capture outcomes with comparatively high probability.

  27. Corey

    Now let’s turn to complements. The complement of an event is everything in the sample space that is not that event. If event A is rolling an even number, its complement is rolling an odd number. We write the complement as A-prime, and taking the complement twice gives us the original event.

  28. Maria

    The key probability fact is that all the possible outcomes together have probability one. A coin must land heads or tails, so the probabilities of those two outcomes add to one. More generally, when a set of events covers the entire sample space without double-counting, their probabilities add to one.

  29. Corey

    If a proposed total is greater than one, that cannot be the probability of a single complete set of mutually exclusive outcomes. It may indicate that some outcomes were counted more than once because events can happen simultaneously. If the total is less than one, then some possible outcomes have not been included.

  30. Maria

    Since an event and its complement together cover the sample space, their probabilities add to one. So the probability of the complement of A is one minus the probability of A. This is especially handy when it is simpler to calculate the outcomes that do not meet our condition.

  31. Corey

    For a die, the probability of rolling a three is one sixth. The chance of not rolling a three is therefore one minus one sixth, or five sixths. That is also the probability of rolling one, two, four, five, or six.

  32. Maria

    With those probability tools in place, we can explore combinatorics: counting ways to select objects from a finite set, sometimes with restrictions on repetition or order. The main ideas are permutations, variations, and combinations. Counting favourable outcomes this way can help us calculate probabilities in more complicated situations.

  33. Corey

    A permutation is an arrangement of all the elements in a set, where order matters. If three drivers—Lewis, Max, and Kimi—finish on a podium, there are six possible orders: any of the three can win, and the other two can take second and third in either order.

  34. Maria

    For n distinct elements, the number of permutations is n factorial, written n!. We can understand that by filling positions one at a time: n choices for the first position, n minus one for the next, then n minus two, continuing down to one. Multiplying those choices gives n factorial.

  35. Corey

    A factorial is the product of the natural numbers from one through n. For example, 3! is 1 times 2 times 3, which equals 6. Zero factorial is defined to be one, and negative numbers do not have a factorial in this course’s counting formulas.

  36. Maria

    Factorials also have convenient relationships. For a natural number n, n! equals n times (n minus 1)!, and (n plus 1)! equals (n plus 1) times n!. More generally, expanding upward multiplies by the additional factors: 7! is 5! times 6 times 7.

  37. Corey

    And when a factorial is divided by a smaller factorial, the shared factors cancel. For example, 7! divided by 4! leaves 5 times 6 times 7. That cancellation is what makes many counting formulas practical to calculate.

  38. Maria

    A variation is an ordered selection of some elements from a set. Unlike a permutation, it does not have to arrange the entire set. For a two-letter lock code using A, B, and C, if letters can repeat, there are three choices for each of two positions, giving 3 squared, or 9 codes.

  39. Corey

    In general, variations with repetition are calculated as n to the power p, where n is the number of available elements and p is the number of positions. A two-letter code from all 26 letters therefore has 26 squared, or 676, possibilities if repetition is allowed.

  40. Maria

    If repetition is not allowed, each choice reduces the options for the next position. For example, choosing four runners in order from five team members gives 5 choices for the first, 4 for the second, 3 for the third, and 2 for the fourth. That is 5 times 4 times 3 times 2, or 120.

  41. Corey

    The general formula for variations without repetition is n! divided by (n minus p)!, when arranging p elements selected from n. For the relay, that is 5! divided by 1!, which equals 120. The order matters because the runners have different legs of the relay.

  42. Maria

    A combination is different because it counts selections where order does not matter. If we choose three employees from ten to attend a conference, picking Alex, Sarah, and Dave is the same group regardless of the order in which we name them.

  43. Corey

    For any one group of three distinct people, there are 3!, or six, ways to arrange those people. Variations count those six orders separately, while a combination counts the group just once. So the number of combinations is the number of variations divided by the number of permutations of the selected elements.

  44. Maria

    The formula for combinations without repetition is n! divided by p! times (n minus p)!, for choosing p elements from n. Choosing three out of ten gives 10! divided by 3! times 7!, which equals 120 groups. Choosing four out of ten gives 210.

  45. Corey

    Combinations have a symmetry that can save calculation. Choosing p items from n is equivalent to choosing the n minus p items to leave out. For six fruits, choosing four to take is the same as choosing two to leave behind; either way there are 15 choices.

  46. Maria

    That symmetry is why choosing three of ten employees gives the same number of groups as choosing seven of ten: either choose the three who attend or the three who stay behind. In general, the counts for p and n minus p are equal, so we can use the smaller of those numbers in calculations.

  47. Corey

    Sometimes a task has several separate parts, each with its own options. If a diner offers three sandwiches, two sides, and two drinks, every sandwich can be paired with every side and drink. Multiply the counts: 3 times 2 times 2 gives 12 possible meals.

  48. Maria

    The same multiplication principle applies to testing online ads. With three headings, five thumbnails, three descriptions, and two buttons, there are 3 times 5 times 3 times 2, or 90 different ads. Counting the possibilities can help a project manager understand the scale of the task.

  49. Corey

    There are also combinations with repetition: selections where order does not matter but an item may be chosen more than once. Their formula is (n plus p minus 1)! divided by p! times (n minus 1)!, for choosing p items from n types.

  50. Maria

    Let’s apply these ideas to the lottery example. Suppose a ticket requires five distinct numbers from 1 to 69, plus one Powerball number from 1 to 26. Order does not matter for the five main numbers, and repetition is not allowed, so we use combinations for that part.

  51. Corey

    There are 69! divided by 5! times 64! ways to choose the five numbers—more than 11 million. The Powerball has 26 possibilities, so the chance of selecting its one correct value is one twenty-sixth. Treating the two required selections as independent, the total number of possible winning outcomes is close to 300 million.

  52. Maria

    A single ticket is one favourable outcome among those possibilities, so its chance of winning the jackpot is approximately one in 300 million. This example combines the favourable-outcomes rule, combinations, and the multiplication rule for independent events.

  53. Corey

    Here is a quick way to distinguish the three counting ideas. Use permutations when arranging every element, variations when selecting and arranging some elements, and combinations when selecting elements but ignoring order. For example, four chosen runners in assigned relay positions call for permutations; choosing four of six and assigning the positions calls for variations; choosing the team without assigning positions calls for combinations.

  54. Maria

    And always ask whether repetition is allowed. With repetition, variations use n to the power p, while combinations use (n plus p minus 1)! divided by p! times (n minus 1)!. Without repetition, the formulas are n! for permutations, n! divided by (n minus p)! for variations, and n! divided by p! times (n minus p)! for combinations.

  55. Corey

    Let’s make those decisions concrete with a pizza-ordering example. A one-person deal includes one pizza, one drink, and one dessert. If there are 26 pizzas, four drinks, and seven desserts, we multiply the choices: 26 times 4 times 7, or 728 possible orders.

  56. Maria

    Now consider a family deal with two pizzas, a small drink, a large drink, and two desserts. If the two pizzas must be different and their order does not matter, there are 26 choose 2, or 325 ways to select them.

  57. Corey

    For the two drinks, assume the same drink is allowed in both sizes and the small and large positions are distinct. There are four choices for each position, so 4 squared, or 16 possibilities. This is a variation with repetition, and the distinction between the drink positions matters.

  58. Maria

    For two desserts, repetition is allowed, but the order does not matter and the restaurant does not need to know who will eat which one. That is a combination with repetition: choosing two from seven types gives (7 plus 2 minus 1)! divided by 2! times 6!, which is 28.

  59. Corey

    Multiply the independent menu parts: 325 pizza selections times 16 drink selections times 28 dessert selections equals 145,600 possible family-deal orders. Notice how we chose the counting method separately for each part, based on whether order mattered and whether repeats were allowed.

  60. Maria

    For a Double Delight, the pizzas and desserts are selected in the same way, so those counts remain 325 and 28. But now the two large drinks must be different, and it matters which person gets which one. That is a variation without repetition: 4 times 3, or 12 drink arrangements.

  61. Corey

    So the Double Delight has 325 times 12 times 28, or 109,200 possible orders. That is 36,400 fewer than the family deal, even though the two deals differ only in the drink arrangement described here. Small details can change the number of possible outcomes substantially.

  62. Maria

    And the family deal and Double Delight both offer far more than eight times the 728 options of the one-person deal. The important lesson is not just to memorize formulas: identify the positions, decide whether order matters, check whether repetition is allowed, and then count each part.

  63. Corey

    We’ve now connected probability’s basic language—events, sample spaces, favourable outcomes, experiments, and expected values—to distributions, complements, and combinatorics. Those tools let us describe uncertainty, count possibilities, and apply probability to practical questions, from business decisions to lottery odds and everyday choices.

  64. Maria

    That’s the foundation this course sets out to build: a careful, analytical way to think about uncertain outcomes. Once we know how to define the possibilities and count them correctly, we’re much better prepared to explore probability and its applications further.

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent