Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Name: NIM: Class:

Assignment 2: Predicate Logic


Mathematical Logic (CII1B3)
First Term 2020-2021
Instructions:

1. This assignment is due Wednesday, November 4, 2020 at 5:00 p.m.. Please submit your work to the
corresponding submission slot in LMS CeLOE. You need to submit a readable .pdf file of this assignment
to the provided submission slot in CeLOE. You can contact your class instructor for more detailed
information. Please make sure that your file size do not exceed the maximum file size allowed.

2. Please upload your assignment to the LMS CeLOE under the file name: A2-<student ID>.pdf,
for example: A2-1301208888.pdf.

3. You may submit this assignment in one the following form:

a. You print this assignment and write your answer using HB/2B pencil or pen with blue/black ink
(handwritten answer). You may add additional A4-sized papers. Afterwards you submit the scan/photograph
of this assignment.
b. You use a .pdf editing tools and write your answer directly using blue/black colored writing.
c. You copy the problem from this assignment to a text/word processing program and type your answer
neatly.
d. You rewrite the problem from this assignment in an A4-sized paper and submit the scan/photograph
of your work.

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

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

6. This assignment consists of 8 problems, each but Problems 6 and 7 are worth 10 points. Problems 6 and
7 are worth 20 points each.

7. Please retain yourself from copying answers from elsewhere without understanding the steps. Such an
attitude will not enhance your knowledge. This assignment is an individual evaluation.

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

page 1 of 9
Problem 1 (10 points) Let P (x) be the statement “1+x2 3x”. Complete the following table concerning
the truth value of these formulas. Provide a relevant reason for each answer.

Truth Value
Part Formula (circle either T or F) Reason [1 point]
[0.25 points]
a. P ( 1) T/F .

b. P (1) T/F

c. 9x P (x) T/F

d. 8x P (x) T/F

e. 9x :P (x) T/F

f. 8x :P (x) T/F

g. 9xP (x) ^ 9x:P (x) T/F

h. 8xP (x) ! 8x:P (x) T/F

page 2 of 9
Name: NIM: Class:

def
Problem 2 (10 points) Let Q (x) x2 + 1 > 2x. If the domain consists of all integers, what are the truth
value of these formulas? Explain your reasoning.

(a). [1 point] Q (1)


A NSWER :

(b). [1 point] Q (2)


A NSWER :

(c). [2 points] 9x Q (x)


A NSWER :

(d). [2 points] 8x Q (x)


A NSWER :

(e). [2 points] 9x :Q (x)


A NSWER :

(f). [2 points] 8x :Q (x)


A NSWER :

Problem 3 (10 points) Suppose Q (x; y) is the predicate x + 2y 2x y. Determine the truth of the
following predicate formulas.

(a). [2.5 points] Q (3; 1)


A NSWER :

(b). [2.5 points] Q (1; 3)


A NSWER :

(c). [2.5 points] 9x9y Q (x; y)


A NSWER :

(d). [2.5 points] 8x8y Q (x; y)


A NSWER :

page 3 of 9
Problem 4 (10 points) Let C (x), P (x), A (x), and D (x) be the statements “x is a cat”, “x is one of my
pet”, “x is an artist”, and “x is willing to dance”, respectively. Express each of these statements using
quantifiers, logical connectives, and also using the previously mentioned predicates.

(a). [2.5 points] No cats are willing to dance.


A NSWER :

(b). [2.5 points] No artist ever decline to dance.


A NSWER :

(c). [2.5 points] All my pets are cats.


A NSWER :

(d). [2.5 points] My cats are not artists.


A NSWER :

page 4 of 9
Name: NIM: Class:

Problem 5 (10 points) Translate each of these statements into logical expression using only the specified
domain and predicates.

(a). [2 points] “Someone in your school has visited Russia”.


The domain is D := fx j x is a human beingg and the predicates are P (x) := “x is a person in your
school” and R (x) := “x has visited Russia”.
A NSWER :

(b). [2 points] “Everyone in your class has studied mathematical logic and programming”.
The domain is D := fx j x is a human beingg and the predicates are C (x) := “x is in your class”,
M (x) := “x has studied mathematical logic”, and P (x) := “x has studied programming”.
A NSWER :

(c). [2 points] No one in your school owns both a bicycle and a motorcycle.
The domain is D := fx j x is a human beingg and the predicates are S (x) := “x is a person in your
school”, B (x) := “x owns a bicycle”, and M (x) := “x owns a motorcycle”.
A NSWER :

