Discrete Structures Chapter 4 Counting and Probability

Download Presentation

Discrete Structures Chapter 4 Counting and Probability

Loading in 2 Seconds...

- 80 Views
- Uploaded on
- Presentation posted in: General

Discrete Structures Chapter 4 Counting and Probability

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Discrete StructuresChapter 4

Counting and Probability

Nurul Amelina Nasharuddin

Multimedia Department

- Rules of Sum and Product
- Permutations
- Combinations: The Binomial Theorem
- Combinations with Repetition: Distribution
- Probability

Example:

How many ways are there to select 4 pieces of fruits from a bowl containing apples, oranges, and pears if the order does not matter, only the type of fruit matters, and there are at least 4 pieces of each type of fruit in the bowl

- Some of the results:

The number of ways to select 4 pieces of fruit = The number of ways to arrange 4 X’s and 2 |’s, which is given by

= 6! / 4!(6-4)! = C(6,4) = 15 ways.

- In general, when we wish to select, with repetition, r of n distinct elements, we are considering all arrangements of r X’s and n-1 |’s and that their number is

- An r-combination of a set of n elements is an unordered selection of r elements from the set, with repetition is:

A person throwing a party wants to set out 15 assorted cans of drinks for his guests. He shops at a store that sells five different types of soft drinks. How many different selections of 15 cans can he make?

(Here n = 5, r = 15)

- 4 |’s (to separate the categories of soft drinks)
- 15 X’s (to represent the cans selected)
= 19! / 15!(19-15)!

= C(19,15)

= 3876 ways.

A donut shop offers 20 kinds of donuts. Assuming that there are at least a dozen of each kind when we enter the shop, we can select a dozen donuts in

(Here n = 20, r = 12).

= C(31, 12) = 141,120,525 ways.

A restaurant offers 4 kinds of food. In how many ways can we choose six of the food?

C(6 + 4 - 1, 6) = C(9, 6)

= C(9, 3)

= 9! = 84 ways.

3! 6!

Different ways of choosing k elements from n

Counting and 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
- Eg: 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.

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?

- 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

Experiment 1: Tossing a coin.

- Sample space: S = {Head or Tail} or we could write: S = {0, 1} where 0 represents a tail and 1 represents a head.
Experiment 2: Tossing a coin twice

- S = {HH, TT, HT, TH} where some events:
- E1 = {Head},
- E2 = {Tail},
- E3 = {All heads}

- Suppose an event E can happen in r ways out of a total of n possible equally likely ways.
- Then the probability of occurrence of the event (called its success) is denoted by
- The probability of non-occurrence of the event (called its failure) is denoted by
- Thus,

- If S is a finite sample space in which all outcomes are equally likely and E is an event in S, then the probability of E, P(E), is
- where
N(E) is the number of outcomes in E

N(S) is the total number of outcomes in S

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: Sample space, S = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}

Next, consider set of ways of tossing all heads or all tails:Event, E = {HHH, TTT}

Assuming all outcomes equally likely to occur

P(E) = 2/8 = 0.25

- 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

- Theorem: Let E1 and E2 be events in the sample space S. Then
P(E1 E2) = P(E1) + P(E2) – P(E1 E2)

- Eg: What is the probability 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

- If any seven digits could be used to form a telephone number, how many seven-digits telephone numbers would not have repeated digits?
- How many seven-digit telephone numbers would have at least one repeated digit?
- What is the probability that a randomly chosen seven-digit telephone number would have at least one repeated digit?

- 10 x 9 x 8 x 7 x 6 x 5 x 4 = 604800
- [no of PN with at least one digit] = [total no of PN] – [no of PN with no repeated digit] = 107 – 604800 = 9395200
- 9395200 / 107 = 0.93952

The Principle of 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)

- In a class of 50 college freshmen, 30 are studying BASIC, 25 studying PASCAL, and 10 are studying both.
How many freshmen are not 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

- Not studying either: 50 – 45 =5

10

20

10

15

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

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:

- 50 – 47 = 3
- ?
- ?

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