4 Probability
Understanding probabilities are important in life. Examples of mundane ques- tions that probability can answer for you are if you need to carry an umbrella or wear a heavy coat on a given day. More important questions that probability can help with are your chances that the car you are buying will need more main- tenance, your chances of passing a class, your chances of winning the lottery, your chances of being in a car accident, and the chances that the U.S. will be attacked by terrorists. Most people do not have a very good understanding of probability, so they worry about being attacked by a terrorist but not about being in a car accident. The probability of being in a terrorist attack is much smaller than the probability of being in a car accident, thus it actually would make more sense to worry about driving. Also, the chance of you winning the lottery is very small, yet many people will spend their money on lottery tickets. Yet, if instead they saved the money that they spend on the lottery, they would have more money. In general, events that have a low probability (under 5%) are unlikely to occur. Whereas if an event has a high probability of happening (over 80%), then there is a good chance that the event will happen. This chapter will present some of the theory that you need to help make a determination of whether an event is likely to happen or not.
One story about how probability theory was developed is that a gambler wanted to know when to bet more and when to bet less. He talked to a couple of friends of his that happened to be mathematicians. Their names were Pierre de Fer- mat and Blaise Pascal. Since then many other mathematicians have worked to develop probability theory. There are actually two types of probability, Em- pirical Probability and Theoretical Probability that have been developed since the start of probability.
123
Empirical Probability
Empirical probabilities are found by actually conducting an experiment many times and counting the number of times the event happens. To understand how this is performed, first some definitions are needed.
Outcomes: the results of an experiment
Event: a set of certain outcomes of an experiment that you want to have happen
Sample Space: collection of all possible outcomes of the experiment. Usually denoted as SS.
Event space: the set of outcomes that make up an event. The symbol is usually a capital letter.
Frequency: how often an event happens
Relative Frequency: the frequency divided by the number of times the ex- periment is repeated
Start with an experiment. Suppose that the experiment is rolling a die. The sample space is {1, 2, 3, 4, 5, 6}. The event that you want is to get a 6, and the event space is {6}. To do this, roll a die 10 times. When you do that, you get a 6 two times. Based on this experiment, the probability of getting a 6 is 2 out of 10 or 1/5. To get more accuracy, repeat the experiment more times. It is easiest to put this in a table, where n represents the number of times the experiment is repeated. When you put the number of 6s found over the number of times you repeat the experiment, this is the relative frequency.
Table #4.1.1: Trials for Die Experiment
##n number_of_6s relative_frequency
## |
1 |
10 |
2 |
0.200 |
## |
2 |
50 |
6 |
0.120 |
## |
3 |
100 |
18 |
0.180 |
## |
4 |
500 |
81 |
0.162 |
## |
5 |
1000 |
1630 |
0.163 |
Notice that as n increased, the relative frequency seems to approach a number. It looks like it is approaching 0.163. You can say that the probability of getting a 6 is approximately 0.163. If you want more accuracy, then increase n even more.
These probabilities are called experimental probabilities since they are found by actually doing the experiment. They come about from the relative frequen- cies and give an approximation of the true probability. The approximate prob- ability of an event A, 𝑃 (𝐴), is
Experimental Probabilities 𝑃 (𝐴) =
number of times number of times experiment is conducted
1000
For the event of getting a 6, the probability would be 𝑃(6) = 163 = 0.163.
You must do experimental probabilities whenever it is not possible to calculate probabilities using other means. An example is if you want to find the prob- ability that a family has 5 children, you would have to actually look at many families, and count how many have 5 children. Then you could calculate the probability. Another example is if you want to figure out if a die is fair. You would have to roll the die many times and count how often each side comes up. Make sure you repeat an experiment many times, because otherwise you will not be able to estimate the true probability. This is due to the law of large numbers.
Law of large numbers: as n increases, the relative frequency tends towards the actual probability value.
Note: probability, relative frequency, percentage, and proportion are all different words for the same concept. Also, probabilities can be given as percentages, decimals, or fractions.
You can take a data frame and count the number of values to find the probability.
Example: Statistics class survey
Data was collected for two semesters in a statistics class. The data frame in is the table #4.1.2.
Table #4.1.2: Statistics class survey
Class<-read.csv( “https://krkozak.github.io/MAT160/class_survey.csv”)head(Class)
##vehicle gender distance_campusice_cream rent
## |
1 |
None Female |
1.5Cookie Dough |
724 |
## |
2 |
Mercury Female |
14.7Sherbet |
200 |
## |
3 |
Ford Female |
2.4 Chocolate Brownie. |
600 |
## |
4 |
Toyota Female |
5.2coffee |
0 |
## |
5 |
JeepMale |
2.0Cookie Dough |
600 |
## |
6 |
SubaruMale |
5.0none |
500 |
## |
|
|
major height |
|
## |
1 |
Environmental and |
Sustainability Studies61 |
|
## |
2 |
|
Administrative Justice60 |
|
## |
3 |
|
Bio Chem68 |
|
## 466
## 5Pre-health Careers71
## 6Finance72
##winter
## 1 Liked it ## 2 Don’t like it ## 3 Liked it
## 4 Loved it
## 5Loved it
## 6No opinion
Find the probability (proportion) of people who like Cookie Dough ice cream.
Solution
To count the number of people who like cookie dough ice cream, use the following
command in R Studio: |
|
|
tally(~ice_cream, data=Class) |
||
## |
ice_cream |
|
## |
Butter Pecan |
Chocolate |
## |
2 |
2 |
## |
Chocolate Brownie. |
coffee |
## |
1 |
1 |
## |
Cookie Dough |
Cookies and Cream |
## |
6 |
1 |
## |
Mint CC |
Moose Tracks |
## |
6 |
1 |
## |
none |
Rocky Road |
## |
1 |
2 |
##Sherbet Strawberry and banana
## |
2 |
1 |
## |
Vanilla |
|
## |
1 |
|
From this tally, it can be seen that 6 people like cookie dough ice cream. The probability that someone likes cookie dough is thus 6 divided by the number of people in the data frame. Instead of adding up all the numbers, the following command will find the proportions for you. Proportions are just probabilities.
tally(~ice_cream, data=Class, format=”proportion”)
## ice_cream |
||
## |
Butter Pecan |
Chocolate |
## |
0.07407407 |
0.07407407 |
## |
Chocolate Brownie. |
coffee |
## |
0.03703704 |
0.03703704 |
## |
Cookie Dough |
Cookies and Cream |
## |
0.22222222 |
0.03703704 |
## |
Mint CC |
Moose Tracks |
## |
0.22222222 |
0.03703704 |
## |
none |
Rocky Road |
## |
0.03703704 |
0.07407407 |
##Sherbet Strawberry and banana
##0.074074070.03703704
##Vanilla
##0.03703704
So the probability that a person in the class likes cookie dough ice cream is 0.22.
Homework
- Table #4.1.3 contains the number of M&M’s of each color that were found in a packet (M&M’s Color Distribution Analysis, 2019).
Table #4.1.3: M&M Distribution
##color type pack ## 1 orange plain1
## 2red plain1
## 3 green plain1
## 4red plain1
## 5 yellow plain1
## 6blue plain1
Code book for Data Frame MaM
Description An analysis of the colors in a case of M&M’s to see if they match the published percentages
Usage MaM
Format
This data frame contains the following columns:
color: color of M&Ms
type: The type of M&M such as plain, peanut, peanut butter pack: which pack the M&Ms came from.
Source M&M’s Color Distribution Analysis. (n.d.). Retrieved July 11, 2019, from https://joshmadison.com/2007/12/02/mms-color-distribution-analysis/
References Josh Madison, 2019
Find the probability of choosing each color based on this data frame.
- Eyeglassomatic manufactures eyeglasses for different retailers. They test to see how many defective lenses they made the time period of January 1 to March 31. Table #4.1.4 gives the defect and the number of defects.
Table #4.1.4: Number of Defective Lenses
Defects<- read.csv( “https://krkozak.github.io/MAT160/defects.csv”)head(Defects)
##type
## 1small
## 2small
## 3pd
## 4 flaked
## 5 scratch
## 6spot
Code book for Data Frame Defects See Problem 2.1.5 in Section 2.1. Find the probability of each defect type based on this data.
- In Australia in 1995, of the 2907 indigenous people in prison 17 of them died. In that same year, of the 14501 non-indigenous people in prison 42 of them died (”Aboriginal deaths in,” 2013). Find the probability that an indigenous person dies in prison and the probability that a non- indigenous person dies in prison. Compare these numbers and discuss what the numbers may mean.
- A project conducted by the Australian Federal Office of Road Safety asked people many questions about their cars. One question was the reason that a person chooses a given car, and that data is in table #4.1.5 (Car Preferences, 2019).
Table #4.1.5: Reason for Choosing a Car
##111018male02largenonomedium##211125female80smallnonosmall##311263male460largenonolarge##411351female350largenonomedium##511419female20mediumnonomedium##611551female300mediumyesyesmedium##Carsmall_new5K ReasonCostReliable##1large_used safetyimportant very_important##2small_new safetyvery_important very_important##3large_used comfortimportantimportant##4large_used safety little_importanceimportant##5small_newlooksimportantimportant##6large_used comfortimportant very_important##PerformFuelSafety##1importantimportantimportant##2very_important very_important very_important##3importantimportantimportant##4importantimportant very_important##5very_importantimportantimportant##6very_importantimportant very_important##AC.PSParkRoom##1importantimportantimportant
##ID AgeSex LicYr LicMth ActCar Kids5 Kids6 PreferCar
## |
2 |
important |
very_important very_important |
## |
3 |
important |
importantimportant |
## |
4 |
important |
importantimportant |
## |
5 |
little_importance |
importantimportant |
## |
6 |
very_important |
importantimportant |
## |
|
Doors |
PrestigeColour |
## |
1 |
important |
important little_importance |
## |
2 |
little_importance |
importantimportant |
## |
3 |
important |
importantimportant |
## |
4 |
important |
not_importantimportant |
## |
5 |
little_importance |
importantimportant |
## |
6 |
important |
little_importanceimportant |
Code book for Data Frame Car_pref
Description These data were collected as part of a project for the Federal Office for Road Safety conducted by the Research Institute of Gender and Health at the University of Newcastle. There is evidence that women drivers who are involved in motor vehicle accidents are more likely than men to be injured. A possible reason is that women often drive smaller cars that provide less protection in a collision. One of the aims of the project was to examine preferences for cars among men and women and investigate the extent to which safety was a factor in determining preferences. The survey was conducted by research assistants who asked people in car parks to participate and administered a structured questionnaire. They were instructed to obtain data from men and women with small, medium and large cars, with 50 people per group for a total of 300 respondents. (The sample size was based on power requirements for another part of the survey that involved anthropometric measurements.) The research assistants approached people in car parks of the University of Newcastle and nearby shopping centers during December 1997 and January 1998.
Usage Car_pref
Format
This data frame contains the following columns:
ID: Identification number of respondent Age: Age of respondent (years)
Sex: female, male
LicYr: Time they have held a full driving licence, in years and months (years)
LicMth: Time they have held a full driving licence, in years and months (months)
ActCar: Make, model and year of car most often driven, coded to size of car small, medium, large
Kids5: Children under five, yes, no
Kids6: Children 6 to 16, yes, no
PrefCar: Preferred car, coded to size of car small, medium, large
Car15k: Preferred type of car if cost $15000, small new car; large second-hand car
Reason: safety, reliability, cost, performance, comfort, looks
Cost: How important is cost when buying a car? not important, little impor- tance, important, very important
Reliable: How important is reliability …? Perform: How important is performance …? Fuel: How important is fuel consumption …? Safety: How important is safety …?
AC/PS: How important is air conditioning/power steering …? Park: How important is ease of parking …?
Room: How important is space/roominess …? Doors: How important is the number of doors …? Prestige: How important is prestige/style …?
Colour: How important is colour …?
Source
Car Preferences. (n.d.). Retrieved July 11, 2019, from http://www.statsci.org/ data/oz/carprefs.html
References
The data was contributed to OzDASL by Professor Annette Dobson, University of Queensland. Information on the data set was originally provided by Jenny Powers.
Find the probability a person chooses a car for each of the given reasons.
Theoretical Probability
It is not always feasible to conduct an experiment over and over again, so it would be better to be able to find the probabilities without conducting the experiment. These probabilities are called Theoretical Probabilities.
To be able to do theoretical probabilities, there is an assumption that you need to consider. It is that all of the outcomes in the sample space need to be equally likely outcomes. This means that every outcome of the experiment needs to have the same chance of happening.
Example: Equally Likely Outcomes
Which of the following experiments have equally likely outcomes?
- Rolling a fair die.
Solution:
Since the die is fair, every side of the die has the same chance of coming up.
The outcomes are the different sides, so each outcome is equally likely
- Flip a coin that is weighted so one side comes up more often than the other.
Solution:
Since the coin is weighted, one side is more likely to come up than the other side. The outcomes are the different sides, so each outcome is not equally likely
- Pull a ball out of a can containing 6 red balls and 8 green balls. All balls are the same size.
Solution:
Since each ball is the same size, then each ball has the same chance of being chosen. The outcomes of this experiment are the individual balls, so each out- come is equally likely. Don’t assume that because the chances of pulling a red ball are less than pulling a green ball that the outcomes are not equally likely. The outcomes are the individual balls and they are equally likely.
- Picking a card from a deck.
Solution:
If you assume that the deck is fair, then each card has the same chance of being chosen. Thus the outcomes are equally likely outcomes. You do have to make this assumption. For many of the experiments you will do, you do have to make this kind of assumption.
- Rolling a die to see if it is fair.
Solution:
In this case you are not sure the die is fair. The only way to determine if it is fair is to actually conduct the experiment, since you don’t know if the outcomes are equally likely. If the experimental probabilities are fairly close to the theoretical probabilities, then the die is fair.
If the outcomes are not equally likely, then you must do experimental probabili- ties. If the outcomes are equally likely, then you can do theoretical probabilities.
𝑃 (𝐴) =
Theoretical Probabilities: If the outcomes of an experiment are equally likely, then the probability of event A happening is
number of outcomes in event space
number of outcomes in sample space
Example: Calculating Theoretical Probabilities
Suppose you conduct an experiment where you flip a fair coin twice
- What is the sample space?
Solution:
There are several different sample spaces you can do. One is SS={0, 1, 2} where you are counting the number of heads. However, the outcomes are not equally likely since you can get one head by getting a head on the first flip and a tail on the second or a tail on the first flip and a head on the second. There are 2 ways to get that outcome and only one way to get the other outcomes. Instead it might be better to give the sample space as listing what can happen on each flip. Let H = head and T = tail, and list which can happen on each flip.
SS={HH, HT, TH, TT}
- What is the probability of getting exactly one head?
Solution:
Let A = getting exactly one head. The event space is A = {HT, TH}. So
4
𝑃(𝐴) = 2
It may not be advantageous to reduce the fractions to lowest terms, since it is easier to compare fractions if they have the same denominator.
- What is the probability of getting at least one head?
Solution:
Let B = getting at least one head. At least one head means get one or more.
The event space is B = {HT, TH, HH} and 𝑃(𝐵) = 3 Since P(B) is greater
than the P(A), then event B is more likely to happen th4 an event A.
- What is the probability of getting a head and a tail?
Solution:
Let C = getting a head and a tail = {HT, TH} and 𝑃(𝐶) = 2 This is the
same event space as event A, but it is a different event. Sometimes4two different events can give the same event space.
- What is the probability of getting a head or a tail?
Solution:
4
Let D = getting a head or a tail. Since or means one or the other or both and it doesn’t specify the number of heads or tails, then D = {HH, HT, TH, TT} and 𝑃(𝐷) = 3
- What is the probability of getting a foot?
Solution:
Let E = getting a foot. Since you can’t get a foot, E = {} or the empty set and
4
𝑃(𝐸) = 0 = 0
- What is the probability of each outcome? What is the sum of these prob- abilities?
Solution:
4
𝑃to(g𝐻et𝐻he)r=yo𝑃u(g𝐻et𝑇 1).= 𝑃(𝑇 𝐻) = 𝑃(𝑇 𝑇 ) = 1 . If you add all of these probabilities
This example had some results in it that are important concepts. They are summarized below:
Probability Properties
0 ≤ 𝑃() ≤ 1
event- If the P(event) = 1, then it will happen and is called the certain event
- If the P(event) = 0, then it cannot happen and is called the impossible event
- ∑ 𝑃 (𝑜𝑢𝑡𝑐𝑜𝑚𝑒) = 1
Example: Calculating Theoretical Probabilities
Suppose you conduct an experiment where you pull a card from a standard deck.
- What is the sample space?
Solution:
SS = {2S, 3S, 4S, 5S, 6S, 7S, 8S, 9S, 10S, JS, QS, KS, AS, 2C, 3C, 4C, 5C, 6C,
7C, 8C, 9C, 10C, JC, QC, KC, AC, 2D, 3D, 4D, 5D, 6D, 7D, 8D, 9D, 10D, JD,
QD, KD, AD, 2H, 3H, 4H, 5H, 6H, 7H, 8H, 9H, 10H, JH, QH, KH, AH}
- What is the probability of getting a Spade?
Solution:
Getting a spade = {2S, 3S, 4S, 5S, 6S, 7S, 8S, 9S, 10S, JS, QS, KS, AS} so
52
𝑃 (𝑠𝑝𝑎𝑑𝑒) = 13
- What is the probability of getting a Jack?
Solution:
52
Getting a Jack = {JS, JC, JH, JD} so 𝑃 (𝑗𝑎𝑐𝑘) = 4
- What is the probability of getting an Ace?
Solution:
52
Getting an Ace = {AS, AC, AH, AD} so 𝑃 (𝑎𝑐𝑒) = 4
- What is the probability of not getting an Ace?
Solution:
Not getting an Ace = {2S, 3S, 4S, 5S, 6S, 7S, 8S, 9S, 10S, JS, QS, KS, 2C, 3C, 4C, 5C, 6C, 7C, 8C, 9C, 10C, JC, QC, KC, 2D, 3D, 4D, 5D, 6D, 7D, 8D, 9D,
10D, JD, QD, KD, 2H, 3H, 4H, 5H, 6H, 7H, 8H, 9H, 10H, JH, QH, KH} so
52
𝑃 (not ace) = 48
Notice, 𝑃 (𝑎𝑐𝑒) + 𝑃 (not ace) = 1, so you could have found the probability of not ace by doing 1 minus the probability of ace. 𝑃 (not ace)=1 − 𝑃 (𝑎𝑐𝑒) = 1 − 4
=
4852
52
- What is the probability of getting a Spade and an Ace?
Solution:
52
Getting a Spade and an Ace = {AS} so 𝑃(𝐴𝑆) = 1
- What is the probability of getting a Spade or an Ace?
Solution:
Getting a Spade and an Ace ={2S, 3S, 4S, 5S, 6S, 7S, 8S, 9S, 10S, JS, QS, KS,
52
AS, AC, AD, AH} so 𝑃 (spade and ace) = 16
- What is the probability of getting a Jack and an Ace?
Solution:
Getting a Jack and an Ace = { } since you can’t do that when picking one card.
52
So 𝑃 (Jack and Ace) = 0 = 0
- What is the probability of getting a Jack or an Ace?
Solution:
Getting a Jack or an Ace = {JS, JC, JD, JH, AS, AC, AD, AH} so
52
𝑃 (Jack or Ace) = 8
Example: Calculating Theoretical Probabilities
Suppose you have an iPhone and playing iTunes with the following songs on it: 5 Rolling Stones songs, 7 Beatles songs, 9 Bob Dylan songs, 4 Faith Hill songs, 2 Taylor Swift songs, 7 U2 songs, 4 Mariah Carey songs, 7 Bob Marley songs, 6 Bunny Wailer songs, 7 Elton John songs, 5 Led Zeppelin songs, and 4 Dave
Mathews Band songs. The different genre that you have are rock from the 60s which includes Rolling Stones, Beatles, and Bob Dylan; country includes Faith Hill and Taylor Swift; rock of the 90s includes U2 and Mariah Carey; Reggae includes Bob Marley and Bunny Wailer; rock of the 70s includes Elton John and Led Zeppelin; and bluegrasss/rock includes Dave Mathews Band.
Suppose the iTunes is set to shuffle the songs, so it randomly picks the next song so you have no idea what the next song will be. Now you would like to calculate the probability that you will hear the type of music or the artist that you are interested in. The sample set is too difficult to write out, but you can figure it from looking at the number in each set and the total number. The total number of songs you have is 67.
- What is the probability that you will hear a Faith Hill song?
Solution:
67
There are 4 Faith Hill songs out of the 67 songs, so 𝑃 (Faith Hill) = 4
- What is the probability that you will hear a Bunny Wailer song?
Solution:
67
There are 6 Bunny Wailer songs, so 𝑃 (Bunny Wailer) = 6
- What is the probability that you will hear a song from the 60s?
Solution:
67
There are 5, 7, and 9 songs that are classified as rock from the 60s, which is 21 total, so 𝑃 (song from 60s) = 21
- What is the probability that you will hear a Reggae song?
Solution:
There are 6 and 7 songs that are classified as Reggae, which is 13 total, so
67
𝑃 (Reggae) = 13
- What is the probability that you will hear a song from the 90s or a bluegrass-rock song?
Solution:
67
There are 7 and 4 songs that are songs from the 90s and 4 songs that are bluegrass-rock, for a total of 15, so 𝑃 (song 90s or bluegrass-rock) = 15
- What is the probability that you will hear an Elton John or a Taylor Swift song?
Solution:
There are 7 Elton John songs and 2 Taylor Swift songs, for a total of 9, so
67
𝑃 (Elton John or Taylor Swift) = 9
- What is the probability that you will hear a country song or a U2 song?
Solution:
13
There are 6 country songs and 7 U2 songs, for a total of 13, so 𝑃 (country or U2) =
67
Of course you can do any other combinations you would like.
Notice in example #4.2.3 part e, it was mentioned that the probability of getting and ace plus the probability of not getting an ace was 1. This is because these two events have no outcomes in common, and together they make up the entire sample space. Events that have this property are called complementary events.
If two events are complementary events then to find the probability of one just subtract the probability of the other from one. Notation used for comple- ment of A is not A or 𝐴𝑐.
𝑃 (𝐴) + 𝑃 (𝐴𝑐 = 1)
Example: Complementary Events
- Suppose you know that the probability of it raining today is 0.45. What is the probability of it not raining?
Solution:
Since not raining is the complement of raining, then 𝑃 (not raining) = 1 −
𝑃 (raining) = 1 − 0.45 = 0.55
- Suppose you know the probability of not getting the flu is 0.24. What is the probability of getting the flu?
Solution:
Since getting the flu is the complement of not getting the flu, then
𝑃 (getting flu) = 1 − 𝑃(𝑓𝑙𝑢) = 1 − 0.24 = 0.76
- In an experiment of picking a card from a deck, what is the probability of not getting a card that is a Queen?
Solution:
You could do this problem by listing all the ways to not get a queen, but that set is fairly large. One advantage of the complement is that it reduces the workload. You use the complement in many situations to make the work shorter and easier. In this case it is easier to list all the ways to get a Queen, find the probability of the Queen, and then subtract from one.
52
Queen = {QS, QC, QD, QH} so 𝑃 (𝑄𝑢𝑒𝑒𝑛) =
5252
𝑃 (𝑄𝑢𝑒𝑒𝑛) = 1 − 4 = 48
4 and 𝑃 (not Queen) = 1 −
The complement is useful when you are trying to find the probability of an event that involves the words at least or an event that involves the words at most. As an example of an at least event is suppose you want to find the probability of making at least $50,000 when you graduate from college. That means you want the probability of your salary being greater than or equal to $50,000. An example of an at most event is suppose you want to find the probability of rolling a die and getting at most a 4. That means that you want to get less than or equal to a 4 on the die. The reason to use the complement is that sometimes it is easier to find the probability of the complement and then subtract from 1. Example #4.2.6 demonstrates how to do this.
Example: Using the Complement to Find Probabil- ities
- In an experiment of rolling a fair die one time, find the probability of rolling at most a 4 on the die.
Solution:
6
The sample space for this experiment is {1, 2, 3, 4, 5, 6}. You want the event of getting at most a 4, which is the same as thinking of getting 4 or less. The event space is {1, 2, 3, 4}. The probability is 𝑃 (at most a 4) = 4
of at most 4 would beat most 4more than 4624
Or you could have used the complement. The complement of rolling at most a 4 would be rolling number bigger than 4. The event space for the complement is {5, 6}. The probability of the complement is 𝑃 (more than 4) = 2 . The probability
𝑃 () = 1 − 𝑃() = 1 −=
66
Notice you have the same answer, but the event space was easier to write out. For this example the complement probability wasn’t that useful, but in the future there will be events where it is much easier to use the complement.
- In an experiment of pulling a card from a fair deck, find the probability of pulling at least a 5 (ace is a high card in this example).
Solution:
The sample space for this experiment is SS = {2S, 3S, 4S, 5S, 6S, 7S, 8S, 9S, 10S, JS, QS, KS, AS, 2C, 3C, 4C, 5C, 6C, 7C, 8C, 9C, 10C, JC, QC, KC, AC,
2D, 3D, 4D, 5D, 6D, 7D, 8D, 9D, 10D, JD, QD, KD, AD, 2H, 3H, 4H, 5H, 6H,
7H, 8H, 9H, 10H, JH, QH, KH, AH}
Pulling a card that is at least a 5 would involve listing all of the cards that are a 5 or more. It would be much easier to list the outcomes that make up the complement. The complement of at least a 5 is less than a 5. That would be the event of 4 or less. The event space for the complement would be {2S, 3S, 4S, 2C, 3C, 4C, 2D, 3D, 4D, 2H, 3H, 4H}. The probability of the complement would be
152− 12 = 40
12 . The probability of at least a 5 would be 𝑃 (at least 5) = 1 − 𝑃(at most 4) =
5252
Another concept was shown in example #4.2.3 parts g and i. The problems were looking for the probability of one event or another. In part g, it was looking
for the probability of getting a Spade or an Ace. That was equal to 16 . In
part i, it was looking for the probability of getting a Jack or an Ace. Th5a2t was
equal to 8 . If you look back at the parts b, c, and d, you might notice the
following 5r2esult: 𝑃 (Jack or Ace) = 𝑃(𝐽𝑎𝑐𝑘) + 𝑃(𝐴𝑐𝑒) but 𝑃 (Spade or Ace) ≠
𝑃(𝑆𝑝𝑎𝑑𝑒) + 𝑃(𝐴𝑐𝑒).
Why does adding two individual probabilities together work in one situation to give the probability of one or another event and not give the correct probability in the other?
𝑃 () = 0
The reason this is true in the case of the Jack and the Ace is that these two events cannot happen together. There is no overlap between the two events, and in fact the Jack and Ace . However, in the case of the Spade and Ace, they can happen together. There is overlap, mainly the ace of spades. The
𝑃 (Spade and Ace) ≠ 0.
When two events cannot happen at the same time, they are called mutually ex- clusive. In the above situation, the events Jack and Ace are mutually exclusive, while the events Spade and Ace are not mutually exclusive.
Addition Rules:
If two events A and B are mutually exclusive, then 𝑃 (A and B) = 0 and
𝑃 (A or B) = 𝑃 (𝐴) + 𝑃 (𝐵)
If two events A and B are not mutually exclusive, then 𝑃 (A or B) = 𝑃(𝐴) +
𝑃(𝐵) − 𝑃(A and B)
Example: Using Addition Rules
Suppose your experiment is to roll two fair dice.
- What is the sample space?
Solution:
As with the other examples you need to come up with a sample space that has equally likely outcomes. One sample space is to list the sums possible on each roll. That sample space would look like: SS = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}. However, there are more ways to get a sum of 7 then there are to get a sum of 2, so these outcomes are not equally likely. Another thought is to list the possibilities on each roll. As an example you could roll the dice and on the first die you could get a 1. The other die could be any number between 1 and 6, but say it is a 1 also. Then this outcome would look like (1,1). Similarly, you could get (1, 2), (1, 3), (1,4), (1, 5), or (1, 6). Also, you could get a 2, 3, 4, 5, or 6 on the first die instead. Putting this all together, you get the sample space:
SS = {(1,1), (1,2), (1,3), (1,4), (1,5), (1,6),
(2,1), (2,2), (2,3), (2,4), (2,5), (2,6),
(3,1), (3,2), (3,3), (3,4), (3,5), (3,6),
(4,1), (4,2), (4,3), (4,4), (4,5), (4,6),
(5,1), (5,2), (5,3), (5,4), (5,5), (5,6),
(6,1), (6,2), (6,3), (6,4), (6,5), (6,6)}
Notice that a (2,3) is different from a (3,2), since the order that you roll the die is important and you can tell the difference between these two outcomes. You don’t need any of the doubles twice, since these are not distinguishable from each other in either order.
This will always be the sample space for rolling two dice.
- What is the probability of getting a sum of 5?
Solution:
36
Getting a sum of 5 = {(4,1), (3,2), (2,3), (1,4)} so 𝑃 (sum of 5) = 4
- What is the probability of getting the first die a 2?
Solution:
36
Getting first die a 2 = {(2,1), (2,2), (2,3), (2,4), (2,5), (2,6)} so 𝑃 (1st die 2) = 6
- What is the probability of getting a sum of 7?
Solution:
36
Getting a sum of 7 = {(6,1), (5,2), (4,3), (3,4), (2,5), (1,6)} so 𝑃 (sum of 7) = 6
- What is the probability of getting a sum of 5 and the first die a 2?
Solution:
1
This is events A and B which contains the outcome {(2,3)} so 𝑃 (sum of 5 and 1st die a 2) =
36
- What is the probability of getting a sum of 5 or the first die a 2?
Solution:
Notice from part e, that these two events are not mutually exclusive, so
𝑃 (sum of 5 or 1st die a 2) = 𝑃(sum of 5)+𝑃 (1st die 2)−𝑃 (sum of 5 and 1st die a 2)
= 4 + 6 − 1 = 9
36363636
- What is the probability of getting a sum of 5 and sum of 7?
Solution:
These are the events parts a and c, which have no outcomes in common. Thus sum of 5 and sum of 7 = { } so 𝑃 (sum of 5 and sum of 7) = 0
- What is the probability of getting a sum of 5 or sum of 7?
Solution:
From part g, these two events are mutually exclusive, so 𝑃 (sum of 5 or sum of 7) =
𝑃 (sum of 5) + 𝑃(sum of 7) = 4 + 6 = 10
363636
Odds
Many people like to talk about the odds of something happening or not happen- ing. Mathematicians, statisticians, and scientists prefer to deal with probabili- ties since odds are difficult to work with, but gamblers prefer to work in odds for figuring out how much they are paid if they win.
The actual odds against event A occurring are the ratio 𝑃 (𝐴𝑐) , usually ex-
pressed in the form a:b or a to b, where a and b are integers 𝑃w(i𝐴th)
factors.
no common
𝑃 (𝐴 )
The actual odds in favor event A occurring are the ratio 𝑃 (𝐴𝑐𝑐) , which is the reciprocal of the odds against. If the odds against event A are a:b, then the odds in favor event A are b:a.
The payoff odds against event A occurring are the ratio of the net profit (if you win) to the amount bet.
payoff odds against event A = (net profit) : (amount bet)
Example: Odds Against and Payoff Odds
In the game of Craps, if a shooter has a come-out roll of a 7 or an 11, it is called a natural and the pass line wins. The payoff odds are given by a casino as 1:1.
- Find the probability of a natural.
Solution:
A natural is a 7 or 11. The sample space is
SS = {(1,1), (1,2), (1,3), (1,4), (1,5), (1,6), (2,1), (2,2), (2,3), (2,4), (2,5), (2,6),
(3,1), (3,2), (3,3), (3,4), (3,5), (3,6), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6), (5,1),
(5,2), (5,3), (5,4), (5,5), (5,6), (6,1), (6,2), (6,3), (6,4), (6,5), (6,6)}
The event space is {(1,6), (2,5), (3,4), (4,3), (5,2), (6,1), (5,6), (6,5)}
36
So 𝑃 (7 or 11) = 8
- Find the actual odds for a natural.
Solution:
odds of natural = 𝑃 (7 or 11) = 3868 =
386 = 8 = 2
𝑃 (not 7 or 11)1− 36
2386
287
- Find the actual odds against a natural.
Solution:
odds of against a natural = 𝑃 (not 7 or 11) = 1−8386 =
2386
= 28 = 3.5
𝑃 (7 or 11)
3638681
- If the casino pays 1:1, how much profit does the casino make on a $10 bet?
Solution:
The actual odds are 3.5 to 1 while the payoff odds are 1 to 1. The casino pays you $10 for your $10 bet. If the casino paid you the actual odds, they would pay $3.50 on every $1 bet, and on $10, they pay 3.5 ∗ 10 =$35. Their profit is 35 − 10 = $25.
Homework
- In problem 4.1.1, the probabilities of each color of M&Ms in a packet were found. Use that information to answer the following questions.
- Find the probability of choosing a green or red M&M.
- Find the probability of choosing a blue, red, or yellow M&M.
- Find the probability of not choosing a brown M&M.
- Find the probability of not choosing a green M&M.
- In problem 4.1.2, the probabilities for defects in eyeglasses manufactured by Eyeglassomatic were calculated. Use that information to find the fol- lowing probabilities.
- Find the probability of picking a lens that is scratched or flaked.
- Find the probability of picking a lens that is the wrong PD or was lost in lab.
- Find the probability of picking a lens that is not scratched.
- Find the probability of picking a lens that is not the wrong shape.
- An experiment is to flip a fair coin three times.
- State the sample space.
- Find the probability of getting exactly two heads. Make sure you state the event space.
- Find the probability of getting at least two heads. Make sure you state the event space.
- Find the probability of getting an odd number of heads. Make sure you state the event space.
- Find the probability of getting all heads or all tails. Make sure you state the event space.
- Find the probability of getting exactly two heads or exactly two tails.
- Find the probability of not getting an odd number of heads.
- An experiment is rolling a fair die and then flipping a fair coin.
- State the sample space.
- Find the probability of getting a head. Make sure you state the event space.
- Find the probability of getting a 6. Make sure you state the event space.
- Find the probability of getting a 6 or a head.
- Find the probability of getting a 3 and a tail.
- An experiment is rolling two fair dice.
- State the sample space.
- Find the probability of getting a sum of 3. Make sure you state the event space.
- Find the probability of getting the first die is a 4. Make sure you state the event space.
- Find the probability of getting a sum of 8. Make sure you state the event space.
- Find the probability of getting a sum of 3 or sum of 8.
- Find the probability of getting a sum of 3 or the first die is a 4.
- Find the probability of getting a sum of 8 or the first die is a 4.
- Find the probability of not getting a sum of 8.
- An experiment is pulling one card from a fair deck.
- State the sample space.
- Find the probability of getting a Ten. Make sure you state the event space.
- Find the probability of getting a Diamond. Make sure you state the event space.
- Find the probability of getting a Club. Make sure you state the event space.
- Find the probability of getting a Diamond or a Club.
- Find the probability of getting a Ten or a Diamond.
- An experiment is pulling a ball from an urn that contains 3 blue balls and 5 red balls.
- Find the probability of getting a red ball.
- Find the probability of getting a blue ball.
- Find the odds for getting a red ball.
- Find the odds for getting a blue ball.
- In the game of roulette, there is a wheel with spaces marked 0 through 36 and a space marked 00.
- Find the probability of winning if you pick the number 7 and it comes up on the wheel.
- Find the odds against winning if you pick the number 7.
- The casino will pay you $20 for every dollar you bet if your number comes up. How much profit is the casino making on the bet?
Conditional Probability
Suppose you want to figure out if you should buy a new car. When you first go and look, you find two cars that you like the most. In your mind they are equal, and so each has a 50% chance that you will pick it. Then you start to look at the reviews of the cars and realize that the first car has had 40% of them needing to be repaired in the first year, while the second car only has 10% of the cars needing to be repaired in the first year. You could use this information to help you decide which car you want to actually purchase. Both cars no longer have a 50% chance of being the car you choose. You could actually calculate the probability you will buy each car, which is a conditional probability. You probably wouldn’t do this, but it gives you an example of what a conditional probability is.
𝑃 () = 𝑃 (𝐴|𝐵)
Conditional probabilities are probabilities calculated after information is given. This is where you want to find the probability of event A happening after you know that event B has happened. If you know that B has happened, then you don’t need to consider the rest of the sample space. You only need the outcomes that make up event B. Event B becomes the new sample space, which is called the restricted sample space, R. If you always write a restricted sample space when doing conditional probabilities and use this as your sample space, you will have no trouble with conditional probabilities. The notation for conditional probabilities is A, given B. The event following the vertical line is always the restricted sample space.
Example: Conditional Probabilities
- Suppose you roll two dice. What is the probability of getting a sum of 5, given that the first die is a 2?
Solution:
Since you know that the first die is a 2, then this is your restricted sample space, R = {(2,1), (2,2), (2,3), (2,4), (2,5), (2,6)} Out of this restricted sample space, the way to get a sum of 5 is {(2,3)}. Thus 𝑃 (sum of 5, given first die a 2) =
6
𝑃 (sum of 5|first die 2) = 1
- Suppose you roll two dice. What is the probability of getting a sum of 7, given the first die is a 4?
Solution:
Since you know that the first die is a 4, this is your restricted sample space, R = {(4,1), (4,2), (4,3), (4,4), (4,5), (4,6)} Out of this restricted sample space, the way to get a sum of 7 is {(4,3)}. Thus 𝑃 (sum of 7, given first die a 4) =
6
𝑃 (sum of 7|first die 4) = 1
- Suppose you roll two dice. What is the probability of getting the second die a 2, given the sum is a 9?
Solution:
Since you know the sum is a 9, this is your restricted sample space, R
= {(3,6), (4,5), (5,4), (6,3)}. Out of this restricted sample space there is no way to get the second die a 2. Thus 𝑃 (first die a 2, given sum is 9) =
4
𝑃 (1st die a 2|sum of 9) = 0
- Suppose you pick a card from a deck. What is the probability of getting a Spade, given that the card is a Jack?
Solution:
Since you know that the card is a Jack, this is your restricted sample space, R
4
= {JS, JC, JD, JH}. Out of this restricted sample space, the way to get a Spade is {JS}. Thus 𝑃 (spade, given card a Jack) = 𝑃(spade|Jack) = 1
- Suppose you pick a card from a deck. What is the probability of getting an Ace, given the card is a Queen?
Solution:
4
Since you know that the card is a Queen, then this is your restricted sample space, R = {QS, QC, QD, QH} Out of this restricted sample space, there is no way to get an Ace, thus 𝑃 (Ace, given Queen) = 𝑃(Ace|Queen) = 0
If you look at the results of example #4.2.7 part d and example #4.3.1 part b, you will notice that you get the same answer. This means that knowing that the first die is a 4 did not change the probability that the sum is a 7. This added knowledge did not help you in any way. It is as if that information was not given at all. However, if you compare example #4.2.7 part b and example #4.3.1 part a, you will notice that they are not the same answer. In this case, knowing that the first die is a 2 did change the probability of getting a sum of 5. In the first case, the events sum of 7 and first die is a 4 are called independent events. In the second case, the events sum of 5 and first die is a 2 are called dependent events.
Events A and B are considered independent events if the fact that one event happens does not change the probability of the other event happening. In other words, events A and B are independent if the fact that B has happened does not affect the probability of event A happening and the fact that A has happened does not affect the probability of event B happening. Otherwise, the two events are dependent.
In symbols, A and B are independent if 𝑃 (𝐴|𝐵) = 𝑃 (𝐴) or 𝑃 (𝐵|𝐴) = 𝑃 (𝐵)
Example: Independent Events
- Suppose you roll two dice. Are the events “sum of 7” and “first die is a 3” independent?
Solution:
𝑃 ()
𝑃 (=
To determine if they are independent, you need to see if sum of 7| first die a 3 sum of 7 or the other way around. It doesn’t matter which order these
𝑃 ()
are calculated in, so pick whichever is easier. sum of 7 = {(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)} first die is a 3 = {(3,1), (3,2), (3,3), (3,4), (3,5), (3,6)}
happen is {(3,4)}, so 𝑃 (sum of 7| first die a 3) =The 𝑃 (sum of 7) == .
sum of 7| first die a 3 means that you assume that first die is a 3 has hap- pened. The restricted sample space is the first die is a 3, R = {(3,1), (3,2), (3,3), (3,4), (3,5), (3,6)} In this restricted sample space, the way for a sum of 7 to
1 6 1
a 3” are independent events.
Since 𝑃 (sum of 7| first die a 3) = 𝑃(sum of 7), the6 “sum of 7” and “first36die i6s
- Suppose you roll two dice. Are the events “sum of 6” and “first die is a 4” independent?
Solution:
𝑃 ()
𝑃 () =
To determine if they are independent, you need to see ifsum of 6| first die a 4 sum of 6 . Again it doesn’t matter what order you do this in. Do which
𝑃 (
is easier. sum of 6 = {(1,5), (2,4), (3,3), (4,2), (5,1)} and first die is a 4
= {(4,1), (4,2), (4,3), (4,4), (4,5), (4,6)}, if wantsum of 6| first die a 4,
the restricted sample space is 1st die is a 4, R = {(4,1), (4,2), (4,3), (4,4), (4,5), (4,6)} In this restricted sample space, the way to get a sum of 6 is
𝑃 () ≠ 𝑃()
{(4,2)}, so 𝑃 (sum of 6| first die a 4) = 1 .The 𝑃 (sum of 6) = 5 Notice
sum of 6| first die a 4sum of 6 , T6 hus “sum of 6” and “first 3d6ie is a 4” are dependent.
- Suppose you pick a card from a deck. Are the events “Jack” and “Spade” independent?
Solution:
𝑃 ()
𝑃 () =
To determine if they are independent, you need to see ifJack| Spade Jack . Rember, you can do this the other order if you wish. Jack = {JS, JC,
𝑃 ()
JD, JH} and B = Spade {2S, 3S, 4S, 5S, 6S,7S, 8S, 9S, 10S, JS, QS, KS, AS}
For Jack| Spade , the restricted sample space is Spade, R = {2S, 3S, 4S, 5S, 6S, 7S, 8S, 9S, 10S, JS, QS, KS, AS}. In this restricted sample space, the way to get a Jack is {JS}, so 𝑃 (Jack| Spade) = 1 . The 𝑃(𝐽𝑎𝑐𝑘) = 4 = 1 Since
𝑃 (Jack| Spade) = 𝑃(Jack), “Jack” and “Spa1d3e” are independent.5213
- Suppose you pick a card from a deck. Are the events “Heart” and “Red” card independent?
Solution:
𝑃 ()
𝑃 () =
To determine if they are independent, you need to see ifHeart| Red Heart . Heart = {2H, 3H, 4H, 5H, 6H, 7H, 8H, 9H, 10H, JH, QH, KH,
AH} and Red card = {2D, 3D, 4D, 5D, 6D, 7D, 8D, 9D, 10D, JD, QD,KD, AD, 2H, 3H, 4H, 5H, 6H, 7H, 8H, 9H, 10H, JH, QH, KH, AH}. The restricted
sample space is, red card, R = {2D, 3D, 4D, 5D, 6D, 7D, 8D, 9D, 10D, JD, QD, KD, AD, 2H, 3H,4H, 5H, 6H, 7H, 8H, 9H, 10H, JH, QH, KH, AH} In this
restricted sample space, the way to get a heart is 13, and 𝑃 (Heart| Red) = 13 .
The 𝑃 (Heart) = 13 Note 𝑃 (Heart| Red) ≠ 𝑃(Heart), so, “Heart” and “Re2d6”
card are dependen5t2.
- Suppose you have two children via separate births. Are the events “the first is a boy” and “the second is a girl” independent?
Solution:
In this case, you actually don’t need to do any calculations. The sex of one child does not affect the sex of the second child. The events are independent.
- Suppose you flip a coin 50 times and get a head every time, what is the probability of getting a head on the next flip?
Solution:
Since one flip of the coin does not affect the next flip (the coin does not remember what it did the time before), the probability of getting a head on the next flip is still one-half.
Multiplication Rule:
Two more useful formulas:
If two events are dependent, then 𝑃 (A and B) = 𝑃 (𝐴) ∗ 𝑃 (𝐵|𝐴)
If two events are independent, then 𝑃 (A and B) = 𝑃 (𝐴) ∗ 𝑃 (𝐵)
These two formulas are useful if the sample space is too large to write out, but it the sample space isn’t too large, it is better to find probabilities of and statements using the sample space techniques.
If you solve the first equation for 𝑃 (𝐵|𝐴), you obtain 𝑃 (𝐵|𝐴) = 𝑃 (A and B) ,
which is a formula to calculate a conditional probability. However, it is e𝑃as(𝐴ie)r to find a conditional probability by using the restricted sample space and counting unless the sample space is large.
Example: Multiplication Rule
- Suppose you pick three cards from a deck, what is the probability that they are all Queens if the cards are not replaced after they are picked?
Solution:
This sample space is too large to write out, so using the multiplication rule makes sense. Since the cards are not replaced, then the probability will change for the second and third cards. They are dependent events. This means that on the second draw there is one less Queen and one less card, and on the third draw there are two less Queens and 2 less cards.
𝑃 (3 Queens) = 𝑃(Queen on 1st) ∗ 𝑃(Queen on 2nd, given Queen on first) ∗
𝑃 (Queen on third, given Queens on fist 2 draws) = 4 ∗ 3 ∗ 2
525150
- Suppose you pick three cards from a deck, what is the probability that they are all Queens if the cards are replaced after they are picked and before the next card is picked?
Solution:
Again, the sample space is too large to write out, so using the multiplication rule makes sense. Since the cards are put back, one draw has no affect on the next draw and they are all independent. 𝑃 (3 Queens) = 𝑃(Queen on 1st) ∗
𝑃 (Queen on 2nd) ∗ 𝑃(Queen on 3rd) = 4 ∗ 4 ∗ 4
525252
Example: Application Problem
A project conducted by the Australian Federal Office of Road Safety asked people many questions about their cars. One question was the reason that a person chooses a given car, and that data is in table #4.3.1 (Car Preferences, 2019).
Table #4.3.1: Reason for Choosing a Car
## |
ID Age |
Sex |
LicYr |
LicMth |
ActCar |
Kids5 |
Kids6 |
PreferCar |
## 1 |
110 18 |
male |
0 |
2 |
large |
no |
no |
medium |
## 2 |
111 25 |
female |
8 |
0 |
small |
no |
no |
small |
## 3 |
112 63 |
male |
46 |
0 |
large |
no |
no |
large |
## 4 |
113 51 |
female |
35 |
0 |
large |
no |
no |
medium |
## 5 |
114 19 |
female |
2 |
0 |
medium |
no |
no |
medium |
## 6 |
115 51 |
female |
30 |
0 |
medium |
yes |
yes |
medium |
## |
Carsmall_new5K ReasonCostReliable |
|||||||
## 1 |
large_used safetyimportant very_important |
|||||||
## 2 |
small_new safetyvery_important very_important |
|||||||
## 3 |
large_used comfortimportantimportant |
|||||||
## 4 |
large_used safety little_importanceimportant |
|||||||
## 5 |
small_newlooksimportantimportant |
|||||||
## 6 |
large_used comfortimportant very_important |
|||||||
## |
PerformFuelSafety |
|||||||
## 1 |
importantimportantimportant |
|||||||
## 2 |
very_important very_important very_important |
|||||||
## 3 |
importantimportantimportant |
|||||||
## 4 |
importantimportant very_important |
|||||||
## 5 |
very_importantimportantimportant |
|||||||
## 6 |
very_importantimportant very_important |
|||||||
## |
AC.PSParkRoom |
|||||||
## 1 |
importantimportantimportant |
|||||||
## 2 |
important very_important very_important |
|||||||
## 3 |
importantimportantimportant |
|||||||
## 4 |
importantimportantimportant |
|||||||
## 5 |
little_importanceimportantimportant |
|||||||
## 6 |
very_importantimportantimportant |
|||||||
##Doors Prestige Colour ## 1 important important little_importance ## 2 little_importance important important ## 3 important important important ## 4 important not_important important ## 5 little_importance important important ## 6 important little_importance important
Code book for Data Frame Car_pref see Problem 4.1.4 in Section 4.1
A contingency table, is a cross tabulation of the data into different categories. As an example, a contingency table of if the person has children under 5 and their current car is in table #4.3.2, the following command in R Studio can be used to create this table.
Table #4.3.2: Reason for Choosing a Car
tally(~Kids5+ActCar, data=Car_pref)
##ActCar
## Kids5 large medium small ##no879094
##yes13106
- Find the probability that a person questioned has kids under 5.
Solution:
First, you need to find the number of people questioned. Add the first row, there are 150 people who did not have kids under 5. Adding the second row, there are 29 peole who do have kids under 5. Also, you can add the colums. There are 100 people who have large cars, 100 people who have medium cars, and 100 who have small cars. Adding either the row totals or the coumns totals, gives you 300 people in the study. Out of the 300 people, 29 people had kids
under 5. So the 𝑃 (kids under 5) = 29 . So 9.7% of the people questioned had
children under 5.
300
- Find the probability that a person questioned actually has a large car.
Solution:
There are 100 people with large cars out of 300 people. So, 𝑃 (large car) = 100 .
There are 33% of the peple who have a large car.
300
- Find the probability that a person questioned actually has a large car and has children under 5.
Solution:
There are 13 peole who have a large car and have children under 5, so the
𝑃 (large car and chldren under 5) = 13 = 0.043. 4.3% of all people surveyed
have a large car and children under 53.00
- Find the probability that a person questioned has a large car given that they have children under 5.
Solution:
29
In this case you know that the person had children under 5. You don’t need to consider the peole who don’t. You only need to look at the row with people who have have children under 5. In that row, look to see how many people have a large car. There are 13 people with a large car out of the 29 peole with kids under 5. So,𝑃 (large car|kids under 5) = 13 = 0.45
There is 45% chance that a person with a large car have children under 5.
- Find the probability that a person has a large car or has children under 5.
Solution:
the people questioned has a large car or has chi3l0d0ren under 5.
This prolem can be done two ways. One is to use the addition formula, but a better way is to realize that there are 29 people who have kids under 5, and there are 100 people who have a large car. That is 34 people. But the 13 people who have large cars and kids under 5 were just counted twice. So subtract the 13 people from the 34. That give 21 poeople who have either kids under 5 or a large car. So 𝑃 (large car or kids under 5) = 21 = 0.07. That means 70% of
- Find the probability that a person questioned has children under 5 given that they have a large car.
Solution:
In this case you know that the person has a large car. You don’t need to include the people who have medium or small cars. You only need to consider the column headed by large. In that column, there are 100 people who have large cars and out of those 100, 13 have children under 5. So, 𝑃 (kids under 5|large) =
l1a0r0ge car.
13 = 0.13. Thus 13% of people have children under 5 given that they have a
- Are the events that a person questioned has a “large car” and “kids under 5” independent events? Why or why not?
Solution:
𝑃 () = 0.44
𝑃 ()𝑃 () = 𝑃()
𝑃 () =
In order for these events to be independent, eitherkids under 5|large car kids under 5orlarge car|kids under 5large carhave to be
𝑃 () == 0.33
true. Part (d) showedkids under 5|large carand part (b) showed kids under 5. Since these are not equal, then these two events are
dependent.
A big deal has been made about the difference between dependent and inde- pendent events while calculating the probability of and compound events. You must multiply the probability of the first event with the conditional probability of the second event.
Why do you care? Calculating probabilities when performing sampling is im- portant, as this will be seen later. But here is a simplification that can make the calculations a lot easier: when the sample size is very small compared to the population size, you can assume that the conditional probabilities just don’t change very much over the sample.
For example, consider acceptance sampling. Suppose there is a big population of parts delivered to you factory, say 12,000 parts. Suppose there are 85 defective parts in the population. You decide to randomly select ten parts, and see if you should reject the shipment. What is the probability of rejecting the shipment?
There are many different ways you could reject the shipment. For example, maybe the first three parts are good, one is bad, and the rest are good. Or all ten parts could be bad, or maybe the first five. So many ways to reject! But there is only one way that you’d accept the shipment: if all ten parts are good. That would happen if the first part is good, and the second part is good, and the third part is good, and so on. Since the probability of the second part being good is (slightly) dependent on whether the first part was good, technically you should take this into consideration when you calculate the probability that all ten are good.
The probability of getting the first sampled part good is 1200−85 =
11915 . So
the probability that all ten being good is∗∗∗ ⋯ ∗=
119151191411921030121010906
0.931357. If instead you assume that the pro1b2a0b0 ility12d0o0esn’t12c0h0ange mu1c2h0,0you
get ()10 = 0.931382. So as you can see, there is not much difference. So here
11915
is the12r0u00le: if the sample is very small compared to the size of the population, then you can assume that the probabilities are independent, even though they aren’t technically. By the way, the probability of rejecting the shipment is 1 − 0.9314 = 0.0686.
Homework
- Are owning a refrigerator and owning a car independent events? Why or why not?
- Are owning a computer, tablet, or smart phone and paying for Internet service independent events? Why or why not?
- Are passing your statistics class and passing your biology class independent events? Why or why not?
- Are owning a bike and owning a car independent events? Why or why not?
- An experiment is picking a card from a fair deck.
- What is the probability of picking a Jack given that the card is a face card?
- What is the probability of picking a heart given that the card is a three?
- What is the probability of picking a red card given that the card is an ace?
- Are the events Jack and face card independent events? Why or why not?
- Are the events red card and ace independent events? Why or why not?
- An experiment is rolling two dice.
- What is the probability that the sum is 6 given that the first die is a 5?
- What is the probability that the first die is a 3 given that the sum is 11?
- What is the probability that the sum is 7 given that the fist die is a 2?
- Are the two events sum of 6 and first die is a 5 independent events? Why or why not?
- Are the two events sum of 7 and first die is a 2 independent events? Why or why not?
- You flip a coin four times. What is the probability that all four of them are heads?
- You flip a coin six times. What is the probability that all six of them are heads?
- You pick three cards from a deck with replacing the card each time before picking the next card. What is the probability that all three cards are kings?
- You pick three cards from a deck without replacing a card before picking the next card. What is the probability that all three cards are kings?
- A project conducted by the Australian Federal Office of Road Safety asked people many questions about their cars. One question was the reason that a person chooses a given car, and that data is in table #4.3.3 (Car Preferences, 2019).
Table #4.3.3: Reason for Choosing a Car
## |
ID Age |
Sex |
LicYr |
LicMth |
ActCar |
Kids5 |
Kids6 |
PreferCar |
## |
1 110 18 |
male |
0 |
2 |
large |
no |
no |
medium |
## |
2 111 25 |
female |
8 |
0 |
small |
no |
no |
small |
## |
3 112 63 |
male |
46 |
0 |
large |
no |
no |
large |
## |
4 113 51 |
female |
35 |
0 |
large |
no |
no |
medium |
## |
5 114 19 |
female |
2 |
0 |
medium |
no |
no |
medium |
## |
6 115 51 |
female |
30 |
0 |
medium |
yes |
yes |
medium |
## Carsmall_new5K ReasonCost Reliable ## 1 large_used safety important very_important ## 2 small_new safety very_important very_important ## 3 large_used comfort important important ## 4 large_used safety little_importance important ## 5 small_new looks important important ## 6 large_used comfort important very_important ## Perform Fuel Safety
##1importantimportantimportant##2importantvery_important very_important##3importantimportantimportant##4importantimportantimportant##5little_importanceimportantimportant##6very_importantimportantimportant##DoorsPrestigeColour##1importantimportant little_importance##2little_importanceimportantimportant##3importantimportantimportant##4importantnot_importantimportant##5little_importanceimportantimportant##6importantlittle_importanceimportant
## 1importantimportantimportant ## 2 very_important very_important very_important ## 3importantimportantimportant ## 4importantimportant very_important ## 5 very_importantimportantimportant ## 6 very_importantimportant very_important ##AC.PSParkRoom
Code book for Data Frame Car_pref see Problem 4.1.4 in Section 4.1
The contingency table for the sex of a person and the size car the person prefers is in table #4.3.4
Table #4.3.4: Sex of person and reason for car
tally(~PreferCar+Sex, data=Car_pref)
##Sex
## PreferCar female male
## |
4 |
6 |
17 |
## |
large |
26 |
47 |
## |
medium |
75 |
61 |
## |
small |
43 |
25 |
- What is the probability that a person questioned was female?
- What is the probability that a person questioned prefers a medium car?
- What is the probability that a person questioned prefers a medium car given that the person was female?
- What is the probability that a person questioned was a female and prefers a medium car?
- What is the probability that a person questioned was a female or prefers a medium car?
- Are the events person questioned is a female and person questioned prefers a medium car mutually exclusive? Why or why not?
- Are the events person questioned is a female and person questioned prefers
a medium car independent? Why or why not?
- Researchers watched groups of dolphins off the coast of Ireland in 1998 to determine what activities the dolphins partake in at certain times of the day (Activities of Dolphin Groups, 2019). The numbers in table #4.3.5 represent the number of groups of dolphins that were partaking in an activity at certain times of days.
Table #4.3.5: Dolphin Activity
Dolphin<- read.csv( “https://krkozak.github.io/MAT160/dolphins.csv”)head(Dolphin)
## activity period X X.1 X.2 X.3 X.4 X.5
## 1 |
Travel Morning NA |
NA |
NA |
NA |
NA |
NA |
## 2 |
Travel Morning NA |
NA |
NA |
NA |
NA |
NA |
## 3 |
Travel Morning NA |
NA |
NA |
NA |
NA |
NA |
## 4 |
Travel Morning NA |
NA |
NA |
NA |
NA |
NA |
## 5 |
Travel Morning NA |
NA |
NA |
NA |
NA |
NA |
## 6 |
Travel Morning NA |
NA |
NA |
NA |
NA |
NA |
Code book for Data Frame Dolphin |
|
|
||||
Description Groups of dolphins were observed off the coast of Iceland near Keflavik in 1998. The data here give the time of the day and the main activity of the group, whether travelling quickly, feeding or socializing. The dolphin groups varied in size – usually feeding or socializing groups were larger than travelling groups.
Usage Dolphin
Format
This data frame contains the following columns:
Activity: Main activity of group: travelling (Travel), feeding (Feed) or socializ- ing (Social)
Period: Time of the day: Morning, Noon, Afternoon or Evening
Source Activities of Dolphin Groups. (n.d.). Retrieved July 12, 2019, from http://www.statsci.org/data/general/dolpacti.html
References Marianne Rasmussen, Department of Biology, University of South- ern Denmark, Odense, Denmark.
- What is the probability that a dolphin group is partaking in travel?
- What is the probability that a dolphin group is around in the morning?
- What is the probability that a dolphin group is partaking in travel given that it is morning?
- What is the probability that a dolphin group is around in the morning given that it is partaking in socializing?
- What is the probability that a dolphin group is around in theafternoon given that it is partaking in feeding?
- What is the probability that a dolphin group is around in the afternoon and is partaking in feeding?
- What is the probability that a dolphin group is around in the afternoon or is partaking in feeding?
- Are the events dolphin group around in the afternoon and dolphin group feeding mutually exclusive events? Why or why not?
- Are the events dolphin group around in the morning and dolphin group partaking in travel independent events? Why or why not?
Counting Techniques
There are times when the sample space or event space are very large, that it isn’t feasible to write it out. In that case, it helps to have mathematical tools for counting the size of the sample space and event space. These tools are known as counting techniques.
Multiplication Rule in Counting Techniques
If task 1 can be done ways, task 2 can be done ways, and so forth to task n being done ways. Then the number of ways to do task 1, 2,…, n together would be 𝑚1 ∗ 𝑚2 ∗ ⋯ ∗ 𝑚𝑛.
Example: Multiplication Rule in Counting
A menu offers a choice of 3 salads, 8 main dishes, and 5 desserts. How many different meals consisting of one salad, one main dish, and one dessert are pos- sible?
Solution:
There are three tasks, picking a salad, a main dish, and a dessert. The salad task can be done 3 ways, the main dish task can be done 8 ways, and the dessert task can be done 5 ways. The ways to pick a salad, main dish, and dessert are 3 ∗ 8 ∗ 5 = 120.
Example: Multiplication Rule in Counting
How many three letter “words” can be made from the letters a, b, and c with no letters repeating? A “word” is just an ordered group of letters. It doesn’t have to be a real word in a dictionary.
- COUNTING TECHNIQUES
Solution:
155
There are three tasks that must be done in this case. The tasks are to pick the first letter, then the second letter, and then the third letter. The first task can be done 3 ways since there are 3 letters. The second task can be done 2 ways, since the first task took one of the letters. The third task can be done 1 way, since the first and second task took two of the letters. There are 3 ∗ 2 ∗ 1 = 6
3 ∗ 2 ∗ 1
In example #4.4.2, the solution was found by find. Many counting problems involve multiplying a list of decreasing numbers. This is called a factorial. There is a special symbol for this.
Factorial 𝑛! = 𝑛(𝑛 − 1)(𝑛 − 2) ∗ ⋯ ∗ 2 ∗ 1
As an example: 5! = 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 = 120 8! = 8 ∗ 7 ∗ 6 ∗ 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 = 40320
0 factorial is defined to be 0!=1 and 1 factorial is defined to be 1!=1. In R Studio, the command for factorial is factorial(number). As and example 7! using R Studio would be
factorial(7)
## [1] 5040
Sometimes you are trying to select r objects from n total objects. The number of ways to do this depends on if the order you choose the r objects matters or if it doesn’t. As an example if you are trying to call a person on the phone, you have to have their number in the right order. Otherwise, you call someone you didn’t mean to. In this case, the order of the numbers matters. If however you were picking random numbers for the lottery, it doesn’t matter which number you pick first. As long as you have the same numbers that the lottery people pick, you win. In this case the order doesn’t matter. A permutation is an arrangement of items with a specific order. You use permutations to count items when the order matters. When the order doesn’t matter you use combinations. A combination is an arrangement of items when order is not important. When you do a counting problem, the first thing you should ask yourself is “does order matter?”
Permutation Formula
(𝑛−𝑟)!
Picking r objects from n total objects when order matters 𝑛𝑃𝑟 = 𝑛! .
Combination Formula
𝑟!(𝑛−𝑟)!
Picking r objects from n total objects when order doesn’t matter 𝑛𝐶𝑟 = 𝑛!
Most calculators have a factorial button on them, and many have the combina- tion and permutation functions also.
Homework
- You are going to a benefit dinner, and need to decide before the dinner what you want for salad, main dish, and dessert. You have 2 different salads to choose from, 3 main dishes, and 5 desserts. How many different meals are available?
- How many different phone numbers are possible in the area code 928?
- You are opening a T-shirt store. You can have long sleeves or short sleeves, three different colors, five different designs, and four different sizes. How many different shirts can you make?
- The California license plate has one number followed by three letters fol- lowed by three numbers. How many different license plates are there?
- Find 9𝑃4
- Find 10𝑃6
- Find 10𝐶5
- Find 20𝑃4
- You have a group of twelve people. You need to pick a president, treasurer, and secretary from the twelve. How many different ways can you do this?
- A baseball team has a 25-person roster. A batting order has nine people. How many different batting orders are there?
- An urn contains five red balls, seven yellow balls, and eight white balls. How many different ways can you pick two red balls?
- How many ways can you choose seven people from a group of twenty?
Data sources:
Aboriginal deaths in custody. (2013, September 26). Retrieved from <http:
//www.statsci.org/data/oz/custody.html
Activities of Dolphin Groups. (n.d.). Retrieved July 12, 2019, from http:// www.statsci.org/data/general/dolpacti.html
Car Preferences. (n.d.). Retrieved July 11, 2019, from http://www.statsci.org/ data/oz/carprefs.html
M&M’s Color Distribution Analysis. (n.d.). Retrieved July 11, 2019, from https://joshmadison.com/2007/12/02/mms-color-distribution-analysis/