0% found this document useful (0 votes)
903 views22 pages

DMS Solved Question Paper 2024..

The document outlines the Winter Examination-2023 for B. Tech students at Dr. Babasaheb Ambedkar Technological University, covering subjects like Discrete Mathematics and various mathematical proofs and graph theory concepts. It includes questions on logical statements, mathematical induction, De Morgan’s laws, graph properties, and Dijkstra’s algorithm, along with Huffman coding for optimal average-bit-length codes. Each section provides detailed answers and explanations for the problems posed.

Uploaded by

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

DMS Solved Question Paper 2024..

The document outlines the Winter Examination-2023 for B. Tech students at Dr. Babasaheb Ambedkar Technological University, covering subjects like Discrete Mathematics and various mathematical proofs and graph theory concepts. It includes questions on logical statements, mathematical induction, De Morgan’s laws, graph properties, and Dijkstra’s algorithm, along with Huffman coding for optimal average-bit-length codes. Each section provides detailed answers and explanations for the problems posed.

Uploaded by

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

DR. BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE .

Regular & Supplementary Winter Examination-2023

Course: B. Tech. Branch : CE / CSE / CS/ Allied

Subject Code & Name: Discrete Mathematics [BTCOC302] Semester : III

Max Marks: 60 Duration: 03:00Hrs.

Date: 04-01-24

--------------------------------------------------------------------------------------------------------------------------------------

Q. 1 Attempt the following questions. [12]

A) Let P(x), Q(x), and R(x) be the statements “x is a professor,” “x is ignorant,” and “x is vain,”
respectively. Express each of these statements using quantifiers; logical connectives; and P(x), Q(x),
and R(x), where the domain consists of all people.

(a) No professors are ignorant. (b) All ignorant people are vain.

(c) No professors are vain. (d) Does (c) follows (a) and (b)?

Answer:-

Given:

 P(x): x is a professor.
 Q(x): xis ignorant.
 R(x): xis vain.
 The domain consists of all people.

(a) No professors are ignorant.

This means that if someone is a professor, they are not ignorant:

∀x(P(x)→¬Q(x))

(b) All ignorant people are vain.

This means that if someone is ignorant, they must also be vain:

∀x(Q(x)→R(x))

(c) No professors are vain.

This means that if someone is a professor, they are not vain:

∀x(P(x)→¬R(x))

(d) Does (c) follow from (a) and (b)?


To check whether (c) follows from (a) and (b), let's analyze the logical reasoning:

1. From (a): ∀x(P(x)→¬Q(x))


o This means that if x is a professor, then x is not ignorant.
2. From (b): ∀x(Q(x)→R(x))
o This means that if x is ignorant, then x is vain.
3. Suppose x is a professor. From (a), we know x is not ignorant. However, this does not directly
imply that x is not vain because (b) only tells us that ignorant people are vain, not that only
ignorant people are vain.

--------------------------------------------------------------------------------------------------------------------------------------

B) Show that if n is a positive integer, then 1+2+3+.......+n= n(n+1) 2 by using mathematical


induction.

Answer:-

To prove the formula

for all positive integers n, we use mathematical induction.

Step 1: Base Case (n = 1)

For n=1:

Since both sides are equal, the base case holds.

Step 2: Inductive Hypothesis

Assume that the formula is true for some positive integer kkk, i.e.,

This is the inductive hypothesis.


Step 3: Inductive Step

We need to prove that the formula holds for k+1, i.e.,

Using the inductive hypothesis, we substitute the sum of the first k terms:

Factor out (k+1):

which is exactly the right-hand side of the formula for n=k+1.

Step 4: Conclusion

Since the formula holds for n=1(base case) and we have shown that if it holds for n=k, then it also
holds for n=k+1, by the principle of mathematical induction, the formula is true for all positive
integers n. ✅

------------------------------------------------------------------------------------------------------

C) Use De Morgan’s laws to find the negation of each of the following statements.

(a) Kwame will take a job in industry or go to graduate school.

(b) Yoshiko knows Java and calculus.

(c) James is young and strong.

(d) Rita will move to Oregon or Washington.

Answer:-

De Morgan’s laws state that:

1. ¬(P∨Q)≡¬P∧¬Q (The negation of an OR is an AND of the negations)


2. ¬(P∧Q)≡¬P∨¬Q (The negation of an AND is an OR of the negations)

Now, applying these laws to each statement:


