Assignment 1 Propositional Logic
Assignment 1 Propositional Logic
Source: Discrete Mathematics and its applications, Sixth Edition - Kenneth H.Rosen
Chapter 1, Pages 16-21
Question 1 Which of these sentences are propositions? What are the truth values of those that
are propositions?
Solution:
e. It is not a proposition (∵ the given statement is neither TRUE nor FALSE unless we
assign a value for the variable x).
Question 2 Which of these are propositions? What are the truth values of those that are propo-
sitions??
f. 2n ≥ 100.
Solution:
c. This is a proposition that is FALSE, as anyone who has been to Maine knows.
a. Today is Thursday.
c. 2 + 1 = 3.
Solution:
c. 2+16=3.
2
d. p∧q
e. p↔q
f. ¬p → ¬q
g. ¬p ∧ ¬q
h. ¬p ∨ (p ∧ q)
Solution:
b. Either I bought a lottery ticket this week or I won the million dollar jackpot on Friday.
c. If I bought a lottery ticket this week, then I won the million dollar jackpot on Friday.
d. I bought a lottery ticket this week and I won the million dollar jackpot on Friday.
e. I bought a lottery ticket this week if and only if I won the million dollar jackpot on Friday.
f. If I did not buy a lottery ticket this week, then I did not win the million dollar jackpot on
Friday.
g. I did not buy a lottery ticket this week, and I did not win the million dollar jackpot on Friday.
h. Either I did not buy a lottery ticket this week, or else I did buy one and won the million
dollar jackpot on Friday.
Question 5 Let p and q be the propositions “Swimming at the New Jersey shore is allowed”and
“Sharks have been spotted near the shore,”respectively. Express each of these compound proposi-
tions as an English sentence.
a. ¬q
b. p∧q
c. ¬p ∨ q
d. p → ¬q
e. ¬q → p
f. ¬p → ¬q
g. p ↔ ¬q
h. ¬p ∧ (p ∨ ¬q)
Solution:
b. Swimming at the New Jersey shore is allowed, and sharks have been spotted near the shore.
c. Swimming at the New Jersey shore is not allowed, or sharks have been spotted near the
shore.
3
d. If swimming at the New Jersey shore is allowed, then sharks have not been spotted near
the shore.
e. If sharks have not been spotted near the shore, then swimming at the New Jersey shore
is allowed.
f. If swimming at the New Jersey shore is not allowed, then sharks have not been spotted
near the shore.
g. Swimming at the New Jersey shore is allowed if and only if sharks have not been spotted
near the shore.
h. Swimming at the New Jersey shore is not allowed, and either swimming at the New Jersey
shore is allowed or sharks have not been spotted near the shore.
Question 6 Let p and q be the propositions.“The election is decided" and “The votes have been
counted," respectively. Express each of these compound propositions as an English sentence.
a. ¬p
b. p ∨ q
c. ¬p ∧ q
d. q → p
e. ¬q → ¬p
f. ¬p → ¬q
g. p ↔ q
h. ¬q ∨ (¬p ∧ q)
Solution:
c. The election is not decided, and the votes have been counted.
e. If the votes have not been counted, then the election is not decided.
f. If the election is not decided, then the votes have not been counted.
4
g. The election is decided if and only if the votes have been counted.
h. Either the votes have not been counted, or else the election is not decided and the votes have
been counted.
Solution:
a. p ∧ q
b. p ∧ ¬q
c. ¬p ∧ ¬q
d. p ∨ q
e. p → q
f. (p ∨ q) ∧ (p → ¬q)
g. p ↔ q
a. p → q
5
b. ¬q ↔ r
c. q → ¬r
d. p ∨ q ∨ r
e. (p → ¬r) ∨ (q → ¬r)
f. (p ∧ q) ∨ (¬q ∧ r)
Solution:
b. You will pass the course if and only if don’t miss the final examination.
c. If you miss the final examination, then you will not pass the course.
d. You have the flu or you miss the final examination or you pass the course.
e. If you either have the flu or miss the final examination, then you will not pass the course
(or) If you have the flu, then you do not pass the course or if you miss the final examination,
then you do not pass the course or both
f. Either you have the flu and miss the final examination, or you don’t miss the final examination
and pass the course.
b. You drive over 65 miles per hour, but you do not get a speeding ticket.
c. You will get a speeding ticket if you drive over 65 miles per hour.
d. If you do not drive over 65 miles per hour, then you will not get a speeding ticket.
e. Driving over 65 miles per hour is sufficient for getting a speeding ticket.
f. You get a speeding ticket, but you do not drive over 65 miles per hour.
g. Whenever you get a speeding ticket, you are driving over 65 miles per hour.
Solution:
a. ¬p
6
b. p ∧ ¬q
c. p → q
d. ¬p → ¬q
e. p → q
f. q ∧ ¬p
g. p → q
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.
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.
Solution:
a. r ∧ ¬q
b. p ∧ q ∧ r
c. r → p
d. p ∧ ¬q ∧ r
e. (p ∧ q) → r
f. r ↔ (p ∨ q)
7
q : Hiking is safe on the trail.
r : Berries are ripe along the trail.
a. Berries are ripe along the trail, but grizzly bears have not been seen in the area.
b. Grizzly bears have not been seen in the area and hiking on the trail is safe, but berries are
ripe along the trail.
c. If berries are ripe along the trail, hiking is safe ifand only if grizzly bears have not been seen
in the area.
d. It is not safe to hike on the trail, but grizzly bears have not been seen in the area and the
berries along the trail are ripe.
e. For hiking on the trail to be safe, it is necessary but not sufficient that berries not be ripe
along the trail and for grizzly bears not to have been seen in the area.
f. Hiking is not safe on the trail whenever grizzly bears have been seen in the area and berries
are ripe along the trail.
Solution:
a. r ∧ ¬p
b. (¬p ∧ q) ∧ r
c. (r → q) ↔ ¬p
d. ¬q ∧ (¬p ∧ r)
e. q → (¬r ∧ ¬p)
f. (p ∧ r) → ¬q
Question 12 (Pg.16, Q:18) Write each of these statements in the form "if p, then q" in English.
c. A sufficient condition for the warranty to be good is that you bought the computer less than
a year ago.
8
e. You can access the website only if you pay a subscription fee.
Solution:
c. If you buy the computer less than a year ago, then the warranty holds good .
f. If you know the right people, then you will get elected.
Question 13 (Pg.16, Q:19) Write each of these statements in the form “if p, then q in English.
c. That the Pistons win the championship implies that they beat the Lakers.
f. If you drive more than 400 miles, you will need to buy gasoline.
g. Your guarantee is good only if you bought your CD player less than 90 days ago.
Solution:
b. If it stays warm for a week, then the apple trees will bloom.
c. If the Pistons win the championship, then they beat the Lakers.
9
d. If you get to the top of Long’s Peak, then you must have walked 8 miles.
e. If you are world famous, then you will get tenure as a professor.
f. If you drive more than 400 miles, then you will need to buy gasoline.
g. If your guarantee is good, then you bought your CD player less than 90 days ago.
Question 14 (Pg.16, Q:20) Write each of these propositions in the form “p if and only if q" in
English.
a. I will remember to send you the address only if you send me an e-mail message.
b. To be a citizen of this country, it is sufficient that you were born in the United States.
c. If you keep your textbook, it will be a useful reference in your future courses.
d. The Red Wings will win the Stanley Cup if their goalie plays well.
e. That you get the job implies that you had the best credentials.
h. You will reach the summit unless you begin your climb too late.
Solution:
a. If you send me an e-mail message, then I will remember to send you the address.
b. If you were born in the United States, then you are a citizen of this country.
c. If you keep your textbook, then it will be a useful reference in your future courses.
d. If their goaltender plays well, then the Red Wings will win the Stanley Cup.
e. If you get the job, then you had the best credentials.
h. If you do not begin your climb too late, then you will reach the summit.
10
Question 15 (Pg.16, Q:21) Write each of these propositions in the form "p if and only if q" in
English.
a. If it is hot outside you buy an ice cream cone, and if you buy an icecream cone it is hot outside.
b. For you to win the contest it is necessary and sufficient that you have the only winning ticket.
c. You get promoted only if you have connections, and you have connections only if you get
promoted.
e. The trains run late on exactly those days when I take it.
Solution:
b. You win the contest if and only if you have the only winning ticket.
Question 16 (Pg.16, Q:22) Write each of these propositions in the form “p if and only if q”in
English.
a. For you to get an A in this course, it is necessary and sufficient that you learn how to
solve discrete mathematics problems.
b. If you read the newspaper every day, you will be informed, and conversely.
c. It rains if it is a weekend day, and it is a weekend day if it rains.
d. You can see the wizard only if the wizard is not in, and the wizard is not in only if you
can see him.
Solution:
a. You will get an A in this course if and only if you learn how to solve discrete mathematics
problems.
b. You will be informed if and only if you read the newspaper every day.
11
Question 17 (Pg.16, Q:23) State the converse, contrapositive, and inverse of each of these con-
ditional statements.
c. If a positive integer is prime, then it has no divisors other than 1 and itself.
Solution:
c.i. If a number has no divisors other than 1 and itself, then the number is prime
c.ii. If a number has a divisor other than 1 itself, then the number is not prime
c.iii. If a number is not prime, then it has a divisor other than 1 and itself.
Question 18 (Pg.16, Q:24) State the converse, contrapositive, and inverse of each of these con-
ditional statements.
Solution:
12
b. (i) Converse: Whenever I go to the beach, it is a sunny summer day.
(ii) Contrapositive: Whenever I do not go to the beach, it is not a sunny summer day.
(iii) Inverse: Whenever it is not a sunny day, I do not go to the beach.
Solution:
This assertion not a proposition (Since the truth value is neither TRUE nor FALSE). This is a
self-contradictory statement. Assigning TRUE to this statement implies that its truth value is
FALSE and vice versa. This is a paradox.
Question 20 (Pg.16, Q:43) The nth statement in a list of 100 statements is “Exactly n of the
statements in this list are false."
b. Answer part (a) if the nth statement is “At least n of the statements in this list are false."
Solution:
b. Statements 1 through 50 are all true and statements 51 through 100 are all false.
c. This can not happen; it is a paradox, showing that these cannot be statements.
Question 21 (Pg.16, Q:44) An ancient Sicilian legend says that the barber in a remote town
who can be reached only by traveling a dangerous mountain road shaves those people, and only
those people, who do not shave themselves. Can there be such a barber?
Solution:
Converting the paradox into a logical sentence,
N (y) : y do not shave by himself.
S(x, y) : x shaves y.
∃x (∀y (N (y) ↔ S(x, y)))
If UOD is set of all human beings, a female barber x exists and truth value is True.
If UOD is set of all males and they shaves, then who will shave the barber. If he shaves himself,
then sufficiency is violated. If x do not shave himself, then barber will shave him. This violates
necessay and hence such a barber cannot exist.
13
Question 22 (Pg.16, Q:45) Each inhabitant of a remote village always tells the truth or always
lies. A villager will only give a "Yes" or a "No" response to a question a tourist asks. Suppose
you are a tourist visiting this area and come to a fork in the road. One branch leads to the ruins
you want to visit; the other branch leads deep into the jungle. A villager is standing at the fork
in the road. What one question can you ask the villager to determine which branch to take?
Solution:
Ask him "If i am asking you whether road 1 leads to ruins, then what would be your answer ?".
Note the if he were a person who always tells truth, then tourist can follow his words. If he were
a person who always lies, then he would have negated his answer twice and hence, tourist can
follow his words.
Question 23 (Pg.16, Q:46) An explorer is captured by a group of cannibals. There are two types
of cannibals-those who always tell the truth and those who always lie. The cannibals will barbecue
the explorer unless he can determine whether a particular cannibal always lies or always tells the
truth. He is allowed to ask the cannibal exactly one question.
a) Explain why the question "Are you a liar?" does not work.
b) Find a question that the explorer can use to determine whether the cannibal always lies or
always tells the truth.
Solution:
a) Note that the answer given by all cannibals are "NO", and therefore we cannot distinguish a
liar from honest cannibals.
b) Question to be asked should be a hypothetical question. "If i am asking you whether you are
a liar, what will be your response ?". Observe that if the cannibal is a honest cannibal, then he
answers "NO", otherwise "YES".
Exercises 55-59 relate to inhabitants of the island of knights and knaves created by Smullyan,
where knights always tell the truth and knaves always lie. You encounter two people, A and
B. Determine, if possible, what A and B are if they address you in the ways described. If you
cannot determine what these two people are, can you draw any conclusions?
Question 24 (Pg.16, Q:55) A says “At least one of us is a knave" and B says nothing.
Solution:
All possibilities for A and B are given along with the truth value of the above statement.
A B Truth value of A’s stmt Is assertion possible?
knight knight False No
knight knave False Yes
knave knight True No
knave knave True No
A Knave cannot say he is a knave, so A is a Knight and his statement is true. Therefore B
is a Knave.
Question 25 (Pg.16, Q:56)A says “The two of us are both knights”and B says “A is a knave”.
Solution:
If A is a knight, then his statement that both of them are knights is true, and both will be telling
the truth. But that is impossible, because B is asserting otherwise (that A is a knave). If A is a
knave, then B’s assertion is true, so he must be a knight, and A’s assertion is false, as it should
be. Thus we conclude that A is a knave and B is a knight.
14
Question 26 (Pg.16, Q:57)A says “I am a knave or B is a knight”and B says nothing.
Solution:
If A is a knave, then we get an immediate contradiction, since this implies, A is a knight and
B is a knave, which is impossible. Hence, A must be a knight, then his statement that B is a
knight is true. Thus we conclude that A is a knight and B is also a knight.
Solution:
All possibilities for A and B are given along with the truth value of the above statement.
A B Truth value of stmts for A and B Is assertion possible?
knight knight A(T), B(T) Yes
knight knave A(T), B(F) Yes
knave knight A(F), B(T) Yes
knave knave A(F), B(T) Yes
It is possible for either A or B to be either a knight or a knave.
Question 28 (Pg.16, Q:59) A says "We are both knaves" and B says nothing.
Solution:
All possibilities for A and B are given along with the truth value of the above statement.
A B Truth value of A’s stmt
knight knight False
knight knave False
knave knight True
knave knave False
Therefore A is Knave and B is Knight.
Exercises 60-65 are puzzles that can be solved by translating statements into logical expressions
and reasoning from these expressions using truth tables.
Question 29 (Pg.16, Q:60) The police have three suspects for the murder of Mr. Cooper: Mr.
Smith, Mr. Jones, and Mr. Williams. Smith, Jones, and Williams each declare that they did not
kill Cooper. Smith also states that Cooper was a friend of Jones and that Williams disliked him.
Jones also states that he did not know Cooper and that he was out of town the day Cooper was
killed. Williams also states that he saw both Smith and Jones with Cooper the day of the killing
and that either Smith or Jones must have killed him. Can you determine who the murderer was if
a. one of the three men is guilty, the two innocent men are telling the truth, but the statements
of the guilty man may or may not be true?
Solution:
a. We look at the three possibilities of who the innocent men might be. If Smith and Jones
are innocent (and therefore telling the truth), then we get an immediate contradiction, since
15
Smith said that Jones was a friend of Cooper, but Jones said that he did not even know
Cooper. If Jones and Williams are the innocent truth-tellers, then we again get a contradic-
tion, since Jones says that he did not know Cooper and was out of town, but Williams says
he saw Jones with Cooper (presumably in town, and presumably if we was with him, then
he knew him). Therefore it must be the case that Smith and Williams are telling the truth.
Their statements do not contradict each other. Based on Williams statement, we know that
Jones is lying, since he said that he did not know Cooper when in fact he was with him.
Therefore Jones is the murderer.
b. If all are innocent, then all of their statement is true, but that is impossible. Thus there is a
possibility where more than one are guity.
Question 30 (Pg.16, Q:61) Steve would like to determine the relative salaries of three coworkers
using two facts. First, he knows that if Fred is not the highest paid of the three, then Janice is.
Second, he knows that if Janice is not the lowest paid, then Maggie is paid the most. Is it possible
to determine the relative salaries of Fred, Maggie, and Janice from what Steve knows? If so, who
is paid the most and who the least? Explain your reasoning.
Solution:
In the order of decreasing salary: Fred, Maggie, Janice.
Question 31 (Pg.16, Q:62) Five friends have access to a chat room. Is it possible to determine
who is chatting if the following information is known? Either Kevin or Heather, or both, are
chatting. Either Randy or Vijay, but not both, are chatting. If Abby is chatting, so is Randy.
Vijay and Kevin are either both chatting or neither is. If Heather is chatting, then so are Abby
and Kevin. Explain your reasoning.
Solution:
Heather, Abby and Randy are not chatting. Vijay and Kevin are chatting.
Question 32 (Pg.16, Q:63) A detective has interviewed four witnesses to a crime. From the
stories of the witnesses the detective has concluded that if the butler is telling the truth then
so is the cook; the cook and the gardener cannot both be telling the truth; the gardener and the
handyman are not both lying; and if the handyman is telling the truth then the cook is lying. For
each of the four witnesses, can the detective determine whether that person is telling the truth
or lying? Explain your reasoning.
Solution:
If the cook is telling truth, then the gardener is lying. This implies, handyman is telling truth,
who says cook is lying, which is a contradiction. Thus, cook is lying. If the butler is telling
truth, then cook is also telling truth. This implies, gardener is lying and handyman is telling
truth. But handyman says, cook is lying, which is a contradiction. Thus, butler is lying. But we
cannot determine whether the gardener is telling the truth or whether the handyman is telling
the truth.
Question 33 (Pg.16, Q:64) Four friends have been identified as suspects for an unauthorized
access into a computer system. They have made statements to the investigating authorities. Alice
said “Carlos did it." John said “I did not do it." Carlos said “Diana did it." Diana said “Carlos
lied when he said that I did it."
a. If the authorities also know that exactly one of the four suspects is telling the truth, who did
it? Explain your reasoning.
16
b. If the authorities also know that exactly one is lying, who did it? Explain your reasoning.
Solution:
a. John only did it. There are four cases to consider. If Alice is the sole truth-teller, then Carlos
did it; but this means that John is telling the truth, a contradiction. If John is the sole
truth-teller, then Diana must be lying, so she did it, but then Carlos is telling the truth,
a contradiction. If Carlos is the sole truth-teller, then Diana did it, but that makes John
truthful, again a contradiction. So the only possibility is that Diana is the sole truth-teller.
This means that John is lying when he denied it, so he did it. Note that in this case both
Alice and Carlos are indeed lying.
b. Again there are four cases to consider. Since Carlos and Diana are making contradictory
statements, the liar must be one of them (we could have used this approach in part (a) as
well). Therefore Alice is telling the truth, so Carlos did it. Note that John and Diana are
telling the truth as well here, and it is Carlos who is lying.
Question 34 (Pg.16, Q:65) Solve this famous logic puzzle, attributed to Albert Einstein, and
known as the zebra puzzle. Five men with different nationalities and with different jobs live in
consecutive houses on a street. These houses are painted different colors. The men have different
pets and have different favorite drinks. Determine who owns a zebra and whose favorite drink is
mineral water (which is one of the favorite drinks) given these clues: The Englishman lives in
the red house. The Spaniard owns a dog. The Japanese man is a painter. The Italian drinks tea.
The Norwegian lives in the first house on the left. The green house is immediately to the right
of the white one. The photographer breeds snails. The diplomat lives in the yellow house. Milk is
drunk in the middle house. The owner of the green house drinks coffee. The Norwegian’s house
is next to the blue one. The violinist drinks orange juice. The fox is in a house next to that of the
physician. The horse is in a house next to that of the diplomat. [Hint: Make a table where the
rows represent the men and columns represent the color of their houses, their jobs, their pets,
and their favorite drinks and use logical reasoning to determine the correct entries in the table.]
Solution:
Num. from left Nationality H.color Job Pet Fav Drink
1 Norwegian Yellow Diplomat Fox Mineral water
2 Italian Blue Physician Horse Tea
3 Englishman Red Photographer Snail milk
4 Spaniard White Violinist Dog Orange juice
5 Japanese Green Painter Zeebra Coffee
Question 35 (Pg.28, Q:23) Show that (p → r)∧(q → r) and (p∨q) → r are logically equivalent.
Solution:
17
p q r p → r q → r p ∨ q (p → r) ∧ (q → r) (p ∨ q) → r
T T T T T T T T
T T F F F T F F
T F T T T T T T
T F F F T T F F
F T T T T T T T
F T F T F T F F
F F T T T F T T
F F F T T F T T
Hence, (p → r) ∧ (q → r) and (p ∨ q) → r are logically equivalent.
Question 36 (Pg.28, Q:24) Show that (p → q) ∨ (p → r) and (p → (q ∨ r)) are logically
equivalent.
Solution:
L.H.S : (p → q) ∨ (p → r)
↔ (¬p ∨ q) ∨ (¬p ∨ r)
↔ (¬p ∨ ¬p) ∨ (q ∨ r) (By Associativity property)
↔ ¬p ∨ (q ∨ r) (by the property (p ∨ p → p))
↔ (p → (q ∨ r))
Hence proved.
Note: It can be proved using truth table method also.
Question 37 (Pg.28, Q:25) Show that (p → r)∨(q → r) and (p∧q) → r are logically equivalent.
Solution:
p q r p → r q → r (p → r) ∨ (q → r) p ∧ q (p ∧ q) → r
TTTT T T T T
TTFF F F T F
TFTT T T F T
TFFF T T F T
FTTT T T F T
FTFT F T F T
FFTT T T F T
FFFT T T F T
Solution:
p q r ¬p q → r p ∨ r ¬p → (q → r) q → (p ∨ r)
T T T F T T T T
T T F F F T T T
T F T F T T T T
T F F F T T T T
F T T T T T T T
F T F T F F F F
F F T T T T T T
F F F T T F T T
Hence, ¬p → (q → r) and q → (p ∨ r) are logically equivalent.
18
Question 39 (Pg.28, Q:27) Show that p ↔ q and (p → q) ∧ (q → p) are logically equivalent.
Solution:
p q p → q q → p (p → q) ∧ (q → p) p ↔ q
TTT T T T
TFF T F F
FTT F F F
FFT T T T
Solution:
p q p ↔ q ¬p ¬q ¬p ↔ ¬q
TTT F F T
TFF F T F
FTF T F F
FFT T T T
Solution:
p q r p → q q → r (p → q) ∧ (q → r) p → r (p → q) ∧ (q → r) → (p → r)
T T T T T T T T
T T F T F F F T
T F T F T F T T
T F F F T F F T
F T T T T T T T
F T F T F F T T
F F T T T T T T
F F F T T T T T
Hence, (p → q) ∧ (q → r) → (p → r) is a tautology.
Solution:
p q r p ∨ q ¬p (¬p ∨ r) (p ∨ q) ∧ (¬p ∨ r) (q ∨ r) (p ∨ q) ∧ (¬p ∨ r) → (q ∨ r)
FFFF T T F F T
FFTF T T F T T
FTFT T T T T T
FTTT T T T T T
TFFT F F F F T
TFTT F T T T T
TTFT F F F T T
TTTT F T T T T
Question 43 (Pg.28, Q:31) Show that (p → q) → r and p → (q → r) are not logically equiva-
lent.
19
Solution:
p q r p → q (p → q) → r q → r p → (q → r)
TTTT T T T
TTFT F F F
TFTF T T T
TFFF T T T
FTTT T T T
FTFT F F T
FFTT T T T
FFFT F T T
Solution:
p q r p ∧ q p → r (q → r) (p → r) ∧ (q → r) (p ∧ q) → r
T T T T T T T T
T T F T F F F F
T F T F T T T T
T F F F F T F T
F T T F T T T T
F T F F T F F T
F F T F T T T T
F F F F T T T T
Solution:
1
2
3
4
5
6
7
8
9
10
p q r s p→qr→s
3 →
4 p→rq→s
5 →
6
T T T T T T T T T T
T T T F T F F T F F
T T F T T T T F T T
T T F F T T T F F T
T F T T F T T T T T
T F T F F F T T T T
T F F T F T T F T T
T F F F F T T F T T
F T T T T T T T T T
F T T F T F F T F F
F T F T T T T T T T
F T F F T T T T F F
F F T T T T T T T T
F F T F T F F T T T
F F F T T T T T T T
F F F F T T T T T T
20