Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 66

LOGIC

1.) Fill in the corresponding truth values (T or F) of the expressions


(the shadowed area contains the answers)

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

3.) Translate the sentences into propositional expressions:


a.) "Neither the fox nor the lynx can catch the hare if the hare is alert and quick."

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

Since ~P ~Q is equivalent to ~( P V Q), another translations is:


(R S) ~( P V Q)
b.) "You can either (stay at the hotel and watch TV ) or (you can go to the museum and spend
some time there)".
The parentheses are used to avoid ambiguity concerning the priority of the logical connectives.
P: You stay at the hotel.
Q: You watch TV
R: You go to the museum
S: You spend some time in the museum
Translation: (P Q) V (R S)

4.) Given a conditional statement in English,


a.) translate the sentence into a logical expression
b.) write the negation of the logical expression and translate the negation into
English
c.) write the converse of the logical expression and translate the
converse into English
d.) write the inverse of the logical expression and translate the inverse
English
e.) write the contrapositive of the logical expression and translate the
contrapositive into English
"If we are on vacation we go fishing."

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

6.) Determine whether the following arguments are valid or invalid:

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.

Conclusion: If I don't study hard, I won't graduate this year.


Solution:
This is a valid argument, based on the hypothetical syllogism.
In order to show this we will represent the argument formally.
Let

P: I don't study hard


Q: I will not pass this course
R: I cannot graduate this year
Formal representation:
(1) P Q
(2) Q R
(3) Therefore P R
3.

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.

Conclusion: You have solved the test problems.


Solution:
This is an invalid 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
The above argument is a combination of disjunctive syllogism and modus ponens, however the
modus ponens is not applied correctly.
The disjunctive syllogism consists in the following:
Given that (Q V R) is true, and that Q is false (~Q is true) we conclude that R is true.
However we cannot know whether Q V R is true, given that P is true.
The error in concluding that Q V R is true is called converse error.

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

Translate the sentences in quantified expressions of predicate logic, write down


the negated expression and then translate the negated expression in English. The
predicates to be used are given in parentheses .
7.) Some problems are difficult. (problem(x), difficult(x))

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

9.) No students are allowed to carry guns. (student(x), carry_gun(x))

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

10.) International students are not eligible for federal loans.


(international_student(x), eligible(x))
x (international_student(x) ~eligible(x))
Negation:
~( x (international_student(x) ~eligible(x))) =
x, ~(international_student(x) ~eligible(x)) =
x, ~(~international_student(x) V ~eligible(x)) =
x, (international_student(x) eligible(x))
Translation: Some international students are eligible for federal loans.

11.) p represents the proposition "Henry VIII had six wives".


q represents the proposition "The English Civil War took place in the
nineteenth century".
(a) Connect these two propositions with OR. Is the resulting compound proposition true or
false?
(b) Now connect them with AND. Is this compound proposition true or false?

(c) Is the 'opposite' of p true or false?


Answer:
(a) p q is "Henry VIII had six wives or the English Civil War took place in the nineteenth
century"
This is true. The first part of the compound proposition is true, and this is sufficient to make the
whole statement true if a little odd-sounding!
(b) p q is "Henry VIII had six wives and the English Civil War took place in the nineteenth
century". This is false.
(c) The opposite of p, which we write as p, is "Henry VIII did not have six wives". This is clearly
false. And in general, ifp is true, then p is false, and vice versa.

12.)

p is "The printer is off-line"


q is "The printer is out of paper"
"r" is "The document has finished printing"

Write as English sentences, in as natural a way as you can


(a) p q
(b) r

(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.

13.) Propositional functions p, q and r are defined as follows:

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)

