7. Logic, Sets, and Counting
7.3 Basic Counting Principles
Chemistry class – 13 males, 15 females
Set M, set F, , , ,
Algebra – 22 Math, 16 Physics, 7 double majors
Set M, set P, , ,
Addition Principle (for Counting)
For any two sets A and B,
If A and B are disjoint, then
According to a survey, 750 businesses offer health insurance to their employees, 640 offer dental insurance, and 280 offer both. How many offer health or dental insurance?
Venn diagrams
A city has two daily newspapers. A survey of 100 residents shows that 35 subscribe to the Sentinel, 60 to the Journal, and 20 to both.
- How many subscribe to only the Sentinel?
- How many subscribe to only the Journal?
- How many subscribe to neither paper?
- Organize this information in a table.
Multiplication Principle (for Counting)
A store stocks windbreaker jackets in S, M, L, and XL, and all are available in blue and red. What are the combined choices, and how many combined choices are there?
If two operations and are performed in order, with possible outcomes of the first and possible outcomes of the second, then there are possible outcomes of the first followed by the second.
How many ways can 3 letters and 3 numbers appear on a license plate?
4 letters and two numbers?
Suppose a university screening test is to consist of 5 questions, and the generating computer stores 5 comparable first questions, 8 second, 6 third, 5 fourth, and 10 fifth. How many different 5-question tests can be generated?
How many 3-letter code words can be generated using the first 8 letters of the alphabet if:
- No letter is repeated?
- Letters can be repeated?
- Adjacent letters cannot be alike?
7.4 Permutations and Combinations
Factorials
For n, a natural number,
5!=
Permutations
A permutation of a set of distinct objects is an arrangement of the objects in a specific order without repetition.
How many ways can 5 pictures be arranged on a wall?
Number of permutations of n objects
The number of permutations of n distinct objects without repetition, designated , is
Permutations of n objects taken r at a time
How many ordered arrangements of 3 pictures can be formed from the 5 pictures above?
The number of permutations of n distinct objects taken r at a time, is given by
or
Given the set , how many permutations are there of this set taken 2 at a time?
- Using a tree diagram?
- Multiplication principle
- Two formulas for
Find the number of permutations of 13 objects taken 8 at a time.
Combinations
A combination of n objects taken r at a time without repetition is an r-element subset of the set of n objects. The arrangement of the elements in the subset does not matter.
Symbolism
Combinations of n objects taken r at a time
The number of combinations of n objects taken r at a time without repetition is given by
=
From a committee of 10 people,
- How many ways can we choose a chair, vice-chair, and a secretary?
- How many ways can we choose a subcommittee of 3 people?
Find the number of combinations of 13 objects taken 8 at a time.
Permutation order is vital
Combination order is irrelevant
How many 5-card hands will have 3 aces and 2 kings?
Serial numbers for a product are to be made using 2 letters followed by 3 numbers. If letters are selected from the first 8 letters of the alphabet with no repeats, and numbers are to be taken from the 10 digits (0-9), with no repeats, how many serial numbers are possible?
A company has 7 senior officers and 5 junior officers. How many ways can a 4-officer committee be formed composed of:
- any four officers
- 4 senior officers
- 3 seniors and a junior
- 2 seniors and 2 juniors
- at least 2 seniors
From a standard 52-card deck, how many 3-card hands have all cards from the same suit?
8. Probability
8.1 Sample Spaces, Events, and Probability
Theoretical approach, empirical approach
If we formulate a set S of outcomes (events) in such a way that each trial of an experiment has only one possible outcome out of a set, we call that set a sample space and each outcome, a simple outcome or simple event. An eventE
is defined to be any subset of S (including the empty set and the entire set). E is a simple event if it includes only one element, and a compound event if more than one.
Simple roulette wheel – 18 spaces
Desired outcome: divisible by 4
Outcome is a prime number
Outcome is the square of 4
Sample spaces
A nickel and a dime are flipped. Sample space?
Possible outcomes
Number of heads
Match or Don’t match
Rolling two dice
1 / 2 / 3 / 4 / 5 / 61 / / / / / /
2 / / / / / /
3 / / / / / /
4 / / / / / /
5 / / / / / /
6 / / / / / /
Some events:
Roll a 7
Roll 11
Sum less than 4
Sum of 12
Probability of an event
Acceptable probability assignment
Given a sample space
we assign a real number, denoted , called the probability of event .
1.Each probability is between 0 and 1
2.Sum of all probabilities is 1.
Tossing a coin
Theoretical approach
Empirical approach
Probability of an event E
Given an acceptable probability assignment for simple events in sample space S, the probability of an arbitrary event E, denoted , is as follows:
- If E is the empty set, then .
- If E is a simple event, has already been assigned.
- If E is a compound event, then is the sum of the probabilities of the simple events in E.
- If E=S, .
A nickel and a dime are flipped.
Sample space
Event/ HH / HT / TH / TT
Probability of one head and one tail?
Probability of at least one head?
Probability of at least one head or at least one tail?
Probability of 3 heads?
To find probability of an event E:
- Setup an appropriate sample space S for the experiment.
- Assign acceptable probabilities to each simple event in S.
- To obtain the probability for an arbitrary event E, add the probabilities of the simple events in E.
Theoretical approach: We use assumptions and deductive reasoning to assign probabilities.
Empirical approach: We assign probabilities based on results of experiments.
Frequency
Relative frequency
Empirical Probability
Empirical Probability approximation
Equally likely assumption
In a sample space
with n elements, we assume that each simple event is as likely to occur as any other. Then
Rolling a prime number with die
Probability of an Arbitrary Event under an Equally Likely Assumption
If we assume that each simple event in simple space S is as likely to occur as any other, then the probability of an arbitrary event E in S is given by:
Consider rolling two dice,
Roll 7
Roll 11
Sum less than 4
Sum of 12
In drawing 5 cards from a 52 card deck without replacement, what is the probability of getting 5 spades?
The board of regents is made up of 12 men and 16 women. If a committee of 6 is chosen at random, what is the probability that it will contain 3 men and 3 women?
8.2 Union, Intersection, and Complement of Events; Odds
The event A or B is defined as
The event A and B is defined as .
Let A be the probability of rolling an odd number, and B be the probability of divisible by 3.
Probability of odd and divisible by 3?
Probability of odd or divisible by 3?
Probability of a Union of Two Events
For any events A and B,
If A and B are disjoint, then
Probability of rolling a 7 or 11?
Probability of rolling less than 5 or doubles?
Probability that a number is exactly divisible by 3 or 4?
Complement of an Event
Suppose we divide into two disjoint subsets.
and .
Then is called the complement of E relative to S.
Also,
If the probability of having a boy in a two child family is 0.75, what is the probability of 2 girls?
A shipment of 45 precision parts, including 9 that are defective, is sent to an assembly plant. The quality control division selects 10 parts at random for testing and rejects the entire shipment of 1 or more in the sample are found defective. What is the probability that the shipment will be rejected?
In a group of n people, what is the probability that at least two people have the same birthday (same month/day, excluding 29 Feb)
Odds
Odds for E =
Odds against E =
Probability and Odds of rolling a 4 with one die:
Probability
Odds
What are the odds for rolling a 7 in a single roll of two dice?
If you bet $1 on rolling a 7, what should the house pay if you roll a 7 for the game to be fair?
If the odds for an event E are , then the probability of E is
If in repeated rolls of two fair dice, the odds of rolling a 5 before a 7 are 2 to 3, then the probability of rolling a 5 before a 7 is:
Applications to Empirical Probability
Law of Averages
The approximate empirical probability can be made as close to the actual probability as we please by making the sample size sufficiently large.
From a survey of 1,000 people, it was determined that 500 people had tried a certain brand of diet soda, 600 had tried the brand of regular soda, and 200 had tried both. If a resident is selected at random, what is the (empirical) probability that:
The resident has tried diet or regular soda? What are the (empirical) odds for this event?
The resident has tried one but not both? What are the (empirical) odds against this event?
8.3 Conditional Probability, Intersection, and Independence
Conditional Probability
Occurrence of an event, given the occurrence of another event.
A=adult has lung cancer
B=adult is a heavy smoker
What is the probability of rolling a prime number?
What is the probability of the number being prime if we know an odd number has occurred?
Conditional Probability
For events A and B in arbitrary sample space S, we define conditional probability of A given B by
A pointer is spun once on a circular spinner with probabilities below:
/ 1 / 2 / 3 / 4 / 5 / 6/ .1 / .2 / .1 / .1 / .3 / .2
- What is the probability of landing on a prime number?
- What is the probability of landing on a prime number given it is an odd number?
Suppose that past records in a large city produced the following probability data on a driver being in an accident on the last day of a Memorial Day weekend.
Accident / No accident / TotalsA / A’
Rain / R / .025 / .335 / .360
No Rain / R’ / .015 / .625 / .640
Totals / .040 / .960 / 1.000
- Find the probability of an accident, rain or no rain.
- Find the probability of rain, accident or no accident.
- Find the probability of accident and rain.
- Find the probability of accident, given rain.
Intersection of Events: Product Rule
and
Product Rule
For events A and B with non-zero probabilities in a sample space S,
If 60% of a department store’s customers are female and 75% of the female customers have charge accounts at the store, what is the probability that a customer selected at random is female and has a charge account?
Probability Trees
Two balls are drawn in succession, without replacement, from a box containing 3 blue and 2 white balls. What is the probability of drawing a white ball on the second draw?
Constructing Probability Trees
- Draw a tree diagram corresponding to all combined outcomes of the sequence of experiments.
- Assign a probability to each branch. (Probability of event at right end of branch given the occurrence of the other events leading to it)
- Use the results to answer various questions related to the sequence as a whole.
Computer company A subcontracts circuit board production 40% to company B, and 60% to company C. B subs 70% to D and 30% to E. Completed boards are shipped direct back to A. 1.5%, 1%, and .5% from D, E, and C, respectively prove defective in first 90 days. What is the probability of a defective board?
Independent Events
Without replacement vs. with replacement
Independence
If A and B are events in sample space S, we say that A and B are independent iff
Otherwise, A and B are said to be dependent.
Thm 1
If A and B are independent events with nonzero probabilities, in a sample space S, then
and
Since and
Testing for independence
Consider sample space of two coin tosses.
and events
A= head on first toss =
B= head on second toss =
Draw a card from a deck
A. E=drawn card is a spade.
F=drawn card is a face card.
B.G=drawn card is a club.
H=drawn card is a heart.
A set of events is said to be independent if for each finite subset
A space shuttle has 4 independent computer control systems. If the probability of failure (during flight) of any one system is 0.001, what is the probability of the failure of all four systems?
8.4 Bayes’ Formula
Probability of an earlier event, given a later event.
One urn has 3 blue and 2 white balls, a second urn has 1 blue and 3 white balls. A single fair die is rolled, and if 1 or 2 comes up, the ball is drawn from the first urn, otherwise ball is drawn from the second urn. If the drawn ball is blue, what is the probability that it came from the first urn?
M
c
U
adN
S
beM
V
fN
Bayes’ Formula
Let be mutually exclusive events whose union is sample space S. Let E be an arbitrary event in S such that . Then,
Tuberculosis screening
A trusted test for TB shows 8% of 1000 in a test group have TB. A new test indicates TB in 96% who have it, and in 2% who do not have it. What is the probability of a random person having it testing positive? What is the probability of a person not having it testing positive?
A company produces 1000 refrigerators a week. Plant A produces 350, plant B produces 250, and plant C produces 400. Records indicate 5% from plant A, 3% from plant B, and 7% from plant C are defective. If a refrigerator is found to be defective, what is the probability it is from plant A?
8.5 Random Variable, Probability Distribution, and Expected Value
A random variable is a function that assigns a numerical value to each simple event in a sample space S.
3 coin tosses
TTT
TTH
THT
HTT
THH
HTH
HHT
HHH
where
Probability distribution of the random variable X
Exactly 2 heads occur
The probability distribution of a random variable X, denoted by , satisfies
1.
2.
where are the values of X.
Expected value of a Random Variable
Given the probability distribution for the random variable X,
where , we define the expected value of X, denoted , by the formula
What is the expected value of the number of dots facing up on the roll of a single die?
A carton of 20 laptop batteries contains 2 dead ones. A random sample of 3 is selected from the 20 and tested. Let X be the random variable associated with the number of dead batteries found in a sample.
- Find the probability distribution of X.
- Find the expected number of dead batteries in a sample.
A spinner device is numbered 0 to 5, each number is equally likely to occur. Any player who bets $1 on any given number wins $4 (and gets his bet back) if the pointer lands on the chosen number, otherwise, the $1 is lost. What is the expected value of the game?
Suppose you are considering insurance on a $2000 car video system against theft. The company charges $225/year, claiming empirical probability of 0.1 that the stereo will be stolen some time during the coming year. What is the expected return to the insurance company if you take out this policy?
Consider exam scores 85, 73, 82, 65, 95, 85, 73, 75, 85, and 75.
Class average (mean)
Decision analysis
An outdoor concert featuring a very popular musical group is scheduled for Sunday afternoon in a large open stadium. The promoter, worried about a rainout, hears from a forecaster the probability of rain is 0.24. If it does not rain, the promoter will net $100,000, if it does rain, the promoter will net $10,000. An insurance company agrees to insure the concert for $100,000 against rain at a premium of $20,000. Should the promoter buy the insurance?
11. Data Description and Probability Distributions
11.2 Measures of Central Tendency
Measures that indicate the approximate center of a distribution are called measures of central tendency.
Measures that indicate the amount of scatter about a central point are called measures of dispersion.
Mean
The mean of a set of quantitative data is equal to the sum of all measurements in the data set divided by the total number of measurements in the set.
Notation:=sample mean
=population mean
Mean: ungrouped data
If is a set of measurements, then the mean is the set of measurements is given by:
Use symbol for sample mean or for population mean.
Find the mean for sample measurements 3, 5, 1, 8, 6, 5, 4, and 6.
Mean: grouped data
A data set of n measurements is grouped into k classes in a frequency table. If is the midpoint of the ith class interval and is the ith class frequency, the mean for the grouped data is given by
Use symbol for sample mean or for population mean.
Note that n is the total number of measurements in all the classes, not the number of classes.
Suppose the annual salaries of seven people in a small company are $34k, $36k, $36k, $40k, $48k, $56k, and $156k.
=
Median
If the number of measurements in a set is odd, the median is the middle measurement, when the measurements are arranged in ascending or descending order.
If the number of measurements in a set is even, the median is the mean of the two middle measurements, when the measurements are arranged in ascending or descending order.
Median for grouped data
The median for grouped data with no classes of frequency 0 is the number such that the histogram has the same area to the left of the median as to the right of the median.
Mode
The mode is the most frequently occurring measurement in the data set.
4,5,5,5,6,6,7,8,12
1,2,3,3,3,5,6,7,7,7,23
1,3,5,6,7,9,11,15,16
11.3 Measures of Dispersion
Range
The range for a set of ungrouped data is the difference between the largest and the smallest values in the data set.
The range for a frequency distribution is the difference between the upper boundary of the highest class and the lowest boundary of the lowest class.
Standard Deviation: Ungrouped data
5.2, 5.3, 5.2, 5,5, 5.3
variance =
standard deviation =
Definitions:
The sample variance of a set of n sample measurements with mean is given by
If is the whole population with mean , then the population variance is given by
The sample standard deviations of a set of n sample measurements with mean is given by
If is the whole population with mean , then the population standard deviation is given by