Presentation is loading. Please wait.

Presentation is loading. Please wait.

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(A.

Similar presentations


Presentation on theme: "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(A."— Presentation transcript:

1 Counting and Probability

2 Counting Elements of Sets Theorem. The Inclusion/Exclusion Rule for Two or Three Sets If A, B, and C are finite sets, then N(A  B) = N(A) + N(B) – N(A  B) and N(A  B  C) = N(A) + N(B) + N(C) – N(A  B) – N(A  C) – N(B  C) + N(A  B  C)

3 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(A  B) = N(A)+N(B)-N(A  B) = 30 + 25 – 10 = 45 10 20 10 15

4 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 SQL 47 know at least one of the 3 languages.

5 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

6 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.

7 Discrete Probability The 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.

8 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.

9 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.

10 Example EG: 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 occur Definition: The probability of the event E is the ratio p (E ) = |E | / |S | EG: Our case: p (E ) = 2/8 = 0.25

11 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

12 Question ???

13 Probability of combinations of events Theorem. Let E 1 and E 2 be events in the sample space S. Then P(E 1  E 2 ) = P(E 1 ) + P(E 2 ) – P(E 1  E 2 ) 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. E 1 : event that the integer selected is divisible by 2 E 2 : event that the integer selected is divisible by 5 P(E 1  E 2 ) = 50/100 + 20/100 – 10/100 = 3/5

14 Exercise Two fair dice are rolled. What is the probability that the sum of the numbers on the dice is 10?

15 THANK YOU


Download ppt "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(A."

Similar presentations


Ads by Google