Reviewer in Discrete Mathematics
Reviewer in Discrete Mathematics
Example 1:
Example 3: How many different bit strings are there of
• The chairs of an auditorium are to be length 7?
labeled with a letter and a positive
Solution:
integer not exceeding 100.
• What is the largest number of chairs • Each of the seven bits can be chosen in two
that can be labeled differently? ways, since each bit is either 0 or 1.
• Therefore, the product rule shows that there
Solution:
are
• The procedure of labeling a chair consists of • t1t2t3t4t5t6t7 = t 7 = 2 7 = 128 different
two tasks, namely: bit strings of length seven
• t1)Assigning a chair with one of the 26 letters;
• t2) Assigning a chair with one of the 100
possible positive integers not exceeding 100.
• Using product rule, it shows that there are
• t1t2 = 26100 = 2600 different ways that a
chair can be labeled.
• Therefore, the largest number of chairs that
Example 4: How many different license plates are
can be labeled differently is 2600.
available if each plate contains a sequence of three
letters followed by three digits (and no sequences of
letters are prohibited, even if they are obscene)?
Example 2:
Solution:
Example 1:
Solution: Example 1:
• The first task t1: choosing a member of the 1.a) Among a group of 367 people, there must be at
mathematics faculty, can be done in 37 ways least two with the same birthday, because there are
• The second task t2: choosing a mathematics only 366 possible birthdays.
major, can be done in 83 ways. 1.b) In any group of 27 English words, there must be at
• From the sum rule, it follows that there are: least two that begins with the same letter, since there
• t1 + t2 = 37 + 83 = 120 possible ways to pick are 26 letters in the English alphabet.
this representative
Example 2: How many students must be in class to
guarantee that at least two students receive the same
score on the final exam, if the exam is graded on a
scale from 0 to 100 points?
Solution:
11. A drawer contains a dozen brown socks and a • Suppose that there are eight runners in a race.
dozen black socks, all unmatched. A man takes socks • The winner receives a gold medal, the second-
out at random in the dark. How many socks must he place finisher receives a silver medal, and the
take out to be sure that he has at least 2 socks of the third-place finisher receives bronze medal.
same color?
DISCRETE MATHEMATICS REVIEWER FINALS- Babao
• How many different ways are there to award
these medals, if all possible outcomes of the
race can occur and there are no ties?
Solution:
5. COMBINATIONS
• The number of different ways to award the
medals is the number of 3-permutations of a • An r-combination of elements of a set is an
set with eight elements. unordered selection of r elements from the
• Hence, there are: set.
• Thus, an r-combination is simply a subset of
the set with r elements.
• Let S be the set { 1, 2, 3, 4 }. Then { 1, 3, 4 } is
a 3-combination from S.
Example 3: • The number of r-combinations of a set with n
distinct elements is denoted by 𝐶(𝑛, 𝑟) and is
• Suppose that a saleswoman has to visit eight
called binomial coefficient.
different cities.
• The number of r-combinations of a set with n
• She must begin her trip in a specified city, but
elements, where n is a nonnegative integer
she can visit the other seven cities in any
and r is an integer with 0 r n, equals
order she wishes.
• How many possible orders can the
saleswoman use when visiting these cities?
Solution:
Example 1:
• The number of possible paths between the
How many ways are there to select five
cities is the number of permutations of seven
players from a 10-member tennis team to
elements, since the first city is determined,
make a trip to a match at another school?
but the remaining seven can be ordered
arbitratily, then there are only 7 elements to
Solution:
arrange.
• The answer is given by the number of 5-
• P(n,r) = P(7,7) = 7! = 5,040 possible ways for
combinations of a set with ten elements.
the saleswoman to choose her tour
• The number of such combinations is:
Example 4:
Solution:
Example 3:
Solution:
X Y Example:
a 6 X= {1,2,3,4}
b 2
R= {(1,1), (2,1), (2,2), (3,1), (3,3), (4,1), (4,4)}
a 1
c 1 It is a Reflexive because the ordered pairs are
present.
Example:
Getting the Domain and Range of R.
Example: R= {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2),
R= {(1,1), (2,1), (2,2), (3,1), (3,3), (4,1), (4,4)} (3,3)}
Domain of R = {1,2,3,4} It is a symmetric since the ordered pair (1,2) may
Range of R = {1,2,3,4} kabaliktad which is (2,1).
Digraph
- an informative way to picture a relation on a 3.) Antisymmetric (x, y) є R and (x ≠ y) then (y, x )
set is to draw its graph. is not element of R.
- Pagbabaliktarin ang ordered pair dapat wala
Steps in Drawing Digraph sa relation.
1. Draw Dots - Okay lang may magloop isali lang ito sa
2. Draw an arrow (Called directed Edge). evaluation.
Note:
1 2 (x, y) = (1,1)
(y, z) = (1,2)
(x, z) = (1,2)
➢ Comparable
- (x ≤ y or y ≤ x)
- Mas maliit si x sa y vice versa
- Consistent ang order
➢ Incomparable
- Hindi consistent ang order.
Example:
{(3,1), (4,2), (5,3)} Comparable
{(1,3), (1,5), (4,3)} Incomparable
➢ Total Order
- If every pair of an element in x is comparable,
we call R a Total Order.
➢ Inverse (R -1)
- Kabaliktaran ng relation
- Example:
R= {(1,1), (1,2), (1,3), (1,4), (2,5), (2,3)}
R-1= {(1,1), (2,1), (3,1), (4,1), (5,2), (3,2)}
//sa relation na mag focus dili na sa given na
may rule pa.
Example:
R1 = {(1,2), (1,6), (2,4), (3,4), (3,6), (3,8)}
R2 = {(2, u), (4,5), (4, t), (6, t), (8, u)}
R2 o R1 = {(1, u), (1, t), (2, 5), (2, t), (3, 5), (3, t),
(3, u)}
TYPES OF GRAPHS
2.) Multigraph
- Function f from E to {(u, v ) |u, v is an
element of a V, u is not equal to v.
GRAPH MODELS
3.) Pseudograph
- Function f from E to {(u, v) |u, v is an
element of a V.
- An edge loop if f(e) = {u, u} = {u} for some
u is an element of V.
-
-
-
-
-
-
-
-
Note: it is undirected edges and Multiple
edges and looping is allowed.
DISCRETE MATHEMATICS REVIEWER FINALS- Babao
2.) Acquaintanceship Graph 5.) Round-Robin Tournaments
- We use this model to represent various - A tournament where each team plays
relationships between people. each other team exactly once.
- Each Person represented by a vertex and - Such tournaments can be modeled using
an undirected edge is used to connect two Directed Graph where each team is
people when these people know each represented by a vertex.
other.
SHORTEST-PATH PROBLEMS
SHORTEST_PATH ALGORITM
EXAMPLE:
DISCRETE MATHEMATICS REVIEWER FINALS- Babao
EXERCISES:
from Washington to Newark, and one flight from 6. The intersection graph of a collection of sets A1 , A2
Washington to Miami, with: ,…,An is the graph that has a vertex for each of these
sets and has an edge connecting the vertices
a) an edge between vertices representing cities that
representing two sets if these sets have a nonempty
have a flight between them (in either direction).
intersection. Construct the intersection graph of these
b) an edge between vertices representing cities for collections of sets.
each flight that operates between them (in either
a)
direction).
A1 = {0, 2, 4, 6, 8},
c) an edge between vertices representing cities for A2 = {0, 1, 2, 3, 4},
each flight that operates between them (in either A3 = {1, 3, 5, 7, 9},
direction), plus a loop for a special flight sightseeing A4 = {5, 6, 7, 8, 9},
trip that takes off and lands in Miami A5 = {0, 1, 8, 9}
b)
d) an edge from a vertex representing a city where a
A1 = {…, -4, -3, -2, -1, 0},
flight starts to the vertex representing the city where
A2 = {…, -2, -1, 0, 1, 2, …},
it ends.
A3 = {…, -6, -4, -2, 0, 2, 4, 6, …},
e) an edge for each flight from a vertex representing a A4 = {…, -5, -3, -1, 1, 3, 5, …},
city where the flight begins to the vertex representing A5 = {…, -6, -3, 0, 3, 6, …}
the city where the flight ends.
7. Construct a niche overlap graph for six species of
For Exercises 2-5, determine whether the graph shown birds, where the hermit thrush competes with the
is a simple graph, a multigraph (and not a simple robin and with the blue jay, the robin also competes
graph), a pseudograph (and not a multigraph), a with the mockingbird, the mockingbird also competes
directed graph, or a directed multigraph (and not a with the blue jay, and the nuthatch competes with the
directed graph). hairy woodpecker.