(x = 0)) ((a > 5)

((n = 7)

(x = 0))

(b)
((n = 7)

(a 5))

(n 7) (a > 5)

(c)
(n = 7) (((a 5)

(x = 0))

((n = 7) (a > 5)) (x 0)


Answer:
(a)
(p q)
(p
(p q)

= (r

p) r

= (p

r) (q

(b)

r) (q
=r

q)
r)

r
r)

(p q)

Commutative Law

Distributive Law
Commutative Law (twice)

First, we note that


q is "a 5"; and
p is "n 7".
So the expressions are:
(p

q)

p q
(p

= p (q)

q)

= p q

De Morgan's Law

Involution Law

(c)
First, we note that
r is "x 0".

So the expressions are


p ((q

r))

(p q) r
p ((q

r))

= p ((q) r)

= p (q r)

Involution Law

= (p q) r

Associative Law

De Morgan's Law

14.) Which of the following are propositions?


(a) 17 + 25 = 42
(b) July 4 occurs in the winter in the Northern Hemisphere.
(c) The population of the United States is less than 250 million.

(d) Is the moon round?


(e) 7 is greater than 12.
(f) x is greater than y.
Answer:
(a) is a proposition; and of course it has the 'truth value' true.
(b) is a proposition. Of course, it's false, but it's still a proposition.
(c) is a proposition, but we may not actually know whether it's true or false.
Nevertheless, the fact is that the statement itself is a proposition, because it is definitely
either true or false.
(d) is not a proposition. It's a question.
(e) is a proposition. It's false again, of course 7<12.
(f) is a bit more debatable! It's certainly a potential proposition, but until we know the
values of x and y, we can't actually say whether it is true or false. Note that this isn't quite the
same as (c), where we may not know the truth value because we aren't well-enough informed.
See the next paragraph.

15.) Which of the following are propositions?


(a) Buy Premium Bonds!
(b) The Apple Macintosh is a 16 bit computer.
(c) There is a largest even number.
(d) Why are we here?
(e) 8 + 7 = 13
(f) a + b = 13
Answer:
(a) is not a proposition. (It is a command, or imperative.)
(b) and

(c) are both propositions.


(d) is not a proposition; it's a question.
(e) strictly speaking is a propositional function, but many people would say it is a proposition.
(f) is not a proposition, because the result can be either true or false, it depends on the values of
a & b.

16.) p is "x < 50"; q is "x > 40".


Write as simply as you can:
(a) p
(b) q
(c) p

(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.

17.) In each part of this question a proposition p is defined. Which of the


statements that follow the definition correspond to the proposition p? (There
may be more than one correct answer.)
(a)
p is "Some people like Maths".
(i) "Some people dislike Maths"
(ii) "Everybody dislikes Maths"
(iii) "Everybody likes Maths"
(You may assume in this question that no-one remains neutral: they either like or dislike Maths.)
(b)
p is "The answer is either 2 or 3".
(i) "Neither 2 nor 3 is the answer"
(ii) "The answer is not 2 or it is not 3"
(iii) "The answer is not 2 and it is not 3"
(c)
p is "All people in my class are tall and thin".
(i) "Someone in my class is short and fat"
(ii) "No-one in my class is tall and thin"
(iii) "Someone in my class is short or fat"
(You may assume in this question that everyone may be categorised
as either tall or short, either thin or fat.)
Answer:
(a) (ii)

(b) (i) and (iii)


(c) (iii)

18.) p is "1024 bytes is known as 1MB"


q is "A computer keyboard is an example of a data input device".
Express the following compound propositions as English sentences in as natural a way as you
can. Are the resulting propositions true or false?
(a) p

(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.

19.) p is "I like Maths"


q is "I am going to spend at least 6 hours a week on Maths"
Write in as simple English as you can:
(a) (p)

(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.

20.) Use the laws of logical propositions to prove that:


(z

w) (z

w) (z

w) z w

State carefully which law you are using at each stage.


Answer:

(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

Express the statements using quantifiers.

1.) Everybody knows everybody.

(z w)

(z w)

= (z w)

QUANTIFIERS

w)

Identity Law

Distributive Law

Complement Law

Commutative Law

