Question 1
a
Let A and B be two sets with ∣A∣=20, ∣B∣=25 and ∣A∪B∣=35. Find ∣A∩B∣
\begin{align}
|A \cap B| &= |A| + |B| - |A \cup B| \\
&= 20 + 25 - 35 \\
&= 10
\end{align}
b
In a group of 100 people, 73 people can speak English and 43 can speak Spanish.
A=Set of those that can speak English
B=Set of those that can speak Spanish
∣A∣=73
∣B∣=43
∣A∪B∣=100
i
How many can speak both English and Spanish?
A∩B is the set of people who speak both English and Spanish.
$$
\begin{align}
|A \cap B| &= |A| + |B| - |A \cup B| \
&= 73 + 43 - 100 \
&= 16
\end{align}
$$
ii
How many can speak English only?
A−B is the set of people who speak English only.
\begin{align}
|A - B| &= |A| - |A \cap B| \\
&= 73 - 16 \\
&= 57
\end{align}
iii
How many can speak Spanish only?
B−A is the set of people who speak Spanish only.
\begin{align}
|B - A| &= |B| - |A \cap B| \\
&= 43 - 16 \\
&= 27
\end{align}
iv
Draw a Venn Diagram to show this information.
c
Let A and B be two sets. Determine which of the following statements are true and which are false. Prove each statement is true and give a counter example.
i
P(A∩B)=P(A)∩P(B)
The statement P(A∩B)=P(A)∩P(B) is true
Proof
I will show that P(A∩B)⊆P(A)∩P(B) and P(A)∩P(B)⊆P(A∩B)
Suppose X∈P(A∩B).
Since X∈P(A∩B), we infer X⊆A∩B.
Therefore, X⊆A and X⊆B.
Therefore, X∈P(A) and X∈P(B).
Therefore, X∈P(A)∩P(B)
Which means, P(A∩B)⊆P(A)∩P(B).
Suppose X∈P(A)∩P(B).
Since X∈P(A)∩P(B), we infer X∈P(A) and X∈P(B)
Therefore, X⊆A and X⊆B
Therefore, X⊆A∩B
Therefore, X∈P(A∩B)
Which means, P(A)∩P(B)⊆P(A∩B)
This concludes the proof.
ii
P(A∪B)=P(A)∪P(B)
The statement P(A∪B)=P(A)∪P(B) is false.
Proof
I give a proof by counterexample.
A={1}
B={2}
A∪B={1,2}
P(A)={∅,{1}}
P(B)={∅,{2}}
P(A∪B)={∅,{1},{2},{1,2}}
P(A)∪P(B)={∅,{1},{2}}
Therefore, P(A∪B)=P(A)∪P(B)
This concludes the proof.
iii
P(A)∪P(B)⊆P(A∪B)
The statement P(A)∪P(B)⊆P(A∪B) is true
Proof
I show that X∈P(A)∪P(B)→X∈P(A∪B)
Suppose X∈P(A)∪P(B)
Therefore, X∈P(A) or X∈P(B)
Therefore, X⊆A or X⊆B
Therefore, X⊆P(A∪B)
This means that X∈P(A)∪P(B)→X∈P(A∪B)
This concludes the proof.
Question 2
a
Which of the following are functions? If f is not a function explain why.
i
f:R→R with f(x)=1−x21
To be a function, every element in the domain has to have an image in the co-domain.
−1,1∈R
However, f(−1) and f(1) don't exist.
f(1)=1−121= Undefined due to divide by 0
f(−1)=1−(−1)21= Undefined due to divide by 0
Therefore, this is not a function.
ii
f:Z→Z with f(x)=2x
To be a function, every element in the domain has to have an image in the co-domain.
3∈Z
f(3)=3/2=1.5
1.5∈/Z
3 and all other odd numbers don't have an image. Therefore, this is not a function.
iii
f:R→R with f(x)=ln(x)
To be a function, every element in the domain has to have an image in the co-domain.
0∈R
f(0)=ln(0)=Undefined
Therefore, this is not a function.
b
Let f:R→R and g:R→R with f(x)=x+2 and g(x)=−x. Find g o f, (g o f)−1, f−1, g−1
- g o f=g(f(x))=g(x+2)=−(x+2)=−x−2
- (g o f)−1=−x−2
- Proof
- (g o f)=y
- −x−2=y
- −x=y+2
- x=−y−2
- f−1=x−2
- Proof
- f(x)=y
- x+2=y
- x=y−2
- g−1=(−x)−1=−x
c
Let f:R∗→R with f(x)=xx+1 where R∗ is the set of all real numbers different from 0.
i
Determine whether or not f is a one to one function
This function is one to one (injective).
Proof
Let a,b∈R∗
I will show that f(a)=f(b)→a=b
f(a)=f(b)
aa+1=bb+1
b(a+1)=a(b+1)
ba+a=ab+a
(ba+b)−ab=(ab+a)−ba
b=a
Therefore, this function is one to one.
This concludes the proof.
ii
Determine whether or not f is an onto function.
This function is onto (surjective).
Proof
Show that for any element y∈R, there exists x∈R∗ such that f(x)=y
f(x)=y⟹xx+1=y⟹x+1=xy⟹x=xy−1∈R
Hence, for all y∈R there exists x∈R∗ such that f(x)=y
This concludes the proof.
d
Given a function F:P({a,b,c})→Z is defined by F(A)=∣A∣ for all A∈P({a,b,c})
i
Is F a one-to-one function? Prove or give counter-example.
F is not a one-to-one function, as every element of P({a,b,c}) does not have a unique image in Z.
In other words, f(a)=f(b) does not imply a=b
Proof
I show proof by counterexample.
A={a,b}, B={b,c}
A,B∈P({a,b,c})
F(A)=2,F(B)=2
F(A)=F(B),A=B, therefore, this function is not one-to-one.
ii
Is F an onto function? Prove or give a counter-example.
F is not an onto (surjective) function.
Proof by Counter-example
100∈Z
F(X)=100
There is no X in the set of P({a,b,c}) such that ∣X∣=100. Therefore, this function is not onto (surjective).
e
Let f:A→B and g:B→C by functions. Prove that if g o f is one-to-one then f is also one-to-one.
Proof
Since g o f is a one to one function, we show that for all a,b∈A if a=b then f(a)=f(b)
g o f is a one to one function, hence, given a,b∈A with a=b then (gof)(a)=(gof)(b)
This means that g(f(a))=g(f(b)).
This means that f(a)=f(b), which implies f is a one to one function.
Question 3
a
Let p,q,r,s be four propositions.
Assuming that p and r are false and that q and s are true, find the truth value of each of the following propositions:
i
((p∧¬q)→(q∧r))→(s∨¬q)
Answer
((p∧¬q)→(q∧r))→(s∨¬q)
(F→(q∧r))→(s∨¬q)
(F→F)→(s∨¬q)
T→(s∨¬q)
T→T
True
ii
((p∨q)∧(q∨s))→((¬r∨p)∧(q∨s))
Answer
((p∨q)∧(q∨s))→((¬r∨p)∧(q∨s))
(T∧T)→((¬r∨p)∧(q∨s))
T→((¬r∨p)∧(q∨s))
T→(T∧T)
T→T
True
b
Let p, q and r be 3 propositions defined as follows:
* p means "Sofia is happy"
* q means "Sofia paints a picture"
* r means "Samir is happy"
Express each of the 3 following compound propositions symbolically by using p, q and r and appropriate logical symbols.
i
If Sofia is happy and paints a picture then Samir isn't happy.
(p∧q)→¬r
ii
Sofia is happy only if she paints a picture.
p→q
iii
Sofia either paints a picture or she is not happy.
q∨¬p
c
Give the contrapositive, the converse and the inverse of each of the following statements:
i
∀x∈R if x>3 then x2>9
P(x)=x>3
Q(x)=x2>9
Contrapositive form
∀x∈R, if ¬Q(x) then ¬P(x)
∀x∈R, if x2≤9 then x≤3
Converse form
∀x∈R, if Q(x) then P(x)
∀x∈R, if x2>9 then x>3
Inverse form
∀x∈R, if ¬P(x) then ¬Q(x)
∀x∈R if x≤3 then x2≤9
ii
∀x∈R if x(x+1)>0 then x>0 or x<−1
P(x)=x(x+1)>0
Q(x)=x>0 or x<−1
Contrapositive form
∀x∈R if ¬Q(x) then ¬P(x)
∀x∈R if ($x \le 0$ and x≥−1) then x(x+1)≤0
Converse form
∀x∈R if Q(x) then P(x)
∀x∈R if (x>0 or x<−1) then x(x+1)>0
Inverse form
∀x∈R if ¬P(x) then ¬Q(x)
∀x∈R if (x(x+1)≤0) then (x≤0 and x≥−1)
d
A tautology is a proposition that is always is always true. Let p,q,r be three propositions, show that (p→(q∨r))⇔((p∧¬q)→r) is a tautology.
I will prove the tautology using truth tables.
p |
q |
r |
p→(q∨r) |
((p∧¬q)→r) |
(p→(q∨r))⇔((p∧¬q)→r) |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
As you can see from the truth table, (p→(q∨r))⇔((p∧¬q)→r) is a tautology, as the statements on either side of the material equivalence operator are equivalent.
Question 4
a
Let P(x, y) by a boolean function. Assume that ∃x ∀y P(x,y) is True and the domain of discourse is nonempty. Which of the following must also be true? If the statement is true, explain your answer; otherwise, give a counter-example.
i
∀x ∃y ¬P(x,y)
False
We know the negation of ∀x∃y¬P(x,y), which is ∃x ∀y P(x,y) is true, therefore the statement must be false.
ii
∀x ∀y P(x,y)
False
We give an example to show that this statement can be False while the given statement is true.
Let P(x,y) be the propositional function x≤y with domain of discourse as the natural numbers.
∃x ∀y P(x,y) is True when x=1 since 1≤y for all y∈N
However, ∀x ∀y P(x,y) is False as we can find a counter-example like x=3,y=1 ($3 \le 1$) which is false.
iii
∃x ∃y P(x,y)
True
Since ∃x ∀y P(x,y) is True, we know there is an x value where, for all y, P(x,y) is True.
Therefore, the same x value clearly has at least one y value where P(x,y).
Therefore, ∃x∃yP(x,y) is true.
b
Given the following argument:
- "The football game will be cancelled only if it rains."
- "It rained, therefore the football game was cancelled."
Assume p means "it rains" whereas q means "football game cancelled"
i
Translate this argument to symbolic form.
q→p
p
∴q
ii
Construct the truth table.
q |
p |
q→p |
(q→p)∧p |
((q→p)∧p)→q |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
iii
Determine if this argument is a valid argument or not.
This argument is not valid.
The proposition ((q→p)∧p)→q is not a tautology, because it is False when q is False and p is True.
This is an incorrect argument using the fallacy of affirming the consequent.
c
Say whether or not the following argument is a valid argument. Explain your answer.
a) Successful candidates for this job must have either a Master's degree or five years of work experience.
b) Johny has a Master's degree.
c) Johnny got the job
d) ∴ Johnny does not have five years of work experience.
p: means the candidate was successful.
q: means the candidate has a masters degree.
r: means the candidate has five years of work experience.
p→(q∨r)
q
p
∴¬r
We can represent as a true table:
p |
q |
r |
p→(q∨r) |
(p→(q∨r))∧q∧p |
¬r |
((p→(q∨r))∧q∧p)→¬r |
0 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
0 |
0 |
From this, we can see this is not a valid argument as the proposition ((p→(q∨r))∧q∧p)→¬r is not a tautology.
There is an example where the premise is true but the conclusion is false.
d
Let P(x) and Q(x) be two predicates and suppose D is the domain of x.
For the statement forms in each pair, determine whether the have the same truth value for every choice of P(x), Q(x), D or not.
i
∀x∈D,(P(x)∧Q(x)), and (∀x∈D,P(x))∧(∀x∈D,Q(x))
These two statements have the same truth value.
Proof
In the first statement, we see that for all x∈D, P(x)∧Q(x) is true.
This means for all x∈D, P(x) is true. It also means for all x∈D, Q(x) is true.
This means (∀x∈D,P(x))∧(∀x∈D,Q(x))
Therefore, these statements have the same truth value.
ii
∀x∈D,(P(x)∨Q(x)), and (∀x∈D,P(x))∨(∀x∈D,Q(x))
These two statements do not have the same truth value.
Proof
I prove that these statements do not have the same true value with a counterexample.
D={1,2}
P(1)=T
P(2)=F
Q(1)=F
Q(2)=T
The statement P(x)∨Q(x) is true for all x∈D: P(1)∨Q(1), P(2)∨Q(2)
However, it is not true that ∀x∈D,P(x), as P(2)=F. It is also not true that ∀x∈D,Q(x) as Q(1)=F.
This means that (∀x∈D,P(x))∨(∀x∈D,Q(x)) is false.
Therefore, these statements do not have the same truth value.
Question 5
a
Use rules of boolean algebra to simplify the following boolean expressions:
i
ab(a+b)(b+b)
\begin{align}
\overline{ab}(\overline{a} + b)(\overline{b} + b) &= \overline{ab}(\overline{a} + b)1 \text{ -- Complement law} \\
&= \overline{ab}(\overline{a} + b) \text{ -- Idempotent} \\
&= \overline{ab}\overline{a} + \overline{ab}b \text{ -- Distributive} \\
&= (\overline{a} + \overline{b})\overline{a} + (\overline{a} + \overline{b})b \text{ -- De Morgan's} \\
&= \overline{a}\overline{a} + \overline{a}\overline{b} + \overline{a}b + \overline{b}b \text{ -- Distributive} \\
&= \overline{a} +\overline{a}\overline{b} + \overline{a}b + 0 \text{ -- Idempotent and Complement} \\
&= \overline{a} + \overline{a}(\overline{b} + b) + 0 \text{ -- Distributive} \\
&= \overline{a} + \overline{a}.1 + 0 \text{ -- Idempotent} \\
&= \overline{a} + \overline{a} \text{ -- Identity} \\
&= \overline{a} \text{ -- Idempotent}
\end{align}
ii
a(a+b)+(b+aa)(a+b)
$$
\begin{align}
\overline{a}(a + b) + (b + aa)(a + \overline{b}) &= \overline{a}(a + b) + (b + a)(a + \overline{b}) \text{ -- Idempotent law} \
&= \overline{a}(a + b) + (a + b)(a + \overline{b}) \text{ -- Commutative law} \
&= (a + b) . (\overline{a} + (a + \overline{b})) \text{ -- Distributive law (factorise (a+b))} \
&= (a + b) . ((\overline{a} + a) + b) \text{ -- Associative law} \
&= (a + b) . (1 + \overline{b}) \text{ -- Complement law} \
&= (a + b) . 1 \text{ -- Tautology} \
&= (a + b) \text{ -- Identity}
\end{align}
$$
b
Use the duality principle to find out the dual of the following equation:
ab+cd=(a+c)(a+d)(b+c)(b+d)
Answer
The dual was determined using these steps:
- changing each OR (+) sign to an AND (.) sign
- changing each AND (.) sign to an OR (+) sign.
- changing each 0 to 1 and each 1 to 0
(a+b).(c+d)=(a.c)+(a.d)+(b.c)+(b.d)
c
The lights in a classroom are controlled by two switches: one at the back and one at the front of the room.
Moving either switch to the opposite position turns the light off if they were on and on if they were off.
Assume the lights have installed so that when both switches are in the down position, the lights are off. Let P and Q be the input to switches and R be the output (light on/off), design a circuit to control the switches and give its corresponding truth table.
The boolean expression that can represent the circuit is:
R=PQ+PQ
The truth table is:
P |
Q |
R |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
0 |
Circuit:
d
i
Fill in the K-map for the Boolean function
F(x,y,z)=x.y.z+x.y.z+x.y.z+x.y.z
xy |
00 |
01 |
11 |
10 |
z |
--- |
--- |
--- |
--- |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
ii
Use the previous K-map and find a minimisation, as the sum of three terms, of the expression.
F(x,y,z)=xy+xy