CH2.3 - Conditional Probability and Independence
This section covers conditional probability and independence. Conditional probability is the probability of an event given that another event has occurred. Independence is when the occurrence of one event does not affect the probability of another event.
Example
Example
This probability is an Intersection and joint probability, think of multiply, but only if you can answer the following question.
Independence
Question
Are the events Independent of each other?
Independent - the outcome of one event does not effect the probability of the other event
Here are some examples of independent events:
Independent Events
- spin a roulette wheel twice
- flip a coin twice
- rolling two dice
- sampling with replacement
Going back to the question, lets look at the possible answers.
Option 1: Yes
Option 2: No
Lets tackle a practice problem now.
Practice Problem
Problem
Mobile telephones perform handoffs as they move from call to cell. During a call, a telephone either performs zero handoffs (0), one handoff (H1), or more than one handoff (H2). IN addition, each call is either long (L), if it last more then three minutes, or brief (B). We have the following table that represents the data, a sample of 100 calls:
H0 H1 H2 Row Total L 10 10 20 40 B 40 10 10 60 Col Total 50 20 30 n=100
Research Question: Are lengths and handoffs Independent of Each Other?
- Marginal Distributions
Length
Probability of a Long Call Probability of a Brief Call
Handoffs
Probability of Zero Handoffs Probability of One Handoff Probability of More than One Handoff
-
Conditional Distributions
Condition in a level for one categorical variable given the level of another categorical variable.
Calculating for the following probabilities:
- Probability of Zero Handoffs given a Long Call
P ( * | L)
- Probability of Zero Handoffs given a Brief Call
P ( * | B)
- Probability of a Long Call given Zero Handoffs
P ( * | H0)
- Probability of a Brief Call given Zero Handoffs
P ( * | H1)
- Probability of a Long Call given More than One Handoff
P ( * | H2)
Bringing it all together, let’s calculate the following:
Final Calculations
Segmented Bar Chart with Matplotlib
Either:
Conditionals are not similar to marginals, there is an association between the two, and thus, not independent.
Or:
Conditionals are Similar to Marginals, there is no association between the two, and thus, independent.
Showing Mathematically: are two events independent
Lets find a random combination from that table and determine if they are independent.
Question
Are L and H0 independent of each other?
Therefore, is
Example - Independence
Example
If you own two cars, what is the probablity that:
- neither will need repair?
- both will need repair?
- at least one car will need repair?
Probability table
X | p(x) |
---|---|
0 | .72 |
1 | .17 |
2 | .07 |
≥ 3 | .04 |
- Neither will need repair
Correct Answer
- Both will need repair
Correct Answer
- At least one car will need repair
Correct Answer
Example - Independence
Classic exmaple: Balls in Urn to Demonstrate Tree Diagrams, Conditional Probability, Joint Probability, and Independence.
Example
10 balls in an urn, 3 are orange, 5 are red, and 2 are blue. Draw two balls without replacement.
Mermaid Tree Diagram
The following tree diagram is a visual representation of the problem.
graph LR Start["Start (10 balls)"] Start --> O1["Orange (3/10)"] Start --> R1["Red (5/10)"] Start --> B1["Blue (2/10)"] O1 --> O2["Orange (2/9)"] O1 --> R2["Red (5/9)"] O1 --> B2["Blue (2/9)"] R1 --> O3["Orange (3/9)"] R1 --> R3["Red (4/9)"] R1 --> B3["Blue (2/9)"] B1 --> O4["Orange (3/9)"] B1 --> R4["Red (5/9)"] B1 --> B4["Blue (1/9)"]
From the tree diagram, we can calculate the following:
- Probability of Drawing an Orange Ball
Correct Answer
- Probability of Drawing a Red Ball
Correct Answer
- Probability of Drawing a Blue Ball
Correct Answer