discrete structures by: tony thi by: tony thi aaron morales aaron morales cs 490 cs 490
TRANSCRIPT
![Page 1: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/1.jpg)
Discrete Discrete StructuresStructures
By: Tony ThiBy: Tony Thi
Aaron MoralesAaron Morales
CS 490CS 490
![Page 2: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/2.jpg)
SETS:
-Sets are a collection of object
NOTATIONS: belongs to/element of a set
does not belong to/ is not an element of a set
empty set
U universal set
subset
![Page 3: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/3.jpg)
Definitions:
A.) Equality of Sets: Two sets are equal if and only if they have the same elements.
A = B if and only if x [x A x B].
Ex: A = { 2, 4, 6 } B = { 2, 4, 6 }
B.) Subsets: For any sets A and B, A is a subset of B if and only if x [ x A x B ].
AB
Ex: A = { 1, 3} B = {1, 2, 3, 4, 5, 6}
C.) Proper Subset: AB . A is a subset of B, but A B
![Page 4: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/4.jpg)
D.) Cardinality: If a set S has n, distinct elements for some natural number n, n is the cardinality (size) of S and S is a finite set. The cardinality of a set is denoted by |S|.
Ex: S = { 1, 3, 5, 7, 9}
|S| = 5
E.) Power Set: the set of all subsets of a set S is called the power set of S
and is denoted by 2|S| of (S).
Ex: S = { 1, 5 }, P(S) = { {}, {1}, {5}, {1,5} }
![Page 5: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/5.jpg)
F.) Empty Set: A set which has no elements is called an
empty set.
Ex: S = { }
G.) Universal Set: a set which has all the elements in the universe of
discourse.
![Page 6: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/6.jpg)
SET OPERATIONS:
A.) Union of Sets:
Def. The union of sets A and B,
denoted by A B, is the set defined as
A B = { x | x A x B }
Ex: If A = { 1, 2, 3 } and B = { 3, 4, 5}, then
A B = { 1, 2, 3, 4, 5 }
![Page 7: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/7.jpg)
B.) Intersection of Sets:
Def. The intersection of sets A and B,
denoted by A B, is the set defined as
A B = { x | x A x B }
Ex: If A = { 1, 2, 3 } and B = { 3, 4, 5}, then
A B = {3}
![Page 8: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/8.jpg)
C.) Difference: the difference of sets A & B,
denoted by A – B is the set defined as
A – B = { x | x A x B }
Ex: A = { 1, 2, 3, 4, 5 }
B = { 3, 5, 7}
A – B = { 1, 2, 4 }
NOTE: Generally, A – B B – A
![Page 9: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/9.jpg)
D.) Complement: Given a universal set U and a subset X of U, the
set U – X is called the
complement of X.
Ex. U ={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
X = { 1, 2, 3, 4, 5 }
Complement of X = {6, 7, 8, 9 ,10}
![Page 10: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/10.jpg)
II.) Discrete Probability
An experiment is an process that yields and outcome.
An event is an outcome or combination of outcomes from and experiment.
The sample space is the event consisting of all possible outcomes.
![Page 11: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/11.jpg)
The probability P(E) of an event E from the finite sample space S is
P(E) = |E| / |S|
Ex: Two fair dice are rolled. What is the
probability that the sum of the
numbers on the dice is 10?
![Page 12: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/12.jpg)
Ans:
The 1st die can be any one of the 6 numbers.
The 2nd die can also be one of the 6 numbers.
6 x 6 = 36 possible combinations
S ={(1,1), (1,2), (1,3), (1,4), (1,5), (1,6),
(2,1), (2,2), (2,3), (2,4), (2,5), (2,6),
(3,1), (3,2), (3,3), (3,4), (3,5), (3,6),
(4,1), (4,2), (4,3), (4,4), (4,5), (4,6),
(5,1), (5,2), (5,3), (5,4), (5,5), (5,6),
(6,1), (6,2), (6,3), (6,4), (6,5), (6,6) }
![Page 13: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/13.jpg)
E = { (4,6), (5,5), (6,4) }
So,
P(E) = |E| / |S|
= 3 / 36
= 1/ 12
![Page 14: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/14.jpg)
Let E1 E2 be events, then
P(E1 E2 ) = P(E1) + P(E2) - P(E1 E2 )
Ex: Two fair dice are rolled, what is the
probability of getting doubles ( 2
dice showing the same number ) or a
sum of 6?
![Page 15: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/15.jpg)
Let E1 = event of getting “doubles”
Let E2 = event of a sum of 6.
P(E1) = 6/36
= 1/ 6
There are 5 ways to get a sum of 6:
[(1,5), (2,4), (3,3), (4,2), (5,1)]
P(E2) = 5/36
![Page 16: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/16.jpg)
The event E1 E2 is “getting doubles AND getting a sum of 6.
P(E1 E2 ) = 1/ 36
Hence,
P(E1 E2 ) = P(E1) + P(E2) - P(E1 E2 )
= 6/36 + 5/36 – 1/36
= 10/36
= 5/18
![Page 17: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/17.jpg)
Events E1 and E2 are mutually exclusive
E1 E2 =
P(E1 E2 ) = P(E1) + P(E2)
Conditional Probability: A probability given that some event has occurred.
Def: Let E and F be events and P(F) > 0.
The conditional probability of E given F is P( E | F ) = P(EF) / P(F)
![Page 18: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/18.jpg)
Ex: Suppose that among all of the freshmen of an engineering college took calculus and discrete math last semester. 70% of the students passed calculus, 55% passed discrete math, and 45% passed both. If a randomly selected freshmen is found to have passed calculus last semester, what is the probability that he or she also passed discrete math last semester?
![Page 19: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/19.jpg)
P( E | F ) = P(EF) / P(F)
Let E = event that the student passed discrete math
Let F = event that the student passed calculus
P(E) = 0.55
P(EF) = 0.45
P(F) = 0.70
P( E | F ) = 0.45 /0.70
![Page 20: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/20.jpg)
Recurrence Relation: a recurrence relation for
a sequence
a0, a1, . . . is an equation that relates an to certain of its predecessors a0, a1, . . ., an-1
![Page 21: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/21.jpg)
Ex. Consider the following instructions for generating a sequence:
1. Start with 5
2. Given any term, add 3 to get the next
term,
If we list the terms of the sequence, we obtain
5, 8, 11, 14, 17, . . .
![Page 22: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/22.jpg)
The Fibonacci sequence is defined by the recurrence relation
fn = fn-1 + fn-2 , n 3
and the initial conditions
f1 = 1
f2 = 2
1, 2, 3, 5, 8, 13, . . .
![Page 23: Discrete Structures By: Tony Thi By: Tony Thi Aaron Morales Aaron Morales CS 490 CS 490](https://reader035.vdocument.in/reader035/viewer/2022062423/5697bf7b1a28abf838c83ac8/html5/thumbnails/23.jpg)
Source:
Johnsonbaugh, R. (2001). Discrete Mathematics (5th ed.). Prentice-Hall , Inc.