Homework1 Solution

CMSC 203 Section 0301: Homework1 Solution
1. Exercise Set 5.2
Problem:
(10 points)
Let A = {a, 0, 2}, B = {1, a, 2}, C = {0, 1}, D = power set of C
Describe (give answer as a set) A x B, A x A, power set of A, D x D
Sol:
D = power set of C.
D = {Ø, {0}, {1}, {0, 1}}
a. A X B = { (a,1), (a,a), (a,2), (0,1), (0,a), (0,2), (2,1), (2,a), (2,2) }
b. A X A = { (a,a), (a,0), (a,2), (0,a), (0,0), (0,2), (2,a), (2,0), (2,2) }
c.
Power set of A = { Ø, {a}, {0}, {2}, {a,0}, {a,2}, {0,2}, {a,0,2} }
d. D X D = { (Ø, Ø), (Ø, {0}), (Ø, {1}), (Ø, {0, 1}),
({0}, Ø), ({0}, {0}), ({0}, {1}), ({0}, {0, 1}),
({1}, Ø), ({1}, {0}), ({1}, {1}), ({1}, {0, 1}),
({0, 1}, Ø), ({0, 1}, {0}), ({0, 1}, {1}), ({0, 1}, {0, 1})
}
Problem 9:
(10 points)
For all sets A, B and C,
(A – B) ∩ (C – B) = (A ∩ C) – B
Sol:
To prove that (A – B) ∩ (C – B) = (A ∩ C) – B
We must prove (A – B) ∩ (C – B) is a subset of (A ∩ C) – B and
(A ∩ C) – B is a subset of (A – B) ∩ (C – B)
i. (A – B) ∩ (C – B) is a subset of (A ∩ C) – B
Let x Є (A – B) ∩ (C – B)
We have to prove that x Є (A ∩ C) – B
Since x Є (A – B) ∩ (C – B)
Hence,
x Є (A – B) and x Є (C – B)
i.e. x Є A and x Є BC and x Є C and x Є BC
i.e. x Є A and x Є C and x Є BC
i.e. x Є (A ∩ C ∩ BC)
i.e. x Є (A ∩ C) – B
Hence, (A – B) ∩ (C – B) is a subset of (A ∩ C) – B
ii. (A ∩ C) – B is a subset of (A – B) ∩ (C – B)
CMSC 203 : Section 0301 : Homework1 Solution
Let x Є (A ∩ C) – B
We have to prove that x Є (A – B) ∩ (C – B)
Since x Є (A ∩ C) – B
Hence,
x Є (A ∩ C) and x !Є B ( x is not an element of B)
i.e. x Є A and x Є C and x !Є B
i.e. x Є A and x Є C and x Є BC
i.e. (x Є A and x Є BC) and (x Є C and x Є BC)
i.e. x Є (A ∩ BC) and x Є (C ∩ BC)
i.e. x Є (A - B) and x Є (C - B)
i.e. x Є (A – B) ∩ (C – B)
Hence, (A ∩ C) – B is a subset of (A – B) ∩ (C – B)
Thus from (i) and (ii) we have,
(A – B) ∩ (C – B) = (A ∩ C) – B
Problem 14:
(10 points)
For all sets A and B,
c
If A is a subset of B, then B is a subset of AC
Sol:
Given that A is a subset of B,
i.e. if x Є A then x Є B
c
To prove that B is a subset of AC
Let x Є BC,
x Є BC implies x !Є B,
Since it is given that A is a subset of B,
Hence if x !Є B, then x !Є A
i.e. if x Є BC, then x Є AC
c
i.e. B is a subset of AC
Thus
c
If A is a subset of B, then B is a subset of AC
CMSC 203 : Section 0301 : Homework1 Solution
Problem 15:
(10 points)
For all sets A, B and C,
If A is a subset of B, and A is a subset of C then A is a subset of B ∩ C
Sol:
Given that A is a subset of B i.e. if x Є A then x Є B
Also, A is a subset of C i.e. if x Є A then x Є C
To prove that A is a subset of B ∩ C
Let x Є A, Hence by given conditions x Є B and x Є C
i.e. x Є (B ∩ C)
Thus if x Є A then x Є (B ∩ C)
Hence,
If A is a subset of B, and A is a subset of C then A is a subset of B ∩ C
2. Exercise Set 1.1
Problem 2:
(10 points)
a. If all computer programs contain errors, then this program contains error.
This program does not contain an error.
Therefore, it is not the case that all the computer programs contain errors.
This is in the form:
p→q
~q
therefore,
~p
b. If all the prime numbers are odd, then 2 is odd.
2 is not odd.
Therefore, it is not the case that all prime numbers are odd.
Problem 5:
(5 points)
a. 1024 is a smallest four digit number that is a perfect square.
Statement
b. She is a mathematics major
Not a statement
c.
128 = 26
Statement
d. x = 26
Not a statement
CMSC 203 : Section 0301 : Homework1 Solution
Problem 28:
(10 points)
Determine which of the following pair of statement are logically equivalent
(r V p) ^ ( ( ~r V (p^q) ) ^ (r V q) ) and p ^ q
Truth Table:
p
1
q
2
r
3
~r
4
p^q
5
~r V (p^q)
6
rVq
7
rVp
8
( ~r V (p^q) ) ^ (r V q)
9
9^8
10
T
T
T
T
F
F
F
F
T
T
F
F
T
T
F
F
T
F
T
F
T
F
T
F
F
T
F
T
F
T
F
T
T
T
F
F
F
F
F
F
T
T
F
T
F
T
F
T
T
T
T
F
T
T
T
F
T
T
T
T
T
F
T
F
T
T
F
F
F
T
F
F
T
T
F
F
F
F
F
F
Since values in the column 5 and column 10 are same the give two statements are logically
equivalent.
Problem 51:
(10 points)
Use theorem 1.1.1 to prove the logical equivalence of the statements.
(p ^ ( ~ (~p V q) ) ) V (p ^ q)
(p ^ ( ~(~p) ^ ~q ) ) V (p ^ q)
(De Morgan’s laws)
(p ^ ( p ^ ~q )) V (p ^ q)
(Double negation law)
(p ^ ~q) V (p ^ q)
(Idempotent law)
p ^ (~q V q)
(Distributive laws)
p^t
(Negation laws)
p
(Identity laws)
Therefore,
(p ^ ( ~ (~p V q) ) ) V (p ^ q) ≡ p
CMSC 203 : Section 0301 : Homework1 Solution
3. Exercise Set 1.2
Problem 6:
(10 points)
Construct the truth table for the statements
(pVq) V (~p^q) → q
p
q
~p
pVq
~p ^ q
(p V q) V (~p ^ q)
(p V q) V (~p ^ q) → q
T
T
F
F
T
F
T
F
F
F
T
T
T
T
T
F
F
F
T
F
T
T
T
F
T
F
T
T
Problem 18:
(15 points)
Write each of the following three statements in the symbolic form and determine which pairs
are logically equivalent
a. If it walks like a duck and it talks like a duck, then it is a duck
b. Either it does not walk like a duck or it does not talk like a duck, or it is a duck
c. If it does not walk like a duck and it does not talk like a duck, then it is not a duck
Sol:
Let:
p = it walks like a duck
q = it talks like a duck
r = it is a duck
Then given statements can be represented as:
a. (p ^ q) → r
b. ~p V ~q V r
c. (~p ^ ~q) → ~r
The truth tables for each of the above statements are as below:
CMSC 203 : Section 0301 : Homework1 Solution
a. (p ^ q) → r
p
q
r
p^q
(p ^ q) → r
T
T
T
T
F
F
F
F
T
T
F
F
T
T
F
F
T
F
T
F
T
F
T
F
T
T
F
F
F
F
F
F
T
F
T
T
T
T
T
T
b. ~p V ~q V r
p
q
r
~p
~q
~p V ~q
~p V ~q V r
T
T
T
T
F
F
F
F
T
T
F
F
T
T
F
F
T
F
T
F
T
F
T
F
F
F
F
F
T
T
T
T
F
F
T
T
F
F
T
T
F
F
T
T
T
T
T
T
T
F
T
T
T
T
T
T
c. (~p ^ ~q) → ~r
p
q
r
~p
~q
~r
~p ^ ~q
(~p ^ ~q) → ~r
T
T
T
T
F
F
F
F
T
T
F
F
T
T
F
F
T
F
T
F
T
F
T
F
F
F
F
F
T
T
T
T
F
F
T
T
F
F
T
T
F
T
F
T
F
T
F
T
F
F
F
F
F
F
T
T
T
T
T
T
T
T
F
T
Since the truth tables for statements a and b are same the two statements are equivalent.
CMSC 203 : Section 0301 : Homework1 Solution