Identity Law

xE(x), E(x) = knows everybody.

2.) Somebody knows everybody.


xE(x)

3.) There is somebody whom no one knows.


~xE(x)

4.) x : x 2 = 4 is true, since 2 is an x for which x 2 = 4. On the other hand, x : x 2 = 4 is clearly


false; not all numbers, when squared, are equal to 4.

5.) x : x 2 +1 > 0 is true, but x : x 2 > 2 is false, since for example x = 1 doesnt satisfy the
predicate.

6.) x : x 2 > 2 is true, since x = 2 is an example that satisfies it.


P(x, y) is x is a citizen of y. Q(x, y) is x lives in y. The universe of discourse of
x is the set of all people and the universe of discourse for y is the set of US
states.
7.) All people who live in Florida are citizens of Florida.
x(Q(x, Florida) P(x, Florida))

8.) Every state has a citizen that does not live in that state.
yx(P(x, y) Q(x, y))

Suppose R(x, y) is the predicate x understands y, the universe of discourse for


x is the set of students in your discrete class, and the universe of discourse for y
is the set of examples in these lecture notes. Pay attention to the differences in
the following propositions.
9.) xyR(x, y) is the proposition There exists a student in this class who understands every
example in these lecture notes.

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.

Use predicates and quantifiers to express this statement


15.) There is a man who has visited some park in every province of Canada
Solution:
Let V (x, y), where x is a person and y is a park be a predicate Person x visited park y.
Let L(x, y), where x is a park and y is a province be a predicate
Park x is located in province y.
Then the statement under consideration can be expressed as follows
x y z V (x, z) L(z, y).

Find a counterexample, if possible, to this universally quantified statement, where


the universe for all variables consists of all integers
16.) xy (3xy = 12)
Solution:

A counterexample is in particular x = 12. If we assume that there is y such that


3xy = 12,
then we would have 3 12 y = 12 and thus y = 1/3, which is does not belong to the universe of
all integers.

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.

20.) Given premises: All clear explanations are satisfactory


Some excuses are unsatisfactory
infer Some excuses are not clear explanations.
Write the proof formally.
Solution
Let S(x) be x is a satisfactory, C(x) be x is a clear explanation
and E(x) be x is an excuse. Then the premises turn into:
x C(x) S(x)
x E(x) S(x).
While conclusion is x E(x) C(x).
The proof goes as follows:
1) x E(x) S(x) (premise)
2) E(x) S(x0) (for some x, by existential specification of 1))
3) x C(x) S(x) (premise)
4) C(x) S(x) (by universal specification of 3))
5) S(x) (by simplification of 2) )
6) C(x) (Modus Tollens of 4) and 5))

7) E(x) (by simplification of 2) )


8) E(x) C(x) (conjunction of 6) and 7))
9) x E(x) C(x) (existential generalization of 8))

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, Taylor. was not hired by the bank in NY.


2.) Apply Conjunction.
Let p be I will study discrete math.
Let q be I will study English literature.
p
q___
p q
I will study discrete math.
I will study English literature.

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.

Therefore , I will study English literature.


4.) Apply Resolution.
Let p be I will study discrete math.
Let r be I will study English literature.
Let q be I will study databases.
-p v r

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.

Therefore, I will study databases or I will English literature.


5.) Show that the following argument form
pr
rs
t v -s
-t v u
-u_____
-p
is valid by breaking it into a list of known elementary valid argument forms or rules.
1. p r, r s

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

6.) Determine whether it is valid or invalid.

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).

8.) Show if the following argument is valid?


If you do every problem in this book, then you will learn discrete mathematics. You learned
discrete mathematics. Therefore, you did every problem in this book.
Let
p: You did every problem in this book,
q: You learned discrete mathematics.
So the argument can be expressed as: [(pq)q]p. But [(pq)q]p is not a tautology, it is
false if p=F and q=T. Therefore the reasoning is not correct. This type incorrect reasoning is
called the fallacy of denying the hypotheses.

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))

