Probability
How likely something is to happen.
Many events can't be predicted with total certainty.
The best we can say is how likely they are to
happen, using the idea of probability.
The best we can say is how likely they are to
happen, using the idea of probability.
Tossing a Coin
When a coin is tossed, there are two
possible outcomes:
We say that the probability of the coin
landing H is ½.
And the probability of the coin
T is ½. |
Throwing Dice
The probability of any one of them is
1/6. |
Probability
In general:
Probability of an event happening = | Number of ways it can happen | |
Total number of outcomes |
Example: the chances of rolling a "4" with a die
Number of ways it can happen: 1 (there is only 1 face with a "4" on it)
Total number of outcomes: 6 (there are 6 faces altogether)
So the probability = | 1 |
6 |
Example: there are 5 marbles in a bag: 4 are blue, and 1 is red. What is the probability that a blue marble gets picked?
Number of ways it can happen: 4 (there are 4 blues)
Total number of outcomes: 5 (there are 5 marbles in total)
So the probability = | 4 | = 0.8 |
5 |
Probability Line
We can show probability on Probability Line:
Probability is always between 0 and 1
Probability is Just a Guide
Probability does not tell us exactly what
will happen, it is just a guide
will happen, it is just a guide
Example: toss a coin 100 times, how many Heads will come up?
Probability says that heads have a ½ chance, so we can expect 50 Heads.
But when we actually try it we might get 48 heads, or 55 heads ... or anything really, but in most cases it will be a number near 50.
Words
Some words have special meaning in
Probability:
Probability:
Experiment or Trial: an action where the result is uncertain.
Tossing a coin, throwing dice, seeing
what pizza people choose are all
examples of experiments.
what pizza people choose are all
examples of experiments.
Sample Space: all the possible outcomes of an experiment
Example: choosing a card from a deck
There are 52 cards in a deck (not including Jokers)
So the Sample Space is all 52 possible cards: {Ace of Hearts, 2 of Hearts, etc... }
The Sample Space is made up of Sample Points:
Sample Point: just one of the possible outcomes
Example: Deck of Cards
- the 5 of Clubs is a sample point
- the King of Hearts is a sample point
"King" is not a sample point. As there are 4 Kings that is 4 different sample points.
Event: a single result of an experiment
Example Events:
- Getting a Tail when tossing a coin is an event
- Rolling a "5" is an event.
An event can include one or more possible outcomes:
- Choosing a "King" from a deck of cards (any of the 4 Kings) is an event
- Rolling an "even number" (2, 4 or 6) is also an event
The Sample Space is all possible outcomes.
A Sample Point is just one possible outcome.
And an Event can be one or more of the possible outcomes.
|
Hey, let's use those words, so you get used to them:
Example: Alex wants to see how many times a "double" comes up when throwing 2 dice.
Each time Alex throws the 2 dice is an Experiment.
It is an Experiment because the result is uncertain.
The Event Alex is looking for is a "double", where both dice have the same number. It is made up of these 6 Sample Points:
{1,1} {2,2} {3,3} {4,4} {5,5} and {6,6}
The Sample Space is all possible outcomes (36 Sample Points):
{1,1} {1,2} {1,3} {1,4} ... {6,3} {6,4} {6,5} {6,6}
These are Alex's Results:
Experiment | Is it a Double? |
{3,4} | No |
{5,1} | No |
{2,2} | Yes |
{6,3} | No |
... | ... |
After 100 Experiments, Alex has 19 double" Events ... is that close to what you would expect?
Conditional Probability
How to handle Dependent Events
Life is full of random events! You need to get a "feel"
for them to be a smart and successful person.
for them to be a smart and successful person.
Independent Events
Example: Tossing a coin.
Each toss of a coin is a perfect isolated thing.
What it did in the past will not affect the current toss.
The chance is simply 1-in-2, or 50%, just like ANY toss of the coin.
So each toss is an Independent Event.
Dependent Events
But events can also be "dependent" ... which means
they can be affected by previous events ...
they can be affected by previous events ...
Example: Marbles in a Bag
2 blue and 3 red marbles are in a bag.
What are the chances of getting a blue marble?
The chance is 2 in 5
But after taking one out the chances change!
So the next time:
- if we got a red marble before, then the chance of a blue marble next is 2 in 4
- if we got a blue marble before, then the chance of a blue marble next is 1 in 4
See how the chances change each time? Each
event depends on what happened in the previous
event, and is called dependent.
event depends on what happened in the previous
event, and is called dependent.
That is the kind of thing we look at here.
"Replacement"
Note: if we replace the marbles in the bag each time, then the chances do not change and the events are independent:
- With Replacement: the events are Independent (the chances don't change)
- Without Replacement: the events are Dependent (the chances change)
Tree Diagram
A Tree Diagram: is a wonderful way to picture what is going on, so let's build one for our marbles example.
There is a 2/5 chance of pulling out a Blue marble, and a 3/5 chance for Red:
We can even go one step further and see what happens when we select a second marble:
If a blue marble was selected first there is now a 1/4 chance of getting a blue marble and a 3/4 chance of getting a red marble.
If a red marble was selected first there is now a 2/4 chance of getting a blue marble and a 2/4 chance of getting a red marble.
Now we can answer questions like "What are the chances of drawing 2 blue marbles?"
Answer: it is a 2/5 chance followed by a 1/4 chance:
Did you see how we multiplied the chances? And got 1/10 as a result.
The chances of drawing 2 blue marbles is 1/10
Example:
Notation
We love notation in mathematics! It means we
can then use the power of algebra to play around
with the ideas. So here is the notation for probability:
can then use the power of algebra to play around
with the ideas. So here is the notation for probability:
P(A) means "Probability Of Event A"
In our marbles example Event A is "get a Blue
Marble first" with a probability of 2/5:
Marble first" with a probability of 2/5:
P(A) = 2/5
And Event B is "get a Blue Marble second" ... but for
that we have 2 choices:
that we have 2 choices:
- If we got a Blue Marble first the chance is now 1/4
- If we got a Red Marble first the chance is now 2/4
So we have to say which one we want, and use
the symbol "|" to mean "given":
the symbol "|" to mean "given":
P(B|A) means "Event B given Event A"
In other words, event A has already happened, now what is the chance of event B?
P(B|A) is also called the "Conditional Probability" of B given A.
And in our case:
P(B|A) = 1/4
So the probability of getting 2 blue marbles is:
And we write it as
"Probability of event A and event B equals
the probability of event A times the probability of event B given event A"
Let's do the next example using only notation:
Example: Drawing 2 Kings from a Deck
Event A is drawing a King first, and Event B is drawing a King second.
For the first card the chance of drawing a King is 4 out of 52 (there are 4 Kings in a ceck of 52 cards):
P(A) = 4/52
But after removing a King from the deck the probability of the 2nd card drawn is lesslikely to be a King (only 3 of the 51 cards left are Kings):
P(B|A) = 3/51
And so:
P(A and B) = P(A) x P(B|A) = (4/52) x (3/51) = 12/2652 = 1/221
So the chance of getting 2 Kings is 1 in 221, or about 0.5%
Finding Hidden Data
Using Algebra we can also "change the subject" of
the formula, like this:
the formula, like this:
Start with: | P(A and B) = P(A) x P(B|A) | |
Swap sides: | P(A) x P(B|A) = P(A and B) | |
Divide by P(A): | P(B|A) = P(A and B) / P(A) |
And we have another useful formula:
"The probability of event B given
event A equals the probability of event A and event B divided by the probability of event A
Example: Ice Cream
70% of your friends like Chocolate, and 35% like Chocolate AND like Strawberry.
What percent of those who like Chocolate also like Strawberry?
P(Strawberry|Chocolate) = P(Chocolate and Strawberry) / P(Chocolate)
0.35 / 0.7 = 50%
50% of your friends who like Chocolate also like Strawberry
Big Example: Soccer Game
You are off to soccer, and want to be the Goalkeeper, but that depends who is the Coach today:
- with Coach Sam the probability of being Goalkeeper is 0.5
- with Coach Alex the probability of being Goalkeeper is 0.3
Sam is Coach more often ... about 6 out of every 10
games
(a probability of 0.6).
So, what is the probability you will be a Goalkeeper today?
Let's build a tree diagram. First we show the two possible coaches: Sam or Alex:
The probability of getting Sam is 0.6, so the probability of Alex must be 0.4 (together the probability is 1)
Now, if you get Sam, there is 0.5 probability of being Goalie (and 0.5 of not being Goalie):
If you get Alex, there is 0.3 probability of being Goalie (and 0.7 not):
The tree diagram is complete, now let's calculate the overall probabilities. Remember that:
Here is how to do it for the "Sam, Yes" branch:
(When we take the 0.6 chance of Sam being coach and include the 0.5 chance that Sam will let you be Goalkeeper we end up with an 0.3 chance.)
But we are not done yet! We haven't included Alex as Coach:
An 0.4 chance of Alex as Coach, followed by an 0.3 chance gives 0.12
And the two "Yes" branches of the tree together make:
0.3 + 0.12 = 0.42 probability of being a Goalkeeper today
(That is a 42% chance)
Check
One final step: complete the calculations and make sure they add to 1:
0.3 + 0.3 + 0.12 + 0.28 = 1
Yes, they add to 1, so that looks right.
Friends and Random Numbers
Here is another quite different example of Conditional Probability.
4 friends (Alex, Blake, Chris and Dusty) each
choose a random number between 1 and 5. What is
the chance that any of them chose the same
number?
choose a random number between 1 and 5. What is
the chance that any of them chose the same
number?
Let's add our friends one at a time ...
First, what is the chance that Alex and Blake have
the same number?
Blake compares his number to Alex's number. There
is a 1 in 5 chance of a match.
is a 1 in 5 chance of a match.
As a tree diagram:
Note: "Yes" and "No" together makes 1
(1/5 + 4/5 = 5/5 = 1)
(1/5 + 4/5 = 5/5 = 1)
Now, let's include Chris ...
But there are now two cases to consider:
- If Alex and Blake did match, then Chris has only one number to compare to.
- But if Alex and Blake did not match then Chris has two numbers to compare to.
And we get this:
For the top line (Alex and Blake did match) we
already have a match (a chance of 1/5).
already have a match (a chance of 1/5).
But for the "Alex and Blake did not match" there is
now a 2/5 chance of Chris matching (because Chris
gets to match his number against both Alex and
Blake).
now a 2/5 chance of Chris matching (because Chris
gets to match his number against both Alex and
Blake).
And we can work out the combined chance
by multiplying the chances it took to get there:
by multiplying the chances it took to get there:
Following the "No, Yes" path ... there is a 4/5 chance of No, followed by a 2/5 chance of Yes:
(4/5) × (2/5) = 8/25
Following the "No, No" path ... there is a 4/5 chance of No, followed by a 3/5 chance of No:
(4/5) × (3/5) = 12/25
Also notice that when we add all chances together we
still get 1 (a good check that we haven't made a mistake):
still get 1 (a good check that we haven't made a mistake):
(5/25) + (8/25) + (12/25) = 25/25 = 1
Now what happens when we include Dusty?
It is the same idea, just more of it:
OK, that is all 4 friends, and the "Yes" chances
together make 101/125:
together make 101/125:
Answer: 101/125
But here is something interesting ... if we follow the "No" path we can skip all the other calculations and make our life easier:
The chances of not matching are:
(4/5) × (3/5) × (2/5) = 24/125
So the chances of matching are:
1 - (24/125) = 101/125
(And we didn't really need a tree diagram for that!)
And that is a popular trick in probability:
It is often easier to work out the "No" case
No comments:
Post a Comment