Discrete Mathematics Structures

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

Assignment No.

Programme Name:BCA UID: D21BCA16016

Semester: 2 Credit: 4

Course Title:Discrete Mathematical Structures Course Code: 21ODBCT154

Submitted Date: 06-Dec-2021 Last date of Submission: 10-Dec-2021

Max. Marks: 30 Weightage: 50% (15 Marks)

Sec A
Question No 1-4 5-7 8-9 10

Page No 2-3 3-4 4-5 5

Sec B
Question No 11 12 13 14 16

Page No 5-8 8 9 9-10 11-12

Student Signature:
UID: D21BCA16016 Course Code: 21ODBCT154

SECTION A (10 MARKS)

1. Let A = {1, 2, 3}, B = {3, 4} and C = {4, 5, 6}. Find A × (B ∩ C).


(i)A×(B∩C)
∩ Intersection:common between two sets
B∩C={3,4}∩{4,5,6}={4}
A×(B∩C)=
{1,2,3}×{4}
={(1,4),(2,4),(3,4)}

B ∩ C = {3, 4} ∩ {"4, 5, 6" }= {"4" }A × (B ∩ C) = {"1, 2, 3" } × {"4" }= {"(1, 4), (2,
4), (3, 4)" }

2. What is the total number of possible outcomes when a pair of coins is


tossed?

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.

Therefore, total numbers of outcome are 22 = 4

3. What is Composition of Function?


Answer - Composition of Functions
In Maths, the composition of a function is an operation where two functions say f and g
generate a new function say h in such a way that h(x) = g(f(x)). Function g is applied to the
function of x. So, basically, a function is applied to the result of another function.

Let f : A → B and g : B → C be two functions. Then the composition of f and g, denoted by


g ∘ f, is defined as the function g ∘ f : A → C given by g ∘ f (x) = g(f (x)), ∀ x ∈ A.

4. Find a recurrence relation and initial conditions for 1,5,17,53,161,485…


Answer - Finding the recurrence relation would be easier if we had some context for the
problem (like the Tower of Hanoi, for example). Alas, we have only the sequence.
Remember, the recurrence relation tells you how to get from previous terms to future terms.
What is going on here? We could look at the differences between terms: 4, 12, 36, 108,.....
Notice that these are growing by a factor of 3. Is the original sequence as well?
1⋅3=3, 5⋅3=15, 17⋅3=51
and so on. It appears that we always end up with 2 less than the next term. Aha!

2/12
UID: D21BCA16016 Course Code: 21ODBCT154

So an=3an−1+2 is our recurrence relation and the initial condition is a0=1

5. Explain Homogeneous Recurrence Relations.


Answer - A recurrence relation for a sequence 𝑎𝑎0, 𝑎𝑎1, 𝑎𝑎2, … ({an}) is a
formula that relates each term ak to certain of its
predecessors 𝑎𝑎𝑘𝑘−1, 𝑎𝑎𝑘𝑘−2, … , 𝑎𝑎𝑘𝑘−𝑖𝑖 (one or more of the
previous terms of the sequence), where i is an integer with
𝑘𝑘 − 𝑖𝑖 ≥ 0
A recurrence relation for a sequence 𝑎𝑎0, 𝑎𝑎1, 𝑎𝑎2, … ({an}) is a
formula that relates each term ak to certain of its
predecessors 𝑎𝑎𝑘𝑘−1, 𝑎𝑎𝑘𝑘−2, … , 𝑎𝑎𝑘𝑘−𝑖𝑖 (one or more of the
previous terms of the sequence), where i is an integer with
𝑘𝑘 − 𝑖𝑖 ≥ 0.

6. What is Generating Function?


Answer - A generating function is just a different way of writing a sequence of numbers.
Here we will be
dealing mainly with sequences of numbers (an) which represent the number of objects of size
n
for an enumeration problem. The interest of this notation is that certain natural operations on
generating functions lead to powerful methods for dealing with recurrences on an.
Definition 1. Let be a sequence of numbers. The generating function associated to
this sequence is the series

7. Differentiate between tree and graph.


Answer - Tree and graph come under the category of non-linear data structure where tree
offers a very useful way of representing a relationship between the nodes in a hierarchical
structure and graph follows a network model. Tree and graph are differentiated by the fact
that a tree structure must be connected and can never have loops while in the graph there are
no such restrictions.

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