Universal instantiation from(2)

4. Q(100)

Modus ponens from (1) and (3)

12.) Show

q, q

that the following argument form


r, p

t,

r,

s,

is valid by breaking it into a list of known elementary valid argument


forms or rules.
Solution We'll treat all the rules of inference introduced earlier in
this subsection as the known elementary argument forms. The
logical inference for the argument form in the question is as follows.
(1)

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.

12.) Apply disjunctive syllogism.


From: Joe is a plumber Joe took a college class.
And: Joe is not a plumber.___________________
Conclude: Joe took a college class.

13.) Apply modus ponens in predicate logic.


From: a = b and b = c implies a = c
And: (x y)2 = x2 2xy + y2 = (y x)2
Conclude: (x y)2 = (y x)2

Tell the validity of each argument by choosing one of the ff:


MP- Modus Ponens

LS- Law of Syllogism

MT- Modus Tollens

LC- Law of Contrapositive

NVC- No Valid Conclusion


14.)
pr

-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

18.) From the single proposition.


p ( p

q)

Show that q is a conclusion.


STEP

REASON

1.) p (pq)

Premise

2.) p

Conjunction using (1)

3.) pq

4.) q

Conjunction using (1)

Modus Ponens using (2) and (3)

19.) Using the rules of inference, construct a valid argument to show that John
Smith has two legs
is a consequence of the premises:

Every man has two legs. John Smith is a man.


Solution: Let M(x) denote x is a man and L(x) x has two legs and let John Smith be a
member of the domain.

Valid Argument:
STEP

REASON

x (M(x) L(x))

Premise

M(J) L(J)

UI from (1)

M(J)

Premise

L(J)

Modus Ponens using (2) and (3)

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.

First we translate the premises and conclusion into symbolic form.


x (C(x) -B(x))
x (C(x) P(x))
x (P(x) -B(x))
STEP

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)

MD from (3) and (5)

-B(a)

Simplication from (2)

P(a) -B(a)

Conj from (6) and (2)

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

2.) U = R; A = {4, 2, 2/3, -2.5, -5, 33, 9, }


Using the {} set notation, write the sets of:
(a) natural numbers in A
(b) integers in A
(c) rational numbers in A
(d) irrational numbers in A
Answer:
(a) {4, 33, 9}
(b) {4, -5, 33, 9}
(c) {4, 2/3, -2.5, -5, 33, 9}
(d) {2, }

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, }

(b) {1, 3, 5, 7, }, but not 3 or 1


(c) {5, -5}
(d) {3, 27, 243, }

4.) If U = {letters of the alphabet}, A = {a, a, a, b, b, a, c}, B = {c, b, a, c} and C = {a,


b, c}, what can be said about A, B andC?
Answer:
They are all equal.

5.) 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) A U
(b) B A
(c) U
Answer:
(a) True (b) False (c) True
6.) U = {a, b, c, d, e, f, g, h}; P = {c, f}; Q = {a, c, d, e, f, h}; R = {c, d, h}

(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.)

8.) U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}


A = {2, 4, 6, 8, 10}
B = {1, 3, 6, 7, 8}
C = {3, 7}
(a) Illustrate the sets U, A, B and C in a Venn diagram, marking all the elements in
the appropriate places. (Note: if any region in your diagram does not contain any
elements, re-draw the set loops to correct this.)
(b) Using your Venn diagram, list the elements in each of the following sets:
A B, A C, A, B, B A, B C, A B, A B

(c) Complete the statement using a single symbol: C - B = ... .

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 =

9.) True or false?


(a) | | = 1
(b) | { x, x } | = 2
(c) | U | = 0
Answer:

(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

= (A' ) ' U'

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

= (A B) (A ' (B ' ) ' )

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

16.) X = {a, c} and Y = {a, b, e, f}


Write down the elements of:
(a) X Y
(b) Y X
(c) X 2 (= X X)
(d) What could you say about two sets A and B if A B = B A?
Answer:
(a) X Y = {(a, a), (a, b), (a, e), (a, f), (c, a), (c, b), (c, e), (c, f)}
(b) Y X = {(a, a), (a, c), (b, a), (b, c), (e, a), (e, c), (f, a), (f, c)}
(c) X X = {(a, a), (a, c), (c, a), (c, c)}

(d) They are equal: A = B

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)

18.) In a certain programming language, all variable names have to be 3


characters long. The first character must be a letter from 'a' to 'z'; the others can
be letters or digits from 0 to 9.
If L = {a, b, c, ... , z}, D = {0, 1, 2, ..., 9}, and V = {permissible variable names}, use a Cartesian
product to complete: V = {pqr | (p, q, r) ... }
Answer:
V = {pqr | (p, q, r) L (L D) (L D)}

A = {4, 2, 2/3, -2.5, -5, 33, 9, }


19.) natural numbers in A
Answer: {4, 33, 9}

20.) rational numbers in A


Answer: {4, 2/3, -2.5, -5, 33, 9}

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)

(~A + ~B) * (~A + B)


~A + ~B * B
~A

3.) LMN + ML
MLN + ML
ML (N + 1)
ML * 1
ML

4.) S= (A + B) DD+ (A+ A)D


(A + B)0 + 1*0
0+D
D

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

13.) f= ( a, b ,c ,d) = m (0, 3, 6, 11, 13, 14) + d(5, 7, 10, 12)

ab

00

01

11

10

cd
00
01
11
10

1
1

x
X
1

X
1
1

1
1
x

bcd + bcd + acd + abcd

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

15.) f(a, b, c, d) = m(1, 11, 12, 15) + d (3, 13)


ab

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

16.) f (a,b,c,d,e,f) = m (15, 16, 17, 32, 33, 42, 43)


def
abc
000
001
011
010
100
101
111
110

000

001

011

010

100

101

111

110

1
1
1

1
1
1

cde

abcde

Answer: cde + abcde + abcdef

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

Answer: uwxyz + wxy + wxyz + wxyz

19.)f (u,v,w,x,y,z)= m (17, 18, 21, 25, 26, 29, 33, 34, 37, 41, 42, 45)
xyz

xyz

xyz

Answer: 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.

3 .) Prove that g: Z5 Z5 given by g(x) = x3 is injective.


x
0
1
2
3
4

g(x)
0
1
4
4
1

It is not injective.

4.) Let A = { 1, 2, 3 } and B = { a, b }.


1

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

S = {(1,a), (1,b), (2,a), (3,b)} is a not function from A to B.


6.) Let A = { 1, 2, 3 } and B = { a, b }.

T = {(1,a), (3,b)} is not a function from A to B.

7.) Determine the domain, codomain and range.


p
1

The domain is {1,2,3}.


The codomain is {p, q, r, s}
The range is {p, r}

Determine if it is onto or not onto function.


All elements in B are used. That is f(a) = b. ( subjective)
8.)
r

2
5

Answer: Onto
r

9.)

2
8

Answer: Not onto

10.) Which of the relations below is a function?


a.) {(2,3), (3,4), (5,1), (6,2), (2,4)}
b.) {(2,3), (3,4), (5,1), (6,2), (7,3)}
c.) {(2,3), (3,4), (5,1), (6,2), (3,3)}
Answer: b

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

12.) True or False.


The following relation is a function.
{(10,12), (5,3), (15, 10), (5,6), (1,0)}
Answer: False

13.) Which of the relations below is a function?


a.) {(1,1), (2,1), (3,1), (4,1), (5,1)}
b.) {(2,1), (2,2), (2,3), (2,4), (2,5)}
c.) {(0,2), (0,3), (0,4), (0,5), (0,6)}
Answer: a

