Labs

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

LAB 1

SET THEORY
1. Suppose that A is the set of sophomores at your school and B is the set of
students in discrete mathematics at your school. Express each of these sets in
terms of A and B.

a) The set of sophomores taking discrete mathematics in your school.


b) The set of sophomores at your school who are not taking discrete mathe-
matics.
c) The set of students at your school who either are sophomores or are taking
discrete mathematics.
d) The set of students at your school who either are not sophomores or are
not taking discrete mathematics.

2. Let A = {a, b, c, d, e} and B = {a, b, c, d, e, f, g, h}. Find

a) A ∪ B. c) A − B.
b) A ∩ B. d) B − A.

3. Find the sets A and B if A − B = {1, 5, 7, 8}, B − A = {2, 10}, and


A ∩ B = {3, 6, 9}.
4. Find the power set of the set {a, {b}}.
5. The successor of the set A is the set A ∪ {A}. Find the successors of the
following sets.

a) {1, 2, 3}. c) {∅}.


b) ∅. d) {∅, {∅}}.

6. At a department store, there are 212 customers. Suppose 93 have purchased


shirts, 86 have purchased pants, and 68 have purchased neither. How many
purchased both shirts and pants?
7. Show that if A, B and C are sets, then A ∩ B ∩ C = A ∪ B ∪ C

a) by showing each side is a subset of the other side.


b) using a membership table.
2

LAB 2
FUNCTIONS
1. Does there exist

a) a bijection/ one-to-one/ onto function from a set of 8 elements to a set of


6 elements?
b) a bijection/ one-to-one/ onto function from a set of 6 elements to a set of
8 elements?
c) a bijection from the set of even integers to the set of odd integers?
d) a bijection from the set of odd inetegers to the set of all integers?

Explain your answer.


2. Find the inverse functions of the following functions:

a) f : R → R, f (x) = −3x + 6.

b) f : [−3, +∞) → [0, +∞), f (x) = x + 3.

3. Is g = f −1 ?

a) Assume f (x) = x3 − 4 and g(x) = 3
x + 4.
x
b) Suppose f (x) = x3 and g(x) = .
3
4. Let f, g : R → R be defined as

3x + 1 if x < 0


f (x) =  and g(x) = 5x − 7.
x2

+5 if x ≥ 0

Find g ◦ f .
5. Let h(x) = (f ◦ g)(x)

a) Assume g(x) = x − 1 and h(x) = 3x + 2. Find f (x).


b) Suppose h(x) = 3x + 2 and f (x) = x − 1. Determine g(x).
3

LAB 3
GRAPHS
1. Do there exist simple graphs with 5 vertices of degrees:

a) 1, 7.
b) 1, 2, 3, 3, 4.
c) 2, 3, 3, 3, 3.

2. Use an incidence matrix to represent the following graphs

a b a b
a b

c d
c d c d

3. How many edges each of the graphs Kn , Cn , Wn , Qn , Kmn has?


4. Which graphs Kn , Cn , Wn , Qn are bipartite? Explain your answer.
5. For what values of m, n do the special graphs Kn , Cn , Wn , Qn , Kmn has Hamil-
ton paths/circuits? Explain your answer.
6. Determine whether the given graph has an Euler circuit. Construct such a
circuit when one exists. If no Euler circuit exists, determine whether the graph
has an Euler path and construct such a path if one exists.

a b

e d
4

LAB 4
GRAPHS (Continue)
1. Find the length of a shortest path between a and z in the given weighted
graph.

5 5
b d f
4 7

a 2 3 1 2 z

3 4
c e g
6 5

g 8
d
8
4 5 4
10 z
3 7
a b e
6
9 1 4 5

c f
6

2. Find a route with the least total airfare that visits each of the cities in
this graph, where the weight on an edge is the least price available for a flight
between the two cities.

Detroit
$329 $18
9
$359
29
49 $2 $279 New York
$179 $3
San Francisco
Denver
9
$69 $20 $379

Los Angeles
5

3. What are the chromatic numbers of Wn and Kn ?


4. Take into account the following two questions and explain your answer.

a) Determine the values of n for which the complete graph Kn is planar.


b) Identify the values of m and n for which the complete bipartite graph Km,n
is planar.

5. You are managing a conference with six workshops: W1 , W2 , W3 , W4 , W5 , W6 .


The workshops have the following constraints:

• W1 and W2 cannot run simultaneously.


• W3 and W4 must be scheduled back-to-back.
• W5 and W6 should not be scheduled at the same time.

Determine a schedule for the workshops while adhering to the given constraints.
Assign each workshop to a time slot (1, 2, or 3) based on the constraints.
6

LAB 5
TREES
1. Consider the following questions.

