Discrete Mathematics 5. COMBINATORICS Lecture 8 Dr.-Ing. Erwin Sitompul

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

1 A B C
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
5.1 Rules for Exponents Review of Bases and Exponents Zero Exponents
Copyright © Cengage Learning. All rights reserved.
AP STUDY SESSION 2.
1
& dding ubtracting ractions.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Multiplication X 1 1 x 1 = 1 2 x 1 = 2 3 x 1 = 3 4 x 1 = 4 5 x 1 = 5 6 x 1 = 6 7 x 1 = 7 8 x 1 = 8 9 x 1 = 9 10 x 1 = x 1 = x 1 = 12 X 2 1.
Division ÷ 1 1 ÷ 1 = 1 2 ÷ 1 = 2 3 ÷ 1 = 3 4 ÷ 1 = 4 5 ÷ 1 = 5 6 ÷ 1 = 6 7 ÷ 1 = 7 8 ÷ 1 = 8 9 ÷ 1 = 9 10 ÷ 1 = ÷ 1 = ÷ 1 = 12 ÷ 2 2 ÷ 2 =
Objectives: Generate and describe sequences. Vocabulary:
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
David Burdett May 11, 2004 Package Binding for WS CDL.
We need a common denominator to add these fractions.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
CALENDAR.
1 1  1 =.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
PUBLIC KEY CRYPTOSYSTEMS Symmetric Cryptosystems 6/05/2014 | pag. 2.
4-1 Chapter 4 Counting Techniques.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
1 Combination Symbols A supplement to Greenleafs QR Text Compiled by Samuel Marateck ©2009.
Break Time Remaining 10:00.
Factoring Quadratics — ax² + bx + c Topic
Turing Machines.
PP Test Review Sections 6-1 to 6-6
Digital Lessons on Factoring
DIVISIBILITY, FACTORS & MULTIPLES
MM4A6c: Apply the law of sines and the law of cosines.
9.5 Counting Subsets of a Set: Combinations
Briana B. Morrison Adapted from William Collins
Look at This PowerPoint for help on you times tables
1 Combinations & Counting II Samuel Marateck © 2009.
Basic Permutations and Combinations
Copyright © 2013, 2009, 2005 Pearson Education, Inc.
Name Convolutional codes Tomashevich Victor. Name- 2 - Introduction Convolutional codes map information to code bits sequentially by convolving a sequence.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
Chapter 1: Expressions, Equations, & Inequalities
1..
Adding Up In Chunks.
Discrete Mathematics 3. MATRICES, RELATIONS, AND FUNCTIONS Lecture 5 Dr.-Ing. Erwin Sitompul
Discrete Mathematics Dr.-Ing. Erwin Sitompul
Discrete Mathematics 6. GRAPHS Lecture 10 Dr.-Ing. Erwin Sitompul
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
Sets Sets © 2005 Richard A. Medeiros next Patterns.
Artificial Intelligence
Subtraction: Adding UP
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Analyzing Genes and Genomes
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Lecture 12 Permutations and Combinations CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Clock will move after 1 minute
Intracellular Compartments and Transport
PSSA Preparation.
& dding ubtracting ractions.
Essential Cell Biology
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)
Chapter 5 Relations and Functions
Discrete Mathematics 4. NUMBER THEORY Lecture 7 Dr.-Ing. Erwin Sitompul
Presentation transcript:

Discrete Mathematics 5. COMBINATORICS Lecture 8 Dr.-Ing. Erwin Sitompul

8/2 Erwin SitompulDiscrete Mathematics Homework 7 Determine GCD(216,88) and express the GCD as a linear combination of 216 and 88. No.1: No.2: Given the ISBN-13: , check whether the code is valid or not. Hint: Verify the check digit of the ISBN numbers.

8/3 Erwin SitompulDiscrete Mathematics Solution of Homework 7 No.1: By enumerating:  Divisors of 216: 1,2,3,4,6,8,9,12,18,24,27,36,54,72,108.  Divisors of 88: 1,2,4,8,11,22,44.  Common divisors of 216 and 88 are 1, 2, 4, 8. GCD(45,36) = 8. By using Euclidean Algorithm : 216= 88  = 40  = 8  n = 0  m = 8 is the GCD, GCD(216,88) = 8.