14.) Is the relation depicted in the chart below a function?


X
y

0
8

1
9

3
10

5
6

Yes
No
Cannot be determined from a chart.
Answer: Yes

Determine if it is function or not.


15.)
a

Answer: Not a function

16.)

Answer: Function

17.) Is the relation depicted in the chart below a function?

3
10

9
7

X
y

-2
5

-1
5

0
5

Yes
No
Cannot be determined from a chart.
Answer: Yes

18.) Find the domain.


f(x) = 2x + 1
x2 + 5x + 6
x2 + 5x + 6 0
(x + 3) (x + 2) 0
x= -3 ; x= -2
Answer: Domain= ( -, -3) u (-3, -2) u (-2, )

19.) Find the domain.


f(x) = (x+1)
x+1 0
x -1
Answer: Domain= {Rx -1} or (-1, )

20.) Given f (x) = 2x - 3x + 6, find f (2.5).


a.) 11
b.) 23.5
c.) 76
Answer: a

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)

Rimply R is not transitive.

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) .

Show R is an equivalence relation.


Solution We just need to verify that R is reflexive, symmetric and transitive.
(a) Reflexive: for any n

we have nRn because 3 divides n-n=0.

b) Symmetric: for any m,n


if mRn, i.e. m n (mod 3) then there exists a k
such that m-n
=3k. This means n-m=3(-k), i.e. n m (mod 3), implying finally nRm. For example, 7R4 is
equivalent to 4R7 can be seen from 7R4
7 4 (mod 3)
7-4 =3 1
4-7 =3 (-1)
4
7 (mod 3)
4R7
(c) Transitive: for any m,n,p
, if mRn and nRp, then there exist r,s
=3r and n-p=3s. Hence m-p=(m-n)+(n-p)=3(r+s), i.e.mRp.

such that m-n

We thus conclude that R is an equivalence relation.

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)}.

4.) Consider these relations on the set of integers:


R1 = {(a, b) | a b},
R2 = {(a, b) | a>b},
R3 = {(a, b) | a = b or a = b},
R4 = {(a, b) | a = b},

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.

5.) How many relations are there on a set with n elements?


Solution: A relation on a set A is a subset of A A. Because A A has n2 elements when A has n
elements, and a set with m elements has 2m subsets, there are 2n2 subsets of A A. Thus,
there are 2n2 relations on a set with n elements. For example, there are 232 = 29 = 512
relations on the set {a, b, c}.

6.) Consider the following relations on {1, 2, 3, 4}:


R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
R2 = {(1, 1), (1, 2), (2, 1)},
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)},
R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)},
R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)},
R6 = {(3, 4)}.

Which of these relations are reflexive?


Solution: The relations R3 and R5 are reflexive because they both contain all pairs of the form
(a, a), namely, (1, 1), (2, 2), (3, 3), and (4, 4). The other relations are not reflexive because they
do not contain all of these ordered pairs. In particular, R1, R2, R4, and R6 are not reflexive
because (3, 3) is not in any of these relations.

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

only if they are equal. R5 is antisymmetric because it is impossible that a = b + 1 and b = a + 1.


The reader should verify that none of the other relations is antisymmetric.

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.

9.) Which of the relations from problem no.6 are reflexive?


Solution: The reflexive relations from Example 5 are R1 (because a a for every integer a), R3,
and R4. For each of the other relations in this example it is easy to find a pair of the form (a, a)
that is not in the relation. (This is left as an exercise for the reader.)

10.) Is the divides relation on the set of positive integers reflexive?


Solution: Because a | a whenever a is a positive integer, the divides relation is reflexive. (Note
that if we replace the set of positive integers with the set of all integers the relation is not
reflexive because by definition 0 does not divide 0.)

11.) Is the divides relation on the set of positive integers symmetric? Is it