(a) Kwame will take a job in industry or go to graduate school.

 Let P = "Kwame will take a job in industry"


 Let Q = "Kwame will go to graduate school"
 Given statement: P∨Q
 Negation: ¬(P∨Q)≡¬P∧¬Q
 Negation: "Kwame will not take a job in industry and will not go to graduate school."

(b) Yoshiko knows Java and calculus.

 Let P = "Yoshiko knows Java"


 Let Q= "Yoshiko knows calculus"
 Given statement: P∧QP
 Negation: ¬(P∧Q)≡¬P∨¬Q
 Negation: "Yoshiko does not know Java or does not know calculus."

(c) James is young and strong.

 Let P = "James is young"


 Let Q = "James is strong"
 Given statement: P∧Q
 Negation: ¬(P∧Q)≡¬P∨¬Q
 Negation: "James is not young or James is not strong."

(d) Rita will move to Oregon or Washington.

 Let P = "Rita will move to Oregon"


 Let Q = "Rita will move to Washington"
 Given statement: P∨Q
 Negation: ¬(P∨Q)≡¬P∧¬Q
 Negation: "Rita will not move to Oregon and will not move to Washington."

--------------------------------------------------------------------------------------------------------------------------------------

Q.2 Solve Any Two of the following. [12]

A) Answer these questions for the partial order represented by this Hasse diagram.

a) Find the maximal elements.

b) Find the minimal elements.

c) Is there a greatest element?

d) Is there a least element?

e) Find all upper bounds of {a, b, c}.


f) Find all lower bounds of {f, g, h}

Answer:-

Step 1: Understanding the Hasse Diagram

 A Hasse diagram represents a partially ordered set (poset), where an edge between two
elements indicates a covering relation (i.e., one element is directly greater than another).
 The elements at the top are the maximal elements (no element is greater than them).
 The elements at the bottom are the minimal elements (no element is smaller than them).

Answers to the Questions:

(a) Find the maximal elements.

A maximal element is an element that no other element is greater than (i.e., it is not covered by
any other element).
From the diagram, the maximal elements are:

l,m

These are at the top of the diagram.

(b) Find the minimal elements.

A minimal element is an element that no other element is smaller than (i.e., it does not cover any
other element).
From the diagram, the minimal elements are:

a,b,c
These are at the bottom of the diagram.

(c) Is there a greatest element?

A greatest element is an element that is greater than or equal to all other elements in the poset.

 Here, there is no single element that is greater than all others because both l and m are
maximal elements, but neither is greater than the other.
 Answer: No, there is no greatest element.

(d) Is there a least element?

A least element is an element that is less than or equal to all other elements in the poset.

 Here, there is no single element that is smaller than all others because a, b, and c are
minimal elements, but neither is smaller than the others.
 Answer: No, there is no least element.

(e) Find all upper bounds of {a, b, c}.

An upper bound of a set is an element that is greater than or equal to all elements in the set.

 The elements {a, b, c} have the following upper bounds:


o For a: Possible upper elements are d, i, j, l.
o For b: Possible upper elements are d, e, h, k, l, m.
o For c: Possible upper elements are e, f, g, h, k, m.
 Common upper bounds for all {a, b, c}:
o e, h, k, l, m (these elements are greater than or equal to all of {a, b, c}).

(f) Find all lower bounds of {f, g, h}.

A lower bound of a set is an element that is less than or equal to all elements in the set.

 The elements {f, g, h} have the following lower bounds:


o For f: Possible lower elements are c.
o For g: Possible lower elements are c, e.
o For h: Possible lower elements are b, e.
 Common lower bounds for all {f, g, h}:
o e (since it is less than or equal to f, g, and h).

Final Answers:
(a) Maximal elements: l,m
(b) Minimal elements: a,b,c
(c) Greatest element: No
(d) Least element: No
(e) Upper bounds of {a, b, c}: e,h,k,l,m
(f) Lower bounds of {f, g, h}: e

--------------------------------------------------------------------------------------------------------------------------------------

B) Let f(x) = x + 2, g(x) = x – 2, and h(x) = 3x for x ∈ R where R = set of real numbers.

Find i) gof

ii) fohog

iii) foh

Answer:-

We are given the functions:

f(x)=x+2, g(x)=x−2, h(x)=3xf

where x∈R.Now, let's compute the required compositions.

(i) g∘f

