Contents
Sample Spaces, Events and Basic Probability
Probability measures how likely something is to happen, from 0 (impossible) to 1 (certain). Before calculating anything, you need to define what can happen.
Sample Space
The sample space, written S, lists all possible outcomes of an experiment. Rolling one die gives S = {1, 2, 3, 4, 5, 6}. Two coin flips give S = {HH, HT, TH, TT}.
Event
An event is any group of outcomes you care about. “Rolling an even number” is the event {2, 4, 6}. An event can be a single outcome or several.
Basic Probability
P(A) = number of outcomes in A / number of outcomes in S
- P(A): the probability that event A happens, a number between 0 and 1.
- Outcomes in A: the outcomes that count as a success for the event.
- Outcomes in S: every possible outcome. This formula assumes all outcomes are equally likely.
Example: Two dice are rolled. What is the probability that the sum is 8?
- The sample space has 6 × 6 = 36 equally likely outcomes.
- The outcomes that sum to 8 are (2,6), (3,5), (4,4), (5,3), and (6,2), for a total of 5.
- P(sum is 8) = 5 / 36 ≈ 0.139
When Outcomes Are Not Equally Likely
Real data rarely behaves like fair dice. In that case, probability is estimated from observed frequency: if 130 of 1,000 website visitors made a purchase, the estimated probability of a purchase is 130 / 1,000 = 0.13. A classification model works on the same idea when it outputs a probability for each class.
Probability and Statistics for Data Science
Abhishek Pati