8/4 Erwin SitompulDiscrete Mathematics Solution of Homework 7 No.1: Apply Euclidean Algorithm and obtain GCD(216,88) = 8 as follows: 216= 2  (1) 88 = 2  (2) 40= 5  (3) Rearrange (2) to 8 = 88 – 2  40(4) Rearrange (1) to 40= 216 – 2  88(5) Insert (5) to (4) so that 8 = 88 – 2  (216 – 2  88) = 88 – 2   88 = 5  88 – 2  216 Thus, GCD(216, 88) = 8 = 5  88 – 2  216 = –2   88

8/5 Erwin SitompulDiscrete Mathematics Solution of Homework 7 No.2: ISBN-13: Assuming the first 12 characters are true, the check digit of a valid ISBN can be obtained as follows: 9             3 = 105 Thus, the check digit is x 13  0 (mod 10) x 13 =5 The result is identical with the check digit of the ISBN, which is 5. Then, the ISBN is valid.

8/6 Erwin SitompulDiscrete Mathematics  A password may consist of 6 up to 8 characters. The characters can be letters or numbers. How many possible password can be generated? abcdef abcdeg a123bc … resnick mdrosen … zzzzzzzz Password Possibilities

8/7 Erwin SitompulDiscrete Mathematics Definition of Combinatorics  Combinatorics is a branch of mathematics concerning the study of finite or countable discrete structures.  One aspect of combinatorics is counting the number of possible structures of a given kind and size without enumeration.  This is done by deciding when certain criteria can be met, and followed by constructing and analyzing objects meeting the criteria.

8/8 Erwin SitompulDiscrete Mathematics Basic Rules  Rule of Product Attempt 1: p ways Attempt 2: q ways Attempt 1 and attempt 2: p  q ways  Rule of Sum Attempt 1: p ways Attempt 2: q ways Attempt 1 or attempt 2: p + q ways

8/9 Erwin SitompulDiscrete Mathematics Basic Rules Example: A leader of 6 th class in SDN 01 Cikarang will be elected out of 35 male students and 15 female students. In how many ways can the class leader be elected? Solution: By using Rule of Sum, = 50 ways. Example: The 6 th class in SDN 01 Cikarang is ordered to participate on the traditional costume parade in next August 17. Two students will be chosen to join the parade, one male and one female student. In how many ways can the two representatives be chosen? Solution: By using Rule of Product, 35  15 = 525 ways.

8/10 Erwin SitompulDiscrete Mathematics Extension of Basic Rules  Suppose there are n attempts, and each i-th attempt can be done in p i different ways. then:  Rule of Product For n attempts, the outcome can be obtained in p 1  p 2  …  p n ways.  Rule of Sum For n attempts, the outcome can be obtained in p 1 + p 2 + … + p n ways.

8/11 Erwin SitompulDiscrete Mathematics Example: A binary digit (bit) is constructed by 0 or 1. How many bit strings can be constructed if: (a) The length of the string is 5 digit. (b) The length of the string is 8 digit (= 1 byte). Solution: (a) 2  2  2  2  2 = 2 5 = 32 strings. (b) 2 8 = 256 strings. Extension of Basic Rules

8/12 Erwin SitompulDiscrete Mathematics Extension of Basic Rules Example: How many odd integers are there between 1000 and 9999 (including 1000 and 9999), if: (a) The integers are made of distinct numbers? (b) The integers may be made of the same numbers? Solution: (a) Unit digit: 5 possible numbers (1,3,5,7,9). Thousands digit:8 possible numbers (1 taken, no 0). Hundreds digit: 8 possible numbers (2 taken). Tens digit: 7 possible numbers (3 taken). The amount of possible odd integers are: 5  8  8  7 = (b)Unit digit : 5 possible numbers (1,3,5,7,9). Thousands digit:9 possible numbers (1-9, no 0). Hundreds digit: 10 possible numbers (0-9). Tens digit: 10 possible numbers (0-9). The amount of possible odd integers are 5  9  10  10 = 4500.

8/13 Erwin SitompulDiscrete Mathematics Extension of Basic Rules Example: The password in a certain computer network is 6- up to 8-character long. The character can be capital letters (A-Z) or numbers (0-9). How many password can be made for this network? Solution: Number of possible characters for the password = 26 (A-Z) + 10 (0-9) = 36 characters. Number of possible 6-character-long passwords: 36  36  36  36  36  36 = 36 6 = Number of possible 7-character-long passwords : 36  36  36  36  36  36  36 = 36 7 = Number of possible 8-character-long passwords : 36  36  36  36  36  36  36  36 = 36 8 = Total number of possible passwords (Rule of Sum): =

