Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Mathematical Structures (Counting Principles)

Similar presentations


Presentation on theme: "Discrete Mathematical Structures (Counting Principles)"— Presentation transcript:

1 Discrete Mathematical Structures (Counting Principles)

2 Discrete Mathematical Structures: Theory and Applications 2 Learning Objectives  Learn the basic counting principles— multiplication and addition  Explore the pigeonhole principle  Learn about permutations  Learn about combinations

3 Discrete Mathematical Structures: Theory and Applications 3 Learning Objectives  Explore generalized permutations and combinations  Learn about binomial coefficients and explore the algorithm to compute them  Discover the algorithms to generate permutations and combinations  Become familiar with discrete probability

4 Discrete Mathematical Structures: Theory and Applications 4 Basic Counting Principles

5 Discrete Mathematical Structures: Theory and Applications 5 Basic Counting Principles

6 Discrete Mathematical Structures: Theory and Applications 6 Basic Counting Principles  There are three boxes containing books. The first box contains 15 mathematics books by different authors, the second box contains 12 chemistry books by different authors, and the third box contains 10 computer science books by different authors.  A student wants to take a book from one of the three boxes. In how many ways can the student do this?

7 Discrete Mathematical Structures: Theory and Applications 7 Basic Counting Principles  Suppose tasks T 1, T 2, and T 3 are as follows:  T 1 : Choose a mathematics book.  T 2 : Choose a chemistry book.  T 3 : Choose a computer science book.  Then tasks T 1, T 2, and T 3 can be done in 15, 12, and 10 ways, respectively.  All of these tasks are independent of each other. Hence, the number of ways to do one of these tasks is 15 + 12 + 10 = 37.

8 Discrete Mathematical Structures: Theory and Applications 8 Basic Counting Principles

9 Discrete Mathematical Structures: Theory and Applications 9 Basic Counting Principles  Morgan is a lead actor in a new movie. She needs to shoot a scene in the morning in studio A and an afternoon scene in studio C. She looks at the map and finds that there is no direct route from studio A to studio C. Studio B is located between studios A and C. Morgan’s friends Brad and Jennifer are shooting a movie in studio B. There are three roads, say A 1, A 2, and A 3, from studio A to studio B and four roads, say B 1, B 2, B 3, and B 4, from studio B to studio C. In how many ways can Morgan go from studio A to studio C and have lunch with Brad and Jennifer at Studio B?

10 Discrete Mathematical Structures: Theory and Applications 10 Basic Counting Principles  There are 3 ways to go from studio A to studio B and 4 ways to go from studio B to studio C.  The number of ways to go from studio A to studio C via studio B is 3 * 4 = 12.

11 Discrete Mathematical Structures: Theory and Applications 11 Basic Counting Principles

12 Discrete Mathematical Structures: Theory and Applications 12 Basic Counting Principles  Consider two finite sets, X 1 and X 2. Then  This is called the inclusion-exclusion principle for two finite sets.  Consider three finite sets, A, B, and C. Then  This is called the inclusion-exclusion principle for three finite sets.

13 Discrete Mathematical Structures: Theory and Applications 13 Basic Counting Principles

14 Discrete Mathematical Structures: Theory and Applications 14 Pigeonhole Principle  The pigeonhole principle is also known as the Dirichlet drawer principle, or the shoebox principle.

15 Discrete Mathematical Structures: Theory and Applications 15 Pigeonhole Principle

16 Discrete Mathematical Structures: Theory and Applications 16

17 Discrete Mathematical Structures: Theory and Applications 17 Pigeonhole Principle

18 Discrete Mathematical Structures: Theory and Applications 18 Permutations

19 Discrete Mathematical Structures: Theory and Applications 19 Permutations

20 Discrete Mathematical Structures: Theory and Applications 20 Combinations

21 Discrete Mathematical Structures: Theory and Applications 21 Combinations

22 Discrete Mathematical Structures: Theory and Applications 22 Generalized Permutations and Combinations

23 Discrete Mathematical Structures: Theory and Applications 23 Generalized Permutations and Combinations

24 Discrete Mathematical Structures: Theory and Applications 24 Binomial Coefficients  The expression x +y is a binomial expression as it is the sum of two terms.  The expression (x +y) n is called a binomial expression of order n.

25 Discrete Mathematical Structures: Theory and Applications 25 Binomial Coefficients

26 Discrete Mathematical Structures: Theory and Applications 26 Binomial Coefficients

27 Discrete Mathematical Structures: Theory and Applications 27 Binomial Coefficients  Pascal’s Triangle  The number C(n, r) can be obtained by constructing a triangular array.  The row 0, i.e., the first row of the triangle, contains the single entry 1. The row 1, i.e., the second row, contains a pair of entries each equal to 1.  Calculate the nt h row of the triangle from the preceding row by the following rules:

28 Discrete Mathematical Structures: Theory and Applications 28 Binomial Coefficients

29 Discrete Mathematical Structures: Theory and Applications 29

30 Discrete Mathematical Structures: Theory and Applications 30 Binomial Coefficients  ALGORITHM 7.1: Determine the factorial of a nonnegative integer.  Input: n—a positive integer  Output: n!  function factorial(n)  begin  fact := 1;  for i := 2 to n do  fact := fact * i;  return fact;  end