(g∘f)(x)=g(f(x))

Substituting f(x)=x+2 into g(x):

g(f(x))=g(x+2)=(x+2)−2=x

Thus,

(g∘f)(x)=x

(ii) f∘h∘g

(f∘h∘g)(x)=f(h(g(x)))

First, compute g(x):

g(x)=x−2

Now apply h(x) to g(x):


h(g(x))=h(x−2)=3(x−2)=3x−6

Now apply f(x) to h(g(x)):

f(h(g(x)))=f(3x−6)=(3x−6)+2=3x−4

Thus,

(f∘h∘g)(x)=3x−4

(iii) f∘h

(f∘h)(x)=f(h(x))

Substituting h(x)=3x into f(x):

f(h(x))=f(3x)=3x+2

Thus,

(f∘h)(x)=3x+2

Final Answers:

(i) g∘f(x)=x
(ii) f∘h∘g(x)=3x−4
(iii) f∘h(x)=3x+2

--------------------------------------------------------------------------------------------------------------------------------------

Q. 3 Solve Any Two of the following. [12]

A) Draw the following graphs.

a) K7 b) K1,8 c) K4,4 d) C7 e) W7

Answer

a) K7 has 7 vertices and there needs to be an edge between every pair of vertices.
b) K1,8 has two sets of vertices: a set of 1 vertex and a set of 8 vertices
M={A}M={A}
N={B,C,D,E,F.G.H.I}N={B,C,D,E,F.G.H.I}
The vertex that is alone in its set should be connected to all other vertices.

c) K4,4 has two sets of vertices: a set M of 4 vertices and a set N of 4 vertices
M={A,B,C,D}M={A,B,C,D}
N={E,F,G,H}N={E,F,G,H}
All vertices in the set M should be connected with every vertex in the set N.
d) C7 has 7 vertices A,B,C,D,E,F,G, where A and B are connected, B and C are connected,...,
F and G are connected, and G and A are connected.

e) W7 is the graph of C7 in part (d) to which a vertex H was added and this vertex is connected with
all other vertices.

--------------------------------------------------------------------------------------------------------------------------------------

B) Use paths either to show that these graphs are not isomorphic or to find an isomorphism
between them.
Answer:-

To determine whether the graphs and are isomorphic, we should compare their structure using key
graph properties:

1. Number of vertices and edges

Both graphs have 8 vertices.

Counting the edges:

Graph has 12 edges.

Since they have the same number of vertices and edges, isomorphism is still possible.

2. Vertex degrees

In , the degrees of the vertices vary.

In , each vertex has degree 3.

Since graph has varying degrees while graph has uniform degrees, the two graphs cannot be
isomorphic.

Conclusion

Graphs and are not isomorphic because their degree sequences differ. This confirms that no one-
to-one correspondence preserves adjacency between them.

----------------------------------------------------------------------------------------------------------------------------------

C) Use Dijkstra’s algorithm to find the length of a shortest path between the vertices 1 and 4 in the
weighted graph displayed in Figure below.
Answer:-

We will use Dijkstra’s algorithm to find the shortest path between vertex 1 and vertex 4 in the given
weighted graph.

Step-by-Step Execution of Dijkstra's Algorithm

1. Initialization:

Set the starting vertex 1 with a distance of 0.

Set all other vertices to ∞ (infinity).

Keep track of visited nodes and update distances as we progress.

2. Graph Representation (Edges & Weights):

The graph has edges with the following weights:

(1 → 2) = 8

(1 → 0) = 4

(2 → 3) = 2

(2 → 5) = 4

(2 → 8) = 2

(3 → 5) = 14

(4 → 5) = 10

(5 → 6) = 6

(6 → 7) = 7

(7 → 0) = 11

(7 → 8) = 1

(8 → 6) = 6

Execution of Algorithm

The shortest path 1 → 2 → 3 → 5 → 4 gives a total distance of 22.

Final Answer:

The length of the shortest path from 1 to 4 is 22.


Q.4 Attempt the following questions. [12]

A) Use Huffman’s algorithm to provide an optimal average-bit-length code for the probability
distribution a: 0.2, b: 0.2, c: 0.15, d: 0.15, e: 0.15, f: 0.1, and g: 0.05. Draw a binary tree to find the
prefix code for for each probability distribution and compute the average bit-length of a codeword

Answer:-

Step 1: Arrange the Symbols by Probability

