counting and probability. counting elements of sets theorem. the inclusion/exclusion rule for two or...
TRANSCRIPT
Counting and Probability
Counting Elements of Sets Theorem. The Inclusion/Exclusion
Rule for Two or Three Sets If A, B, and C are finite sets, then N(AB) = N(A) + N(B) – N(A B) and N(ABC) = N(A) + N(B) + N(C) –
N(AB) – N(AC) – N(BC) + N(ABC)
Example 1 In a class of 50 college freshmen, 30 are
studying BASIC, 25 studying PASCAL, and 10 are studying both.
How many freshmen are studying either computer language?
A: set of freshmen study BASIC B: set of freshmen study PASCAL N(AB) = N(A)+N(B)-N(AB) = 30 + 25 – 10 = 45
10
20
10
15
Example 2 A professor takes a survey to determine how
many students know certain computer languages. The finding is that out of a total of 50 students in the class,
30 know Java;18 know C++26 know SQL 9 know both Java and C++16 know both Java and SQL 8 know both C++ and SQL47 know at least one of the 3 languages.
Example 2
a. How many students know none of the three languages?
b. How many students know all three languages?
c. How many students know Java and C++ but not SQL? How many students know Java but neither C++ nor SQL
Answer:a. 50 – 47 = 3
Example 2
J = the set of students who know Java
C = the set of students who know C++
S = the set of students who know SQL
Use Inclusion/Exclusion rule.
Discrete ProbabilityThe probability of an event is the likelihood
that event will occur. “Probability 1” means that it must happen while
probability 0 means that it cannot happen E.g.: the probability of…
“Manchester United defeat Liverpool this season” is 1
“Liverpool win the Premier League this season” is 0 Events which may or may not occur are
assigned a number between 0 and 1.
Discrete Probability
Consider the following problems: What’s the probability of tossing a
coin 3 times and getting all heads or all tails?
What’s the probability that a list consisting of n distinct numbers will not be sorted?
Set cardinalities are useful.
Discrete Probability An experiment is a process that yields
an outcome. A sample space is the set of all possible
outcomes of a random process. An event is an outcome or combination
of outcomes from an experiment. An event is a subset of a sample space. Examples of experiments: - Rolling a six-sided die - Tossing a coin.
ExampleEG: What’s the probability of tossing a coin 3 times and
getting all heads or all tails?Can consider set of ways of tossing coin 3 times:
S = {HHH,HHT,HTH,HTT,THH,THT,TTH,TTT}S is called a sample space. Next, consider set of ways of tossing all heads or all tails:
E = {HHH,TTT}E is called the event.Assuming all outcomes equally likely to occurDefinition: The probability of the event E is the ratio
p (E ) = |E | / |S |EG: Our case: p (E ) = 2/8 = 0.25
Example Five microprocessors are randomly selected
from a lot of 1000 microprocessors among which 20 are defective. Find the probability of obtaining no defective microprocessors.
There are C(1000,5) ways to select 5 micros. There are C(980,5) ways to select 5 good
micros. The prob. of obtaining no defective micros is C(980,5)/C(1000,5) = 0.904
Question
???
Probability of combinations of events Theorem. Let E1 and E2 be events in the sample space S.
Then P(E1 E2) = P(E1) + P(E2) – P(E1 E2)E.g. What is the prob. that a positive integer selected
at random from the set of positive integers not greater than 100 is divisible by either 2 or 5.
E1: event that the integer selected is divisible by 2
E2: event that the integer selected is divisible by 5
P(E1 E2) = 50/100 + 20/100 – 10/100 = 3/5
Exercise
Two fair dice are rolled. What is the probability that the sum of the numbers on the dice is 10?
THANK YOU