(d). [2 points] There is a person in your school who is not happy.


The domain is D := fx j x is a human beingg and the predicates are S (x) := “x is a person in your
school” and H (x) := “x is happy”.
A NSWER :

(e). [2 points] Everyone in your school was born in the twentieth or twenty-first century.
The domain is D := fx j x is a human beingg and the predicate are S (x) := “x is a person in
your school”, T (x) := “x was born in the twentieth century”, and F (x) := “x was born in the
twenty-first century”.
A NSWER :

page 5 of 9
Problem 6 (20 points) Verify whether each of these arguments is valid or not. Explain which rules of
inference are used for each step.

(a). [5 points] “Linda, a student in this class, owns a red car. Everyone who owns a red car has gotten
at least one speeding ticket. Therefore, someone in this class has gotten a speeding ticket.” Use the
following predicates: C (x) := x is a student in this class, R (x) := x owns red car, T (x) := x has
gotten a speeding ticket. Suppose the domain for x is the set of all persons.
A NSWER :

(b). [5 points] “A convertible car is fun to drive. Isaac’s car is not a convertible. Therefore, Isaac’s car is
not fun to drive.” Use the following predicates: C (x) := x is a convertible car, F (x) := x is fun to
drive. Suppose the domain of x is the set of all cars.
A NSWER :

page 6 of 9
Name: NIM: Class:

(c). [5 points] “All movies produced by Steven Spielberg are exciting. Steven Spielberg produced a
movie about dinosaurs. Therefore, there is an exciting movie about dinosaurs.” Use the following
predicates: S (x) := x is a movie produced by Steven Spielberg, E (x) := x is an exciting movie,
D (x) := x is a movie about dinosaurs. Suppose the domain of x be the set of all movies.
A NSWER :

(d). [5 points] “There is someone in this class who has been to France. Everyone who goes to France visit
the Louvre. Therefore, someone in this class has visited the Louvre.” Use the following predicates:
C (x) := x is in this class, F (x) := x has been to France, L (x) := x has visited Louvre. Suppose
the domain of x be the set of all persons.
A NSWER :

page 7 of 9
Problem 7 (20 points) Mowgli lives in an Indian rainforest and recently he learned following facts:

All tigers are carnivorous animal.


Sherkan is a tiger and it eats plants regularly.
Every animal that eats plants regularly has a long life span.

(a). [10 points] Suppose we have D = fx j x is an animalg and following predicates:

T (x) : “x is a tiger” P (x) : “x eats plants regularly”


C (x) : “x is a carnivorous animal” L (x) : “x has a long life span”.

Help Mowgli to translate each of his facts into predicate formulas.


A NSWER :

(b). [10 points] Mowgli thinks only one of the following conclusion is correct:

There is a carnivorous animal who has a long life span.


There is no carnivorous animal who has a long life span.

What is the correct conclusion? Explain your reasoning using rule of inference in predicate logic.
A NSWER :

page 8 of 9
Name: NIM: Class:

Problem 8 (10 points) Suppose we have the following Prolog knowledge base.

plant(herbs). eats(deer,shrub).
plant(grass). eats(grasshopper,grass).
plant(shrub). eats(rabbit,herbs).

animal(caterpillar).
eats(crow,caterpillar).
animal(deer).
eats(crow,herbs).
animal(grasshopper).
eats(crow,grasshopper).
animal(rabbit).
eats(fox,rabbit).
animal(crow).
eats(frog,caterpillar).
animal(fox).
eats(frog,grasshopper).
animal(frog).
eats(snake,frog).
animal(snake).
eats(snake,rabbit).
animal(hawk).
animal(lion).
eats(hawk,crow).
eats(caterpillar,grass). eats(hawk,snake).
eats(caterpillar,herbs). eats(lion,deer).
eats(deer,herbs). eats(lion,fox).

Suppose the above knowledge base is supplemented with the following rules:

herbivore(X):- eats(X,Y), plant(Y).

carnivore(X):- eats(X,Y), animal(Y).

omnivore(X):- herbivore(X), carnivore(X).

prey(X):- eats(Y,X), animal(X), animal(Y).

Determine the output of the following queries if the program is run using SWI-Prolog:

(a). [1 point] eats(hawk,X). (e). [2 points] omnivore(X).

(b). [1 point] eats(X,caterpillar).


(f). [2 points] prey(hawk).
(c). [1 point] herbivore(frog).

(d). [1 point] carnivore(crow). (g). [2 points] prey(X), not(carnivore(X)).

A NSWER :

page 9 of 9

You might also like