8/14 Erwin SitompulDiscrete Mathematics Extension of Basic Rules Example: Every byte consists of 8 bits (binary digits). How many bytes begin with ‘11’ or end with ‘11’? Solution: Suppose A = Set of bytes beginning with ’11’, B = Set of bytes ending with ‘11’. then A  B = Set of bytes starting and ending with ‘11’, A  B = Set of bytes starting or ending with ‘11’.  A  = 2 6 = 64,  B  = 2 6 = 64,  A  B  = 2 4 = 16. then  A  B  =  A  +  B  –  A  B  = – 16 = 112.

8/15 Erwin SitompulDiscrete Mathematics Permutation In how many distinct sequences can the balls (red, blue, white) be placed in the boxes 1, 2, and 3?

8/16 Erwin SitompulDiscrete Mathematics Permutation r bw wb b rw wr w rb br The number of possible ball placements with distinct sequence is 3  2  1 = 3! = 6. Box 1Box 2Box 3

8/17 Erwin SitompulDiscrete Mathematics Permutation  Definition: Permutation is understood to be a sequence containing each element of a finite set, once and only once.  Permutation is a special form of Rule of Product.  Suppose there are n elements in a set, then First place is chosen out of n elements, Second place is chosen out of n – 1 elements, Third place is chosen out of n – 2 elements, … Last place is chosen out of 1 remaining element.  According to Rule of Product, the number of permutations of n elements is: n  (n – 1)  (n – 2)  …  2  1 = n!

8/18 Erwin SitompulDiscrete Mathematics Example: How many letter sequences can be made out of the word “ERASE”? Solution: Way 1: 5  4  3  2  1 = 120 sequences. Way 2: P(5,5) = 5! = 120 sequences. Permutation Example: In how many different ways can an attendance list be made, if the number of students in a class is 25? Solution: P(25,25) = 25! ≈  different ways.

8/19 Erwin SitompulDiscrete Mathematics Permutation r of n Now, there are 6 balls with different color and 3 boxes. Each box can only be filled by one ball. In how many distinct sequences can the balls be placed in the boxes? Solution: Box 1 can be filled by one of 6 balls (6 choices). Box 2 can be filled by one of 5 balls (5 choices). Box 3 can be filled by one of 4 balls (4 choices). Number of distinct sequences = 6  5  4 = 120.

8/20 Erwin SitompulDiscrete Mathematics Permutation r of n If there are n balls with different colors and r boxes (r  n), then First box can be filled by one of n ball  (there are n choices), Second box can be filled by one of (n – 1) balls  (there are n – 1 choice), Third box can be filled by one of (n – 2) balls  (there are n – 2 choice), … The r-th box can be filled by one of (n – (r – 1)) balls  (there are n – r + 1 choices), Number of distinct sequences in placing the balls is : n  (n – 1)  (n – 2)  …  (n – (r – 1)).

8/21 Erwin SitompulDiscrete Mathematics Permutation Formula Permutation of r out of n different objects is the number of possible sequences of r objects which are taken out of n available objects, with the condition r  n.

8/22 Erwin SitompulDiscrete Mathematics Example: How many possible hundreds number can be formed by using the first five positive integers 1, 2, 3, 4, and 5, if: (a) Each number may only used once (no repetition)? (b) Each number may be used more than once (repetition is allowed)? Solution: (a)By Rule of Product: 5  4  3 = 60. By Permutation Formula P(5,3) = 5!/(5 – 3)! = 60. (b)By Rule of Product: 5  5  5 = 5 3 = 125. Cannot be solved by using Permutation Formula (it is not a permutation). Permutation

8/23 Erwin SitompulDiscrete Mathematics Permutation Example: The book code in a library consists of 7 characters, with 4 distinct letters followed by 3 distinct numbers. How many book code can be made according to this rule? Solution: P(26,4)  P(10,3) = 26!/(26 – 4)!  10!/(10 – 3)! = 26  25  24  23  10  9  8 =

8/24 Erwin SitompulDiscrete Mathematics Combination  Combination is a specific form of permutation.  If in permutation the order matters, then in combination the order does not matter.  Combination is understood to be a sequence containing elements of a finite set