a) How many edges does a tree with 10, 000 vertices have?
b) How many edges does a full binary tree with 1000 internal vertices have?
c) How many leaves does a full 3-ary tree with 100 vertices have?
d) How many vertices does a full 5-ary tree with 100 internal vertices have?

2. Either draw a full m-ary tree with 84 leaves and height 3, where m is a
positive integer, or show that no such tree exists.
3. Use depth-first search to produce a spanning tree for the given simple graph.
Choose a as the root of this spanning tree and assume that the vertices are
ordered alphabetically.

a e h i

c d

b f g j

4. Use backtracking to find a subset, if it exists, of the set {5, 10, 15, 20, 25, 30}
with a sum of 45.
5. Use Kruskal’s algorithm to find a minimum spanning tree for the following
weighted graph.

a 5 b 4 c

2 3 5 6 3
7 e 1
d f

6 3 4
8 4

g 4 h 2 i
7

LAB 6
BOOLEAN ALGEBRA
1. Use a table to express the values of the given Boolean function
F (x, y, z) = x(yz + ȳz̄).

2. Simplify the following Boolean expression


(x + y)(x̄ + y).

3. Find the sum-of-products expansion of the Boolean function F (w, x, y, z)


that has the value 1 if and only if an odd number of w, x, y, and z have the
value 1.
4. Find the sum-of-products expansions of the following Boolean functions.
F (x, y, z) = x and G(x, y, z) = (x + z)y.

5. Show that
x + y = (x ↓ y) ↓ (x ↓ y).

6. Find the output of the given circuits.

(a)

(b)

7. Show how the sum of two five-bit integers can be found using full and half
adders.
8

LAB 7
BOOLEAN ALGEBRA (Continue)
1. Find the sum-of-products expansions represented by each of these K-maps.

2. Draw a K-map for a function in three variables. Put a 1 in the cell that
represents x̄yz̄. Which minterms are represented by cells adjacent to this cell?
3. Construct a K-map for

F (x, y, z) = xz̄ + xyz + yz̄.

Use this K-map to find the implicants, prime implicants, and essential prime
implicants of F (x, y, z).
4. Draw a K-map for a function in four variables. Put a 1 in the cell that
represents w̄xyz̄. Which minterms are represented by cells adjacent to this
cell?
5. Use the Quine-McCluskey method to simplify the following sum-of-products
expansions
x̄yz + x̄ȳz.
9

LAB 8
ABSTRACT ALGEBRA
1. Describe the distinguishing characteristics of different binary operations that
are performed on the same set. Provide examples to illustrate how these op-
erations impact the set and discuss any unique properties that emerge in each
case.
2. Check whether the operations applied to the appropriate sets qualify as
binary operations.

a) Addition on the set of natural numbers.

+: N×N→N
(x, y) 7→ x + y.

b) Multiplication on the set of integers.

·: Z×Z→Z
(x, y) 7→ x · y.

3. Consider the binary operations ∗ and ◦ defined on the set of integers as


follows:

• For any integers m and n, m ∗ n is the maximum of m and n.


• For any integers m and n, m ◦ n is the minimum of m and n.

Create the operation tables for these binary operations on the set {1, 2, 3}.
4. Let G be the additive group of integers modulo 8, denoted as Z8 , and let H
be the subgroup generated by the element 2. Find

(a) the order of the group G.


(b) the order of the subgroup H.

5. Let V be an n-dimensional vector space over R, let GL(V ) denote the set
of all bijective linear transformations of V . Prove that GL(V ) is a group under
composition.
10

LAB 9
ABSTRACT ALGEBRA (Continue)
1. Let G and H be groups, and let ϕ : G → H be a group homomorphism.
Which of the following statements is always true?

a) ϕ(eG ) = eH , where eG and eH are the identity elements of G and H,


respectively.
b) ϕ(g −1 ) = ϕ(g)−1 for all g ∈ G.
c) ϕ(g1 g2 ) = ϕ(g1 )ϕ(g2 ) for all g1 , g2 ∈ G.
d) If ϕ is injective, then ker(ϕ) = {eG }, where ker(ϕ) is the kernel of ϕ.

2. Let (Z, +) be the additive group of integers and 3Z its subgroup. Consider
the function f defined by

f : Z → 3Z
a 7→ f (a) = 3a.

a) Prove that f is a group homomorphism.


b) Determine ker(f ) and im(f ). Is f an isomorphism? Explain your answer.

3. Determine whether the following set together with the binary operation is a
semigroup, a monoid or neither. If it is a monoid, specify the identity. If it is a
semigroup or a monoid determine whether it is commutative.

a) A is the set of all positive integers where a ∗ b = max{a, b}.


b) B is the set of integers where a ∗ b = a + b − ab.
c) C = {1, 2, 3, 6, 12} where a ∗ b = gcd(a, b).

4. Encrypt the message SECRET using the RSA cryptosystem with the public
key (8693, 29).

You might also like