Discrete Mathematics Structures
Discrete Mathematics Structures
Discrete Mathematics Structures
Semester: 2 Credit: 4
Sec A
Question No 1-4 5-7 8-9 10
Sec B
Question No 11 12 13 14 16
Student Signature:
UID: D21BCA16016 Course Code: 21ODBCT154
B ∩ C = {3, 4} ∩ {"4, 5, 6" }= {"4" }A × (B ∩ C) = {"1, 2, 3" } × {"4" }= {"(1, 4), (2,
4), (3, 4)" }
Answer - When we toss two coins simultaneously then the possible of outcomes are:
(two heads) or (one head and one tail) or (two tails) i.e., in short (H, H) or (H, T) or (T, T)
respectively; where H is denoted for head and T is denoted for tail.
2/12
UID: D21BCA16016 Course Code: 21ODBCT154
3/12
UID: D21BCA16016 Course Code: 21ODBCT154
A non-linear data structure consists of a collection of the elements that are distributed on a
plane which means there is no such sequence between the elements as it exists in a linear
data structure.
8. Let A and B be two finite sets such that n(A) = 20, n(B) = 28 and n (A ∪ B) =
36, find n (A ∩ B).
Answer - Using the formula n(A∪B)=n(A)+n(B)−n(A∩B)
then, n(A∩B)=n(A)+n(B)−n(A∪B)
=20+28−36=48−36=12
f(x) .
f(x)=3(y+53)−5
4/12
UID: D21BCA16016 Course Code: 21ODBCT154
bijection.
For example: 13 +23 + 33 + ….. +n3 = (n(n+1) / 2)2, the statement is considered here as true
for all the values of natural numbers.
Answer - Let us assume M, C, P to be the sets of students who had taken mathematics, computer
science, and physics.
n(M) = 64 students
n(C) = 94 students
n(P) = 58 students
5/12
UID: D21BCA16016 Course Code: 21ODBCT154
n(M∩C) = 26 students
n(M∩P) = 28 students
n(P∩C) = 22 students
n(M∩C∩P) = 14 students
= 64 - [28 + 22 - 14]
= 14 students
Calculating the number of students who had only taken Computer Science:
= 94 - [26+22-14]
= 60 students
6/12
UID: D21BCA16016 Course Code: 21ODBCT154
= 58 - [28 + 22 - 14]
= 36 students
Calculating the total number of students who had only taken one course:
= 14 + 60 + 36
= 50 students
The Total Number of students that were surveyed can be calculated with the help of a Venn
Diagram:
= 24 + 12 + 60 + 8 + 14 + 22
= 140 students.
Can see in diagram -
7/12
UID: D21BCA16016 Course Code: 21ODBCT154
(c) R₃ = {(2, 3); (3, 5); (4, 7); (5, 9); (6, 11)}
(d) R₄ = {(p, l); (p, m); (q, x); (q, n); (r, m)}
Answer-
8/12
UID: D21BCA16016 Course Code: 21ODBCT154
13.By using mathematical induction prove that the given equation is true for
all
positive integers.
1 x 2 + 3 x 4 + 5 x 6 + …. + (2n - 1) x 2n = n(n+1) (4n−1)3n(n+1) (4n−1)3.
When n = 1,
LHS =1 x 2 = 2
RHS = 1(1+1)(4x1−1)3 = 63 = 2
For P(k + 1)
= (k+1)3(4k2 - k + 12 k + 6)
= (k+1)(4k2+8k+3k+6)3
= (k+1)(k+2)(4k+3)3
= (k+1)((k+1)+1)(4(k+1)−1)3 = RHS for P (k+1)
Answer - Let an = s1an−1 be a first order linear recurrence relation with a1 = k. Notice, a2 =
s1k,
a3 = s1a2 = s
2
1
k, a4 = s1a3 = s
3
9/12
UID: D21BCA16016 Course Code: 21ODBCT154
1
k, and in general an = ksn−1
1
.
Example 1.1 If a1 = 4 and an =
an−1
2
for n ≥ 2, then an = 4( 1
2
n−1
)=1
2n−3 .
Suppose now that we have a homogeneous linear recurrence relation of order 2: an =
s1an−1 + s2an−2 with a1 = k1 and a2 = k2. We take a guess that the solution will be of the
form an = crn
. Substituting this into our recurrence relation we obtain
crn = s1crn−1 + s2crn−2
.
Factoring out crn−2 we obtain a quadratic equation: r
2 = s1r + s2 or
r
2 − s1r − s2 = 0.
We have three possibilities for the roots of this quadratic equation: two distinct real roots
a and b, a unique double root a or two complex conjugate roots a + ib and a − ib. The
solutions to the recurrence relation will depend on these roots of the quadratic equation.
Suppose first that the recurrence relation has two distinct real roots a and b, then the
solution of the recurrence relation will be an = c1a
n + c2b
n
. We use a1 = k1 and a2 = k2 to
solve the recurrence relation. Since these give us values to solve a system of equations in
two variables c1 and c2:
k1 = c1a + c2b
k2 = c1a
2 + c2b
2.
10/12
UID: D21BCA16016 Course Code: 21ODBCT154
Answer - A binary tree is a non-linear data structure which is a collection of elements called
nodes.
In a binary tree, the topmost element is called the root-node. An element can have 0,1 at the most
2 child nodes.
There are many variants of Binary tree. A Binary search tree or BST is one among them.
A binary search tree, also known as ordered binary tree is a binary tree wherein the nodes are
arranged in a order. The order is :
a) All the values in the left sub-tree has a value less than that of the root node.
b) All the values in the right node has a value greater than the value of the root node.
Since the tree is already ordered, the time taken to carry out a search operation on the tree is
greatly reduced as now we don’t have to traverse the entire tree, but at every sub-tree we get hint
where to search next.
Binary trees also help in speeding up the insertion and deletion operation.
The average running time of a search operation is O(log2 n ) as at every step, the search-area is
reduced by half.
Consider an example. We need to insert the following elements in a binary tree:
48,2,98,12,56,32,4,6
Firstly we insert the first element as the root node.
Then we take the next element in queue a check whether it is lesser or greater than root node.
Here it will go to left tree as 2 is less than 48.
Then the third value, i.e 98 will go to right tree as 98 is greater than 48. And so on we progress.
11/12
UID: D21BCA16016 Course Code: 21ODBCT154
************************
12/12