8/25 Erwin SitompulDiscrete Mathematics r bw wb b rw wr w rb br  In combination, the order of appearance is neglected.  The number of distinct combinations in placing 3 balls in 3 boxes is 1 = P(3,3)/3! Box 1Box 2Box 3 Combination rbw = rwb = brw = bwr = wrb = wbr

8/26 Erwin SitompulDiscrete Mathematics Combination  The number of distinct combinations (that is, without regarding the order) in placing 3 out of 7 balls in 3 boxes is 20 = P(6,3)/3! (Check by enumerating!)  A mix of 3 balls with different colors is only counted as 1 one combination only.

8/27 Erwin SitompulDiscrete Mathematics Combination Formula In general, the number of ways to put r colored balls in n boxes, without regarding the order of the balls when they are taken and put, is can also be written as Combination of r out of n objects, or C(n,r), is the number of unordered choices of r objects taken out of n.

8/28 Erwin SitompulDiscrete Mathematics Interpretation of Combination  C(n,r) is the number of subsets consisting r elements/members, which are made out of a set with n elements/members.  Suppose A = { 1,2,3,4 }.  Subsets with 3 elements/members are: { 1,2,3 } = { 1,3,2 } = { 2,1,3 } = { 2,3,1 } = { 3,1,2 } = { 3,2,1 } { 1,2,4 } = { 1,4,2 } = { 2,1,4 } = { 2,4,1 } = { 4,1,2 } = { 4,2,1 } { 1,3,4 } = { 1,4,3 } = { 3,1,4 } = { 3,4,1 } = { 4,1,3 } = { 4,3,1 } { 2,3,4 } = { 2,4,3 } = { 3,2,4 } = { 3,4,2 } = { 4,2,3 } = { 4,3,2 }  Thus, there are 4 subsets which are distinct to each other, or

8/29 Erwin SitompulDiscrete Mathematics Combination Example: Commission IV of DPR RI consists of 25 members. In how many ways can a special committee be formed, if the size of the committee is 5 people? Solution: From the available information, a special committee is a group of members where order does not matter. The members of the special committee have equal position. C(25,5)= 25!/((25 – 5)!5!) = 25  24  23  22  21/(5  4  3  2  1) =

8/30 Erwin SitompulDiscrete Mathematics Combination Example: Among 10 IT students batch 2009, a 5-member representative committee will be formed. Encep and Florina are calculating their chance to be elected. In how many ways can the committee be formed such that: (a)Encep is elected. (b) Encep is not elected. (c) Encep is elected but Florina not. (d) Florina is elected but Encep not. (e)Encep and Florina are elected. (f) At least one of them is elected.

8/31 Erwin SitompulDiscrete Mathematics Combination Solution: (a) Encep is elected. (b) Encep is not elected. (c) Encep is elected but Florina not.

8/32 Erwin SitompulDiscrete Mathematics Combination Solution: (d) Florina is elected but Encep not. (e) Encep and Florina are elected. (f) At least one of them is elected. Identical to the answer of (c) Encep elected, Florina not Florina elected, Encep not Both of them elected

8/33 Erwin SitompulDiscrete Mathematics Solution: (f) At least one of them is elected. Combination  Part (f) can also be solved by using Inclusion-Exclusion Principle.  Assume X = Number of ways to form a representative that includes Encep, Y = Number of ways to form a representative that includes Florina, X  Y= Number of ways to form a representative that includes both Encep and Florina.  Then  X  = C(9,4) = 126  Y  = C(9,4) = 126  X  Y  = C(8,3) = 56  X  Y  =  X  +  Y  –  X  Y  = – 56 = 196.

8/34 Erwin SitompulDiscrete Mathematics Homework 8 A chairperson and a treasurer of PUMA IE should be chosen out of 50 eligible association members. In how many ways can a chairperson and a treasurer can be elected, if: (a)There is no limitation. (b) Amir wants to serve only if elected as a chairperson. (c) Budi and Cora want to be elected together or not at all. (d) Dudi and Encep do not want to work together.

8/35 Erwin SitompulDiscrete Mathematics Homework 8 New A vehicle registration plate in greater Jakarta area contains 3 letters since the end of This is due to the increase of motorized vehicles in the area. (a)Before, how many registration plates are available (when only 2 letters are used)? (b) Afterwards, how many registration plates are available (with 3 letters used). Hint: Assume that there is no restrictions to arrage the letters and numbers.