The given symbols and their probabilities:

Symbol Probability

g 0.05

f 0.10

c 0.15

d 0.15

e 0.15

a 0.20

b 0.20

Step 2: Construct the Huffman Tree

We iteratively combine the two smallest probabilities until we form a single tree.

1. Merge g (0.05) and f (0.10) → New node (0.15)


2. Merge (g+f) = 0.15 with c = 0.15 → New node (0.30)
3. Merge d (0.15) and e (0.15) → New node (0.30)
4. Merge (c+f+g) = 0.30 and (d+e) = 0.30 → New node (0.60)
5. Merge a (0.20) and b (0.20) → New node (0.40)
6. Merge (a+b) = 0.40 and (c+d+e+f+g) = 0.60 → Root node (1.0)

Step 3: Assign Huffman Codes

Now, we traverse the tree and assign binary values:

Symbol Huffman Code Code Length

a 00 2
Symbol Huffman Code Code Length

b 01 2

c 100 3

d 101 3

e 110 3

f 1110 4

g 1111 4

Step 4: Compute the Average Bit-Length

The average bit-length is computed using:

L=∑(Pi×li)

Substituting the values:

L=(0.2×2)+(0.2×2)+(0.15×3)+(0.15×3)+(0.15×3)+(0.1×4)+(0.05×4)

=0.4+0.4+0.45+0.45+0.45+0.4+0.2

=2.7

Thus, the optimal average bit-length = 2.7 bits per symbol.

Step 5: Draw the Huffman Tree

Here’s a textual representation:

(1.00)
/ \
(0.40) (0.60)
/ \ / \
(a) (b) (0.30) (0.30)
/ \ / \
(c) (0.15) (d) (e)
/ \
(f) (g)
B) Use Kruskal’s algorithm to find a minimum spanning tree for the weighted graph in the Figure
below.

Answer:-

To find the Minimum Spanning Tree (MST) using Kruskal’s algorithm, follow these steps:

Step 1: List the Edges and Sort by Weight

Kruskal’s algorithm works by sorting edges in ascending order and adding them to the MST while ensuring
no cycles form.

Here are the edges sorted by weight:

Edge Weight

(a, b) 1

(c, d) 1

(e, f) 1

(g, h) 1

(i, j) 1

(k, l) 1

(m, n) 1
Edge Weight

(o, p) 1

(a, e) 2

(d, h) 2

(m, i) 2

(p, l) 2

(b, c) 3

(f, g) 3

(j, k) 3

(n, o) 3

(b, f) 3

(c, g) 3

(f, j) 3

(g, k) 3

(j, n) 3

(k, o) 3

Step 2: Apply Kruskal’s Algorithm

1. Start with an empty set.


2. Add the smallest edge that does not form a cycle.
3. Continue adding edges until all vertices are connected.

Building the MST

1. Add (a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p) (all weight 1)
2. Add (a, e), (d, h), (m, i), (p, l) (all weight 2)
3. Add (b, c), (f, g), (j, k), (n, o) (all weight 3)

Since we now have all 16 vertices connected, we stop.

Step 3: Draw the MST

The MST consists of the selected edges forming a minimum cost structure while avoiding cycles.
Step 4: Calculate Total Weight

1×8+2×4+3×4=8+8+12=24

Total MST weight = 24

---------------------------------------------------------------------------------------------------------------------------------------------------

C) (i) What is the value of each of the prefix expressions + − ↑ 3 2 ↑ 2 3 / 6 − 4 2? (ii) What is the
value of each of the postfix expressions 3 2 ∗ 2 ↑ 5 3 − 8 4 / ∗ −?

Answer:-

(i) Evaluating the Prefix Expression

Expression:

+−↑32↑23/6−42

Step 1: Understanding the Operators

 ↑ represents exponentiation (**).


 - represents subtraction.
 / represents division.
 + represents addition.

Step 2: Evaluating from Right to Left

1. Evaluate Exponentiation:
o ↑32=32=9
o ↑23=23=8
2. Evaluate Subtraction:
o −98=9−8=1
3. Evaluate Division:
o −42=4−2=2
o /62=6/2=3
4. Evaluate Final Addition:
o +13=1+3=4

Final Answer: 4

(ii) Evaluating the Postfix Expression

Expression:

