You are on page 1of 8

Name: NIM: Class:

Assignment 2: Propositional Logic 2


Mathematical Logic - A (MSH1B3)
First Term 2019-2020
Instructions:

1. Be aware of the submission deadline for this assignment. See the description of the submission deadline
in the corresponding submission slot for this assignment at CeLoE.

2. You only need to submit a readable scan or photograph of this assignment to the provided submission
slot at CeLoE. Please contact your class instructor or teaching assistant for more detailed information.
Please make sure that your file size do not exceed the maximum file size allowed.

3. To save paper, you may print and reproduce this assignment on both sides of a paper.

4. Your answers should be handwritten. You may use: HB or 2B pencil, or pen with blue or black ink.

5. All problems in this assignment are adapted from the textbooks. The problems are written in English.
If you are a student in a regular class, you may answer the problems in Bahasa Indonesia. However,
if you are a student in international class, your answers must be written in English—otherwise your
assignment will not be graded. You may ask your class instructor or teaching assistant for helping you
understanding the problem, but you should not ask them to give the solution of any problem.

6. Write your solutions on the provided space. If you need more space, you may use additional A4
papers and attach them to your assignment.

7. This assignment consists of four problems, each problem is worth 10 points. Your final grade is calcu-
lated using the formula P=40 100, where P denotes your point(s) for this assignment.

8. Be neat and write legibly. You will be graded not only on the correctness of your answers, but also on
the clarity with which you express them.

9. Please retain yourself from copying answers from elsewhere without understanding the steps. This
assignment is an individual evaluation.

10. Important: late submission without reasonable explanation will not be graded.

page 1 of 8
Problem 1 (10 points) Determine the value of z (the output) of the following programs in Pascal and
justify your answer!

(a). [2 points]
Program Arithmetic(output);
var x,y,z:integer;
begin
x:= -2;
y:= 1;
if (x > 0) and (y > 0) then
z := x + y
else
z := x - y;
writeln(’The value of z is ’, z);
end.
A NSWER :

(b). [2 points]
Program Arithmetic(output);
var x,y,z:integer;
begin
x:= -2;
y:= 1;
if (x >= 1) or (y >= 1) then
z := x * y
else
z := x + y;
writeln(’The value of z is ’, z);
end.
A NSWER :

page 2 of 8
Name: NIM: Class:

(c). [3 points]
Program Arithmetic(output);
var x,y,z:integer;
begin
x:= -2;
y:= 1;
if (x < 1) xor (y < 1) then
z := x*x + y*y
else
z := x*y;
writeln(’The value of z is ’, z);
end.
A NSWER :

(d). [3 points]
Program Arithmetic(output);
var x,y,z:integer;
begin
x:= -2;
y:= 1;
if not(x > y) xor not(y < 0) the
z := x + y
else
z := 2*x*y;
writeln(’The value of z is ’, z);
end.
A NSWER :

page 3 of 8
Problem 2 (10 points) For each of the following propositional formulas, construct its corresponding truth
table and determine whether the formula is (1) valid, (2) satisfiable, (3) contradictory/unsatisfiable, and (4)
a contingency. Provide relevant arguments for your answer.

(a). [5 points] p _ q ! :p :q
A NSWER :

(b). [5 points] (p q) $ (:p q) _ (p :q)


A NSWER :

page 4 of 8
Name: NIM: Class:

Problem 3 (10 points) In the following problems, you may use truth table.

(a). [3 points] Determine whether p ! r is a logical consequence of p _ q ! r.


A NSWER :

(b). [3 points] Determine whether p ! q is a logical consequence of p ! q _ r.


A NSWER :

page 5 of 8
(c). [4 points] Determine whether p ! q is a logical consequence of p ^ r ! q.
A NSWER :

page 6 of 8
Name: NIM: Class:

Problem 4 (10 points) In the following problems, you may use truth table.

(a). [3 points] Determine whether (p ! q) ^ (p ! r) and p ! (q ^ r) are logically equivalent.


A NSWER :

(b). [3 points] Determine whether (p ! q) ! r and p ! (q ! r) are logically equivalent.


A NSWER :

page 7 of 8
(c). [4 points] Determine whether :p ! (q ! r) and q ! (p _ r) are logically equivalent.
A NSWER :

page 8 of 8

You might also like