discrete math - al al-bayt university · 1 sets & sequences 3 8 relations & diagraphs 3 2...
TRANSCRIPT
2/10/19
1
Discrete Math
Instructor’s Information:Name: Dr. Najah Al-shanablehOffice hours: Sunday and Tuesday : 9:30 -11:00 amMonday and Wednesday: 11:00 am – 12:00 pmE-Mail: [email protected] Tel.: 3395
Sunday, Tuesday
Class Hall Time
02 201 IT 11-12:30
Monday, Wednesday
Class Hall Time
03 104 IT 12:30-2
2/10/19
2
Course Description
Click Here
Course Description
Click Here
2/10/19
3
The Course Plan
2/10/19
4
Textbook:
Discrete Mathematical Structures, B. Kolman , RC. Busby and SC Ross, Prentice Hall, 6th Edition, 2008
Grading:
Mid-term Exams (2): 50% Final Exam: 50%
The instructor encourages everyone to participate in class activities, discussions, and respond to questions from other students and complete in/out-class writing assignments.
Tentative Course Outline/Schedule:
No. Topic Hours
No. Topic Hours
1 Sets & Sequences 3 8 Relations & Diagraphs 32 Division in the Integer &
Matrices3 9 Equivalence Relations &
Operations on Relations3
3 Propositions & Logical Operations
3 10 Functions & Functions for Computer Science
3
4 Conditional Statements & Methods of Proof
3 11 Labeled, Searching & Minimal Spanning Trees
3
5 Mathematical Induction 3 12 Euler & Hamiltonian Paths/Circuits
3
6 Permutations & Combinations
3 13 Finite State Machine 3
7 Elements of Probability 3 14 Experiments in Discrete Mathematics
3
2/10/19
5
ةعطقتملا تایضایرلاChapter 1: Fundamentals• Section 1.1: Examples {1,5,6,8,9,10,11}• Section 1.2: Examples {1,2,3,4,6,7}• Section 1.3: Examples {1,2,3,4,5,6,7,12}• Section 1.4: Examples {7}• Section 1.5: Examples {12,13}Chapter 2: Logic• Section 2.1: Examples {1,2,3,4,5,}• Section 2.2: Examples {1,2,3,4}• Section 2.4: Examples {1,2}Chapter 3: Counting• Section 3.1: Examples {8,9,10}• Section 3.2: Examples {3}Chapter 4: Relations & Digraphs• Section 4.1: Examples {1,2,6}• Section 4.2: Examples {1,2,3,4,10,11,18,19,22,23,24}• Section 4.3: Examples {5,6}• Section 4.4: Examples {1(c),4,10}• Section 4.5: Examples {2}• Section 4.7: Examples {1,3,4,5,6,10,12,13}Chapter 5: Functions• Section 5.1: Examples {1,2,912,14}• Section 5.4: Examples {2,3,4,5,6,7,9,10}Chapter 7: Trees• Section 7.1: Theorem 1• Section 7.2: Examples {3,4}• Section 7.3: Examples {1,2,3,4}• Section 7.5: Examples {1,2,5,6}Chapter 8: Topics in Graph Theory• Section 8.1: Examples {1,2,3}• Section 8.2: Examples {1,2,4}• Section 8.3: Examples {1}Chapter 10: Languages & FSMs• Section 10.3: Examples {1,2,3,4}• Section 10.4: Examples {1}
)3( ةدا#لا اــهAمً اــ?أ :ــ=ت&ی >;ــلا :ــلا9لا ض&ــعت ةــ/$یدأت تاــفلا2م ةــ/لا#لا لاــ+عألا &ــ$#عت
-:ماALلا ا;ه يف اه/لع صAGE+لا ة/$یدأ#لا تاEFقعلل
بRـ+لا عاA#مالا-أّ _&ـخألا تاـ$جاEلا Uـع وأ سورRـلا وأ تا&ـضاY+لا رEـWح Uـع &
.عاA#مالا ا;ه ىلع Y&fgت لdو ،اه/لع ة$bاE+لاa ة+Lنألا يWقت ي#لا
ماــALبلالــخإلاو ،هــ/ف عو&ــpلا وأ كا&#ــشالا وأ ناــY#مالا وأ راــ$#خالا يــف lــغلا-ب
.ه/ف ه&فاEت :جاEلا ءوRهلا وأ ناY#مالا وأ را$#خالا
ةp9نألاوأ تاوARلا وأ تا&ضاY+لا ه/W#قت >;لا vا$Wنالا وأ ماALلاa لالخإلا-أ
.ةعماwلا لخاد ماقت ي#لا
Uــــم >أ وأ {fرRــــ#لا ةــــ|/ه EــــWع }ــــaY :ــــلا9لا اــــه$=ت&ی ةءاــــسإ وأ ةــــناهإ >أ-ب
.ةعماwلا يف ة$ل9لا وأ U/لماعلا
2/10/19
6
)4( ةدا#لا Eــم )3(ةداــ2لا يــف ةدرا+ــلا >ــلا;لل ةــ89یدأ5لا تاــفلا23لا ىــلع تاــ,+قعلا د$ــ"ت
-:يلا5لا +"Hلا ىلع ماHIلا اGه
.ي;3لا ه5H89لا-أ
.هجاSخإل ةروS[لا $Hع يعما\لا Eمألا ءاع$5ساو VWر$5لا ةعاق Eم جاSخإلا-ب
ماـHIلاa >لا;لا لf3 ي5لا دا+2لا تاSضا"م لc وأ bعa ر+[ح Eم نامS"لا-ج
.اهVhر$ت ءاHثأ
EـمSـmكأ وأ kـفSم اهم$ـقf ي5لا تام$3لا Eم ةداف5سالا Eم ةد$"م ة$2ل نامS"لا-د
.اه9ف ةفلا23لا باoترا nت ي5لا ة9عما\لا kفا2Sلا
يــ5لا ةــ9بال;لا ة;ــrنألا Eــم Sــmكأ وأ sاــrن ةــسرا2م Eــم ةد$ــ"م ة$ــ2ل ناــمS"لا-ه
.اه9ف ةفلا23لا o8vترا
.يئاهHلاو جود2yلاو لوألا :ثالmلا هتاجر$ب راGنإلا-و
.>لا;لا اهفلتأ ي5لا ءا9شألا وأ ءيrلا يلmم ة92ق Eع لقf ال اa2 ةماSغلا-ز
.ةفلا23لا ه9ف عقت GÅلا لÄفلا دا+م Eم mSكأ وأ ةدام يف ل5h\9لا ءاغلإ-ح
s-كأ وأ ةدام يف ا8سار هرا58عاmS.
Å-فلاÄ2لا لÑقv مE ف ة$2ل ةعما\لاÄكأ وأ يسارد لmS.
ةعما\لا Eم يئاهHلا لÄفلا
)5( ةدا#لا داDـــCلا ABـــحإ يـــف راـــ':خالا وأ ناـــ;:مالا ةـــ6دأت ءاـــ1ثأ يـــف ,ـــلا*لا )'ـــض اذإ
هـNف عUـش وأ كU:ـشا وأ Jـغلا لواـح هـنا NQق;:لا ةNO:ن K'Lت وأ JغلاHً اF'ل:م
-:ةعO:Cم ةNلا:لا تا\Dقعلا هNلع عقDت
.ةداCلا bلت يف ًا'سار هرا':عا-أ
.لgفلا bلذ يف هل ةلCFOلا داCDلا ةNقH يف هلFONت ءاغلإ-ب
.هNف )'ض lmلا لgفلا يلی Aحاو يسارد لgف ةCAل ةعماOلا jم هلgف-ج
2/10/19
7
1.1 Sets and Subsets
• Section 1.1: Examples {1,5,6,8,9,10,11}
Introduction
• A set is a collection of objects.• The objects in a set are called elements of the set.
2/10/19
8
Ways to define sets• Explicitly: {John, Paul, George, Ringo}• Implicitly: {1,2,3,…}, or {2,3,5,7,11,13,17,…}• Set builder: { x : x is prime }, { x | x is odd }. • In general { x : P(x)}, where P(x) is some predicate.
We read “the set of all x such that P(x)”
Set – Builder Notation
• When it is not convenient to list all the elements of a set, we use a notation the employs the rules in which an element is a member of the set. This is called set – builder notation. • V = { people | citizens registered to vote in Maricopa County}• A = {x | x > 5} = This is the set A that has all real numbers greater than
5. • The symbol | is read as such that.
2/10/19
9
17
Set properties 1
• Order does not matter• We often write them in order because it is easier for humans to understand it
that way• {1, 2, 3, 4, 5} is equivalent to {3, 5, 2, 4, 1}
• Sets are notated with curly brackets
18
Set properties 2
• Sets do not have duplicate elements• Consider the set of vowels in the alphabet.
• It makes no sense to list them as {a, a, a, e, i, o, o, o, o, o, u}• What we really want is just {a, e, i, o, u}
• Consider the list of students in this class• Again, it does not make sense to list somebody twice
• Note that a list is like a set, but order does matter and duplicate elements are allowed• We won’t be studying lists much in this class
2/10/19
10
19
Specifying a set 1
• Sets are usually represented by a capital letter (A, B, S, etc.)
• Elements are usually represented by an italic lower-case letter (a, x, y, etc.)
• Easiest way to specify a set is to list all the elements: A = {1, 2, 3, 4, 5}• Not always feasible for large or infinite sets
20
Specifying a set 2• Can use an ellipsis (…): B = {0, 1, 2, 3, …}• Can cause confusion. Consider the set C = {3, 5, 7, …}. What comes next?• If the set is all odd integers greater than 2, it is 9• If the set is all prime numbers greater than 2, it is 11
• Can use set-builder notation• D = {x | x is prime and x > 2}• E = {x | x is odd and x > 2}• The vertical bar means “such that”• Thus, set D is read (in English) as: “all elements x such that x is prime and x is
greater than 2”
2/10/19
11
21
Specifying a set 3
• A set is said to “contain” the various “members” or “elements” that make up the set• If an element a is a member of (or an element of) a set S, we use then
notation a Î S• 4 Î {1, 2, 3, 4}
• If an element is not a member of (or an element of) a set S, we use the notation a Ï S• 7 Ï {1, 2, 3, 4}• Virginia Ï {1, 2, 3, 4}
Example 1
• Let A ={ 1,3,5,7]. Then 1 ϵ A, 3 ϵ A, but 2 Ï A.
2/10/19
12
Special Sets of Numbers• N = The set of natural numbers. The whole numbers from 1 upwards.
(Or from 0 upwards in some fields of mathematics= {1, 2, 3, …}.
• W = The set of whole numbers.={0, 1, 2, 3, …}
• Z = The set of integers.= { …, -3, -2, -1, 0, 1, 2, 3, …}
• Q = The set of rational numbers.={x| x=p/q, where p and q are elements of Z and
q ≠ 0 }• H = The set of irrational numbers.• R = The set of real numbers.• C = The set of complex numbers.
2/10/19
13
Universal Set and Subsets• The Universal Set denoted by U is the set of all
possible elements used in a problem.• When every element of one set is also an element of
another set, we say the first set is a subset. • Example A={1, 2, 3, 4, 5} and B={2, 3}
We say that B is a subset of A. The notation we use is B A.• Let S={1,2,3}, list all the subsets of S.• The subsets of S are , {1}, {2}, {3}, {1,2}, {1,3}, {2,3},
{1,2,3}.
Í
Æ
The Empty Set• The empty set is a special set. It contains no
elements. It is usually denoted as { } or.
• The empty set is always considered a subset of any set.• Do not be confused by this question:• Is this set {0} empty? • It is not empty! It contains the element zero.
Æ
2/10/19
14
Intersection of sets
• When an element of a set belongs to two or more sets we say the sets will intersect.• The intersection of a set A and a set B is denoted by A ∩ B. • A ∩ B = {x| x is in A and x is in B}• Note the usage of and. This is similar to conjunction. A ^ B.• Example A={1, 3, 5, 7, 9} and B={1, 2, 3, 4, 5}• Then A ∩ B = {1, 3, 5}. Note that 1, 3, 5 are in both A and B.
Mutually Exclusive Sets
• We say two sets A and B are mutually exclusive if A ∩ B = . • Think of this as two events that can not happen at the same time.
Æ
2/10/19
15
Union of sets
• The union of two sets A, B is denoted by A U B.• A U B = {x| x is in A or x is in B}• Note the usage of or. This is similar to disjunction A v B. • Using the set A and the set B from the previous slide, then the union
of A, B is A U B = {1, 2, 3, 4, 5, 7, 9}.• The elements of the union are in A or in B or in both. If elements are
in both sets, we do not repeat them.
2/10/19
16
Examples 5 & 6
2/10/19
17
Examples 7 & 8
Examples 9 & 10
2/10/19
18
Cardinality
If S is finite, then the cardinality of S, |S|, is the number of distinct elements in S.
If S = {1,2,3} |S| = 3.
If S = {3,3,3,3,3}
If S = Æ
If S = { Æ, {Æ}, {Æ,{Æ}} }
|S| = 1.
|S| = 0.
|S| = 3.
If S = {0,1,2,3,…}, |S| is infinite. (more on this later)
Power setsIf S is a set, then the power set of S is
P(S) = 2S = { x : x Í S }.
If S = {a}
If S = {a,b}
If S = Æ
If S = {Æ,{Æ}}
We say, “P(S) is the set of all subsets of S.”
2S = {Æ, {a}}.
2S = {Æ, {a}, {b}, {a,b}}.2S = {Æ}.
2S = {Æ, {Æ}, {{Æ}}, {Æ,{Æ}}}.
Fact: if S is finite, |2S| = 2|S|. (if |S| = n, |2S| = 2n)
2/10/19
19
Example 11