Professional Documents
Culture Documents
Lara Discretecompletion2
Lara Discretecompletion2
2.)
expression
Value
PVQ
P Q
PQ
P Q
Let:
P = "John is healthy"
Q = "John is wealthy"
R = "John is wise"
Represent:
John is healthy and wealthy but not wise: P Q R
John is not wealthy but he is healthy and wise: Q P R
John is neither healthy nor wealthy nor wise: P Q R
Let
P: The fox can catch the hare
Q: The lynx can catch the hare.
R: The hare is alert
S: The hare is quick
Translation into logic: (R S) ~P ~Q
into
Answer:
a.) Let
P: we are on vacation
Q: we go fishing
The logical expression for the above sentence is: P Q
b.)negation: P Q
"We are on vacation and we do not go fishing."
c.) converse: Q P
"If we go fishing, we are on vacation."
d.) inverse: P Q
"If we are not on vacation, we don't go fishing."
e.) contrapositive: Q P
"If we don't go fishing, we are not on vacation.
5.) Write the contrapositive, converse and inverse of the expressions:
P Q, ~P Q, Q ~P
contrapositive
converse
inverse
PQ
~Q ~ P
QP
~P ~Q
~P Q
~QP
Q ~P
P ~Q
Q ~P
P ~Q
~P Q
~QP
Premises:
a.) If I read the newspaper in the kitchen, my glasses would be on the kitchen
table.
b.) I did not read the newspaper in the kitchen.
Conclusion : My glasses are not on the kitchen table.
Solution:
This is an invalid argument.
In order to show this we will represent the argument formally.
Let
P: I read the newspaper in the kitchen
Q: my glasses would be on the kitchen table.
Formal representation:
(1) P Q
(2) ~P
(3) Therefore ~Q
We know that when P is false, i.e. we have ~P, the implication is true
for any value of Q.
Hence we cannot say whether Q is true or false.
The error in the above argument is called inverse error.
2.
Premises:
a.) If I don't study hard, I will not pass this course
b.) If I don't pass this course I cannot graduate this year.
Premises:
a.) You will get an extra credit if you write a paper or if you solve the test
problems.
b.) You dont write a paper, however you get an extra credit.
4.
Premises:
a.) You will get an extra credit if you write a paper or if you solve the test problems.
b.) You dont write a paper and you don't get an extra credit.
Conclusion: You have not solved the test problems.
Solution:
This is a valid argument.
In order to show this we will represent the argument formally.
Let
P: you get an extra credit
Q: you write a paper
R: you solve the problems
Formal representation:
(1) (Q V R) P
(2) ~Q
(3) ~P
(4) Therefore ~R
From ~P we can conclude that Q V R is false (modus tollens).
A disjunction is false only when both of its sides are false.
Hence R must be false.
Note, that the premise ~Q is not necessary. Since both sides of the disjunction must be false, Q
must be false too.
A valid argument would be the following one:
(1) (Q V R) P
(2) ~P
(3) Therefore ~Q and ~R
x, (problem(x) difficult(x))
Negation:
~( x, (problem(x) difficult(x))) =
x (~(problem(x) difficult(x))) =
x (~problem(x) V ~ difficult(x)) =
x (problem(x) ~ difficult(x))
Translation: No problems are difficult.
8.) All students that study discrete math are good at logic.
( x (student(x) study_discrete_math(x) good_at_logic(x))
Negation:
~ ( x (student(x) study_discrete_math(x) good_at_logic(x)) =
x (~ (student(x) study_discrete_math(x) good_at_logic(x))) =
x (~ (
~( student(x) study_discrete_math(x)) V good_at_logic(x))) =
x (~ (
(~student(x) V ~study_discrete_math(x)) V good_at_logic(x))) =
x (~ ( ~student(x) V ~study_discrete_math(x) V good_at_logic(x))) =
x ((student(x) study_discrete_math(x)) ~ good_at_logic(x)))
Translation: There is a student that studies discrete math and is not good at logic
x (student(x) ~carry_gun(x))
Negation:
~( x, (student(x) ~carry_gun(x))) =
x, ~(student(x) ~carry_gun(x))) =
x, ~(~student(x) V ~carry_gun(x)) =
x, (student(x) carry_gun(x))
Translation:There is a student that carries a gun
12.)
(c) q
(d) (p q)
Answer:
(a) The printer is off-line or out of paper.
(b) The document has finished printing and the printer is out of paper.
(c) The printer is out of paper and the document has not finished printing.
(c) The printer is out of paper but the document has not finished printing.
(d) The printer is neither off-line nor out of paper.
p is "n = 7"
q is "a > 5"
r is "x = 0"
Write the following expressions in terms of p, q and r, and show that each pair of expressions is
logically equivalent. State carefully which of the above laws are used at each stage.
(a)
((n = 7) (a > 5))
(x = 0)
((n = 7)
(x = 0))
(b)
((n = 7)
(a 5))
(n 7) (a > 5)
(c)
(n = 7) (((a 5)
(x = 0))
= (r
p) r
= (p
r) (q
(b)
r) (q
=r
q)
r)
r
r)
(p q)
Commutative Law
Distributive Law
Commutative Law (twice)
q)
p q
(p
= p (q)
q)
= p q
De Morgan's Law
Involution Law
(c)
First, we note that
r is "x 0".
r))
(p q) r
p ((q
r))
= p ((q) r)
= p (q r)
Involution Law
= (p q) r
Associative Law
De Morgan's Law
(d) p q
(e) p
(f) p
One of these compound propositional functions always produces the output true, and one
always outputs false. Which ones?
Answer:
(a) x 50
(b) x 40
(c) 40 < x < 50
(d) x < 50 or x > 40. This is true for all values of x.
(e) x 50 (Note that we don't need to say, in addition, that x > 40; this must be true
whenever x 50.)
(f) x 50 and x 40. This can never be true, whatever the value of x.
(b) p q
(c) p
Answer:
Noting that p is false (1024 bytes is known as 1KB) and q is true, we have:
(a) "1024 bytes is known as 1MB and a computer keyboard is an example of a data input
device". False.
(b) "(Either) 1024 bytes is known as 1MB or a computer keyboard is an example of a data input
device". True.
The word Either here is optional; it doesn't have - and doesn't need - an equivalent symbol in
Logic.
(c) "1024 bytes is not known as 1MB". True.
(b) (p) q
(c) (p)
(d) (p) (q)
(e) (p q):
(f) (p)
(q)
Answer:
(a) I dont like Maths, but Im going to spend at least 6 hours a week on Maths.
(This sounds much more natural than "I dont like Maths, and Im going to spend at least 6 hours
a week on Maths.")
(b) Either I dont like Maths, or Im going to spend at least 6 hours a week on Maths.
(c) Its not true that I dont like Maths. (Or simply: I do like Maths.)
(d) Either I dont like Maths, or Im not going to spend at least 6 hours a week on Maths.
(It's not very easy to get a natural sounding sentence here. It probably helps to include the word
"Either", but it's not essential.)
(e) Its not true that either I like Maths or Im going to spend at least 6 hours a week on Maths.
Or, simply: I neither like Maths, nor am I going to spend at least 6 hours a week on Maths.
Alternatively, you can write the answer to (f), which is
(f) I dont like Maths and Im not going to spend at least 6 hours a week on Maths.
w) (z
w) (z
w) z w
(z
w) (z
w) (z
w)
= (z
w) (z
w) (z
= (z
(w w)) (z
= (z
T) (z
w)
w)
w)
Commutative Law
Distributive Law
Complement Law
= z (z
= (z z)
=T
=zw
(z w)
(z w)
= (z w)
QUANTIFIERS
w)
Identity Law
Distributive Law
Complement Law
Commutative Law
Identity Law
5.) x : x 2 +1 > 0 is true, but x : x 2 > 2 is false, since for example x = 1 doesnt satisfy the
predicate.
8.) Every state has a citizen that does not live in that state.
yx(P(x, y) Q(x, y))
10.) yxR(x, y) is the proposition For every example in these lecture notes there is a student
in the class who understands that example.
11.) xyR(x, y) is the proposition Every student in this class understands at least one
example in these notes.
12.) yxR(x, y) is the proposition There is an example in these notes that every student in
this class understands.
Determine the truth value of each of these statements if the universe of each
variable consists of (i) all real numbers, (ii) all integers.
13.) xy(x + y 6= y + x)
Solution:
Formally negating the statement we get
xy(x + y = y + x),
which is the law of commutativity of addition.
Thus statement (a) is false in both universes, because addition is commutative and for any x, y
we have x + y = y + x.
14.) xy(x + y = 2 2x y = 2)
Solution:
The statement is false in both universes. To prove it we need to prove that negation of this
statement is true.
(x y (x + y = 2 2x y = 2)) x y x + y 6 2 2x y 6 2)
Let us assign x = 2 and then the quantified predicate turns into
2 + y 2 v 4 y 2 y 0 v y 2.
Rewrite the following statement so that negations appear only within predicates
(that is, no negation is outside a quantifier or an expression involving logical
connectives)
17.) x ((yz P(x, y, z)) (zy R(x, y, z))).
Solution:
Method 1 If you use connective the problem gets easier:
x ((yz P(x, y, z)) (zy R(x, y, z)))
x ((yz P(x, y, z)) (zy R(x, y, z)))
x ((yz P(x, y, z)) (zy R(x, y, z)))
Method 2 If you do not want to use then we have to recall that
((p q)) (p q).
And then after the second step we continue:
x ((yz P(x, y, z)) (zy R(x, y, z)))
x ((yz P(x, y, z)) ((zy R(x, y, z))))
x ((yz P(x, y, z)) (zy R(x, y, z)))
Let Q(x, y) be the statement x+y = xy. If the universe of discourse for both
variables is the set of integers, what are the truth values of the following?
18.)
a) Q(1, 1)
b) Q(2, 0)
c) x Q(x, 2)
d) xy Q(x, y)
e) yx Q(x, y)
Solution
a) 1 + 1 = 1 1 False.
b) 2 + 0 = 2 0 True.
c) x x + 2 = x 2 False, because the equality is equivalent to 2 = 2.
d) xy x + y = x y False. Consider negation of this statement:
xy x + y 6= x y
19.) What does the statement x N(x) mean if N(x) is Compuetr x ix connected to
the network. and the domain consists of all computers on campus?
x N(x) : Every computer on campus is connected to the network.
RULE OF INFERENCE
1.) Apply Modus Tollens.
If Taylor was hired by a bank in NY, then Taylor will move to NY.
Taylor did not move to NY.
pq
-q__
-p
Therefore, I will study discrete math and I will study English literature.
3.) Apply Disjunctive Syllogism
Let p be I will study discrete math.
Let q be I will study English literature.
pvq
-p____
q
I will study discrete math or I will study English literature.
I will not study discrete math.
p v q__
qvr
I will not study discrete math or I will study English literature.
I will study discrete math or I will study databases.
Premise
2. p s
Syllogism
3. t v s
Premise
4. s v t
Commutative Law of v
5. st
-s v t st
6. p t
Syllogism
7. t v u
Premise
8. t u
-t v u tu
9. p u
Syllogism
10. u
Premise
11. p
MT
P1= p q
P2= p___
C=q
((p q) p ) q
P
p q
(p q) p
((p q) p ) q
T
T
F
F
T
F
T
F
T
F
T
T
T
F
F
F
T
T
T
T
tautology; VALID
7.) Show that the hypotheses (pq)r and rs imply the conclusion ps.
Clearly [(pq)r] (rs)= [ (pq) r] (rs). Applying Hypotheses syllogism, from [ (pq)
r] (rs) follows (pq) s. But (pq) s=(pq) s. Applying the distributive law (pq)
s =(ps)(qs) and simplification from (ps)(qs) follows (ps).
9.) Let p and q be as in Example 10. If (pq)p =T, is it correct to Let p and q be
as in Example 10. If (pq)p =T, is it correct to conclude that q=T?
Solution:
We check if [(pq)p] q is a tautology. It is not (check for p=F, q=T). So it is not correct to
conclude that q=T. This type incorrect reasoning is called the fallacy of denying the
hypotheses.
10.) Assume that For all positive integer n, if n is greater than 4, then n^2 is less
than 2^n is true. Show that 100^2.
Solution: Let
P(n): n>4
Q(n): n^2<2^n.
So the statement can be represented as n(P(n)Q(n)), where D=N. We assume that
n(P(n)Q(n)) is true.
STEP
REASON
1. P(100)
Premise
2. n(P(n)Q(n))
Premise
3. P(100)Q(100))
4. Q(100)
12.) Show
q, q
t,
r,
s,
r
r
(2)
(3)
q
q
p
q
p
q
premise
premise
by modus tollens
premise
by (1)
by disjunctive syllogism
premise
q
u s
u s
s
p
s
p s
p s t
p s
t
(4)
(5)
(6)
by (1)
by modus ponens
by (3)
by conjunctive simplification
by (2)
by (4)
by conjunctive addition
premise
by (5)
by modus ponens
11.) Suppose that the conditional statement If it snows today, then we will go
skiing and its hypothesis, It is snowing today are true. Then, by modus
ponens, it follows that the conclusion of the conditional statement, We will go
skiing, is true.
A valid argument can lead to an incorrect conclusion if one or more of its premises is false.
-p____
r
Answer: NVC
15.)
t ( rs)
-(rs) __
-t
Answer: MT
16.)
r-t
-t v__
t v
Answer: LS
17.)
p -r
r -p
Answer: LC
q)
REASON
1.) p (pq)
Premise
2.) p
3.) pq
4.) q
19.) Using the rules of inference, construct a valid argument to show that John
Smith has two legs
is a consequence of the premises:
Valid Argument:
STEP
REASON
x (M(x) L(x))
Premise
M(J) L(J)
UI from (1)
M(J)
Premise
L(J)
20.) Use the rules of inference to construct a valid argument showing that the
conclusion
Someone who passed the first exam has not read the book.
follows from the premises
A student in this class has not read the book.
Everyone in this class passed the first exam.
Solution: Let C(x) denote x is in this class, B(x) denote x has read the book,
and P(x) denote x passed the first exam.
REASON
x (C(x) -B(x))
Premise
C(a) -B(a)
EJ from (1)
C(a)
Simplication from 2
x (C(x) P(x))
Premise
C(a) P(a)
UI from (4)
P(a)
-B(a)
P(a) -B(a)
x (P(x) -B(x))
EG from (8)
SET THEORY
1.) U = {natural numbers}; A = {2, 4, 6, 8, 10}; B = {1, 3, 6, 7, 8}
State whether each of the following is true or false:
a) 2 A
(b) 11 B
(c) 4 B
(d) A U
(e) A = {even numbers}
Answer:
(a) T
(b) F
(c) T
(d) F; A is a subset of U (which we meet in the next section)
(e) F; {even numbers} means the set of all the even numbers, not just those between 2
and 10
3.) The following sets have been defined using the | notation. Re-write them by
listing some of the elements
(a) {p | p is a capital city, p is in Europe}
(b) {x | x = 2n - 5, x and n are natural numbers}
(c) {y | 2y2 = 50, y is an integer}
(d) {z | 3z = n2, z and n are natural numbers}
Answer:
Examples might include:
(a) {London, Paris, Rome, }
(a) Draw a Venn diagram, showing these sets with all the elements entered into the
appropriate regions. If necessary, redraw the diagram to eliminate any empty regions.
b) Which of sets P, Q and R are proper subsets of others? Write your answer(s) using
the symbol.
(c) P and R are disjoint sets. True or False?
Answer:
a.)
(b) P Q; R Q
(c) False
7.)Sketch Venn diagrams that show the universal set, U, the sets A and B, and a
single element x in each of the following cases:
(a) x A; A B
(b) x A; A and B are disjoint
(c) x A; x B; B A
(d) x A; x B; A is not a subset of B; B is not a subset of A
Answer:
a.)
b.)
c.)
d.)
Answer:
a.)
b.) A B = {6, 8}
A C = {2, 3, 4, 6, 7, 8, 10}
A = {1, 3, 5, 7, 9}
B = {2, 4, 5, 9, 10}
B A = {1, 3, 7}
B C = {1, 6, 8}
A B = {2, 4, 10}
A B = {1, 2, 3, 4, 7, 10}
(c) C - B =
(a) F
(b) F
(c) T
10.) What can you say about two sets P and Q if:
(a) P Q =
(b) P Q = P?
Answer:
(a) P Q
(b) Q P
11.) Make six copies of the Venn diagram shown alongside, and then shade the
areas represented by:
(a) A B
(b) A B
(c) (A B)
(d) A B
(e) (A B)
(f) A B
Answer:
a.)
b.)
c.)
d.)
e.)
f.)
12.) Identify the sets represented by each of the shaded areas below, using the
set notation symbols , and only:
a.)
b.)
c.)
d.)
Answer:
(a) B
(b) A B
(c) (A B) (A B) or (A B ) (A B)
(d) (A B) (A B ) or (A B) (A B) or ?
13.) (a) One of the shaded regions in question 5 represents the set A B. Identify which
one it is, and hence write a definition of A B using only symbols from the list , and .
(b) Again using one of your answers to question 5, write a definition of A B using only
symbols from the list , and . (There are two possibilities here see if you can find them
both!)
Answer:
(a) Region (b) represents A B. So A B = A B
(b) Region (c) represents A B.
So A B = (A B) (A B ) or (A B) (A B)
14.) (a) If A = {1, 2, 3, 4}, write down P(A) by listing its elements. What is the value of |P(A)|?
(b) If | A | = 5, what is the value of | P(A) |?
(c) If | A | = 10, what is the value of | P(A) |?
Answer:
(a) P(A) = {, {1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2,4}, {3, 4}, {2, 3, 4}, {1, 3, 4}, {1,
2, 4}, {1, 2, 3}, {1, 2, 3, 4}}
| P(A) | = 16
(b) 32
(c) 210 = 1024
15.) Prove the following identities, stating carefully which of the set laws you are
using at each stage of the proof.
(a) B ( A) = B
(b) (A U) = A
(c) (C A) (B A) = A (B C)
(d) (A B) (A B ' ) = A
(e) (A B) (A B ' ) = B
(f) A (A B) = A
Answer:
LAW
used
(a)
(b)
B ( A)
(A ' U) '
= B (A )
Commutative
=B
Identity
=B
Identity
De Morgan
= A U'
Involution
=A
Complement
(c)
(d)
(e)
(C A) (B A)
(A B) (A B ' )
(A B) (A B ' ) '
=A
Identity
= (A C) (B A)
Commutative
= (A C) (A B)
Commutative
= A (C B)
Distributive
= A (B C)
Commutative
= A (B B ' )
Distributive
=AU
Complement
=A
Identity
De Morgan
= (A B) (A ' B)
Involution
= (B A) (B A ' )
Commutative ( 2)
= B (A A ' )
Distributive
=BU
Complement
=B
Identity
A (A B)
f)
= (A ) (A B)
Identity
= A ( B)
Distributive
= A (B )
Commutative
=A
Identity
=A
Identity
17.) A chess boards 8 rows are labelled 1 to 8, and its 8 columns a to h. Each
square of the board is described by the ordered pair (column letter, row number).
(a) A knight is positioned at (d, 3). Write down its possible positions after a single move
of the knight.
(b) If R = {1, 2, ..., 8}, C = {a, b, ..., h}, and P = {coordinates of all squares on the chess
board}, use set notation to express P in terms of R and C.
(c) A rook is positioned at (g, 2). If T = {2} and G = {g}, express its possible positions
after one move of the rook in terms of R, C, T and G.
Answer:
(a) (b, 2), (b, 4), (c, 1), (c, 5), (e, 1), (e, 5), (f, 2), (f, 4)
(b) P = C R
(c) ((G R) (C T)) - (G T)
BOOLEAN ALGEBRA
1.)(A + B) (A + C)
AA + AC + BA + BC
A + AC + BA +BC
A(1 + C) + BA + BC
A + BA + BC
A(1+ B) + BC
A + BC
2.) ~(A * B) * (~A + B) * (~B + B)
~(A * B) * (~A + B)
3.) LMN + ML
MLN + ML
ML (N + 1)
ML * 1
ML
5.) X= CAB + AB
AB + ABC
AB + C
6.) T = AB + B(B + C) + BC
AB + BB + BC + BC
AB + B + BC + BC
B(A + 1 + C) + BC
B*1 + BC
B+ BC
B+C
7.) (AB + BC) (AB + C)
AB + ABC + BCAB + BCC
AB + ABC + ABC
AB (1 + C + C)
AB
8.) ABC + ABC + ABC + ABC
AB(C+C) + AB(C+C)
AB + AB
B(A+A)
B * 1
B
9.) (AB + C)
AB + C
(A + B) * C
(A + B) * C
10.) ( (A + B) + (CD))
X= (A + B)
Y= (CD)
(X +Y) = X + Y
(A + B) * CD
ACD + BCD
11.) ( (A+B) CD + E + F )
=( (A+B)CD ) * E * F
X=(A+B) CD
X=(A+B)
Y= E
Y= C
Z= F
Z= D
(X+Y+Z) = X * Y * Z
=( (A+B) + C + D ) * E * F
(X*Y*Z) = X + Y + Z
= (A * B + C + D) * EF
=A * BEF + CEF + DEF
12.) ( (U + V) (W + X) (Y + Z) )
=U+V+W+X+Y+Z
A= (U + V)
B= (W + X)
C= (Y + Z) (Y + Z)
(A * B * C) = A + B +C
ab
00
01
11
10
cd
00
01
11
10
1
1
x
X
1
X
1
1
1
1
x
14.) f(w,x y,z) = m ( 5, 7, 9, 11, 13, 14) + d (2, 6, 10, 12, 15)
wx
yz
00
01
11
10
00
01
11
10
1
1
x
x
1
x
1
1
1
x
xz + wz + wy
00
01
11
10
1
0
X
1
1
1
1
1
0
X
0
1
1
1
0
1
cd
00
01
11
10
f= ad + ad + cd + abc
SOP minterms
f=(a + c + d) * (a + b + d) * (a + b + c)
POS maxterms
000
001
011
010
100
101
111
110
1
1
1
1
1
1
cde
abcde
abcdef
17.) f( u,v,w,x,y,z)= m(0, 6, 18, 19, 20, 21, 26, 27, 28, 29, 48, 54)
x,y,z
u,v,w
000
001
011
010
100
101
111
110
000
001
011
010
100
101
111
110
1
1
1
1
1
1
1
1
1
wz
uv
Answer: wz + uv
18.) f(u,v,w,x,y,z)= m (0, 1, 7, 19, 21, 27. 37, 48, 49, 55)
x,y,z
u,v,w
000
001
011
010
100
101
111
110
000
001
010
100
101
111
1
1
1
wxy
wxyz
011
1
1
1
uwxyz
wxyz
110
x,y,z
u,v,w
000
001
011
010
100
101
111
110
000
001
011
010
1
1
1
1
100
101
1
1
1
1
111
110
1
1
1
1
19.)f (u,v,w,x,y,z)= m (17, 18, 21, 25, 26, 29, 33, 34, 37, 41, 42, 45)
xyz
xyz
xyz
20.) f(A,B,C,D,E,F) = m( 17, 19, 20, 21, 25, 28, 29, 33, 35, 57, 59)
000
001
011
010
100
101
111
DEF
ABC
000
001
011
010
100
101
111
110
1
1
1
1
1
1
1
1
DF
1
1
1
1
ABDE
Answer: ABDE + DF
FUNCTION
1. Below are several functions from R to R. Select all of the ones that are
injective.
a.) f(x)=3x-2
b.) f(x)=3x2-2
c.) f(x)=x3-2
d.) f(x)= cos(2x)
e.) f(x)= IxI (the ceiling function)
110
Answer:
a&c
2.) Prove that f: Z5 Z5 given by f(x) = x+3 is injective.
Z5 = {0, 1, 2, 3, 4}
x
0
1
2
3
4
f(x)
3
4
0
1
2
No Collision
It is injective.
g(x)
0
1
4
4
1
It is not injective.
b
R = {(1,a),3 (2,a), (3,b)} is a function from A to B.
5.) Let A = { 1, 2, 3 } and B = { a, b }.
1
2
5
Answer: Onto
r
9.)
2
8
11.) Given the relation A = {(5,2), (7,4), (9,10), (x, 5)}. Which of the following values
for x will make relation A a function?
a.) 7
b.) 9
c.) 4
Answer: c
0
8
1
9
3
10
5
6
Yes
No
Cannot be determined from a chart.
Answer: Yes
16.)
Answer: Function
3
10
9
7
X
y
-2
5
-1
5
0
5
Yes
No
Cannot be determined from a chart.
Answer: Yes
1
5
2
5
3
5
RELATION
1.) Let A={ 0,1,2,3} and a relation R on A be given by
R={ (0,0), (0,1), (0,3), (1,0), (1,1), (2,2), (3,0), (3,3) }
Is R reflexive? symmetric? transitive?
Solution
(a) R is reflexive, i.e. there is a loop at each vertex.
(b) R is symmetric, i.e. the arrows joining a pair of different vertices always appear in a pair with
opposite arrow directions.
(c) R is not transitive. This is because otherwise the arrow from 1 to 0 and arrow from 0 to 3
would imply the existence of an arrow from 1 to 3 (which doesn't exist). In other words (1,0)
R, (0,3)
R and (1,3)
2.) Let m,n and d be integers with d 0. Then if d divides (m-n), denoted by d | (mn), i.e. m-n=dk for some integer k, then we say m is congruent to n modulo d,
written simply as m n (mod d). Let R be the relation of congruence modulo 3 on
the set of all integers, i.e.
mRn
n (mod) 3
3 | (m-n) .
3.) Let A be the set {1, 2, 3, 4}. Which ordered pairs are in the relation R = {(a, b) | a
divides b}?
Solution: Because (a, b) is in R if and only if a and b are positive integers not exceeding 4 such
that a divides b, we see that
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
R5 = {(a, b) | a = b + 1},
R6 = {(a, b) | a + b 3}.
Which of these relations contain each of the pairs (1, 1), (1, 2), (2, 1), (1, 1), and (2, 2)?
Solution: The pair (1, 1) is in R1, R3, R4, and R6; (1, 2) is in R1 and R6; (2, 1) is in R2, R5, and
R6; (1, 1) is in R2, R3, and R6; and finally, (2, 2) is in R1, R3, and R4.
7.) In problem no.6, Which of the relations from Example 5 are symmetric and
which are antisymmetric?
Solution: The relations R3, R4, and R6 are symmetric. R3 is symmetric, for if a = b or a = b,
then b = a or b = a. R4 is symmetric because a = b implies that b = a. R6 is symmetric
because a + b 3 implies that b + a 3. The reader should verify that none of the other
relations is symmetric.
The relations R1, R2, R4, and R5 are antisymmetric. R1 is antisymmetric because the
inequalities a b and b a imply that a = b. R2 is antisymmetric because it is impossible that
a>b and b>a. R4 is antisymmetric, because two elements are related with respect to R4 if and
8.) In problem no.6, Which of the relations in problem no.6 are transitive?
Solution:The relations R1, R2, R3, and R4 are transitive. R1 is transitive because a b and b
c imply that a c. R2 is transitive because a>b and b>c imply that a>c. R3 is transitive because
a = b and b = c imply that a = c. R4 is clearly transitive, as the reader should verify. R5 is not
transitive because (2, 1) and (1, 0) belong to R5, but (2, 0) does not. R6 is not transitive
because (2, 1) and (1, 2) belong to R6, but (2, 2) does not.
Solution: Suppose that a divides b and b divides c. Then there are positive integers k and l such
that b = ak and c = bl. Hence, c = a(kl), so a divides c. It follows that this relation is transitive.
We can use counting techniques to determine the number of relations with specific properties.
Finding the number of relations with a particular property provides information about how
common this property is in the set of all relations on a set with n elements.
13.) Let A = {1, 2, 3} and B = {1, 2, 3, 4}. The relations R1 = {(1, 1), (2, 2), (3, 3)} and
R2 = {(1, 1), (1, 2), (1, 3), (1, 4)} can be combined to obtain
R1 R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)},
R1 R2 = {(1, 1)},
R1 R2 = {(2, 2), (3, 3)},
R2 R1 = {(1, 2), (1, 3), (1, 4)}
14.) Let A and B be the set of all students and the set of all courses at a school,
respectively. Suppose that R1 consists of all ordered pairs (a, b), where a is a
student who has taken course b, and R2 consists of all ordered pairs(a, b), where
a is a student who requires course b to graduate. What are the relations R1 R2,
R1 R2, R1 R2, R1 R2, and R2 R1?
Solution: The relation R1 R2 consists of all ordered pairs (a, b), where a is a student who
either has taken course b or needs course b to graduate, and R1 R2 is the set of all ordered
pairs (a, b), where a is a student who has taken course b and needs this course to graduate.
Also, R1 R2 consists of all ordered pairs (a, b), where student a has taken course b but does
not need it to graduate or needs course b to graduate but has not taken it. R1 R2 is the set of
ordered pairs (a, b), where a has taken course b but does not need it to graduate; that is, b is an
elective course that a has taken. R2 R1 is the set of all ordered pairs (a, b), where b is a
course that a needs to graduate but has not taken.
15.) What is the composite of the relations R and S, where R is the relation
from{1, 2, 3}to {1, 2, 3, 4} with R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)} and S is the
relation from {1, 2, 3, 4} to {0, 1, 2} with S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)}?
Solution: S R is constructed using all ordered pairs in R and ordered pairs in S, where the
second element of the ordered pair in R agrees with the first element of the ordered pair in S.
For example, the ordered pairs (2, 3) in R and (3, 1) in S produce the ordered pair (2, 1) in S R.
Computing all the ordered pairs in the composite, we find
S R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}.
16.) Let R = {(1, 1), (2, 1), (3, 2), (4, 3)}. Find the powers Rn, n = 2, 3, 4,....
Solution: Because R2 = R R, we find that R2 = {(1, 1), (2, 1), (3, 1), (4, 2)}. Furthermore,
because R3 = R2 R, R3 = {(1, 1), (2, 1), (3, 1), (4, 1)}. Additional computation shows that R4 is
the same as R3, so R4 = {(1, 1), (2, 1), (3, 1), (4, 1)}. It also follows that Rn = R3 for n = 5, 6,
7,.... The reader should verify this.
17.) Let R1 be the less than relation on the set of real numbers and let R2 be the
greater than relation on the set of real numbers, that is, R1 = {(x, y) | xy}. What
are R1 R2, R1 R2, R1 R2, R2 R1, and R1 R2?
Solution: We note that (x, y) R1 R2 if and only if (x, y) R1 or (x, y) R2. Hence, (x, y)
R1 R2 if and only if xy. Because the condition xy is the same as the condition x = y, it follows
that R1 R2 = {(x, y) | x = y}. In other words, the union of the less than relation and the
greater than relation is the not equals relation.
Next, note that it is impossible for a pair (x, y) to belong to both R1 and R2 because it is
impossible that xy. It follows that R1 R2 = . We also see that R1 R2 = R1, R2 R1 = R2,
and R1 R2 = R1 R2 R1 R2 = {(x, y) | x = y}.
18.) Let A be the set of cities in the U.S.A., and let B be the set of the 50 states in
the U.S.A. Define the relation R by specifying that (a, b) belongs to R if a city with
name a is in the state b.
For instance, (Boulder, Colorado), (Bangor, Maine), (Ann Arbor, Michigan), (Middletown, New
Jersey), (Middletown, New York), (Cupertino, California), and (Red Bank, New Jersey) are in R.
19.) Consider the relation R = {(1, 3), (1, 4), (3, 2), (3, 3), (3, 4)} on A = {1, 2, 3, 4}.
Find the domain and range of R.
Domain = {1, 3},
Range = {2, 3, 4}
20.) Find the domain and range of the function that assigns to each positive
integer the largest perfect square not exceeding this integer.
Answer:
Domain the set of positive integers
NUMBER SYSTEM
1.) Add 8 to +3
(+3) 0000 0011
+(8) 1111 1000
______________
(5) 1111 1011
2.) Add 5 to 2
(2) 1111 1110
+(5) 1111 1011
______________
(7) 1 1111 1001
3.) 6 from +7
(+7) 0111
0111
(6) 1010 -> Negate -> +0110
__________
_____
13
1101 = 8 + 5 = 3 : Overflow
= 13
13-9 = 410
7.) Convert the following binary numbers to their decimal equivalent. (a) 0.011 (b)
0.111. Divide a & b.
a.) 0.011= (0x2^-1) + (1x2^-2) + (1x2^3)
= 0 + 1/4 + 1/8
= 0.25 + 0.125 = 0.375
b.) 0.111= (1 x 2^-1) + (1 x 2^-2) + (1 x 2^-3)
= 1 /2 + 1/ 4 + 1/ 8
= 0.5 + 0.25 + 0.125 = 0.875= 0.5 + 0.25 + 0.125 = 0.875
a / b = 0.375 / 0.875 = 0.4285710
8.) Convert the following octal numbers to their decimal, equivalent. Add a, b & c.
(a) 358
358
(b) 1008
(c) 0.248
= (8 x 8^1) + (5 x 8^0)
= 24 + 5
= 29
1008
9.) Convert the following binary numbers to their decimal equivalent. Subtract a &
b.
(a)10001112
(b) 11002
1010112 = 1 x 20 + 1 x 21 + 0 x 22 + 1 x 23 + 0 x 24 + 1 x 25
= 4310
2 6 5 6
1 000
4 0
2656 40 = 3328
1
0001
0001
7 8
0111
1000 2
101
101______
11112
15.) BD1616- 15648. Express the answer in decimal.
BD1616= (10 x 163) + (13 x 162) + (1 x 161) + (6 x 160)
= 48406
16.) Convert 18 x 24 to binary form and then perform the binary multiplication.
18 = 18/2 = 9 ; 0
24 = 24/2 = 12; 0
9/2 =4 : 1
=12/2 =6; 0
4/2 =2 ; 0
=6/2 = 3; 1
2/2 =0
=3/2 = 1; 1
1810 = 0010
2410 = 1100
0011
x1100
0000
0000
0011
0011______
1001002
17.) Convert the following binary numbers to their decimal equivalent. (a) 0.011 (b)
0.111. Add a & b.
0.011 = (0 x 2-1) + (1 x 2-2) + (1 x 2-3)
= 0 + 1/4 + 1/8
= 0.25 + 0.125 = 0.375
100____
11 11000
11___
00
0 0___
00
0 0___
00
1002 = 100
= 48
110012= 11001
= 31