Labmanaul
Labmanaul
Labmanaul
b) {−3,−2,−1,0,1,2,3}
c) P(∅)
a) {a}
b) {{a}}
c) {a,{a}}
d) {a,{a},{a,{a}}}
5- Find the power set of each of these sets, where a and b are
distinct elements.
a) {a}
b) {a,b}
c){{∅},∅ }
b) Q(x): 𝑥 2 =2
c) R(x): x<𝑥 2
b) A∩B.
c) A−B.
.d) B −A
A∩B ∩C = A∪B ∪C
9- Show that if A and B are sets, then
A−B = A∩B
10-Why is f not a function from R to R if
a) f(x)=1/x?
c) f(x)=±sqrt( 𝑥 2 +1)?
11- Find the domain and range of these functions. Note that in
each case, to find the domain, determine the set of elements
assigned values by the function
b) the function that assigns to each bit string twice the number
of zeros in that string
12- Find the domain and range of these functions. Note that in
each case, to find the domain, determine the set of elements
assigned values by the function.
section 2
1- Give an example of a function from N to N that is
a) 𝑓 −1 ({1}).
b) 𝑓 −1 ({x |0 <x<1}).
c) 𝑓 −1 ({x | x>4})
3-Find these values.
a)⌊1.1⌋
b) ⌊-0.1⌋
c) ⌈1.1⌉
d) ⌈-0.1⌉
G) ⌊1/2+⌈-0.1⌉+1/2⌋
h) ⌈1/2+⌊-0.1⌋+1/2⌉
3 2
.b) f(m,n) = 𝑛 −𝑛
.c) f(m,n) = m
6- Determine whether each of these functions is a bijection
from R to R.
a) f(x)=− 3x +4
b) f(x)=− 3x2 +7
7-Let S ={− 1,0,2,4,7}. Find f(S)if
a) f(x)=1.
b) f(x)=2x +1.
c) f(x)= ⌈x/5⌉
b) 𝑎1
c) 𝑎4
d) 𝑎5
b) 𝑎𝑛 = 𝑎𝑛−1 2 , a1 =2
b) ∑𝑠𝑗∈𝐬 j2
𝑠
c) ∑𝑗∈𝐬(1/j)
d) ∑𝑠𝑗∈𝐬 1
2-Find the value of each of these sums.
8
a) ∑𝑗=𝟎(1 + (−1)2 )
8
b) ∑𝑗=𝟎 3𝑗 + 2𝑗
.3-Compute each of these double sums
3
2
a) ∑ ∑𝑗=𝟎(𝑖 − 𝑗)
𝑖 =𝟎
3
2
b) ∑ ∑𝑗=𝟎(𝑗)
𝑖 =𝟎
3
2
c) ∑ ∑𝑗=𝟎(𝑖 2 𝑗 3 )
𝑖 =𝟎
4- Show that the set of all integers is countable
a) a=b
. b) a+b =4.
c) a>b
a) {(2,2),(2,3),(2,4),(3,2),(3,3),(3,4)}
b) {(1,1),(1,2),(2,1),(2,2),(3,3),(4,4)}
c) {(2,4),(4,2)} d) {(1,2),(2,3),(3,4)}
e) {(1,1),(2,2),(3,3),(4,4)}
10-let R1={(1,2),(2,3),(3,4)}and
R2={(1,1),(1,2),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3),(3,4)}
Find
a) R1 ∪R2.
b) R1 ∩R2.
c) R1 −R2.
d) R2 −R1.
11-Let R1 and R2 be the “divides” and “is a multiple of”
relations on the set of all positive integers, respectively. That is,
R1 ={(a,b) | a divides b}and R2 ={(a,b) | a is a multiple of b}.
Find
a) R1 ∪R2.
b) R1 ∩R2.
c) R1 −R2.
d) R2 −R1.
.Find S ◦R
****************************************************
Section 4
1-List the triples in the relation {(a,b,c)| a,b, and c are integers
with 0 <a<b<c<5}
a) {(1,1),(1,2),(1,3)}
b) {(1,2),(2,1),(2,2),(3,3)}
c) {(1,1),(1,2),(1,3),(2,2),(2,3),(3,3)}
d) {(1,3),(3,1)}
4-List the ordered pairs in the relations on{1,2,3}corresponding
to these matrices (where the rows and columns correspond to
.the integers listed in increasing order)
a)
1 0 1
0 1 0
1 0 1
b)
0 1 0
0 1 0
0 1 0
c)
1 1 1
1 0 1
1 1 1
𝑀𝑅 = 1 1 0
1 0 1
a) 𝑅 −1 .
b) R.
. c) 𝑅 2
5- Let R1 and R2 be relations on a set A represented by the
matrices
0 1 1
𝑀𝑅1 = 1 1 0
1 0 1
0 1 1
𝑀𝑅2 = 1 1 0
1 0 1
a) R1 ∪R2
b) R1 ∩R2
c) R2◦R1
d) R1◦R1
0 1 0
𝑀𝑅 = 0 0 1
1 1 0
a) R2.
b) R3.
c) R4.
7-Draw the directed graph that represents the relation
{(a,a),(a,b),(b,c),(c,b),(c,d),(d,a), (d,b)}
8-list the ordered pairs in the relations represented by the
directed graphs
9-Let R be the relation on the set {0,1,2,3} containing the
ordered pairs (0,1), (1,1), (1,2), (2,0), (2,2), and (3,0).
Find the
a) reflexive closure of R.
b) symmetric closure of R
********************************
section5
1-Use Warshall’s algorithm to find the transitive closures of the
relations
a) {(1,2),(2,1),(2,3),(3,4),(4,1)}
b) {(2,1),(2,3),(3,1),(3,4),(4,1),(4,3)}
c) {(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}
a) {(0,0),(1,1),(2,2),(3,3)}
b) {(0,0),(0,2),(2,0),(2,2),(2,3),(3,2),(3,3)}
c) {(0,0),(1,1),(1,2),(2,1),(2,2),(3,3)}
d) {(0,0),(1,1),(1,3),(2,2),(2,3),(3,1),(3,2), (3,3)}
e) {(0,0),(0,1),(0,2),(1,0),(1,1),(1,2),(2,0), (2,2),(3,3)}
3-determine whether the relation with the directed graph
shown is an equivalence relation.
4-Determine whether the relations represented by these zero–
one matrices are equivalence relations.
a) 1 1 1
0 1 1
1 1 1
b) 1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1
5-Which of these collections of subsets are partitions of
{1,2,3,4,5,6}?
a) {1,2},{2,3,4},{4,5,6}
b) {1},{2,3,6},{4},{5}
c) {2,4,6},{1,3,5}
d) {1,4,5},{2,6}
a) {−3,−1,1,3},{−2,0,2}
b) {−3,−2,−1,0},{0,1,2,3}
c) {−3,3},{−2,2},{−1,1},{0}
d) {−3,−2,2,3},{−1,1}
a) {0},{1,2},{3,4,5}
b) {0,1},{2,3},{4,5}
c) {0,1,2},{3,4,5}
d) {0},{1},{2},{3},{4},{5}
a) {a,b},{c,d},{e,f,g}
b) {a},{b},{c,d},{e,f},{g}
c) {a,b,c,d},{e,f,g}
d) {a,c,e,g},{b,d},{f}
{(a,b),(a,c), (d,e)}.
Section 5
1-Determine whether these biconditionals are true or false.
a) p∧¬p
b) p∨¬p
c) (p∨¬q)→ q
d) (p∨q)→ (p∧q)
f) (p → q)→ (q → p)
a) p →¬p
b) p ↔¬p
c) p⊕(p∨q)
d) (p∧q)→ (p∨q)
e) (q →¬p)↔ (p ↔ q)
f) (p ↔ q)⊕(p ↔¬q)
a) p →¬p
b) (p∨¬r)∧(q ∨¬s)
c) q ∨p∨¬ s ∨¬ r ∨¬ t ∨ u
(r ∨¬p) is true when p, q, and r have the same truth value and it
is false otherwise.
a) if x +2=3 then x := x +1
b) if (x +1=3) OR (2x +2=3) then x := x +1
e) if x<2 then x := x +1
10-Find the bitwise OR, bitwise AND, and bitwise XOR of each
of these pairs of bit strings.
12- You can see the movie only if you are over 18 years old or
you have the permission of a parent. Express your answer in
terms of m:“Youcanseethemovie,” e:“Youare over 18 years
old,” and p: “You have the permission of a parent.”
a) p∧T≡ p
b) p∨F≡ p
c) p∧F≡F
d) p∨T≡T
e) p∨p ≡ p
f) p∧p ≡ p