














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















1.1 Propositional Logic (Page-13)
Smartphone A, RAM = 256MB, ROM = 32GB, Camera Resolution = 8MP.
Smartphone B, RAM = 288MB, ROM = 64GB, Camera Resolution = 4MP.
Smartphone C, RAM = 128MB, ROM = 32GB, Camera Resolution = 5MP.
a) Smartphone B has the most RAM of these three smartphones. True
b) Smartphone C has more ROM or a higher resolution camera than Smartphone B.
True
c) Smartphone B has more RAM, more ROM, and a higher resolution camera than
Smartphone A. False
d) If Smartphone B has more RAM and more ROM than Smartphone C, then it also has
a higher resolution camera. False
e) Smartphone A has more RAM than Smartphone B if and only if Smartphone B has
more RAM than Smartphone A. False
Acme Computer’s,
Annual revenue = 138 billion dollars
Net profit = 8 billion dollars
Nadir Software’s,
Annual revenue = 87 billion dollars
Net profit = 5 billion dollars
Quixote Media’s,
Annual revenue = 111 billion dollars
Net profit = 13 billion dollars
a) Quixote Media had the largest annual revenue. FALSE
b) Nadir Software had the lowest net profit and Acme Computer had the largest annual
revenue. TRUE
c) Acme Computer had the largest net profit or Quixote Media had the largest net profit.
d) If Quixote Media had the smallest net profit, then Acme Computer had the largest
annual revenue. TRUE
e) Nadir Software had the smallest net profit if and only if Acme Computer had the
largest annual revenue. TRUE
p: It is below freezing.
q: It is snowing.
a) It is below freezing and snowing. Writing this proposition using logical
connectives/Translation: p q
b) It is below freezing but not snowing. Translation: p q
c) It is not below freezing and it is not snowing. Translation: p q
d) It is either snowing or below freezing (or both). Translation: p q
e) If it is below freezing, it is also snowing. Translation: p q
f) Either it is below freezing or it is snowing, but it is not snowing if it is below freezing.
Translation: (p q) (p q)
g) That it is below freezing is necessary and sufficient for it to be snowing. Translation:
p q
p: You drive over 65 miles per hour.
q: You get a speeding ticket.
a) You do not drive over 65 miles per hour. Translation: p
b) You drive over 65 miles per hour, but you do not get a speeding ticket. Translation:
p q
c) You will get a speeding ticket if you drive over 65 miles per hour. Translation: p q
d) If you do not drive over 65 miles per hour, then you will not get a speeding ticket.
Translation: p q
e) Driving over 65 miles per hour is sufficient for getting a speeding ticket. Translation:
p q
f) You get a speeding ticket, but you do not drive over 65 miles per hour. Translation:
q p
g) Whenever you get a speeding ticket, you are driving over 65 miles per hour.
Translation: q p
p: Grizzly bears have been seen in the area.
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.
Translation: r p
b) Grizzly bears have not been seen in the area and hiking on the trail is safe, but berries
are ripe along the trail. Translation: p q r
c) If berries are ripe along the trail, hiking is safe if and only if grizzly bears have not
been seen in the area. Translation: r (q p)
False premise does not imply false conclusion.
Therefore, this conditional statement is true.
d) If monkeys can fly, then 1 + 1 = 3. ( TRUE )
The premise "monkeys can fly" is false.
1 + 1 = 3 is false.
False premise does not imply anything about the truth of the conclusion.
Therefore, this conditional statement is true.
[From: Answers to Odd-Numbered Exercises — a) False b) True c) True d) True]
a) If 1 + 1 = 3, then unicorns exist. ( TRUE )
The premise 1 + 1 = 3 is false.
The statement "unicorns exist" is considered false in reality.
False premise does not imply false conclusion.
Therefore, this conditional statement is true.
b) If 1 + 1 = 3, then dogs can fly. ( TRUE )
The premise 1 + 1 = 3 is false.
The statement "dogs can fly" is considered false in reality.
False premise does not imply false conclusion.
Therefore, this conditional statement is true.
c) If 1 + 1 = 2, then dogs can fly. ( FALSE )
The premise 1 + 1 = 2 is true.
The statement "dogs can fly" is considered false in reality.
True premise does not imply false conclusion.
Therefore, this conditional statement is false.
d) If 2 + 2 = 4, then 1 + 2 = 3. ( TRUE )
Both the premise and the conclusion are true.
True premise implies true conclusion.
Therefore, this conditional statement is true.
one or both of the statements are true. In contrast, when "or" is an exclusive disjunction, it
means that only one of the statements can be true, but not both.
Let's analyze the sentences:
Book ChatGPT Gemini
a) Inclusive or: It is
allowable to take discrete
mathematics if you have had
calculus or computer
science, or both.
Exclusive or: It is allowable
to take discrete mathematics
if you have had calculus or
computer science, but not if
a) To take discrete
mathematics, you must have
taken calculus or a course in
computer science.
Inclusive or: You must have
taken calculus, or you must
have taken a course in
computer science, or you
a) To take discrete
mathematics, you must have
taken calculus or a course in
computer science.
Inclusive Or: You need to
have taken both calculus and
computer science, or at least
one of them.
you have had both.
Most likely the inclusive or
is intended.
must have taken both.
Exclusive or: You must have
taken calculus, or you must
have taken a course in
computer science, but not
both.
Intended meaning: It seems
that the intended meaning is
an inclusive or, suggesting
that having taken either
calculus or a course in
computer science is
sufficient for taking discrete
mathematics.
Exclusive Or: You can only
have taken calculus or
computer science, not both.
Intended Meaning: This is
likely an inclusive or. Most
universities require at least
one of these prerequisites,
not both necessarily.
b) Inclusive or: You can
take the rebate, or you can
get a low-interest loan, or
you can get both the rebate
and a low-interest loan.
Exclusive or: You can take
the rebate, or you can get a
low-interest loan, but you
cannot get both the rebate
and a low-interest loan.
Most likely the exclusive or
is intended.
b) When you buy a new car
from Acme Motor
Company, you get $
back in cash or a 2% car
loan.
Inclusive or: You get $
back in cash, or you get a
2% car loan, or you get both.
Exclusive or: You get $
back in cash, or you get a
2% car loan, but not both.
Intended meaning: The
intended meaning seems to
be an exclusive or,
suggesting that the buyer
can choose either the
cashback offer or the 2% car
loan, but not both.
b) When you buy a new car
from Acme Motor
Company, you get $
back in cash or a 2% car
loan.
Inclusive Or: You get both
the cash and the 2% loan
(unlikely).
Exclusive Or: You get either
the cash or the 2% loan, but
not both.
Intended Meaning: This is
likely an exclusive or. The
offer is one or the other, not
both.
c) Inclusive or: You can
order two items from
column A and none from
column B, or three items
from column B and none
from column A, or five
items including two from
column A and three from
column B.
Exclusive or: You can order
two items from column A or
three items from column B,
but not both.
Almost certainly the
exclusive or is intended.
c) Dinner for two includes
two items from column A or
three items from column B.
Inclusive or: You can
choose two items from
column A, or you can
choose three items from
column B, or you can
choose a combination of
items from both columns.
Exclusive or: You can
choose two items from
column A, or you can
choose three items from
column B, but not both.
Intended meaning: It's likely
c) Dinner for two includes
two items from column A or
three items from column B.
Inclusive Or: You can
choose both two items from
A and three items from B for
your dinner.
Exclusive Or: You can
choose either two items
from A or three items from
B, but not both.
Intended Meaning: This is
likely an inclusive or. The
menu allows you to choose
from various combinations,
not just one option.
c) You get promoted if and only if you have connections.
d) Your mind will decay if and only if you watch television.
e) The train runs late if and only if it is a day, I take the train.
[From: Answers to Odd-Numbered Exercises]
a) If it snows today, I will ski tomorrow.
Converse: “I will ski tomorrow only if it snows today.”
Contrapositive: “If I do not ski tomorrow, then it will not have snowed today.”
Inverse: “If it does not snow today, then I will not ski tomorrow.”
b) I come to class whenever there is going to be a quiz.
Converse: “If I come to class, then there will be a quiz.”
Contrapositive: “If I do not come to class, then there will not be a quiz.”
Inverse: “If there is not going to be a quiz, then I don’t come to class.”
c) A positive integer is a prime only if it has no divisors other than 1 and itself.
Converse: “A positive integer is a prime if it has no divisors other than 1 and
itself.”
Contrapositive: “If a positive integer has a divisor other than 1 and itself, then
it is not prime.”
Inverse: “If a positive integer is not prime, then it has a divisor other than 1
and itself.”
[From: Answers to Odd-Numbered Exercises —
a) Converse: “I will ski tomorrow only if it snows today.”
Contrapositive: “If I do not ski tomorrow, then it will not have snowed today.”
Inverse: “If it does not snow today, then I will not ski tomorrow.”
b) Converse: “If I come to class, then there will be a quiz.”
Contrapositive: “If I do not come to class, then there will not be a quiz.”
Inverse: “If there is not going to be a quiz, then I don’t come to class.”
c) Converse: “A positive integer is a prime if it has no divisors other than 1 and itself.”
Contrapositive: “If a positive integer has a divisor other than 1 and itself, then it is not
prime.”
Inverse: “If a positive integer is not prime, then it has a divisor other than 1 and
itself.”]
a) If it snows tonight, then I will stay at home.
Converse: "If I stay at home, then it snowed tonight."
Contrapositive: "If I don't stay at home tonight, then it didn't snow."
Inverse: "If it doesn't snow tonight, then I won't stay at home."
b) I go to the beach whenever it is a sunny summer day.
Converse: "If I go to the beach, then it is a sunny summer day."
Contrapositive: "If I don't go to the beach, then it is not a sunny summer day."
Inverse: "If it is not a sunny summer day, then I don't go to the beach."
c) When I stay up late, it is necessary that I sleep until noon.
Converse: "If I sleep until noon, then I stayed up late."
Contrapositive: "If I don't sleep until noon, then I didn't stay up late."
Inverse: "If I don't stay up late, then I don't sleep until noon."
i. When, p, q and r are all true:
Here, p, q and r all are false.
Therefore, p q, q r and r p are all true.
Consequently, their conjunction (p q) (q r) (r p) is true as well.
ii. When, p, q and r are all false:
Here, p, q and r all are true.
Therefore, p q, q r and r p are all true.
Consequently, their conjunction (p q) (q r) (r p) is true as well.
Otherwise, if p, q and r do not have the same truth value, at least one of the disjuncts in the
conjunction p q, q r and r p will be false making the entire conjunction false.
Hence, the expression (p q) (q r) (r p) is true when p, q and r have the same truth
value, and it is false otherwise.
i. When at least one of p, q and r is true and at least one of them is false:
If at least one of p, q and r is true and at least one is false, then in the first part p q r, the
disjunction will be true because at least one of p, q or r is true. Simultaneously, in the
second part p q r, at least one of p, q or r will be true since at least one of p, q
or r is false. Therefore, the conjunction of these two parts will be true.
ii. When all three of the variables have the same truth value:
If all three variables p, q and r have the same truth value, either all true or all false—
After evaluation, x remains 1.
e) if x < 2 then x := x + 1
Given x = 1 before the statement is reached:
x < 2 is true because 1 < 2.
Therefore,
x := x + 1 is executed.
After execution,
x = 2 .
After encountering each statement, the value of x is as follows:
a) x=
b) x=
c) x=
d) x=
e) x=
of bit strings:
a) 1011110, 0100001
Bitwise OR:
Bitwise AND: 1011110 ∧ 0100001 = 0000000
Bitwise XOR: 1011110
0100001
b) 11110000, 10101010
Bitwise OR: 11110000 ∨ 10101010 = 11111010
Bitwise AND: 11110000 ∧ 10101010 = 10100000
Bitwise XOR: 11110000
10101010
c) 0001110001, 1001001000
Bitwise OR: 00011100001 ∨ 10010010000 = 10011110001
Bitwise AND:
Bitwise XOR: 00011100001
10010010000
d) 1111111111, 0000000000
Bitwise OR: 1111111111 | 0000000000 = 1111111111
Bitwise AND: 1111111111 & 0000000000 = 0000000000
Bitwise XOR: 1111111111 ^ 0000000000 = 1111111111
These are the results of performing the bitwise OR(|), bitwise AND(&), and bitwise XOR(^)
operations on each pair of bit strings.
[From: Answers to Odd-Numbered Exercises —
a) Bitwise OR is 111 1111; bitwise AND is 000 0000; bitwise XOR is 111 1111.
b) Bitwise OR is 1111 1010; bitwise AND is 1010 0000; bitwise XOR is 0101 1010.
c) Bitwise OR is 10 0111 1001; bitwise AND is 00 0100 0000; bitwise XOR is 10 0011 1001.
d) Bitwise OR is 11 1111 1111; bitwise AND is 00 0000 0000; bitwise XOR is 11 1111
a) 11000 ∧ ( 01011 ∨ 11011 )
First, evaluate the inner expression within the parentheses:
Now, 11000 ∧ 11011 = 11000.
b) ( 01111 ∧ 10101 ) ∨ 01000
First, evaluate
Now,
c) ( 01010 ⊕ 11011 ) ⊕ 01000
First, evaluate
Now,
d) ( 11011 ∨ 01010 ) ∧ ( 10001 ∨ 11011 )
First, evaluate both parts inside the parentheses:
Now, 11011 ∧ 11011 = 11011.
So, the evaluations are:
a) 11000
b) 01101
c) 11001
d) 11011
45-47. Let's solve each exercise using the given truth values:
The truth value of the negation of a proposition in fuzzy logic is 1 minus the truth value
of the proposition.
For "Fred is not happy": 1 - 0.8 = 0.
For "John is not happy": 1 - 0.4 = 0.
its own falseness, making it false. If it's false, then it's contradicting its own claim of being
false, making it true. This creates a logical loop with no clear truth value.
and can be assigned a definite truth value (true or false). However, due to the paradox, "This
statement is false" cannot be definitively categorized as true or false.
contradictions are avoided. Statements like "This statement is false" violate this principle and
can lead to inconsistent conclusions.
Therefore, even though the statement appears to be a simple assertion, it doesn't fulfill the
requirements of being a proposition in formal logic due to its self-contradicting nature.
Google:
"This Statement is false" is not a proposition. The statement is a paradox. It is not possible to
assign a consistent truth value to the statement because it contradicts itself.
[From: Answers to Odd-Numbered Exercises —
This cannot be a proposition, because it cannot have a truth value. Indeed, if it were true, then
it would be truly asserting that it is false, a contradiction; on the other hand, if it were false,
then its assertion that it is false must be false, so that it would be true—again a contradiction.
Thus, this string of letters, while appearing to be a proposition, is in fact meaningless.]
a) For the statement "Exactly n of the statements in this list are false," we can
make the following conclusions:
If the statement is true, then exactly n of the statements in the list are false, including
the statement itself.
If the statement is false, then either fewer than n statements in the list are false or
more than n statements in the list are false, but not exactly n statements.
b) For the statement "At least n of the statements in this list are false," the
conclusions are different:
If the statement is true, then at least n of the statements in the list are false, including
the statement itself.
If the statement is false, then fewer than n statements in the list are false.
c) Now, considering that the list contains 99 statements:
In part (b), if the 99th statement says "At least 99 of the statements in this list are
false," and it happens to be true, it leads to a contradiction. If it is true, then at least 99
statements are false, including itself, which means all statements should be false.
However, if all statements are false, then the 99th statement itself would be false,
contradicting its own assertion. Therefore, the 99th statement cannot be true.
If the 99th statement says "At least 99 of the statements in this list are false," and it's
false, it means fewer than 99 statements are false. However, this leads to a
contradiction because it's impossible for fewer than 99 statements to be false when
there are only 99 statements in total. Therefore, the 99th statement cannot be false
either.
Consequently, there's no consistent truth value assignment for the 99th statement, and
the logic breaks down.
[From: Answers to Odd-Numbered Exercises —
a) The 99th statement is true and the rest are false.
b) Statements 1 through 50 are all true and statements 51 through 100 are all false.
c) This cannot happen; it is a paradox, showing that these cannot be statements.]
1.3 Propositional Equivalences (Page-35)
construct truth tables for each statement and demonstrate that the resulting truth value is
always true (T) regardless of the truth values of the propositional variables involved. Here are
the truth tables for each statement:
a) (p q) p
p q p q p q p
b) p (p q)
p q p q p (p q)
c) p (p q)
p q p p q p (p q)
d) (p q) (p q)
p q p q p q (p q) (p q)
d) [(p q) (p r) (q r)] r
p q r p q p r q r (p q) (p r) (q r) [(p q) (p r) (q r)] r
it's a tautology without using truth tables:
a) (p q) p
(p q) p [Definition of Implication]
p q p [De Morgan’s Law]
p p q [Commutative Law]
(p p) q [Commutative and Associative Law]
T q [Negation Law]
T [Domination Law]
b) p (p q)
p (p q) [Definition of Implication]
(p p) q [Commutative and Associative Law]
T q [Negation Law]
T [Domination Law]
c) p (p q)
(p) (p q) [Definition of Implication]
p (p q) [Double Negation Law and Definition of Implication]
(p p) q [Associative Law]
T q [Negation Law]
T [Domination Law]
d) (p q) (p q)
(p q) (p q) [Definition of Implication]
(p q) (p q) [Definition of Implication]
(p q) (p q) [De Morgan’s Law]
p q p q [Associative Law]
p p q q [Commutative Law]
p (q q) [Idempotent, Commutative and Associative Law]
p T [Negation Law]
T [Domination Law]
e) (p q) p
[(p q)] p [Definition of Implication]
(p q) p [Double Negation Law]
p q p [Definition of Implication and Associative Law]
(p p) q [Commutative and Associative Law]
T q [Negation Law]
T [Domination Law]
f) (p q) q
[(p q)] q [Definition of Implication]
(p q) q [Double Negation Law]
p q q [Definition of Implication and Associative Law]
p (q q) [Associative Law]
p T [Negation Law]
T [Domination Law]
[Assume the hypothesis is true. Since the first part of the hypothesis is true, we know that
either p or q is true. If p is true, then the second part of the hypothesis tells us that r is true;
similarly, if q is true, then the third part of the hypothesis tells us that r is true. Thus in either
case we conclude that r is true.]
with and without a truth table.
p q p q p q q (p q) (q (p q)) p
(q (p q)) p
[q (p q)] p [Definition of Implication]
[(q p) (q q)] p[Distributive Law]
[(p q) F] p [Commutative and Negation Law]
(p q) p [Identity Law]
(p q) p [Definition of Implication]
p q p [De Morgan’s Law and Doble Negation Law]
(p p) q [Commutative and Associative Law]
T q [Negation Law]
T [Domination Law]
their truth tables:
p q p q (p q) p q
To show that ¬(p ⊕ q) and p ↔ q are logically equivalent without using truth tables, we can
demonstrate it through logical equivalences and properties of logical connectives. Let's break
down each expression:
We need to show that ¬(p ⊕ q) is equivalent to p ↔ q.
First, let's express ¬(p ⊕ q) in terms of simpler logical connectives:
¬(p ⊕ q)
¬[(p ∧ ¬q) ∨ (¬p ∧ q)]
¬(p ∧ ¬q) ∧ ¬(¬p ∧ q)
(¬p ∨ q) ∧ (p ∨ ¬q)
Now, let's express p ↔ q in terms of logical connectives:
p ↔ q
(p → q) ∧ (q → p)
(¬p ∨ q) ∧ (¬q ∨ p)
(¬p ∨ q) ∧ (p ∨ ¬q)
Now, let's compare the expressions for ¬(p ⊕ q) and p ↔ q:
¬(p ⊕ q) (¬p ∨ q) ∧ (p ∨ ¬q)
p ↔ q (¬p ∨ q) ∧ (p ∨ ¬q)
(p q) p q (Showed)
We see that both expressions have the same form. They both consist of two conjunctions of
disjunctions involving the negation of one variable and the other variable itself.
Therefore, ¬(p ⊕ q) and p ↔ q are logically equivalent.
their truth tables:
p q p p q (p q) p q
analyze their truth tables:
p q r p q p r q r (p r) (q r) (p q) r
their logical equivalence.
p q r p p r q r p (q r) q (p r)