Assignment 1

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

COMSATS Institute of Information Technology, Islamabad Campus

Department of Computer Science


Discrete Structures – CSC102

BSE/BCT – I Assignment
Propositional Logic & Rules of inference
Mapped to CLO1&2 Marks: 75

Q1-Q3 are mapped to CLO1. Q4 and Q5 are mapped to CLO2.

Question 1)

A. Let p, q , and r be the propositions [3+2+3+3]


p : You get an A on the final exam.
q : You do every exercise in this book.
r : You get an A in this class.
Write these propositions using p, q , and r and logical connectives (including negations).

a) You get an A in this class, but you do not do every exercise in this book.
b) You get an A on the final, you do every exercise in this book, and you get an A in this
class.
c) To get an A in this class, it is necessary for you to get an A on the final.
d) You get an A on the final, but you don’t do every exercise in this book; nevertheless,
you get an A in this class.
e) Getting an A on the final and doing every exercise in this book is sufficient for getting
an A in this class.
f) You will get an A in this class if and only if you either do every exercise in this book or
you get an A on the final.
B. For each of these sentences, determine whether an inclusive or, or an exclusive or, is
intended. Explain your answer.

a) Coffee or tea comes with dinner.

b) A password must have at least three digits or be at least eight characters long.

c) The prerequisite for the course is a course in number theory or a course in

cryptography.

d) You can pay using U.S. dollars or euros.

C. State the converse, contrapositive, and inverse of each of these conditional statements.

a) If it snows today, I will ski tomorrow.

b) I come to class whenever there is going to be a quiz.

c) A positive integer is a prime only if it has no divisors other than 1 and itself.

D. Construct a truth table for each of these compound propositions.

a) p → (¬q ∨ r)

b) ¬p → (q → r)

c) (p → q) ∨ (¬p → r)

d) (p → q) ∧ (¬p → r)

e) (p ↔ q) ∨ (¬q ↔ r)

f) (¬p ↔¬q) ↔ (q ↔ r)
Question 2) [4+4+2+4]

A. Express these system specifications using the propositions p “The message is


scanned for viruses” and q “The message was sent from an unknown system”
together with logical connectives (including negations).

a) “The message is scanned for viruses whenever the message was sent from an
unknown system.”
b) “The message was sent from an unknown system but it was not scanned for
viruses.”
c) “It is necessary to scan the message for viruses whenever it was sent from an
unknown system.”
d) “When a message is not sent from an unknown system it is not scanned for
viruses.”

B. Find the output of the following combinational circuit.

C. Determine whether (¬q ∧ (p → q)) →¬p is a tautology.

D. Show that (p → q) → (r → s) and (p → r) → (q → s) are not logically

equivalent using both truth tables and equivalence laws.


Question 3) [5+5+5+4]

A. Let C(x) be the statement “x has a cat,” let D(x) be the statement “x has a dog,” and
let F (x) be the statement “x has a ferret.” Express each of these statements in terms
of C(x), D(x ), F (x), quantifiers, and logical connectives. Let the domain consist of
all students in your class.

a) A student in your class has a cat, a dog, and a ferret.

b) All students in your class have a cat, a dog, or a ferret.

c) Some student in your class has a cat and a ferret, but not a dog.

d) No student in your class has a cat, a dog, and a ferret.

e) For each of the three animals, cats, dogs, and ferrets, there is a student in your
class who has this animal as a pet.

B. Translate in two ways each of these statements into logical expressions using
predicates, quantifiers, and logical connectives. First, let the domain consist of the
students in your class and second, let it consist of all people.

a) Someone in your class can speak Hindi.


b) Everyone in your class is friendly.
c) There is a person in your class who was not born in California.
d) A student in your class has been in a movie.
e) No student in your class has taken a course in logic programming.

C. Express each of these statements using quantifiers. Then form the negation of the
statement so that no negation is to the left of a quantifier. Next, express the negation
in simple English. (Do not simply use the phrase “It is not the case that.”)

a) All dogs have fleas.


b) There is a horse that can add.
c) Every koala can climb.
d) No monkey can speak French.
e) There exists a pig that can swim and catch fish.

D. Translate these specifications into English where F(p) is “Printer p is out of service,”
B(p) is “Printer p is busy,” L(j ) is “Print job j is lost,” and Q(j ) is “Print job j is
queued.”

a) ∃p(F (p) ∧ B(p)) →∃j L(j )


b) ∀pB (p) →∃j Q(j )
c) ∃j (Q(j ) ∧ L(j )) →∃pF (p)
d) (∀pB (p) ∧∀j Q(j )) →∃j L(j )

(Rules of Inferences)

Q4. Mapped to CLO2 [12+11+8]

a) For each of these sets of premises, what relevant conclusion or conclusions can be
drawn? Explain the rules of inference used to obtain each conclusion from the premises.

a) “If I play hockey, then I am sore the next day.” “I use the whirlpool if I am sore.” “I did
not use the whirlpool.”

b) “If I work, it is either sunny or partly sunny.” “I worked last Monday or I worked last
Friday.” “It was not sunny on Tuesday.” “It was not partly sunny on Friday.”

c) “All insects have six legs.” “Dragonflies are insects.” “Spiders do not have six legs.”
“Spiders eat dragon-flies.”

d) “Every student has an Internet account.” “Homer does not have an Internet account.”
“Maggie has an Internet account.”
b) For each of these arguments, explain which rules of inference are used for each step.

a) “Linda, a student in this class, owns a red convertible. Everyone who owns a red
convertible has gotten at least one speeding ticket. Therefore, someone in this class
has gotten a speeding ticket.”

b) “Each of five roommates, Melissa, Aaron, Ralph, Veneesha, and Keeshawn, has
taken a course in discrete mathematics. Every student who has taken a course in
discrete mathematics can take a course in algorithms. Therefore, all five
roommates can take a course in algorithms next year.”

c) “All movies produced by John Sayles are wonderful. John Sayles produced a
movie about coal miners. Therefore, there is a wonderful movie about coal
miners.”

d) “There is someone in this class who has been to France. Everyone who goes to
France visits the Louvre. Therefore, someone in this class has visited the Louvre.”

Q5: For each of these arguments determine whether the argument is correct or incorrect
and explain why.

a) Everyone enrolled in the university has lived in a dormitory. Mia has never lived in a
dormitory. Therefore, Mia is not enrolled in the university.

b) A convertible car is fun to drive. Isaac’s car is not a convertible. Therefore, Isaac’s
car is not fun to drive.

c) Quincy likes all action movies. Quincy likes the movie Eight Men Out. Therefore,
Eight Men Out is an action movie.
d) All lobstermen set at least a dozen traps. Hamilton is a lobsterman. Therefore,
Hamilton sets at least a dozen traps.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy