Midterm Exam Summer 2004 1 of 6
CS205 Introduction to Discrete Structures Summer 2004
Midterm Exam Solutions
Please note:
It is a violation of the Rutgers Policy on Academic Integrity: (1) to give assistance or information
to another student on an examination; or (2) to receive assistance or information from another
student on an examination. These are “Level Three” violations at Rutgers, and they can result in
suspension from the University. At a minimum, they will result in an automatic failing grade for
the course.
I have read this statement, and I understand it. I will not violate the Rutgers Policy on
Academic Integrity.
Signature:___________________________________
Student ID Number:___________________________
Instructions: This is a closed book exam. You are allowed one double-sided 8½" x 11" page of
notes or two single-sided 8½" x 11" pages of notes. Complete this cover page and
wait for the instructor to start the exam.
Suggestions: Use a pencil or erasable pen. Read each question carefully before answering it. If
a question is unclear to you, ask for help from the instructor. Keep track of the
time; if a question is taking too long, move on to another, and come back to the
first if you have time.
Midterm Exam Summer 2004 2 of 6
1. Circle which of the following does not represent p 6 q.
10 pts -4 for a & b, -4 for c-e, -10 for all wrong
a. p is necessary for q
b. p is sufficient for q
c. p implies q
d. if p then q
e. p if q
2. Let Q(x,y) be the mathematical statement x = xy. If the universe of discourse is the set of
integers, what are the truth values of the following? (write an F or T for each)
12 pts -3 each
a. xyQ(x, y) T b. xyQ(x, y) F c. xyQ(x, y) T
d. xyQ(x, y) T e. yxQ(x, y) T f. yxQ(x, y) T
3. The universe of discourse for the following quantified expressions is {a,b,c}. Expand each
proposition ( e.g. xF(x) = [F(a) v F(b) v F(c)]). Be very careful.
a. yxL(x, y)
5 pts
( L(a,a) wL(b,a)wL(c,a) ) v ( L(a,b) wL(b,b)wL(c,b) ) v ( L(a,c) wL(b,c)wL(c,c) )
b. xyL(y, x)
5 pts
( L(a,a) v L(b,a)v L(c,a) ) w ( L(a,b) v L(b,b)v L(c,b) ) w ( L(a,c) v L(b,c)v L(c,c) )
4. Let C(x,y) be the statement “x has taken class y,” , G(x) be the statement “x is a graduate
student”, where the universe of discourse for x is the set of all students at your University and
for y is the set of all courses at your school. Use Predicate Logic notation to express each
sentence.
a. No class has been taken by every student.
3 pts ¬yxC(x, y)
b. Some class has been taken by every graduate student.
3 pts yx( G(x) 6 C(x, y) )
c. Some class has been taken by no more then two students.
5 pts 6yx1x2{ (x1 =/ x2) v x3[ C(x3, y) ( ( x3 = x1) w ( x3 = x2) ) ] }
d. There are at least two people, who have taken the exact same classes.
5 pts :x1x2{ (x1 =/ x2) v y( C(x1, y) C(x2, y) )
Midterm Exam Summer 2004 3 of 6
5. Let the universe of discourse be non-empty. Answer the following multiple choice questions
with one of the following letters:
12 pts -4 each
a. ] b. Y c. Z d. none of the above
b xP(x) ? ]? xP(x)
]c ¬xP(x)
¬xP(x) ??
]c yxL(x,y)
xyL(x,y) ??
]d
xyL(x,y) ?? xyL(x,y)
]b
xyL(x,y) ?? xyL(x,y)
]d
xyL(x,y) ?? xL(x,x)
]d
x¬yL(x,y) ?? ¬xy¬L(x,y)
]b
xyL(x,y) ?? xL(x,x)
]a
x( P(x) v Q(x) ) ?? xP(x) v xQ(x)
]a xP(x) v yQ(y)
x( P(x) v yQ(y) ) ??
]c xP(x) w xQ(x)
x( P(x) w Q(x) ) ??
]a xP(x) w yQ(y)
x( P(x) w yQ(y) ) ??
6. Recall that the exclusive or logical operator, r, is only true when exactly one propostion is true.
That is p r q ] (p w q) v ¬(p v q). You may use this equivalance rule later in this problem
and you may name it XOR.
You are to do 2 things for each of the following pairs of logical expressions:
First, decide if LHS ]RHS, or if LHS Y RHS, or if LHS Z RHS, or is there is no
implicative relationship between the left hand side and right hand side.
Second, prove your claim with a direct proof, using any of the approved equivalence or
inference rules that you like (including XOR). Make sure to use the standard format, and justify
all your work. (continued on next page)
Midterm Exam Summer 2004 4 of 6
6a. p r (q v r) Z (p r q) v (p r r)
5 pts
A counter example to show that the LHS doesn’t imply the RHS ( not required )
-/->
T FT TFTT
F TF
TF
F
A proof to show that the RHS does imply the LHS
5 pts
1 (p r q) v (p r r) / p r (q v r)
]2 [(p w q) v¬(p v q)] v [(p w r) v ¬(p v r)] 1 XOR
2 DeM
] 3 [(p w q) v(¬p w ¬q)] v [(p w r) v( ¬p w ¬r)] 3 assc., comm.
4 dist
] 4 [(p w q) v (p w r)] v[(¬p w ¬q) v ( ¬p w ¬r)] 5 simp
5 assc,comm,simp
] 5 [p w (q v r)] v[(¬p w ¬q) v ( ¬p w ¬r)] 7 add, assc
8 DeM
Y 6 [p w (q v r)] 9 DeM
6,10 conj
Y 7 ¬p w ¬q 11 XOR
Y 8 ¬p w(¬q w ¬r)
] 9 ¬p w¬(q v r)
] 10 ¬(p v (q v r) )
Y 11 [p w (q v r)] v[¬(p v (q v r) )]
] 12 p r (q v r)
6b. p r (q w r) Y (p r q) w (p r r)
5 pts
proof
5 pts
Midterm Exam Summer 2004 5 of 6
7. The following example is from Lewis Carroll’s Symbolic Logic: First, translate the 7
propositions below into predicate logic where the universe of discourse is all living animals, using
logical operators, quantifiers, parenthesis and the following predicates:
T(x): I trust x B(x): x belongs to me D(x): x is a dog
Y(x): x is in the yard
G(x): x gnaws bones A(x): I admit x into my study
W(x): x will beg when told to do so
Put your answers in the appropriate places below. Note that to say that x is mine is the same as saying
that x belongs to me. Prove that c follows from premises 1-6. Use a direct proof only. You may use
any of the inference, equivalence, instantiation, or generalization rules.
Please be aware that problem 7 will be graded quite strictly, be careful.
10 pts
1. I trust every animal that belongs to me;
x( B(x) 6 T(x) )
2. [all] Dogs gnaw bones;
x( D(x) 6 G(x) )
3. I admit no animals into my study, unless they will beg when told to do so;
x( A(x) 6 W(x) )
4. All the animals in the yard are mine;
x( Y(x) 6 B(x) )
5. I admit every animal, that I trust, into my study;
x( T(x) 6 A(x) )
6. The only animals, that are þ willing to beg when told to do so, are dogs.
x( W(x) 6 D(x) )
c. All the animals in the yard gnaw bones.
x( Y(x) 6 G(x) )
7.
10 pts
Midterm Exam Summer 2004 6 of 6