Be Computer-Engineering Semester-3 2019 May Discrete-Structures-Cbcgs
Be Computer-Engineering Semester-3 2019 May Discrete-Structures-Cbcgs
MAY 19 (CBCS)
Solution:
Let P(n)= 2+5+8+….+(3n-1)=n(3n+1)/2
Step1: n=1
LHS=3x1-1
=2
RHS=1(3x1+1)/2
=2
LHS=RHS
P(n) is true for n=1.
Step2:
Let P(n) be true for n=k
2+5+8+….+(3k-1)=k(3k+1)/2 ……………………………(1)
2+5+8+….(3k-1)+[3(k+1)-1]=(k+1)[3(k+1)+1]/2
LHS= 2+5+8+….(3k-1)+[3(k+1)-1]
=k(3k+1)/2+[3(k+1)-1]
=(3k2+k)/2+[3k+2]
=3k2+7k+4/2
=(k+1)(3k+4)/2
RHS=(k+1)[3(k+1)+1]/2
=(k+1)(3k+4)/2
LHS=RHS
P(n) is true for n=k+1
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q1 b) Find the generating function for the following finite sequences
I) 1,2,3,4,……….
II) 2,2,2,2,2 (5)
Solution:
2
The generating function g(x) = (x5 -1)
x 1
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
1 4 7 13
1 0 1 0 1
4 0 0 1 0
Relation matrix W= MR=
7 0 1 0 0
13 0 0 0 0
Step1: First we copy all 1’s from W to matrix W1.
We observe W has no 1’s at first column and has 1’s at 4 and 13 in first row.
⸫ W1 is same as W
1 4 7 13
1 0 1 0 1
4 0 0 1 0
W1=
7 0 1 0 0
13 0 0 0 0
1 4 7 13
1 0 1 1 1
4 0 0 1 0
W2=
7 0 1 1 0
13 0 0 0 0
1 4 7 13
1 0 1 1 1
4 0 1 1 0
W3=
7 0 1 1 0
13 0 0 0 0
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
f(x)=2x-1
f-1(x)=(x+1)/2
(f O f-1)(x)= f(f-1(x))
x 1
=f( )
2
x 1
= 2( )-1
2
=x+1-1
=x
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q2 a) Define lattice. Check if the following diagram is a lattice or not. (4)
Solution:
A posset (L,≤) in which every pair (a,b) of L has a LUB(least Upper Bound) and GLB
(Greatest Lower bound ) is called a lattice.
For eg.
Let R be a relation of divisibility. Consider the set of divisors of 625
i. e. D625={1,5,25,125,625}
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q2 b) Prove that set G={1,2,3,4,5,6} is a finite abelian group of order 6 w.r.t
multiplication module 7.
Solution: (8)
X7 1 2 3 4 5 6
1 1 2 3 4 5 6
2 2 4 6 1 3 5
3 3 6 2 5 1 4
4 4 1 5 2 6 3
5 5 3 1 6 4 2
6 6 5 4 3 2 1
G1:
Consider any three numbers from table
5 x (6 x 3)=5 x 4=6
(5 x 6) x 3=2 x 3=6
As 5 x (6 x 3)=(5 x 6) x 3
Hence x is associative.
G2:
From table we observe first row is same as header.
I Ꞓ G
G3:
Consider any two number from table
4 x 2 =1 and 2 x 4=1
Hence x is commutative.
G4:
Inverse of x exists.
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q2 c) A travel company surveyed it’s travelers, to learn how much of their travel is
taken with an Airplane, a Train or a car. The following data is known; make a
complete Venn Diagram with all the data. The number of people who flew was 1307.
The number of people who both flew and used a train was 602. The people who used
all three were 398 in number. Those who flew but didn’t drive came to total 599.
Those who drove but did not use train totaled 1097. There were 610 people who
used both trains and cars. The number of people who used either a car or train or
both was 2050. Lastly, 421 people used none of these .Find out how many people
drove but used neither a train nor an airplane, and also, how many people were in
the entire survey.
Solution: (8)
N(A)= 1307
N(AᴖT)=602
The people who flewed and travelled by train but didn’t travelled by car
= N(AᴖT) - N(AᴖTᴖC)
= 602-398
= 204
The people who flewed and travelled by car but didn’t travelled by train are =310
Those who drove but did not use train totaled 1097
The people who travelled by only car = 1097-310=787
The people who travelled by only train= 139
The no of people who drove but used neither a train nor an airplane= 787
The no of people in entire survey were =2866
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
¬(p ˅ ( ¬p ˄ q ))
¬ p ˄ ¬( ¬p ˄ q) By Demorgan’s law
¬p ˄ ( p ˅ ¬q) By double negation
(¬p ˄ p) ˅ (¬p ˄ ¬q) By distributive law
F ˅ (¬p ˄ ¬q) (¬p ˄ p)= F
(¬p ˄ ¬q) By Identity law
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Solution:
The decoding table is as follows:
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q3c) Mention all the elements of set D36 also specify R on D36 as aRb if a|b. Mention
Domain and range of R. Explain if the relation is equivalence relation or a Partially
Ordered Relation. If it is A Partially Ordered Relation, draw its Hasse Diagram.
Solution: (8)
D36={1,2,3,4,6,9,12,18,36}
R={(1,1)(1,2)(1,3)(1,4)(1,6)(1,9)(1,12)(1,18)(1,36)(2,2)(2,3)(2,4)(2,6)(2,9)(2,12)(2,18)(2,
36)(3,3)(3,4)(3,6)(3,9)(3,12)(3,18)(3,36)(4,4)(4,6)(4,9)(4,12)(4,18)(4,36)(6,6)(6,9)(6,12)
6,18)(6,36)(9,9)(9,12)(9,18)(9,36)(12,12)(12,18)(12,36)(18,18)(18,36)(36,36)}
Domain of R ={1,2,3,4,6,9,12,18,36}
Range of R={1,2,3,4,6,9,12,18,36}
A relation R on a set A is called a partial order relation if it satisfies the following three
properties:
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q4a) Explain Extended pigeonhole principle. How many friends must you have to
guarantee that at least five of them should will have birthdays in the same month.
Solution: (4)
Extended pigeonhole principal
It states that if n pigeons are assigned to m pigeonholes (The number of pigeons is very
large than the number of pigeonholes), then one of the pigeonholes must contain at least
[(n-1)/m]+1 pigeons.
Here Number of pigeons = n = ?
No. of pigeonholes = m = 12 (months)
∴ [(n−1)/m]+1=5
[(n−1)/12]+1=5
n - 1 = 48
n = 49 [ No. of pigeons]
∴ 49 friends should be their to guarantee that at-least five of them must have birthday in
a same month of year.
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Euler path: An Euler path is a path that uses every edge of a graph exactly once.
Euler circuit: An Euler circuit is a circuit that yses edges of a graph exactly once and
which starts and ends with same vertex.
Criteria for Euler cycle:
If a connected graph G has a Euler circuit,then all vertices Of G must have a even degree
In fig(a)
Since vertices B and D have odd degree.
Therefore there is no Euler cycle for fig(a).
Hamilton path: Hamiltonian path is a graph that visits each vertex exactly once.
Hamiltonian circuit: Hamiltonian circuit is a path that visitsevery vertex exactly once
and which starts and ends on the same vertex.
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q4c) In a group of 6 boys and 4 girls, four children are to be selected. In how many
different ways can they be selected such that at least one boy should be there?
Solution: (8)
In a group of 6 boys and 4 girls, four children are to be selected such that
at least one boy should be there.
So we can have
(four boys) or (three boys and one girl) or (two boys and two girls) or (one boy and three
girls)
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q5b) A pack contains 4 blue, 2 red and 3 black pens. If 2 pens are drawn at random
from the pack, Not replaced and then another pen is drawn. What is the probability
of drawing 2 blue pens and 1 black pen?
(8)
Solution:
Total blue pens: 4
Total red pens: 2
Total black pens: 3
Total pens: 4+2+3= 9
Probability of drawing 2 blue pens= 4C2 / 9C2 =4 x 3/ 9 x 8= 1/6
After these the pens are not replaced. Therefore there are only 7 pens left.
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q5c) Let A be a set of integers, let R be a relation on AxA defined by (a,b) R (c,d) if
and only if a+d=b+c.
Prove that R is an equivalent relation.
Solution: (8)
Relation R is defined by (a,b) R (c,d) if and only if a+d=b+c.
I) Put a=c and b=d in a+d=b+c
∴ c+d=d+c, which is true
∴ (c,d) R (c,d)
Therefore R is reflexive.
∴ c+b=d+a
∴ (c,d)R(a,b)
∴ R is symmetric.
∴ (a,b)R(e,f)
Hence R is an equivalence relation.
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Q6a) Define reflexive closure and symmetric closure of a relation. Also find
reflexive and symmetric closure of R.
A={1,2,3,4}
B={(1,1),(1,2),(1,4),(2,4),(3,1),(3,2),(4,2),(4,3),(4,4)}
Solution: (4)
Reflexive closure: A relation R' is the reflexive closure of a relation R if and only if
(1) R' is reflexive,
(2) R ⸦ R', and
(3) for any relation R'', if R ⸦ R'' and R'' is reflexive, then R' ⸦ R'' , that is, R' is the
smallest relation that satisfies (1) and (2).
Symmetric closure:A relation R' is the symmetric closure of a relation R if and only if
(1) R' is symmetric,
(2) R ⸦ R', and
(3) for any relation R'', if R ⸦ R'', and R'' is symmetric, then R' ⸦ R'' , that is, R' is the
smallest relation that satisfies (1) and (2).
A={1,2,3,4}
B={(1,1),(1,2),(1,4),(2,4),(3,1),(3,2),(4,2),(4,3),(4,4)}
If ∆ is euality relation then Reflexive closure R1 = ∆ ᴜ R ……….(1)
Symmetric closure R2 = R U R-1 …………..(2)
Reflexive closure:
∆={(1,1),(2,2),(3,3),(4,4)}
From (1)
Reflexive closure R1=∆ ᴜ R=
{(1,1),(1,2),(1,4),(2,2),(2,4),(3,1),(3,2),(3,3),(4,2),(4,3),(4,4)}
Symmetric closure:
R-1= {(1,1),(2,1),(4,1),(4,2),(1,3),(2,3),(2,4),(3,4)}
R2=R U R-1= {(1,1),(1,2),(1,3),(1,4),(2,1),(2,3),(2,4),(3,1),(3,2),(3,4),(4,1),(4,2),(4,3)}
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
1 0 0
0 1 1
1 1 1
Q6b) let H=
1 0 0
0 1 0
0 0 1
∴r=n-m=6-3=3
=000x1x2x3
=0.h1r+ 0.h2r+0.h3r=0
∴ x1=0, x2=0,x3=o
∴eH(000)=000000
=001x1x2x3
∴eH(001)=000111
=010x1x2x3
=0.h1r+ 1.h2r+0.h3r=h2r
∴eH(010)=010011
=011x1x2x3
=0.h1r+ 1.h2r+1.h3r=h2r+h3r
∴eH(011)=011100
=100x1x2x3
∴eH(100)=100100
=101x1x2x3
=1.h1r+ 0.h2r+1.h3r=h1r+h3r
∴eH(101)=101011
=110x1x2x3
=1.h1r+ 1.h2r+0.h3r=h1r+h2r
∴eH(110)=110111
=111x1x2x3
∴ x1=h11+h21+h31=1+0+1=0 ,
x2=h12+h22+h32=0+1+1=0,
x3=h13+h23+h33=0+1+1=0
∴eH(111)=111000
e(000)=000000,e(001)=001111,e(010)=010011,e(011)=010011,e(100)=100100,e(101)=1
01011,e(110)=110111,e(111)=111000.
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________
Solution:
Graph G1
Number of vertices 6
Number of Edges 6
Graph G2
Number of vertices 6
Number of Edges 6
We observe that,
Graph G1 has 2 vertices with degree 1, two vertices with degree 2 and two vertices with
degree 2.
Graph G2 has one vertices with degree 1, four vertices with degree 2 and one vertex with
degree 3.
----------------------------------------------------------------------------------------------------------------
__________________________________________________________________________