antisymmetric?
Solution: This relation is not symmetric because 1|2, but 2 | 1. It is antisymmetric, for if a and b
are positive integers with a |b and b |a, then a = b (the verification of this is left as an exercise
for the reader).
Let R be the relation consisting of all pairs (x, y) of students at your school, where x has taken
more credits than y. Suppose that x is related to y and y is related to z. This means that x has
taken more credits than y and y has taken more credits than z. We can conclude that x has
taken more credits than z, so that x is related to z. What we have shown is that R has the
transitive property, which is defined as follows.

12.) Is the divides relation on the set of positive integers transitive?

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

4.) 11001012 1111012 (10110 6110)


1100101
10110
111101 6110
____________
1100101
+1100101
____________
111111001
+1100101
____________
10100100001
+1100101
____________
101101110001
+1100101
____________
1100000010001 = 409610 + 204810 + 1610 + 1 = 616110

5.) 1001012 1012 (3710 510)


111 result = 710
_________
101)100101
101
______
1000
101
______
111
101
______
10 remainder = 210

6.) 11012 910 =?


1101 = (1x2) + (1x2) + (0x2) + (1x2)
= 8+4+0+1

= 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

= (1 x 8^2) + (0 x 8^1) + (0 x 8^0)


= 64 + 0 + 0
= 64

0.248 = (2 x 8^1) + (4 x 8^-2)


= 2/28 + 4/64
= 0.3125
a + b + c = 29 + 64 + 0.3125
= 93.3125

9.) Convert the following binary numbers to their decimal equivalent. Subtract a &
b.

(a)10001112

(b) 11002

10001112 = (1 x 106) + (0 x 105) + (0 x 104) + (0 x 103) + (1 x 102) + (1 x 101) + (1 x 100)


= 71

11002 = (1 x 103) + (1 x 102) + (0 x 101) + (0 x 100)


= 12

10001112 - 11002= 71 12 = 5910

10.) ABC16 + 1010112 =?. Answer in decimal.


ABC16 = 12 x 1 + 11 x 16 + 10 x 256
= 274810

1010112 = 1 x 20 + 1 x 21 + 0 x 22 + 1 x 23 + 0 x 24 + 1 x 25
= 4310

ABC16 + 1010112 = 274810 + 4310


= 279110

11.) 101101011102 - 10002. Express the answer in octal.


10110101110

2 6 5 6

1 000
4 0

2656 40 = 3328

11.) 1268 + A516 10112. Express the answer in decimal.


1268 = (1 x 82) + (2 x 81) + (6 x 80)
= 86

A516 = (10 x 161) + (5 x 160)


=165

10112 = (1 X 103) + (0 X 102) + (1 X 101) + (1 X 100)


= 11

1268 + A516 10112 = 86 + 165 -11 = 24010

12.) 5018 - 2478 .Express in binary.


5018 = 101000001
2478 = 10100111
________________
= 100110102

13.) 123410 568. Express the answer in octal.


123410 = 1234
568 = (5 x 81) + (6 x 80)
= 46
123410 568 = 1178

1
0001

0001

7 8
0111

1000 2

14.) 112 1012


101
11______

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

15648 = (1 x 83) + (5 x 82) + (6 x 81) + (4 x 80)


= 884

BD1616- 15648 = 48406 884 = 4755210

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

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.0112 + 0.1112 = 0.375 + 0.875 = 1.2510

18.) ECE16 x 1012 . Express the answer in decimal.


ECE16 = (14 x 162) + (12 x 161) + (14 x 160)
= 3790

1012 = (1 x 22) + (0 x 21) + (1 x 20)


=5

ECE16 x 1012 = 3790 x 5 = 1895010

19.) 11002 112 . Express the answer in octal.

100____
11 11000
11___
00
0 0___
00
0 0___
00

1002 = 100
= 48

20. 10010010000112 + 110012. Express the answer in octal.


10010010000112 = 1001001000011
= 11103

110012= 11001
= 31

10010010000112 + 110012= 11103 +31 = 111348

You might also like