Statistics for
Data Science 1
Probability: random experiments, sample spaces and events, Venn diagrams, the axioms and properties of probability, the addition rule, and equally likely outcomes.
Chapters
- 01Random Experiments and Sample SpaceLecture 6.1
- 02EventsLecture 6.2
- 03Venn Diagrams and Playing CardsLecture 6.3
- 04Properties of ProbabilityLecture 6.4
- 05Equally Likely Outcomes and ApplicationsLectures 6.5 and 6.6
- 06Week 7 Summary SheetAll lectures
Based on lectures by Usha Mohan, IIT Madras
Random Experiments and Sample Space
Why probability, random experiments, and the sample space of all basic outcomes.
1.1Why probability?
We often hear claims like "there is a 30% chance of rain tomorrow", "India has a 50% chance of winning the toss", or "party ABC will probably win". To draw valid conclusions about a population from a sample, we need to know how likely certain events are. The likelihood, or chance, that an event will occur is the subject of probability.
1.2Random experiment
An experiment is any process that produces an observation or outcome. A random experiment is an experiment whose outcome is not predictable with certainty. Although the outcome is not known in advance, we suppose the set of all possible outcomes is known.
1.3Sample space
The sample space, written or , is the collection of all basic outcomes. Basic outcomes must be mutually exclusive (only one basic outcome can occur) and exhaustive (one basic outcome must occur).
List everything that could happen (the sample space). Exactly one item from the list will happen. Probability then measures how likely each part of the list is.
1.4Examples of random experiments
| Experiment | Outcomes | Sample space |
|---|---|---|
| Guess a four-option MCQ answer | A, B, C, D | S = {A, B, C, D} |
| Order of finish in a race of six students A–F | all permutations of A, B, C, D, E, F | S = {ABCDEF, ABCDFE, …, EFDBAC} |
| Toss two coins | HH, HT, TH, TT | S = {HH, HT, TH, TT} |
| Lifetime (hours) of a bulb | 0, 1 hour, 2 hours, ... | S = {x : 0 ≤ x < ∞} |
| Throw a dart on a unit square | any point in the square | S = {(x, y) : 0 ≤ x ≤ 1, 0 ≤ y ≤ 1} |
Example 1: sample space of two coins
Write the sample space of tossing two coins and count its outcomes.
- Each coin shows H or T; write the first coin, then the second.
- .
- There are 2 × 2 = 4 basic outcomes (the multiplication rule of Week 5).
- Answer: 4 outcomes.
1.5Going deeper
- HT and TH are different outcomes. The first coin and the second coin are different objects, so "head then tail" and "tail then head" are two basic outcomes.
- The level of detail is a choice (extra remark). For "number of heads" you could also write . That is a valid sample space, but its outcomes are not equally likely: 1 head happens two ways (HT, TH), 0 and 2 heads one way each. Chapter 5 needs equally likely outcomes, so the detailed S is the safer choice.
- Mutually exclusive and exhaustive together mean that exactly one basic outcome happens every time the experiment is run.
- Use a tree or the multiplication rule to count outcomes.
- Check: is every possible result listed exactly once?
- Writing HT and TH as one outcome.
- Listing outcomes that can happen together (not mutually exclusive).
Events
Events as subsets of S: union, intersection, null, complement and subset.
An event E is a collection of basic outcomes, that is, a subset of the sample space. The event has occurred if the outcome of the experiment is in the subset.
| Experiment | Event | As a set |
|---|---|---|
| Guess a four-option MCQ | answer is A | E = {A} |
| Race of six students | A finishes first | E = {ABCDEF, ABCDFE, …, AFEDBC} (5! = 120 orders) |
| Toss two coins | head on the first toss | E = {HH, HT} |
| Bulb lifetime | lifetime is at most 4 hours | E = {x : 0 ≤ x ≤ 4} |
2.1Union of events
For events E and F, the union consists of all outcomes that are in E or in F or in both. occurs if either E or F occurs.
| Experiment | E | F | |
|---|---|---|---|
| Guess an MCQ | answer is A: {A} | answer is B: {B} | A or B: {A, B} |
| Toss two coins | head first: {HH, HT} | head second: {HH, TH} | head first or second: {HH, HT, TH} |
2.2Intersection of events
The intersection consists of all outcomes that are in E and in F. occurs if both E and F occur.
| Experiment | E | F | |
|---|---|---|---|
| Toss two coins | head first: {HH, HT} | head second: {HH, TH} | head on both: {HH} |
| Race of six | A finishes first | B comes second | A first and B second |
2.3Null event and disjoint events
The event with no outcomes is the null event, written . If , then E and F cannot occur together; we say they are disjoint or mutually exclusive.
Example. MCQ: , . "A and B" is . If my guess is A, it cannot be B, so and are mutually exclusive.
2.4Complement of an event
The complement consists of all outcomes in S that are not in E. occurs if and only if E does not occur. Also .
| Experiment | E | |
|---|---|---|
| Toss a coin once, S = {H, T} | (head) | (tail), so |
| Toss two coins | head on first: {HH, HT} | tail on first: {TH, TT} |
2.5Subset of an event
If all outcomes of E are also in F, then E is contained in F, or E is a subset of F, written .
Example. Two coins. F = head on the first toss = {HH, HT}; E = head on both tosses = {HH}. Then : whenever E occurs, F occurs.
2.6Symbols at a glance
| Symbol | Reads as | Means |
|---|---|---|
| E union F | E or F (or both) occurs | |
| E intersection F | both E and F occur | |
| complement of E | E does not occur | |
| null event | no outcomes; cannot happen | |
| disjoint | E and F cannot occur together | |
| E subset of F | whenever E occurs, F occurs |
Example 2: events with two coins
Toss two coins. Let E = head on the first toss, F = head on the second toss. Find , and .
- , .
- .
- .
- .
- Answer: E ∪ F = {HH, HT, TH}; E ∩ F = {HH}; Eᶜ = {TH, TT}.
2.7Going deeper
- "Neither" is a complement (extra remark). "Neither E nor F" is , which equals (De Morgan's law). With two coins: , and . Chapter 5 uses this for "buys neither".
- Mutually exclusive is not the same as complementary. {A} and {B} in the MCQ are disjoint, but together they do not cover S; E and are disjoint and cover S.
- Union and intersection with the null event. and ; with S, and .
- Write every event as a set of outcomes before combining.
- Translate words: or → ∪, and → ∩, not → complement.
- Listing an outcome twice in a union.
- Calling two events disjoint when they share one outcome.
Venn Diagrams and Playing Cards
Seeing events as regions, and counting unions and intersections in a deck of cards.
A Venn diagram draws the sample space S as a big rectangle and each event as a circle inside it. It shows how events relate: overlapping, separate, or one inside the other.
The big rectangle is S and each circle is an event. Shaded areas show the union (everything in E or F), the intersection (the overlap), disjoint events (circles that do not touch), a subset (E fully inside F) and the complement of E (everything in S outside E).
3.1Application: playing cards
A deck has 52 cards. Selecting one card at random, the sample space is S = {all 52 cards}. Define:
| Event | Meaning | Outcomes |
|---|---|---|
| E | the card is the king of hearts | 1 card |
| F | the card is a king | 4 cards (one per suit) |
| G | the card is a heart | 13 cards |
| H | the card is an ace | 4 cards |
| I | the card is a queen | 4 cards |
Example 3: union and intersection with cards
F = king, G = heart. Describe and .
- : the card is a king or a heart: the 4 kings plus the 13 hearts. The king of hearts is counted once, so there are 4 + 13 − 1 = 16 outcomes.
- : the card is a king and a heart: only the king of hearts, which is the same as event E.
- Answer: F ∪ G has 16 cards; F ∩ G = E = {king of hearts}.
Example 4: mutually exclusive?
H = ace, I = queen. (a) Are G (heart) and H (ace) mutually exclusive? (b) Are F (king) and I (queen) mutually exclusive?
- (a) No. They share the outcome "ace of hearts", so both occur if that card is selected.
- (b) Yes. If we select a king we cannot select a queen, so .
- Answer: (a) not mutually exclusive (b) mutually exclusive.
3.2Going deeper
- The "− 1" is Week 5's warning. Adding two groups that overlap counts the overlap twice; the same correction becomes the addition rule of probability in Chapter 4.
- One shared outcome is enough. G and H share just the ace of hearts, and that single card makes them not mutually exclusive.
- Draw the Venn diagram before counting a union.
- For cards, write the overlap explicitly (king of hearts, red queens).
- Adding 4 + 13 = 17 for king or heart.
- Assuming two events with different names are disjoint.
Properties of Probability
Three interpretations, the three axioms, the complement rule and the addition rule.
4.1Three interpretations of probability
| Type | Idea |
|---|---|
| Classical (a priori, theoretical) | If S has n equally likely outcomes and event E consists of exactly m of them, then . |
| Relative frequency (a posteriori, empirical) | The proportion of times the event occurs in a very long series of independent repetitions: if E occurs times in n repetitions, . |
| Subjective | A "best guess" by a person of the chance the event will happen; it measures an individual's degree of belief. |
4.2The probability axioms
Probability is a number from 0 to 1. The whole sample space has probability 1. For events that cannot overlap, probabilities just add.
- For any event E: .
- The probability of the sample space is 1: .
- For mutually exclusive (disjoint) events :
In particular, if and are disjoint, then
4.3General properties
. Why: E and are disjoint and . By axiom 3, ; by axiom 2 this equals .
. Why: , so .
4.4Addition rule of probability
For events that are not necessarily disjoint:
Split the union into three regions I, II, III. , , and . Adding counts region II twice, so we subtract once.
4.5Going deeper
- A subset has a smaller probability (extra remark). If then : F is E plus a disjoint extra part with probability at least 0.
- A quick sanity check. can never be bigger than or , and can never be smaller than either of them.
- Rearranging the rule. Any three of , , , give the fourth; Example 8 uses this to find "A in both".
- Check every answer lies between 0 and 1.
- For "or", always ask whether the events overlap.
- Adding probabilities of overlapping events without subtracting the overlap.
- Writing .
Equally Likely Outcomes and Applications
Counting favourable outcomes, and the addition and complement rules at work.
5.1Equally likely outcomes
If every outcome is equally likely (a fair die, a well-shuffled deck), the probability of an event is just how many outcomes are in it, out of all outcomes.
If S has N outcomes and , then for any event A
Example 5: rolling a fair die
Roll a fair die: S = {1, 2, 3, 4, 5, 6}. Let A = outcome is odd, B = outcome is greater than 4, C = outcome is odd or greater than 4. Find P(A), P(B), P(C).
- Each outcome has probability 1/6.
- A = {1, 3, 5}: P(A) = 1/6 + 1/6 + 1/6 = 1/2.
- B = {5, 6}: P(B) = 2/6 = 1/3.
- : .
- Answer: P(A) = 1/2, P(B) = 1/3, P(C) = 2/3.
Example 6: red or a queen
A card is drawn from a standard deck of 52. What is the probability that it is red or a queen?
- R = red card: P(R) = 26/52 = 1/2.
- Q = queen: P(Q) = 4/52 = 1/13.
- = red queen (2 cards): .
- Answer: 7/13.
5.2Applications of the addition rule
Example 7: shopping for shirts and pants
A customer buys a shirt with probability 0.3, a pant with probability 0.2, and both with probability 0.1. What proportion of customers buy neither?
- Let S = buys a shirt, P = buys a pant. "Neither" is the complement of "shirt or pant", that is .
- .
- .
- Answer: 0.6.
Example 8: subject grades
A student has a 40% chance of an A in statistics, 60% in mathematics, and 86% of an A in either statistics or mathematics. Find the probability that she (1) gets no A in either, (2) gets an A in both.
- Let S = A in statistics, M = A in mathematics. P(S) = 0.40, P(M) = 0.60, .
- (1) No A in either is : 1 − 0.86 = 0.14.
- (2) An A in both is . Rearranging the addition rule: .
- Answer: (1) 0.14 (2) 0.14.
For "neither" or "not even one", first find P(union), then subtract from 1. For "both", rearrange the addition rule: .
5.3Going deeper
- The two 0.14s are a coincidence (extra remark). "Both" and "neither" are different events; here both happen to be 0.14 because P(S) + P(M) = 1 exactly. Change P(M) to 0.50 and "both" becomes 0.04 while "neither" stays 0.14.
- Check the regions add to 1. In Figure 9: 0.26 + 0.14 + 0.46 + 0.14 = 1. If they do not, a number is wrong.
- Equally likely needs a reason (extra remark). The formula only works when the outcomes really are equally likely. The sum of two dice is not: 7 happens in 6 of the 36 equally likely pairs (probability 1/6), but 2 only in 1 (probability 1/36).
- Counting from Weeks 5 and 6. For larger problems the "number of outcomes in A" and N come from the multiplication rule, permutations and combinations.
- "Neither", "at least one", "not": use the complement.
- Draw a Venn diagram with all four regions for two events.
- Forgetting to subtract the overlap (red queens counted twice).
- Using the equally likely formula when outcomes are not equally likely.
Week 7 Summary Sheet
Everything in Week 7 on one sheet.
Lectures 6.1 to 6.6 on one sheet, for a last-minute revision.
Definitions and formulas
| Idea | Meaning / formula |
|---|---|
| Random experiment | outcome not predictable with certainty |
| Sample space S | all basic outcomes; mutually exclusive and exhaustive |
| Event | a subset of S |
| , , | E or F; E and F; not E |
| Disjoint (mutually exclusive) | |
| Axioms | ; ; disjoint events: probabilities add |
| Complement | ; |
| Addition rule | |
| Equally likely | |
| Interpretations | classical (m/n), relative frequency (limit of n(E)/n), subjective (degree of belief) |
Formula sheet at a glance
Formulas
Use whenThe question says "not", "neither" or "at least one".
- Describe the opposite event.
- Find its probability (often easier).
- Subtract from 1.
Use whenThe question says "or" and the events may overlap.
- Find P(E) and P(F).
- Find the overlap P(E ∩ F).
- Add, then subtract the overlap once.
Use whenYou know P(E), P(F) and P(E or F) and need "both".
- Write the addition rule.
- Move P(E ∩ F) to one side.
- Substitute and check the answer is between 0 and 1.
Use whenEvery outcome has the same chance: fair die, fair coin, shuffled deck.
- List or count S.
- Count the outcomes in A (Weeks 5 and 6 if needed).
- Divide.
Values worked in the lectures
| Question | Answer |
|---|---|
| Two coins: number of outcomes | 4 |
| Fair die: P(odd), P(> 4), P(odd or > 4) | 1/2, 1/3, 2/3 |
| Card: P(red or queen) | 7/13 |
| King or heart: number of cards | 16 |
| Shirt/pant: P(neither) | 0.6 |
| Grades: P(no A), P(A in both) | 0.14, 0.14 |
How to decide
- "or" → union: add and subtract the overlap.
- "and" → intersection.
- "not", "neither", "at least one" → use the complement: 1 − P(...).
- Equally likely outcomes → count favourable over total, using Week 5 and 6 counting if needed.
- The lectures are numbered 6.1 to 6.6; these are the Week 7 notes.
- The learning objectives on the slides also list tree diagrams, conditional probability and independence; these are not covered in these six lectures.
- The red-or-queen slide prints = "56"; it should be 2/52 (the result 7/13 is right).
- The source's extra practice questions are not reproduced, as the Statistics 1 notes carry worked examples only.
Mutually exclusive, exhaustive
Two coins: 4
∪ or, ∩ and, c not
Disjoint: E ∩ F = Φ
King or heart: 16
King, queen: disjoint
Disjoint: add
P(Ec) = 1 − P(E)
Red or queen: 7/13
Neither: 1 − union
Shirt/pant 0.6, grades 0.14