S.E. Sem. III [CMPN] Discrete Structures Prelim Question Pper Solution 1. () (i) Disjoint set wo sets re si to be isjoint if they hve no elements in common. Exmple : A = {0, 4, 7, 9} n B = {3, 17, 15} (ii) Symmetric ifference he set of elements belonging to one but not both of two given sets. It is therefore the union of the complement of A with respect to B n B with respect to A, n correspons to the XOR opertion in Boolen logic. or exmple, for A = {1,, 3, 4} n B = {1, 4, 5}, A B = {, 3, 5}, since, 3, n 5 re ech in one, but not both, sets. (iii) Prtition set A prtition of set X is set of nonempty subsets of X such tht every element x in X is in exctly one of these subsets[1] (i.e., X is isjoint union of the subsets). Equivlently, fmily of sets P is prtition of X if n only if ll of the following conitions hol: 1) P oes not contin the empty set. ) he union of the sets in P is equl to X. (he sets in P re si to cover X) 3) he intersection of ny two istinct sets in P is empty. (We sy the elements of P re pirwise isjoint) In mthemticl nottion, these conitions cn be represente s 1) P ) A X A P 3) if A, B P n A B then A B =. where is the empty set. he sets in P re clle the blocks, prts or cells of the prtition (iv) Crtesin prouct A B = { (, b) A, b B} Exmple : A = {1,, 3}, B = {, b} B A = {(, 1), (, ), (, 3), (b, 1), (b, ), (b, 3)} A B = {(1, ), (1, b), (, ), (, b), (3, ), (3, b)} Quntifier : Preictes : Consier the following sentences : (i) x is tll n hnsome (ii) x + 3 = 5 (iii) x + y 10 1. (b) 1113/Engg/SE/Pre Pp/013/CMPN/DS_Soln 1
: S.E. DS hese sentences re not propositions, since they o not hve ny truth vlue. However, if vlues re ssigne to the vribles, ech of them becomes, which is either true or flse. or exmple, the bove sentences cn be converte into. (i) He is tll n hnsome (ii) + 3 = 5 (true sttement) (iii) + 5 10 (flse sttement) Definitions : An ssertion tht contins one or more vribles is clle Preicte its truth vlue is preicte fter ssigning truth vlues to its vribles. A preicte P contining n vribles x 1, x,, x is clle n n-plce preicte. Exmples (i) n (ii) re one-plce preicte. While Exmple (iii) is -plce preicte. If we wnt to specify the vribles in preicte, we enote the preicte by P(x 1, x,, x n ). Ech rible x 1 is lso clle s n rgument. Exmple : (i) x is city in Ini is enote by P(x). (ii) x is the fther of y is enote by P (x, y) (iii) x + y z is enote by P(x, y, z) he vlues which the vribles my ssume constitute collection or set clle s the universe of iscourse. When we specify vlue for vrible ppering in preicte, we bin tht vrible. A preicte becomes proposition only when ll its vribles re boun. Consier the following exmples. (i) P(x) : x + 3 = 5 Let the universe of iscourse be the set of nturl numbers. Putting x = 1, we get the one-plce preicte P(1, y) : 1 + y = 10. urther setting y = 10. We obtin the proposition P(1, 9) which is true. However if we set y = 10k p(1, 10) is flse proposition. In ech cse, we hve boun both the vribles (x by 1, y by 9 n y by 10.) A secon metho of bining iniviul vribles in preicte is by Quntifiction of the vrible. he most common forms of quntifiction re universl n Existentil. Given sttement such s P : is not rtionl number. Negtion of P i.e. ~ P : is rtionl number. 1. (c) he igrph of R is shown in ig. x R y mens tht there is pth of length n from x to y in R. R Since R n R R b Since R n R b R c Since R b n b R c b R e Since b R c n c R e b R Since b R c n c R c R e Since c R n R e Hence R = {(, ), (, b), (, c), (b, e), (b, ), (c, e)} e b c 1013/Engg/SE/Pre Pp/013/CMPN/DS_Soln
Prelim Question Pper Solution o compute R, we nee ll orere pirs of vertices for which there is pth of ny length from the first vertex to the secon. rom ig. we see tht. R = {(, ), (, b), (, c), (, ), (, e), (b, c), (b, ), (b, e), (c, ), (c, e), (, e)}. or exmple, (, ) R, since there is pth of length 3 from to :, b, c,. Similrly, (, e) R, since there is pth of length 3 from to e : ; b, c, e. 1. () A = {1,, 3, 4, 5, 6} for pir of numbers sets will A 1 = {1, 6} A = {, 5} A 3 = {3, 4} 1. (e). () So, by pigeonhole principle, we hve to 1 set extr, Ans. = 4 Show tht the grph given re plner. Let f : R -{} R -{0} is efine by f(x) = consier f(x 1 ) = f(x ) 1 1 = x1 x or, x = x 1 x = x 1 f is injective 1 x x y R {} (omin) R {} (coomin) Consier n rbitrry element y in R-{} (coomin) y = f (x) 1 y = x 1113/Engg/SE/Pre Pp/013/CMPN/DS_Soln 3
: S.E. DS or xy y = 1 xy = 1 + y x = 1 y y R {0} (coomin) Preimge x R {} (omin) Rnge of f = w omin f is subjective f is injective n surjective f is bijective f 1 exist y = f(x) x = f 1 (y) 1 y = x xy y = 1 x = 1 y = f 1 (y) he rule for f 1 is f 1 (x) = 1 x. (b) he corresponing homogeneous recurrence reltion of the given recurrence is given by: n + 5 n + 1 + 6 n = 0 he chrcteristics eqution is : 5 + 6 = 0 = 3, herefore, the homogeneous solution of the given recurrence reltion, we get, h n = A1(3) n + A() n o fin prticulr solution, we consier the term f(n). Since f(n) is constnt, the prticulr solution will lso be constnt P. i.e. n = P, for ll n => n+1 = n+ = P (constnt) Substituting the vlues of n, n + 1, n + in the given recurrence reltion, we get. P 5P + 6P = P = P = 1 Hence, the prticulr solution is, p n 1 hus the totl solution of the given recurrence reltion is, h p n = n n n = A1(3) n + A() n + 1 o etermine A1 n A, use given initil conitions, i.e. 0 = 1, 1 = 1. 4 1013/Engg/SE/Pre Pp/013/CMPN/DS_Soln
. (c) 3. () Prelim Question Pper Solution In figure below, Vertices n b hve o egree so there is no Euler circuit there is n Euler pth. Eulerin pth : -c-f-g--e-c--b-g-f--b b eg() = 3 eg(b) = 3 f g eg(c) = 4 eg() = 4 eg(e) = eg(f) = 4 e eg(g) = 4 In figure below, c number of rtios is 6. Ech vertex hs egree greter thn or equl to 6/. So there is n hrniltonin circuit. :, f, e,, c, b, Hmiltonin pth : -f-e--c-b- e 85 70 195 H 0 45 50 115 B 500 f Let I, H, B be sets of wtches of footbll, hockey n bsketbll respectively, Here 50 people o not wtch ny of these kins of grner. he number of people who wtch tlest one of there kins of gmes. i.e. H B = otl no. of wtchers the no. of people o not wtch ny gmes = 500 50 = 450 Here = 85 H = 195 B = 115 B = 45, H = 70, H B = 50 i) he number of people wtch ll three types of gmes = H B By ition principle H B = + B + H B H B H + B H 450 = 85 + 195 + 115 45 70 50 + B H H B = 450 430 = 0 b c 190 50 95 H 0 5 30 40 500 1113/Engg/SE/Pre Pp/013/CMPN/DS_Soln 5
: S.E. DS ii) he number of people who wtch only footbll gme. = B H + H B = 85 70 45 + 0 = 190 Number of people who wtch only hockey gme = H H H B + H B = 195 70 50 + 0 = 95 he number of people who wtch only bsketbll = B B H B + H B = 115 45 50 + 0 = 40 he number of people wtch exctly one of the sport = 190 + 95 + 40 = 35 3. (b) (i) Contingency (q p) (q p) p q p (q p) (q p) (q p) (q ~p) (ii) q (q p) p q q p q (q p) Contingency. (iii) p (q p) p q q p q (q p) Contingency. () We hve, (b c) = I = while ( b) ( c) = b 0 = b So fig. () is non-istributive. (b) Observe tht (b c) = I = while ( b) ( c) = 0 0 = 0 So ig. (b) is non-istributive. 3. (c) 6 1013/Engg/SE/Pre Pp/013/CMPN/DS_Soln
4. () Prelim Question Pper Solution Given connecte, unirecte grph, spnning tree of tht grph is subgrph tht is tree n connects ll the vertices together. A single grph cn hve mny ifferent spnning trees. We cn lso ssign weight to ech ege, which is number representing how unfvorble it is, n use this to ssign weight to spnning tree by computing the sum of the weights of the eges in tht spnning tree. A minimum spnning tree (MS) or minimum weight spnning tree is then spnning tree with weight less thn or equl to the weight of every other spnning tree. Prim s Algorithm Proof : Let R hve n vertices. Let be the spnning tree for R prouce by Prim s lgorithm. Suppose tht the eges of, in the orer in which they were selecte, re t 1, t. t n 1 or ech i from 1 to n 1, we efine i to be the tree with eges t 1, t, t n 1. or ech i from 1 to n 1, we t i+1 efine i to be the tree with eges t 1, t, t i n 0 = { }. S 1 S hen 0 1. n 1 =. We now prove, by mthemticl inuction, tht ech i is contine in miniml spnning tree for R. S r ig.1 Bsis Step : Clerly P(0) : 0 = { } is contine in every miniml spnning tree for R. Inuction Step : We use P (k) : k is contine in miniml spnning tree for R to show P(k + 1) : k+1 is contine in miniml spnning tree for R. By efinition we hve {t 1, t,.., t k }. If t k+1 lso belongs to, then k+1 n we hve P(k + 1) is true. If t k+1 oes not belong, then {t k+1 } must contin cycle. (Why?) his cycle woul be s shown in ig.5 for some eges S 1, S,, S r in. Now the ege of this cycle cnnot ll be from k or k+1 woul contin this cycle. Let s l be the ege with smllest inex l tht is not in k. hen s t hs one vertex in the tree k n one not in k. his mens tht when t k+1 ws chosen by Prim s lgorithm, s l ws lso vilble. hus the weight of s l is t lest s lrge s tht of t k+1. he spnning tree ( {s t }) {t k+1 } contins k+1. he weight of this tree is less thn or equl to the weight of, so it is miniml spnning tree for R. hus, P(k + 1) is true. So n 1 = is contine in miniml spnning tree n must in fct tht miniml spnning tree. Exmple : he smll B.6 town of Socil Circle.7.1 C mintins system of 3.6 4. wlking trils between A.4.9 the recretionl res in town. he system is I. E 3.4 moele by the 1.8.8 3.3 D.1 weighte grph in ig. 4.4 where the weights J.5 represent the istnce H in kilometers between 3. 5.3 sites. 1.7 G ig. 1113/Engg/SE/Pre Pp/013/CMPN/DS_Soln 7
: S.E. DS Exmple : A miniml spnning tree for the communiction network my be foun by using Prim s lgorithm beginning t ny vertex. ig.3 shows miniml spnning tree prouce by beginning t I. he totl cost of upgring these links woul be $0,00,000. If symmetric connecte reltion R hs n vertices, then Prim s lgorithm hs running time (n ). (his cn be improve somewht.) If R hs reltively few eges, ifferent lgorithm my be more efficient. 4. (b) Subgroup Let H be non-empty subset of group G, the subset H is si to be sub group of group G if it forms group w.r.t. binry opertion of G. Exmple : Let G be the cyclic group Z8 whose elements re G = {0,, 4, 6, 1, 3, 5, 7} n whose group opertion is ition moulo eight. Norml subgroup A subgroup H of G is si to be norml subgroup if ll ++ n right cosets of H re ienticl. Its tble is + 0 4 6 1 3 5 7 0 0 4 6 1 3 5 7 4 6 0 3 5 7 1 4 4 6 0 5 7 1 3 6 6 0 4 7 1 3 5 1 1 3 5 7 4 6 0 3 3 5 7 1 4 6 0 5 5 7 1 3 6 0 4 7 7 1 3 5 0 4 6 his group hs two nontrivil subgroups: J={0,4} n H={0,,4,6}, where J is lso subgroup of H. he tble for H is the top-left qurnt of the tble for G. he group G is cyclic, n so re its subgroups. In generl, subgroups of cyclic groups re lso cyclic H A 1.7 B.4.1 1.8 G I.8 J.6 ig.3 C..1.5 E 8 1013/Engg/SE/Pre Pp/013/CMPN/DS_Soln
Prelim Question Pper Solution 4. (c) 5. () b Prepre ecoing tble : 00000 00110 01001 01111 10011 10101 11010 11100 00001 00111 01000 01110 10010 10100 11011 11101 00010 00100 01011 01101 10001 10111 11000 11110 00100 00010 01101 01011 10111 10001 11110 11000 01000 01110 00001 00111 11011 11101 10010 10100 10000 10110 11001 11111 00011 00101 01010 01100 10001 10111 11000 11110 00010 00100 01011 01101 10010 10100 11011 11101 00001 00111 01000 01110 (i) If we receive the wor 11001, we first locte it in the 3 r column of the ecoing tble. Where it is unerline once. he wor t the top of the 3 r column is 01001. Since e(010) = 01001. We ecoe 11001 s 010. (ii) If we receive the wor 01010, we first locte it in the 7 th column of the ecoing tble. Where it is unerline twice. he wor t the top of the 7 th column is 11010. Since e(110) = 11010. We ecoe 01010 s 110. (iii) Similrly 00110 is locte in n column of the ecoing tble where it is unerline thrice. he wor t the top of the n column is 00110. Since e(001) = 00110, we ecoe 00111 t 001. Hsse Digrm of Poset he igrph of prtil orer reltion cn be simplifie n such simplifie grph of prtil orer is clle Hsse igrm. When the prtil orer is totl orer its Hsse igrm is stright line n the corresponing poset is clle chin. (i) A = {1,, 3, 4} n R = {(1, 1), (1, ), (1, 3), (1, 4), (, ), (, 4), (3, 3), (3, 4), (4, 4)} 4 1 3 4 1 3 (ii) A = {, b, c,, e}, R = {(, ), (, c), (, ), (, e), (b, b), (b, c), (b, ), (b, e), (c, c), (c, ), (c, e), (, ), (e, e)} c e c 4 1 e 3 c 4 1 e 3 b b 1113/Engg/SE/Pre Pp/013/CMPN/DS_Soln 9
: S.E. DS 5. (b) 1/ 1/ 1/ 1/ 1/ We fin tht there re four smll equilterl tringles of sies 1/ unit. Since we re choosing 5 pts (5 pigeons) n there re 4 smll tringles (4 pigeon holes) Since no of pigeonholes in less thn no of pigeons pigeonhole principle is pplicble By pigeonhole principle one pigeonhole must hve tlest two pigeons. One smll tringle must hve points Sies of ech smll tringle is 1/ unit wo of them cn not be more thn 1/ unit prt. 5. (c) Isomorphism between two grphs : A grph G 1 = G 1 (V 1, E 1 ) is si to be isomorphic to grph G = G (V, E ) if there is bijective mpping f : V 1 V such tht if U 1, U V 1, then the number of eges joining U 1, U in G 1 is sme s number of eges joining f (U 1 ) n f (U ) in G. In prticulr isomorphism of two grphs results jcency of ny two vertices. o test whether the following grph re isomorphic or not 1/ 1/ 1/ 1/ c 4 3 Note tht both grphs hve 4 vertices n 6 eges. Ech grph hs vertices of egree 4 n vertices of egree. Also the jcency is preserve. he oneone corresponence between the vertices is given by, b b c 3 4 Hence G 1 G. 6. () 1 + 5 + 9 +...+ (4n 3) = n( 1). for n = 1 LHS = 1 RHS = 1(1) = 1 Sttement is true for n = 1. Let the sttement be true for n = k i.e. 1 + 5 + 9 + + (4k 3) = K (k 1) [p(k)] b 1 10 1013/Engg/SE/Pre Pp/013/CMPN/DS_Soln
Prelim Question Pper Solution 6. (b) now we hve to prove P(K) P(K + 1) i.e. 1 + 5 + 9 + + (4 (K)) = (K + 1) (K + 1) hence the result is true for n = 1 Let it be true for n = K i.e. 1 + 5 + 9 + (4K 3) = K (K + 1) LHS = 1 + 5 + 9 + + (4K 3) (4K + 1) = 5 (K 1) +(4K + 1) = K K + 14K + 1 = K + 3 K + 1 = K + K + K + 1 = (K + 1) (K + 1) = RHS P(K) P(K + 1) he result is true for n = K + 1 Hence it is true for ll n. n = 3 n 1 3 n n 3 n 3n 1 3n n 3 = 0 It is liner Homogeneous recurrence reltion. Its chrcteristic eqution is 3 x 3x 3x 1 = 0 3 (x 1) = 0 x = 1, 1, 1 here re three equl roots, the homogeneous solution is given by (h) n n = (u vn wn )( 1) where u, v, w re constnts 0 = 1 0 1 = (u v 0 w 0) ( 1) u = 1 1 = = (u 1 v 1 w)( 1) 1 = v + w n = 1 1 = (u v 4w)( 1) = v + 4w 1 = v + w = w w = v = 3 Solution is n n = (1 3n n )( 1) 1113/Engg/SE/Pre Pp/013/CMPN/DS_Soln 11
: S.E. DS 6. (c) he recurrence reltion is given by fn fn 1 fn which is homogenous & liner. he qurtic eqution is x = x + 1, f 1 = f = 1 x x 1 = 0 x = 1 1 4 x = 1 5 1 5 1 5 X 1 = ; x n n f n = us vs 1 f n 1 5 1 5 = u v Put n = 1 f 1 1 5 1 5 = u v Put n = f = n 1 5 1 5 u v = 1 (1) n 1 5 1 5 u v 1 5 1 5 u v = 1 () 1 1 Solving (1) & () simultneous u &v 5 5 f n = n 1 1 5 1 1 5 5 5 n 1 1013/Engg/SE/Pre Pp/013/CMPN/DS_Soln