Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Tutorial 1

Uploaded by

kenfack
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Tutorial 1

Uploaded by

kenfack
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Maths for Computing

Tutorial 1
1. Think of some sentences that are neither questions nor instructions, but still not propositions.
Solution: One example is “This sentence is true”.

Consider the below box:

In the above box, 1) is true because if it is false, then it will imply that no statement in the box is
false which is a contradiction. But if 1) is true, then 2) has to be false. So, X will top the exam.
How are we able to prove that X will top the M4C without knowing much about X? What’s the
catch? Is it that 1) may not be a proposition?

2. Determine the truth value of the following statements.


a) If 1 + 1 = 2, then 2 + 2 = 5.
b) If 1 + 1 = 2, then dogs can y.
c) If 1 + 1 = 3, then unicorns exist.
Solution: a) False, b) False, c) True.

3. State the converse, contrapositive, and inverse of each of these conditional statements.
a) I come to the class if there is going to be a quiz.
b) A positive integer is a prime only if it has no divisors other than 1 and itself.
Solution:
a) If there is going to be a quiz, then I will come to the class.
Converse: If I come to the class, then there will be a quiz.
Contrapositive: If I do not come to the class, then there will be no quiz.
Inverse: If there is no quiz, then I will not come to the class.
b) If a positive integer is a prime, then it has no divisors other than 1 and itself.
Converse: If a positive integer has no divisors other than 1 and itself, then it is a prime.
Contrapositive: If a positive integer has divisors other than 1 and itself, then it is not a prime.
Inverse: If a positive integer is not a prime, then it has divisors other than 1 and itself.

4. 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?
fl
Solution: No, there cannot be such a barber. There is a contradiction.
If the barber shaves himself, then he cannot shave himself.
If the barber doesn’t shave himself, then he should shave himself.

5. Construct a compound proposition that corresponds to exclusive OR.


Solution: ( ¬x ∨ ¬y) ∧ (x ∨ y).

6. An island has two kinds of inhabitants, knights, who always tell the truth, and their opposites,
knaves, who always lie. You encounter two people A and B. What are A and B if A says “B is a
knight” and B says “The two of us are opposite types”?
Solution: Both are knaves. Analyse all possible cases. Only the case where both are knaves is
consistent with their statements.

7. Determine whether the following statements are tautology, contradiction or contingency


a) ( ¬p ∧ ( p → q)) → ¬q
b) (( p ∨ q) ∧ ( ¬p ∨ r)) → (q ∨ r)
Solution:
a) Contingency. (Construct the truth table to nd out.)
b) Tautology. (Construct the truth table to nd out.)

8. Show that the following pairs are logically equivalent.


a) ¬p → (q → r) ≡ q → ( p ∨ r)
b) ¬( p ∨ ( ¬p ∧ q)) ≡ ¬p ∧ ¬q
c) (( p → q) ∧ (q → r)) → ( p → r) ≡ T
Solution:
a) ¬p → (q → r)
≡ ¬p → ( ¬q ∨ r) (Using p → q ≡ ¬p ∨ q)
≡ ¬( ¬p) ∨ ( ¬q ∨ r) (Using p → q ≡ ¬p ∨ q)
≡ p ∨ ( ¬q ∨ r) (Double negation law)
≡ ( p ∨ ¬q) ∨ r (Associative law)
≡ ( ¬q ∨ p) ∨ r (Commutative law)
≡ ¬q ∨ ( p ∨ r) (Associative law)
≡ q → ( p ∨ r) (Using p → q ≡ ¬p ∨ q)
b) ¬( p ∨ ( ¬p ∧ q))
≡ ¬(( p ∨ ¬p) ∧ ( p ∨ q)) (Distributive law)
≡ ¬(T ∧ ( p ∨ q)) (Negation law)
≡ ¬(( p ∨ q) ∧ T ) (Commutative law) (Do not forget this step)
≡ ¬( p ∨ q) (Identity law)
≡ ¬p ∧ ¬q (De Morgan’s law)
c) Since the proof is very long, I will be skipping a few obvious steps or apply more than one rule
of inference in one step.
(( p → q) ∧ (q → r)) → ( p → r)
≡ (( ¬p ∨ q) ∧ ( ¬q ∨ r)) → ( ¬p ∨ r) (Using p → q ≡ ¬p ∨ q)
fi
fi
≡ ¬(( ¬p ∨ q) ∧ ( ¬q ∨ r)) ∨ ( ¬p ∨ r) (Using p → q ≡ ¬p ∨ q)
≡ (( p ∧ ¬q) ∨ (q ∧ ¬r)) ∨ ( ¬p ∨ r) (De Morgan’s law)
≡ ((( p ∧ ¬q) ∨ (q ∧ ¬r)) ∨ ¬p) ∨ r (Associative law)
≡ ( ¬p ∨ (( p ∧ ¬q) ∨ (q ∧ ¬r))) ∨ r (Commutative law)
≡ (( ¬p ∨ ( p ∧ ¬q)) ∨ (q ∧ ¬r)) ∨ r (Associative law)
≡ ((( ¬p ∨ p) ∧ ( ¬p ∨ ¬q)) ∨ (q ∧ ¬r)) ∨ r (Distributive law)
≡ ((T ∧ ( ¬p ∨ ¬q)) ∨ (q ∧ ¬r)) ∨ r (Negation law)
≡ (( ¬p ∨ ¬q) ∨ (q ∧ ¬r)) ∨ r (Identity law)
≡ ( ¬p ∨ ( ¬q ∨ (q ∧ ¬r))) ∨ r (Associative law)
≡ ( ¬p ∨ (( ¬q ∨ q) ∧ ( ¬q ∨ ¬r))) ∨ r (Distributive law)
≡ ( ¬p ∨ (T ∧ ( ¬q ∨ ¬r))) ∨ r (Negation law)
≡ ( ¬p ∨ ( ¬q ∨ ¬r)) ∨ r (Identity law)
≡ (( ¬p ∨ ¬q) ∨ ¬r) ∨ r (Associative law)
≡ ( ¬p ∨ ¬q) ∨ ( ¬r ∨ r) (Identity law)
≡ ( ¬p ∨ ¬q) ∨ T (Negation law)
≡ T (Domination law)

9. Find the truth value of the following propositions where the domain is the set of positive
integers. Justify your answer brie y.
a) ∀x ∃y(x = 1/y)
b) ∀x ∃y(y 2 − x < 100)
c) ∀x ∀y(x 2 ≠ y 3)
Solution:
a) False. Counterexample, x = 2.
b) True. For every x, take y = 1.
c) False. Counterexample, x = 1,y = 1 or x = 4,y = 8.
fl

You might also like