Discrete Mathematics: CBMA2103
Discrete Mathematics: CBMA2103
Page
Table of Contents ……………… 1
Page 1 of 11
1.0 QUESTION 1
a) Write the relation R1 as a set of ordered pairs. Draw the arrow diagram and
determine whether R1 are functions or not. Explain your answer.
c) Describe how can the digraph of the relation R1 be used to determine whether R1 is
an equivalence relation. Your answer should include the digraph and detail
description.
d) Determine the matrix of the relation R1 (relative to the given orderings). Now,
reorder R1 as 3,2,1,4, thus determine the new matrix obtained.
e) Another technique to test for reflexive, symmetric and transitivity is by using the
matrix of relation. Analyze matrix of the relation R1 to determine whether R1 is
an equivalence relation.
Page 11 of 11
1.1 Answer for Question 1:
a) R1 =set of ordered pairs. R1 = {(p-q) | p-q is even}
1 1
2 2
3 3
4 4
p R1 q
R1 is not a function since one element of domain can associate with only one element
of co-domain in a function. The above diagram shows each elements in p have 2
pointing point in set q. So R1 is only a relation and not a function.
b) R1 is reflexive because {(1, 1), (2, 2), (3, 3). (4, 4)}.
R1 is symmetric because {(1,3),(3,1),(2,4),(4,2)}.
R1 is transitive because {(3,1),(1,3),(3,3),(2,4),(4,2), (2,2), (4,4)}.
1 2
4 3
Page 11 of 11
d) R1 = { (1,1), (1,3), (2,2), (2,4), (3,1), (3,3), (4,2), (4,4) }
X = {1,2,3,4}
Y = {1,2,3,4}
1 2 3 4
1 1 0 1 0
2 0 1 0 1
R1 =
3 1 0 1 0
4 0 1 0 1
3 2 1 4
3 1 0 1 0
Reorder R1= 2 0 1 0 1
1 1 0 1 0
4 0 1 0 1
1 2 3 4
1 1 0 1 0
2 0 1 0 1
R1 =
3 1 0 1 0
4 0 1 0 1 reflexive concept.
Page 11 of 11
Relation R1 is reflexive because matrix R1 has 1’s on the main diagonal at the right.
(1,1),(2,2),(3,3),(4,4).
Checking for transitivity: Suppose that A1 and A2 are matric represent relation R1 and
R2 respectively. The product of these two matrices is A1A2. If we replace each non zero
entry in A1A2 by 1, we will get a matrix that represents the composition of the two
relations R2 o R1.
The relation of R is transitive if and only if whenever entry i,j in A² is non zero, also
entry i,j in A is nonzero.
1 2 3 4
1 1 0 1 0
2 0 1 0 1
R1 =
3 1 0 1 0
4 0 1 0 1
1 2 3 4 1 2 3 4
1 1 0 1 0 1 1 0 1 0
2 0 1 0 1 X 2 0 1 0 1
R²=
3 1 0 1 0 3 1 0 1 0
4 0 1 0 1 4 0 1 0 1
1 2 3 4
1 2 0 2 0
2 0 2 0 2
R² =
3 2 0 2 0
4 0 2 0 2
Page 11 of 11
Whenever entry i, j in R² is nonzero, entry i, j in R1 is also nonzero. Therefore, the
above matrix is transitive.
1 2 3
4 5 6
is the matrix
1 4
2 5
3 6
1 0 1 0
0 1 0 1
R1 = is symmetric.
1 0 1 0
0 1 0 1
f) R1 on set M = { 1,2,3,4 } is reflexive because for each elements p ∈ M and (p,p) ∈ R1.
So R1 is not irreflexive.
Page 11 of 11
g) It is irreflexive if there exists x that (x, x) is not a member of set N. Meanwhile,
reflexive means in any given element, that element has the given relation to itself. For
example we called reflexive if x = x for all x, whereas the relation of being 'less than'
is not, since it is not true that x < x for any x. Reflexive also has a loop at every
vertex (if we refer to its digraph).
2.0 QUESTION 2
W: If Ali has old story books, then he will donate the books to his school.
a) Write each statement in terms of p and q. Then, re-write the statement into
logical notation.
c) Using the answer in 1(a), determine the truth table of the propositions in
statement W.
2. a) Use the suitable counting technique to solve the following problems. Discuss
and show the steps on how you the answer.
i. An office building contains 28 floors and has 39 offices on each floor. How
many offices are there in the building?
ii. A shirt of the ABC brand comes in 12 colors, has a male version and a
female version and comes in three sizes for each male and female. How
many different types of this shirt are made?
iii. How many different three-letter initials with none of the letters repeated can
people have?
iv. Assume that there are five major auto routes from the city X to Y and seven
auto routes from the city Y to Z. How many major routes are there from X
to Z via Y.
i) Describe the counting techniques that you have chosen to solve 2(a)(i) – (iv).
Why did you choose this technique and in what situation is it appropriate to be
used. Discuss other TWO (2) counting techniques that you know.
Page 11 of 11
2.1 Answer for Question 2:
Number 1:
Notation:
→ is implication
~ is negation
a) p → q
b) W in symbolic form:
negation: ~ (p → q)
converse: q → p
contrapositive: ~ q → ~ p
c)
p q p→q
T T T
T F F
F T T
F F T
d) The statement is neither a tautology nor a contradiction. A tautology would have all
True values for the p→q column, and a contradiction would have all False values for
the p→column. The statement has T F T T as the values in the last column, so it can't
be either.
Page 11 of 11
e)
p q r s ( p → q) ∨ (r ∧ s)
T T T T T
T T T F T
T T F T T
T T F F T
T F T T F
T F T F F
T F F T T
T F F F F
F T T T T
F T T F T
F T F T T
F T F F T
F F T T T
F F T F T
F F F T T
F F F F T
Number 2:
a)
i. 28*39 = 1,092 offices.
iii. There are 26 letters in the alphabet. The first initial can be any of them, but because
we are not allowing repeated letters, the second initial must be one of the other 25, and
the third must be one of the 24 not yet chosen. So there are 26 * 25 * 24 = 15,600
possible sets of initials with none of the letters repeated.
iv. Combine any of the 5 routes from X to Y with any of the 7 from Y to Z to get: 5 * 7
= 35 total routes.
Also multiplied for (ii) and (iv), but the situation is a little different; these are
combinations of independent alternatives.
(iii) It was an example of a permutations calculation: order matters, but the alternatives
are drawn from a single set and no choice can be repeated. (In the case of initials, that's
an artificial and unreasonable restriction, but it was stated and we followed it.)
Page 11 of 11
Other counting techniques:
Combinations: used in cases where the possibilities are drawn from a single set, and no
choice can be repeated, but where order doesn't count.
ii) Powers of 2: used in cases where any of a set of possibilities can be either included
or excluded, and the total included can range from none at all to the entire set.
Example: There are 7 committee members and each of them either shows up for the
meeting or doesn't. How many different possible compositions of the meeting are
there?
Answer: 2^7 = 128 (includes the one where nobody shows up).
Page 11 of 11
3.0 Appendixes
3.1 References
• Zin, A.M. et al. (2009). CBMA2103 Discrete Mathematics. Kuala Lumpur:
Unitem.
• Bradley, J (1987). Introduction to Discrete Mathematics. Massachussets:
Addison-Wesley Publishing Company Inc.
• Portal Discrete Mathematics (”n.d.“). [Online]. Available:
http://en.wikipedia.org/wiki/Portal:Discrete_mathematics [2009, Nov,13].
Page 11 of 11