0% found this document useful (0 votes)
70 views9 pages

Cat 2 Attempted

this paper has got very good insights and reasonable research has been carried out to help the users of the document get deep knowledge on the matter

Uploaded by

MAGOMU DAN DAVID
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views9 pages

Cat 2 Attempted

this paper has got very good insights and reasonable research has been carried out to help the users of the document get deep knowledge on the matter

Uploaded by

MAGOMU DAN DAVID
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

CAVENDISH UNIVERSITY UGANDA

CAT 2
DISCRETE MATHEMATICS
BIT 110
Answer ALLquestions.

Instructions

 To be attempted by only the online students.


 Any physical student/day who attempts the questions won’t receive the marks.

Trees in discrete mathematics

1. Define a tree and state its properties.(5mks)

Tree is a discrete structure that represents hierarchical relationships between individual elements or
nodes. A tree in which a parent has no more than two children is called a binary tree.

Tree and its Properties

Definition − A Tree is a connected acyclic undirected graph. There is a unique path between
every pair of vertices in G. A tree with N number of vertices contains (N-1) number of edges.
The vertex which is of 0 degree is called root of the tree. The vertex which is of 1 degree is
called leaf node of the tree and the degree of an internal node is at least 2.

Example − The following is an example of a tree −


Centers and Bi-Centers of a Tree

The center of a tree is a vertex with minimal eccentricity. The eccentricity of a vertex X in a tree
G is the maximum distance between the vertex X and any other vertex of the tree. The
maximum eccentricity is the tree diameter. If a tree has only one center, it is called Central Tree
and if a tree has only more than one centers, it is called Bi-central Tree. Every tree is either
central or bi-central.

Unlabeled Trees

Definition − An unlabeled tree is a tree the vertices of which are not assigned any numbers. The
number of labeled trees of n number of vertices is (2n)!(n+1)!n!(2n)!(n+1)!n! (nth Catalan number)

Example
Binary Search Tree

Binary Search tree is a binary tree which satisfies the following property −

 X in left sub-tree of vertex V, Value(X) ≤ Value (V)


 Y in right sub-tree of vertex V, Value(Y) ≥ Value (V)
So, the value of all the vertices of the left sub-tree of an internal node V are less than or equal to
V and the value of all the vertices of the right sub-tree of the internal node V are greater than or
equal to V. The number of links from the root node to the deepest node is the height of the
Binary Search Tree.

Example
2. Explain the algorithm to find the center and bi-center of a tree. (5mks)

Algorithm to find centers and bi-centers of a tree

Step 1 − Remove all the vertices of degree 1 from the given tree and also remove their incident
edges.

Step 2 − Repeat step 1 until either a single vertex or two vertices joined by an edge is left. If a
single vertex is left then it is the center of the tree and if two vertices joined by an edge is left
then it is the bi-center of the tree.

Problem 1

Find out the center/bi-center of the following tree −


Solution

At first, we will remove all vertices of degree 1 and also remove their incident edges and get the
following tree −

Again, we will remove all vertices of degree 1 and also remove their incident edges and get the
following tree −

Finally we got a single vertex 'c' and we stop the algorithm. As there is single vertex, this tree
has one center 'c' and the tree is a central tree.
Problem 2

Find out the center/bi-center of the following tree −

Solution

At first, we will remove all vertices of degree 1 and also remove their incident edges and get the
following tree −

Again, we will remove all vertices of degree 1 and also remove their incident edges and get the
following tree −

Finally, we got two vertices 'c' and 'd' left, hence we stop the algorithm. As two vertices joined
by an edge is left, this tree has bi-center 'cd' and the tree is bi-central.
3. Explain the following (5mks)
a) Labelled trees

A labeled tree is a tree the vertices of which are assigned unique numbers from 1 to n. We can
count such trees for small values of n by hand so as to conjecture a general formula. The number
of labeled trees of n number of vertices is nn-2. Two labeled trees are isomorphic if their graphs
are isomorphic and the corresponding points of the two trees have the same labels.

Example

b) Rooted trees

A rooted tree G is a connected acyclic graph with a special node that is called the root of the tree
and every edge directly or indirectly originates from the root. An ordered rooted tree is a rooted
tree where the children of each internal vertex are ordered. If every internal vertex of a rooted
tree has not more than m children, it is called an m-ary tree. If every internal vertex of a rooted
tree has exactly m children, it is called a full m-ary tree. If m = 2, the rooted tree is called a
binary tree.
4. Explain the theory of a binary Search tree(5mks)
a) Define the binary search tree of the following.(4mks)
i) 10,100,200,50,60,5
ii) 30,500,700,20,10,100

Boolean algebra and Functions

a. Define Boolean algebra and Boolean Functions(2mks)


b. What elements are used in Boolean Algebra(2mks)
c. Find the solution(6mks)
i) F(x, y, z) = xy'z + x'y'z + xyz

¿ x y z + x y z+ xyz

¿ z( x y+x y+x y)

¿ z ( x y + x y + xy )

¿ z ( x y + x ( y + y ))

¿ z (x y + x )

¿ z (x+ y)
ii)F(x, y, z) = (xy)' + xyz

xy + xyz

¿ xy + z

Explanation

( xy + xy ) ( xy + z )

xy + xy z+0+ xyz

xy ( 1+ z ) + xyz

¿ xy + xyz

You might also like