32∗2↑53−84/*-

Step 1: Understanding the Operators

 * represents multiplication.
 ↑ represents exponentiation (**).
 - represents subtraction.
 / represents division.

Step 2: Evaluating from Left to Right

1. Evaluate Exponentiation:
o 2↑5=25=32
2. Evaluate Multiplication:
o 3∗2=6
3. Evaluate Subtraction:
o 3−32=−29
4. Evaluate Division:
o 8/4=2
5. Evaluate Multiplication:
o −29∗2=−58
6. Evaluate Final Subtraction:
o 6−(−58)=6+58=64

Final Answer: 64

--------------------------------------------------------------------------------------------------------------------------------------

Q. 5 Attempt the following questions. [12]

A) Consider the binary operation defined on the set A = {a, b, c, d} by following table. Find:

(i) c * d and d * c

(ii) b * d and d * b

(iii) a * (b * c) and (a * b) * c

Answer:-

Step 1: Understanding the Table

The table represents a binary operation on the set A = {a, b, c, d}. The rows represent the first
operand, and the columns represent the second operand.

For example:
b * c = b (row) and c (column) → b

c * d = c (row) and d (column) → a

Solving the Questions

(i) Find c*d and d*c

Using the table

c*d → Find row c, column d → a

d*c → Find row d, column c → a

Answer:

b*d = c

d*b = b

(iii) Find a*(b*c) and (a*b)*c

First, compute : b*c.

● b*c → Find row b, column c → b

Now compute : a*(b*c) = a*b

*a*b → Find row a, column b → c

So a*(b*c) = c.

Now compute : (a*b)*c.

*(a*b)*c = c*c → Find row c, column c → d

Answer:

a*(b*c) = c

(a+b)*c = d

Final Answers:

1. c*d = a, d*c = a

2. b*d = c, d*b =b

3. a*(b*c) = c, (a*b)*c = d.

--------------------------------------------------------------------------------------------------------------------------------------
B) Consider the group G = {1, 2, 4, 7, 8, 11, 13, 14} under multiplication modulo 15.

i) Find multiplication table of G.

ii) Find 2 -1, 7-1 .

iii) Find the orders and subgroups generated by 7 and 11.

Answer:-

We are given the group G={1,2,4,7,8,11,13,14} under multiplication modulo 15. Let's solve each
part step by step.

(i) Find the Multiplication Table of G

The operation is multiplication modulo 15, meaning that for any elements a,b∈G we compute
(a⋅b)mod15.

Multiplication Table

We calculate each entry as (a×b)mod 15:

⋅ 1 2 4 7 8 11 13 14

1 1 2 4 7 8 11 13 14

2 2 4 8 14 1 7 11 13

4 4 8 1 13 2 14 7 11

7 7 14 13 4 11 2 8 1

8 8 1 2 11 4 13 14 7

11 11 7 14 2 13 8 1 4

13 13 11 7 8 14 1 4 2

14 14 13 11 1 7 4 2 8

(ii) Find the Inverses of 2 and 7

The inverse of x (denoted x−1) is the element y such that:

(x×y)mod 15=1
Finding 2−1

We need to find y such that:

(2×y)mod 15=1

From the table, 2×8=16≡1mod 15, so:

2−1=8

Finding 7−1

We need to find y such that:

(7×y)mod 15=1

From the table, 7×13=91≡1 mod 15, so:

7−1=13

(iii) Find the Orders and Subgroups Generated by 7 and 11

The order of an element aaa in G is the smallest integer nnn such that:

an≡1mod 15
Order and Subgroup of 7:

Compute successive powers of 7 modulo 15:

 71≡7mod 15
 72≡49≡4mod 15
 73≡7×4=28≡13mod 15
 74≡7×13=91≡1mod 15

Thus, order of 7 is 4, and the subgroup generated by 7 is:

⟨7⟩={1,7,4,13}

Order and Subgroup of 11:

Compute successive powers of 11 modulo 15:

 111≡11mod 15
 112≡121≡1mod 15

Thus, order of 11 is 2, and the subgroup generated by 11 is:

⟨11⟩={1,11}
Final Answers

1. Multiplication Table: Constructed above.


2. Inverses:
o 2−1=8
o 7−1=13
3. Orders and Subgroups:
o Order of 7=4, ⟨7⟩={1,7,4,13}
o Order of 11=2, ⟨11⟩={1,11}

--------------------------------------------------------------------------------------------------------------------------------------

BEST OF LUCK….

You might also like