Professional Documents
Culture Documents
Qbankfcssem 3
Qbankfcssem 3
Qbankfcssem 3
Use De Morgan's Laws to write the negation of the expression, and translate the negation
in English
Solution:
¬ P V Q is equivalent to P → Q
Problem 2
Let
P = "John is healthy"
Q = "John is wealthy"
R = "John is wise"
Represent:
Problem 3
Translate the sentences into propositional expressions:
"Neither the fox nor the lynx can catch the hare if the hare is alert and quick."
Solution
Let
(R Λ S) → ~( P V Q)
Problem 4
"You can either (stay at the hotel and watch TV ) or (you can go to the museum and
spend some time there)".
The parentheses are used to avoid ambiguity concerning the priority of the logical
connectives.
Translation: (P Λ Q) V (R Λ S)
Problem 5
f. Let
P: we are on vacation
Q: we go fishing
g. negation: P Λ ¬ Q
"We are on vacation and we do not go fishing."
h. converse: Q → P
"If we go fishing, we are on vacation."
i. inverse: ¬ P → ¬ Q
"If we are not on vacation, we don't go fishing."
j. contrapositive: ¬ Q → ¬ P
"If we don't go fishing, we are not on vacation."
Problem 6
P→Q ~Q → ~ P Q→P ~P → ~Q
~P → Q ~Q→P Q → ~P P → ~Q
Q → ~P P → ~Q ~P → Q ~Q→P
Problem 7
Premises:
Solution:
Let
Formal representation:
(1) P → Q
(2) ~P
(3) Therefore ~Q
We know that when P is false, i.e. we have ~P, the implication is true
for any value of Q.
Hence we cannot say whether Q is true or false.
The error in the above argument is called inverse error.
Problem 8
Premises:
Solution:
Let
Formal representation:
(1) P → Q
(2) Q → R
(3) Therefore P → R
Problem 9
Premises:
Solution:
Let
Formal representation:
(1) (Q V R) → P
(2) ~Q
(3) P
(4) Therefore R
Given that (Q V R) is true, and that Q is false (~Q is true) we conclude that R is true.
Problem 10
Premises:
Solution:
Let
Formal representation:
(1) (Q V R) → P
(2) ~Q
(3) ~P
(4) Therefore ~R
Note, that the premise ~Q is not necessary. Since both sides of the disjunction must be
false, Q must be false too.
A valid argument would be the following one:
(1) (Q V R) → P
(2) ~P
(3) Therefore ~Q and ~R
Predicate logic
Problem 11
Translate the sentences in quantified expressions of predicate logic, write down the
negated expression and then translate the negated expression in English. The predicates
to be used are given in parentheses.
Negation:
x (~problem(x) V ~ difficult(x)) =
Problem 12
Negation:
Translation: There is a student that studies discrete math and is not good at logic
Problem 13
No students are allowed to carry guns. (student(x), carry_gun(x))
Negation:
x, ~(student(x) ~carry_gun(x))) =
x, ~(~student(x) V ~carry_gun(x)) =
Problem 14
x (international_student(x) ~eligible(x))
Negation:
x, ~(international_student(x) ~eligible(x)) =
x, ~(~international_student(x) V ~eligible(x)) =
x, (international_student(x) eligible(x))
Problem 15
1. You get an A in this class, but you do not do every exercise in the book.
2. To get an A in this class, it is necessary for you to get an A on the final.
3. Getting an A on the final and doing every exercise in the book is sufficient for
getting an A in this class.
Solution to Problem 12
1. r^ ¬q
2. r => p
Think of the English being reworded to “ If you got an A in this class, you must
have gotten an A on the final. ”
3. p^q => r
Mathematical Induction
Problem 16
1 + 2 + 3 + ... + n = n (n + 1) / 2
Solution:
1 + 2 + 3 + ... + n = n (n + 1) / 2
Left Side = 1
Right Side = 1 (1 + 1) / 2 = 1
Both sides of the statement are equal hence p (1) is true.
STEP 2: We now assume that p (k) is true
1 + 2 + 3 + ... + k = k (k + 1) / 2
and show that p (k + 1) is true by adding k + 1 to both sides of the above
statement
1 + 2 + 3 + ... + k + (k + 1) = k (k + 1) / 2 + (k + 1)
= (k + 1)(k / 2 + 1)
= (k + 1)(k + 2) / 2
The last statement may be written as
1 + 2 + 3 + ... + k + (k + 1) = (k + 1)(k + 2) / 2
Which is the statement p(k + 1).
Problem 17:
Prove that
Solution
Left Side = 1 2 = 1
= (k + 1) [ k (2k + 1)+ 6 (k + 1) ] /6
Expand k (2k + 1)+ 6 (k + 1)
= (k + 1) [ 2k 2 + 7k + 6 ] /6
Now factor 2k 2 + 7k + 6.
= (k + 1) [ (k + 2) (2k + 3) ] /6
We have started from the statement P(k) and have shown that
1 2 + 2 2 + 3 2 + ... + k 2 + (k + 1) 2 = (k + 1) [ (k + 2) (2k + 3) ] /6
Which is the statement P(k + 1).
Problem 18:
1 3 + 2 3 + 3 3 + ... + n 3 = n 2 (n + 1) 2 / 4
Solution
1 3 + 2 3 + 3 3 + ... + n 3 = n 2 (n + 1) 2 / 4
Left Side = 1 3 = 1
Right Side = 1 2 (1 + 1) 2 / 4 = 1
hence p (1) is true.
STEP 2: We now assume that p (k) is true
1 3 + 2 3 + 3 3 + ... + k 3 = k 2 (k + 1) 2 / 4
add (k + 1) 3 to both sides
1 3 + 2 3 + 3 3 + ... + k 3 + (k + 1) 3 = k 2 (k + 1) 2 / 4 + (k + 1) 3
factor (k + 1) 2 on the right side
= (k + 1) 2 [ k 2 / 4 + (k + 1) ]
set to common denominator and group
= (k + 1) 2 [ k 2 + 4 k + 4 ] / 4
= (k + 1) 2 [ (k + 2) 2 ] / 4
We have started from the statement P(k) and have shown that
1 3 + 2 3 + 3 3 + ... + k 3 + (k + 1) 3 = (k + 1) 2 [ (k + 2) 2 ] / 4
Which is the statement P(k + 1).
Problem 19
Solution
Statement P (n) is defined by
n 3 + 2 n is divisible by 3
1 3 + 2(1) = 3
3 is divisible by 3
hence p (1) is true.
STEP 2: We now assume that p (k) is true
k 3 + 2 k is divisible by 3
is equivalent to
(k + 1) 3 + 2 (k + 1) = k 3 + 3 k 2 + 5 k + 3
= [ k 3 + 2 k] + [3 k 2 + 3 k + 3]
= 3 M + 3 [ k2 + k + 1 ] = 3 [ M + k2 + k + 1 ]
Hence (k + 1) 3 + 2 (k + 1) is also divisible by 3 and therefore statement P(k + 1)
is true.
Problem 20:
Prove that 3 n > n 2 for n = 1, n = 2 and use the mathematical induction to prove that 3 n >
n 2 for n a positive integer greater than 2.
Solution
3n > n2
STEP 1: We first show that p (1) is true. Let n = 1 and calculate 3 1 and 1 2 and
compare them
31 = 3
12 = 1
3 is greater than 1 and hence p (1) is true.
Let us also show that P(2) is true.
32 = 9
22 = 4
Hence P(2) is also true.
STEP 2: We now assume that p (k) is true
3k > k2
Multiply both sides of the above inequality by 3
3 * 3k > 3 * k2
The left side is equal to 3 k + 1. For k >, 2, we can write
2 k2 > 2 k + 1
We now add k 2 to both sides of the above inequality to obtain the inequality
3 k2 > k2 + 2 k + 1
Factor the right side we can write
3 * k 2 > (k + 1) 2
If 3 * 3 k > 3 * k 2 and 3 * k 2 > (k + 1) 2 then
3 * 3 k > (k + 1) 2
Rewrite the left side as 3 k + 1
3 k + 1 > (k + 1) 2
Which proves tha P(k + 1) is true
Problem 21:
Prove that n ! > 2 n for n a positive integer greater than or equal to 4. (Note: n! is n
factorial and is given by 1 * 2 * ...* (n-1)*n.)
Solution
n! > 2 n
STEP 1: We first show that p (4) is true. Let n = 4 and calculate 4 ! and 2 n and
compare them
4! = 24
2 4 = 16
24 is greater than 16 and hence p (4) is true.
STEP 2: We now assume that p (k) is true
k! > 2 k
Multiply both sides of the above inequality by k + 1
k! (k + 1)> 2 k (k + 1)
The left side is equal to (k + 1)!. For k >, 4, we can write
k+1>2
Multiply both sides of the above inequality by 2 k to obtain
2 k (k + 1) > 2 * 2 k
The above inequality may be written
2 k (k + 1) > 2 k + 1
We have proved that (k + 1)! > 2 k (k + 1) and 2 k (k + 1) > 2 k + 1 we can now write
(k + 1)! > 2 k + 1
We have assumed that statement P(k) is true and proved that statment P(k+1) is
also true.
Set Theory
Problem 22
In a room of 50 people whose dresses have either red or white color, 30 are wearing red
dress, 16 are wearing a combination of red and white. How many are wearing dresses that
have only white color?
Solution
Number of people wearing a red dress = 30
i.e., n(R) = 30
The total number of people in the room = number of people who are wearing dresses that
have either red or white color = n (R W) = 50.
We know,
n (R W) = n(R) + n(W) - n(R W)
50 = 30 + n(W) - 16
50 - 14 = n(W) - 16
n(W) = 36
i.e., the number of people who are wearing a white dress = 36.
Therefore, number of people who are wearing white dress only = n(W) - n(R W) = 36 -
16 = 20
Problem 23
:How many members of {1, 2, 3, ………….., 105} have nontrivial factors in common
with 105?
Solution
105 = 3 . 5. 7, so a number shares factors with 105 if and only if it is divisible by 3, 5, or
7.
Problem 24
Solution. Let A denote the set of students in algebra class and B denote the set of
students in biology class. To find the number of students in either class, we first add up
the students in each class:
|A| + |B|
However, this counts the students in both classes twice. Thus we have to subtract them
once:
-|A ∩ B|
This shows
|AUB|=|A| + |B|-|A ∩ B|
|AUB|=28 + 30 - 8 = 50
Problem 25
Solution.
Let A,B,C denote the set of students in algebra, biology, and chemistry class,
respectively. Then A U BU C is the set of students in one of the three classes, A∩B is
the set of students in both algebra and biology, and so forth. To count the number of
students in all three classes, i.e. count | A U BU C |, we can first add all the number of
students in all three classes:
|A| + |B|+|C|
However, now we've counted the students in two classes too many times. So we subtract
out the students who are in each pair of classes:
-|A ∩ B|-|A ∩ C|-|B ∩ C|
For students who are in two classes, we've counted them twice, then subtracted them
once, so they're counted once. But for students in all three classes, we counted them 3
times, then subtracted them 3 times. Thus we need to add them again:
|A∩B∩C|
Thus
55 = 28 + 30 + 24 - 8 - 16 - 5 + |A∩B∩C|
Thus |A∩B∩C| = 2, i.e. there are 2 students in all three classes.
Probabilty
Problem 26: A die is rolled, find the probability that an even number is obtained.
Solution
S = {1,2,3,4,5,6}
Let E be the event "an even number is obtained" and write it down.
E = {2,4,6}
Problem 27
Two coins are tossed, find the probability that two heads are obtained.
Note: Each coin has two possible outcomes H (heads) and T (Tails).
Solution
S = {(H,T),(H,H),(T,H),(T,T)}
E = {(H,H)}
Problem 28
A die is rolled and a coin is tossed, find the probability that the die shows an odd number
and the coin shows a head.
Solution
The sample space S of the experiment described in question 5 is as follows
S = { (1,H),(2,H),(3,H),(4,H),(5,H),(6,H)
(1,T),(2,T),(3,T),(4,T),(5,T),(6,T)}
Let E be the event "the die shows an odd number and the coin shows a head".
Event E may be described as follows
E={(1,H),(3,H),(5,H)}
Problem 29
A card is drawn at random from a deck of cards. Find the probability of getting a queen.
Solution
The sample space S of the experiment in question 7 is shwon above (see question
6)
Let E be the event "getting a Queen". An examination of the sample space shows
that there are 4 "Queens" so that n(E) = 4 and n(S) = 52. Hence the probability of
event E occuring is given by
P(E) = 4 / 52 = 1 / 13
Problem 30
A jar contains 3 red marbles, 7 green marbles and 10 white marbles. If a marble is drawn
from the jar at random, what is the probability that this marble is white?
Solution
We first construct a table of frequencies that gives the marbles color distributions as
follows
color frequency
red 3
green 7
white 10
= 10 / 20 = 1 / 2
Problem 31
Solution Answer
There are three possible cases that will satisfy the condition of forming three letter
passwords with at least 1 symmteric letter.
= {(11C1 * 15
C2) + (11C2 * 15
C1) + 11
C3} * 3!
= {11 * + * 15 + } x 6
= 2145 * 6 = 12870
Problem 32
A bag contains 5 yellow balls and 6 orange balls. When 4 balls are drawn at random
simultaneously from the bag, what is the probability that not all of the balls drawn are
orange?
Solution Answer
Sample Space (Denominator) : Four balls can be drawn from a bag containing 11 balls
11
in C4 ways
Event (Numerator) : The number of ways in which all four balls drawn will be orange =
6
C4.
Probability: The probability that all four balls drawn are orange
Therefore, the probability that not all of the balls drawn are orange = 1 - probability of all
four being orange
=>
=>
Problem 33
Functions
a. (x,y) f, and
b. (x,y1) f Λ (x,y2) f → y1 = y2
f : A → B,
f(a) = b , a A, b B
Examples:
Let A = {1,2,3}, B = {a,b}
S = {( 1,a ),( 1,b ),( 2,a ),( 3,b )} is not a function. Why?
Other Definitions:
Example:
domain: { 1, 2, 3},
range: { a, b }
a is image of 1 under f: f(1) = a, f(2) = ….. f(3) = ……
Problem 34
a. one-to-one
Example:
Let A = { 1, 2, 3 }, B = { a, b, c, d }
one-to-one function f = {( 1, a ), ( 2, c ), ( 3, b )}
b. onto
Example:
Let A = { 1, 2, 3 }, B = { a, b }
onto function f = {( 1, a ), ( 2, b ), ( 3, b )}
c. bijection
Example:
Let A = { 1, 2, 3 }, B = { a, b, c } bijection f = {( 1, a ), ( 2, c ), ( 3, b )}
d. Inverse function
Example:
Let A = { 1, 2, 3 }, B = { a, b, c }
f = {( 1, a ), ( 2, c ), ( 3, b )}
f -1 ={( a, 1 ), ( b, 3 ),( c, 2 )}
Problem 35
Composition of functions
Let f : A → B
f -1 ( f( a ) ) = a, f (f -1 ( b ) ) = b, a A, b B
For the inverse of a composition of two functions we have: :
(g f) -1 = f-1 g -1
Problem 36
Not a function:
Problem 37
R = {(a,1),(b,1),(c,3)} is a function.
The function is not onto, because the element 2 in B is not an image under the function.
Problem 38
R = {(a,1),(b,2),(c,5)} is a function.
The function is not onto, because the element 3 and 4 in B are not images
of elements in A under the function.
Problem 39
R = {(a,1),(b,1),(c,2),(d,3)} is a function.
Problem 40
Function, bijection:
R = {(a,1),(b,2),(c,3)} is a function.
The function is one-to-one because every two distinct elements in A
have distinct images in B.
Relations
Problem 41
A college cafeteria line has two stations: main courses and desserts.
The main course station offers spaghetti or fish; the dessert station offers pie or cake.
Three students Ann, Paul, and Tom, go through the line and make the following choices:
Tom X X X
Paul X X X
This table describes a relation between the set of persons {Ann, Tom, Paul} and the set
of food items {spaghetti, fish, pie, cake}
R = {(Ann, spaghetti), (Ann, pie),(Tom, fish), (Tom, pie), (Tom, cake),(Paul, spaghetti),
(Paul, fish), (Paul, pie) }
Problem 42
Problem 43
Problem 44
Ann X X
Tom X X X
Paul X X X
1010
0111
1110
Problem 45
R = {(x,y)| x Î A, y Î B, x < y}
S = {(x,y)| x Î A, y Î B, |x-y| = 2}
a. intersection of R and S:
b. union of R and S:
R È S = {(x,y) | xRy V xSy}
a. difference R - S, S - R:
R - S = {(3,4),(3,9),(5,9), (6,9)}
b. complementation:
Rc = {(x,y) | ~( xRy)}
Rc = E - R
Problem 46
b. other examples:
R is >, R-1 is < 5 > 8, 8 < 5
Problem 47
X: {1,3,5}
Y: {2,4,8}
Z :{2,3,6}
R = {(1,2),(1,4),(1,8),(3,4),(3,8),(5,8)}
S = {(2,3),(2,6),(4,6)}
The element (1,3) is formed by combining (1,2) from R and (2,3) from S
The element (1,6) is formed by combining (1,2) from R and (2,6) from S
Note, that (1,6) can also be obtained by combining (1,4) from R and (4,6)
from S.
The element (3,6) is formed by combining (3,4) from R and (4,6) from S
Problem 48
Reflexive relations
Definition
Let R be a binary relation on a set A.R is reflexive, iff for all x Î A, (x,x) Î R, i.e. xRx is
true.
Examples:
Problem 49
Example:
A:= {1,2,3}
R = {(1,1),(1,2),(1,3),(2,2),(2,3),(3,3)}
Problem 50
1 1 2 3
1 1 0 0
2 0 1 0
3 0 0 1
Problem 51
R1 is a reflexive relation. R2 ? R3 ?
Definition:
Definition:
Let R be a binary relation on a set A.
R is neither reflexive, nor irreflexive iff
there is x Î A, such that (x, x) Î R, and there is y Î A such that (y, y) Ï R
Summary
Problem 52
Symmetric relations
Definition
This means: if two elements x and y are in relation R, then y and x are also in R,
i.e. if xRy is true, yRx is also true.
Examples:
Problem 53
Problem 54
Problem 55
Summary
Problem 56
Transitive relations
Definition
Examples:
Problem 57
Problem 58
Consider the set T of all triangles and relation R = {(x,y)| x and y have equal angles}
R is an equivalence relation. It has the three properties:
1. Reflexivity xRx
2. Symmetry: If xRy then yRx
3. Transitivity: If xRy and yRz, then xRz
Problem 59
Consider the set P of all persons and the relation R "having same age".
R is a relation of equivalence:
Problem 60
a. Consider the set S of all students in a college and the relation R "having the same
advisor".
R is a relation of equivalence:
b. Consider the set of all people and the relation R having same first name.
R is a relation of equivalence.
c. Consider the set of all English words and the relation
R = {(a,b)| a and b have same number of letters. R is a relation of
equivalence.
Problem 61
Consider the power set of a set A = {a, b, c} and the relation R defined on the power set
of A. R = {(Ai,Aj)| Ai. Aj}. R is a partial order. It is not a total order.
1. If we eliminate the links implied by the transitivity, we get a simpler
diagram, called Hasse diagram:
Hasse Diagram
As with the functions and relations there is a convenient graphical rept of partial order –
Hasse diagram.
Consider digraph representation of partial order-means relation must be reflexive and
transitive. Thus we can simplify the graph as follows:
Remove all self loops
Remove all transitive edges
Make the graph direction less-that is ,we can assume that the orientation is
upwards
Lattices
Definition:
A poset is a lattice if every pair of elements has a lub (join) and a glb (meet).
Theorem:
Let <L, ≤> be a lattice, For any a, b, c L,
(i) a*a=a (i') a+a=a (idempotent)
(ii) a*b=b*a (ii') a+b=b+a (Commutative)
Theorem:
− Let <L, ≤> be a lattice for any a, b L, the following
property holds.
a≤ ba*b=a a+b=b
Theorem:
− Let <L, ≤> be a lattice, For any a, b, c L, the following
properties hold.
Theorem:
− Let <L, ≤> be a lattice, For any a, b, c L, the following
properties hold.
a≤b ^ a≤c => a≤b+c
a≤b ^ a≤c =>a≤b*c
b≤a ^ c≤a =>b*c ≤a
b≤a ^ c≤a => b+c≤a
Theorem:
− Let < L, ≤> be a lattice, For any a, b, c L, the
following inequalities hold.
a+(b*c)≤(a+b)*(a+c)
(a*b)+(a*c)≤a*(b+c)
Theorem:
Let <A, *, +> be an algebra which satisfies the
1. Idempotent law, (a*a=a, a+a=a)
2. Commutative law, (a*b=b*a, a+b=b+a)
3. Associative law, ( (a*b)*c= a*(b*c), (a+b)+c= a+(b+c) )
4. Absorption law ( a*(a+b)=a, a+(a*b)=a )
Then there exists a lattice <A, ≤>, such that * is a glb, + is a lub,
and is ≤ defined as follows:
x≤y iff x*y=x
Definitions
Algebraic system :A lattice is an algebraic system <L, *, +> with two binary operations
* and + on L which are both (1) commutative and (2) associative and (3) satisfy the
absorption law.
Sublattice : Let <L, *, +> be a lattice and let S be a subset of L. The algebra <S, *, +> is
a sublattice of <L, *, +> iff S is closed under both operations * and +.
Lattice homomorphism: Let <L, *, +> and <S, ^,V> be two lattice. A mapping g:L→S
is called a lattice homomorphism from the lattice <L, *, +> to <S, ^ , V > if for any a,
bL,
g(a*b)=g(a) ^ g(b) and g(a+b)=g(a) V g(b).
Order-preserving :Let <P, ≤> and <Q, ≤'> be two partially ordered sets, A mapping f: P
→ Q is said to be order-preserving relative to the ordering ≤ in P and ≤' in Q iff for any
a,bP such that a≤ b, f(a) ≤' f(b) in Q.
Complete Lattice: A lattice is called complete if each of its nonempty subsets has a least
upper bound and a greatest lower bound.
Bounds of the lattice :The least and the greatest elements of a lattice, if they exist, are
called the bounds of the lattice, and are denoted by 0 and 1 respectively.
Distributive lattice :A lattice <L, *, +> is called a distributive lattice if for any a, b, c
L, a*(b+c)=(a*b)+(a*c) a+(b*c)=(a+b)*(a+c)
Problem 62
The digraph is
In the above Hasse diagram, is a minimal element and {a, b, c} is a maximal element.
In the poset above {a, b, c} is the greatest element. is the least element.
In the poset above, {a, b, c}, is an upper bound for all other subsets. is a lower bound
for all other subsets.
{a, b, c}, {a, b} {a, c} and {a} are upper bounds and {a} is related to all of them, {a}
must be the lub. It is also the glb.
Problem 63
In the poset (P(S), ), lub(A, B) = A B. What is the glb(A, B)?
Solution:
Consider the elements 1 and 3.
• Upper bounds of 1 are 1, 2, 4 and 5.
• Upper bounds of 3 are 3, 2, 4 and 5.
• 2, 4 and 5 are upper bounds for the pair 1 and 3.
• There is no lub since
- 2 is not related to 4
- 4 is not related to 2
- 2 and 4 are both related to 5.
• There is no glb either.
The poset is n o t a lattice.
Problem 64
Determine whether the posets represented by each of the following Hasse diagrams have
a greatest element an a least element.
Discrete Mathematics
Solution
• The least element of the poset with Hasse diagram (a) is a. This poset has no greatest
element.
• The poset with Hasse diagram (b) has neither a least nor a greatest element.
• The poset with Hasse diagram (c) has no least element. Its greatest element is d.
• The poset with Hasse diagram (d) has least element a and greatest element d.
Problem 65
Find the lower and upper bounds of the subsets {a, b, c}, {j, h}, and {a, c, d, f } and find
the greatest lower bound and the least upper bound of {b, d, g}, if they exist.
Solution
The upper bounds of {a, b, c} are e, f, j, h, and its only lower bound is a.
There are no upper bounds of {j, h}, and its lower bounds are a, b, c, d, e, f .
The upper bounds of {a, c, d, f } are f, h, j, and its lower bound is a.
The upper bounds of {b, d, g} are g and h. Since g _ h, g is the least upper bound.
The lower bounds of {b, d, g} are a and b. Since a _ b, b is the greatest lower bound.
Problem 66
Determine whether the posets represented by each of the following Hasse diagrams are
lattices.
Solution
The posets represented by the Hasse diagrams in (a) and (c) are both lattices because in
each poset every pair of elements has both a least upper bound and a greatest lower
bound.
On the other hand, the poset with the Hasse diagram shown in (b) is
not a lattice, since the elements b and c have no least upper bound. To see this note that
each of the elements d, e and f is an upper bound, but none of these three elements
precedes the other two with respect to the ordering of this poset.
Problem 67