9. Show that the function f(x) = 3x – 5 is a bijective function from R to R.


Answer - If - f(x)=f(y)⇒x=y

Or: if f(x)=f(y) , then x=y

Suppose f(x)=f(y) which mean

3x−5=3y−5 so 3x=3y which mean x=y .

Therefore, f(x) is one-to-one.

Now need to show f(x) is onto R

This means that R=Rng(f) . Now the

range of f is the set of values that f maps to from the

domain. Now, we need to show that

R⊆Rng(f) (we know that

Rng(f)⊆R since f is a function)

So, suppose y∈R and let

x=y+53 . Since y∈R

that means x∈R . Now consider

f(x) .

f(x)=3(y+53)−5

f(x)=y+5−5=y . This means y∈Rng(f) ;

4/12
UID: D21BCA16016 Course Code: 21ODBCT154

thus, R⊆Rng(f) and

Rng(f)⊆R which together

mean R=Rng(f) ; thus, f is onto.

Since f is one-to-one and onto, it is by definition a

bijection.

10.Explain Strong Mathematical Induction with example?


Answer - Mathematical Induction is a technique of proving a statement, theorem or formula
which is thought to be true, for each and every natural number n. By generalizing this in form
of a principle which we would use to prove any mathematical statement is ‘Principle of
Mathematical Induction‘.

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.

SECTION B (20 MARKS)

11. Solve Using Venn diagram: In a survey of university students, 64 had


taken mathematics
Course, 94 had taken chemistry course, 58 had taken physics course, 28 had
taken mathematics
And physics, 26 had taken mathematics and chemistry, 22 had taken
chemistry and physics
course, and 14 had taken all the three courses. Find how many had taken one
course only.

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

Now the students that had taken two courses together:

n(M∩C) = 26 students

n(M∩P) = 28 students

n(P∩C) = 22 students

n(M∩C∩P) = 14 students

Calculating the number of students who had only taken math:

= n(M) - [n(M∩P) + n(P∩C) - n(M∩C∩P)]

Substituting the values into this formula we get:

= 64 - [28 + 22 - 14]

= 14 students

Therefore, 14 students had only taken math.

Calculating the number of students who had only taken Computer Science:

= n(C) - [n(M∩C) + n(P∩C) - n(M∩C∩P)]

Substituting the values into this formula we get:

= 94 - [26+22-14]

= 60 students

Therefore, 60 students had only taken Computer Science.

6/12
UID: D21BCA16016 Course Code: 21ODBCT154

Calculating the number of students who only took physics:

= = n(P) - [n(M∩P) + n(P∩C) - n(M∩C∩P)]

= 58 - [28 + 22 - 14]

= 36 students

Therefore, 36 students only took physics.

Calculating the total number of students who had only taken one course:

= 14 + 60 + 36

= 50 students

Therefore, 50 students had only taken one course.

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

12.Draw the arrow diagrams to represent the following relations.


(a) R₁ = {(3, 3); (3, 6); (3, 9); (5, 8); (6, 3)}
(b) R₂ = {(4, 10); (4, 13); (4, 16); (5, 13); (6, 16)}

(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.

Answer - From the statement formula

When n = 1,

LHS =1 x 2 = 2

RHS = 1(1+1)(4x1−1)3 = 63 = 2

Hence it is proved that P (1) is true for the equation.

Now we assume that P (k) is true or 1 x 2 + 3 x 4 + 5 x 6 + …. + (2k - 1) x 2k = k(k+1)(4k−1)3.

For P(k + 1)

LHS = 1 x 2 + 3 x 4 + 5 x 6 + …. + (2k - 1) x 2k + (2(k + 1) - 1) x 2(k + 1)

= k(k+1)(4k−1)3 + (2(k + 1) - 1) x 2(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)

Now it is proved that P (k + 1) is also true for the equation.

So the given statement is true for all positive integers.

14.Explain Homogeneous Recurrence Relations.

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.

15.Solve the recurrence relation


𝑎𝑛 − 7𝑎𝑛−1 + 10𝑎𝑛−2 = 0 forn ≥ 0.

10/12
UID: D21BCA16016 Course Code: 21ODBCT154

16.What is Binary Search Tree? Explain with example.

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.

c) The same rule is carried forward to all the sub-tree in tree.

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

17.Explain the types of graphs in detail.

************************

12/12

You might also like