






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Answer of Question 1 [1 7 mark]
1 - Use the graph in Figure 1 to answer the questions that follow.
a. Is the graph simple?
Yes, the given graph is simple since it does not have loops and parallel
arcs.
b. Is the graph complete? Figure 1.
No, since not all the nodes are adjacent.
c. Is the graph connected?
Yes, the given graph is connected.
d. Can you find two paths from 3 to 6?
e. Can you find a cycle?
2 - Use the directed graph in Figure 2 to answer the questions that
follow.
a. Which nodes are reachable from node 3?
The nodes which are reachable from node 3 are 4, 5, and 6.
b. What is the length of the shortest path from node 3 to node 6? Figure 2.
The length of the shortest path from node 3 to node 6 is 2.
c. What is a path from node 1 to node 6 of length 8?
A path from node 1 to node 6 of length 8 is 1 → 2 → 1 → 2 → 2 → 3 → 4 → 5 → 6.
3 - Decide if the two graphs In Figure 3 are isomorphic. If so, give the function or functions that
establish the isomorphism; if not, explain why.
Yes the two graphs given in Figure 3 are isomorphic since we can find two bijection functions
concerned with the nodes and the edges, which are 𝑓
1
and 𝑓
2
, respectively,
1
2
1
2
2
7
3
6
4
1
5
3
6
4
7
5
Figure 3. Figure 4.
4 - Verify Euler’s formula for the simple, connected, planar graph in Figure 4, and write the
adjacency matrices for the graphs given in Figures 1, 2.
Euler’s formula for the simple, connected, planar graphs is 𝑛 − 𝑎 + 𝑟 = 2 , where 𝑛 is the number of
the nodes, 𝑎 the number of the arcs, and 𝑟 the number of the regions (faces). For the graph in Figure
4 , 𝑛 = 13 , 𝑎 = 19 , 𝑟 = 8 , hence 13 − 19 + 8 = 2.
The adjacency matrix for the graph in Figure 2 is
5 - Draw the graph represented by the following adjacency matrix [
The output sequence for the input sequence 011011010.
Time 𝑡
0
1
2
3
4
5
6
7
8
9
Input 0 1 1 0 1 1 0 1 0 -
State 𝑠
0
0
1
3
3
3
3
3
3
3
Output 0 0 0 0 0 0 0 0 0 0
3 - Determine whether the given machine in Figure 6 recognizes the given input string 01 1. Also,
give a regular expression for the set recognized by the finite-state machine in Figure 7.
Time 𝑡
0
1
2
3
Input 0 1 1 −
State 𝑠
0
1
0
2
Output 1 0 1 0
This machine can not recognize the given input string 011.
Figure 6.
Figure 7.
A regular expression for the set recognized by the finite-state machine in Figure 7 is 0*.
Question 3 [1 7 mark]
1 - Answer the following questions about the accompanying graph (Figure 8) with node 𝑎 as the
root.
a. Is it a binary tree?
Yes, it is a binary tree.
b. Is it a full binary tree?
No, it is not a full binary tree.
c. Is it a complete binary tree?
Yes, it is a complete binary tree.
d. What is the depth of 𝑔?
The depth of 𝑔 is 2.
e. What is the height of the tree?
The height of the tree is 3.
f. Give the left child-right child array representation. Figure 8.
Node Left-child Right-child
g. Do a preorder, inorder, and postorder traversal for the given tree.
P Preorder:- (root-left-right)
Inorder:- (left- root-right)
Postorder:- (left-right- root)
2 - Let 𝜌 be a binary relation on a set 𝑆 = { 3 , 𝑎, 𝑏, 𝑑, 𝑒} defined by
4 - A committee of 3 members is to be formed consisting of one representative each from labor,
management, and the public. If there are 3 possible representatives from labor, 2 from
management, and 3 from the public, determine how many different committees can be formed
using a decision tree.
1
2
3
1
1
1
2
2
2
2 2 2 2 2 2
1
1
1
1
1
1 3 3 3 3 3 3
Question 4 [1 8 mark]
1 - The encoding function 𝐸: ℤ
2
2
2
5
is given by the generator matrix.
a. Determine all code words. What can we say about the error-detection capability of this
code? What about its error-correction capability?
1
1
2
2
3
3
4
4
By comparing the code words, we can deduce that 𝑑
𝑚𝑖𝑛
= 3. Then 𝑑
𝑚𝑖𝑛
= 𝑘 + 1 = 3 , 𝑘 = 2 , and
we can detect up to 2 errors. Also, 𝑑
𝑚𝑖𝑛
= 2 𝑛 + 1 , 3 = 2 𝑛 + 1 , 𝑛 = 1 , we can correct a single error.
b. Find the associated parity-check matrix 𝐻.
𝑡𝑟
c. Use 𝐻 to decode each of the following received words.
i) 11011 ii) 10101 iii) 00110
For i) 𝑟
1
𝑡𝑟
The result is equal to the first column of 𝐻, hence there is an error in the first bit, i.e.,
1
1
1
= 11011 +10000 = 01011, hence 𝑤
1
For ii) 10101, 𝐻. 𝑟
𝑡𝑟
The result is equal to the second column of 𝐻, hence there is an error in the second bit, i.e.,
8
8
b. Find the minimum distance between the code words.
By comparing the code words, we can deduce that 𝑑
𝑚𝑖𝑛
c. Discuss the error-detecting and error-correcting capabilities of each code.
𝑚𝑖𝑛
= 𝑘 + 1 = 2 , 𝑘 = 1 , and we can detect up to one error. Also, 𝑑
𝑚𝑖𝑛
1
2
hence, the code has the capability of correcting no errors.
3 - A binary symmetric channel has probability 𝑝 = 0. 04 of incorrect transmission. If the code word
𝑐 = 011011101 is transmitted, what is the probability that (a) we receive 𝑟 = 011011101? (b) we
receive 𝑟 = 111011100? (c) a single error occurs? (d) a double error occurs?
For (a) 𝑟 = 011111101 , there is one error, hence the probability of 𝑟 = ( 0. 04 )
0
9
For (b) 𝑟 = 111011100 , there is two errors, hence the probability of 𝑟 = ( 0. 04 )
2
7
For (c) the probability of occurring a single error = (
1
8
For (d) the probability of occurring a double error = (
2
7