31 Discrete Mathematical Structures: Theory and Applications 31 Binomial Coefficients  The technique known as divide and conquer can be used to compute C(n, r ).  In the divide-and-conquer technique, a problem is divided into a fixed number, say k, of smaller problems of the same kind.  Typically, k = 2. Each of the smaller problems is then divided into k smaller problems of the same kind, and so on, until the smaller problem is reduced to a case in which the solution is easily obtained.  The solutions of the smaller problems are then put together to obtain the solution of the original problem.

32 Discrete Mathematical Structures: Theory and Applications 32 Binomial Coefficients

33 Discrete Mathematical Structures: Theory and Applications 33 Binomial Coefficients  ALGORITHM 7.3: Determine C(n, r) using dynamic programming.  Input: n, r, n > 0, r > 0, r ≤ n  Output: C(n, r)  function combDynamicProg(n,r)  begin  for i := 0 to n do  for j := 0 to min(i,r) do  if j = 0 or j = i then  C[i,j] := 1;  else  C[i,j] := C[i-1, j-1] + C[i-1, j];  return C[n, r];  end

34 Discrete Mathematical Structures: Theory and Applications 34 Generating Permutations and Combinations

35 Discrete Mathematical Structures: Theory and Applications 35 Generating Permutations and Combinations

36 Discrete Mathematical Structures: Theory and Applications 36 Generating Permutations and Combinations

37 Discrete Mathematical Structures: Theory and Applications 37 Generating Permutations and Combinations

38 Discrete Mathematical Structures: Theory and Applications 38 Generating Permutations and Combinations

39 Discrete Mathematical Structures: Theory and Applications 39 Generating Permutations and Combinations

40 Discrete Mathematical Structures: Theory and Applications 40

41 Discrete Mathematical Structures: Theory and Applications 41

42 Discrete Mathematical Structures: Theory and Applications 42 Discrete Probability  Definition 7.8.1  A probabilistic experiment, or random experiment, or simply an experiment, is the process by which an observation is made.  In probability theory, any action or process that leads to an observation is referred to as an experiment.  Examples include:  Tossing a pair of fair coins.  Throwing a balanced die.  Counting cars that drive past a toll booth.

43 Discrete Mathematical Structures: Theory and Applications 43 Discrete Probability  Definition 7.8.3  The sample space associated with a probabilistic experiment is the set consisting of all possible outcomes of the experiment and is denoted by S.  The elements of the sample space are referred to as sample points.  A discrete sample space is one that contains either a finite or a countable number of distinct sample points.

44 Discrete Mathematical Structures: Theory and Applications 44 Discrete Probability  Definition 7.8.6  An event in a discrete sample space S is a collection of sample points, i.e., any subset of S. In other words, an event is a set consisting of possible outcomes of the experiment.  Definition 7.8.7  A simple event is an event that cannot be decomposed. Each simple event corresponds to one and only one sample point. Any event that can be decomposed into more than one simple event is called a compound event.

45 Discrete Mathematical Structures: Theory and Applications 45 Discrete Probability  Definition 7.8.8  Let A be an event connected with a probabilistic experiment E and let S be the sample space of E. The event B of nonoccurrence of A is called the complementary event of A. This means that the subset B is the complement A’ of A in S.  In an experiment, two or more events are said to be equally likely if, after taking into consideration all relevant evidences, none can be expected in reference to another.

46 Discrete Mathematical Structures: Theory and Applications 46 Discrete Probability

47 Discrete Mathematical Structures: Theory and Applications 47 Discrete Probability  Axiomatic Approach  Analyzing the concept of equally likely probability, we see that three conditions must hold.  The probability of occurrence of any event must be greater than or equal to 0.  The probability of the whole sample space must be 1.  If two events are mutually exclusive, the probability of their union is the sum of their respective probabilities.  These three fundamental concepts form the basis of the definition of probability.

48 Discrete Mathematical Structures: Theory and Applications 48 Discrete Probability

49 Discrete Mathematical Structures: Theory and Applications 49 Discrete Probability

50 Discrete Mathematical Structures: Theory and Applications 50 Discrete Probability

51 Discrete Mathematical Structures: Theory and Applications 51 Discrete Probability  Conditional Probability  Consider the throw of two distinct balanced dice. To find the probability of getting a sum of 7, when it is given that the digit in the first die is greater than that in the second.  In the probabilistic experiment of throwing two dice the sample space S consists of 6 * 6 = 36 outcomes.  Assume that each of these outcomes is equally likely. Let A be the event: The sum of the digits of the two dice is 7, and let B be the event: The digit in the first die is greater than the second.

52 Discrete Mathematical Structures: Theory and Applications 52 Discrete Probability  Conditional Probability  A : {(6, 1), (5, 2), (4, 3), (3, 4), (2, 5), (1, 6)}  B : {(6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (5, 1), (5, 2), (5, 3),(5, 4), (4, 1), (4, 2), (4, 3), (3, 1), (3, 2), (2, 1)}.  Let C be the event: The sum of the digits in the two dice is 7 but the digit in the first die is greater than the second. Then C : {(6, 1), (5, 2), (4, 3)} = A ∩ B.


Download ppt "Discrete Mathematical Structures (Counting Principles)"

Similar presentations


Ads by Google