Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Structures
CLICK TO VIEW
>>Syllabus
>>Solved Questions
CREDITS 04
Prepare for a background in abstraction, notation, and critical thinking for the mathematics most
directly related to computer science.
Understand and apply logic, relations, functions, basic set theory, countability and counting arguments,
proof techniques,
Understand and apply mathematical induction, combinatorics, discrete probability, recursion, sequence
and recurrence, elementary number theory
Understand and apply graph theory and mathematical proof techniques.
Module -1 Teaching
Hours
Fundamentals of Logic: Basic Connectives and Truth Tables, Logic Equivalence The 10Hours
Laws of Logic, Logical Implication Rules of Inference. The Use of Quantifiers,
Quantifiers, Definitions and the Proofs of Theorems,
Textbook 1: Ch 2
Module -2
Properties of the Integers: Mathematical Induction, The Well Ordering Principle 10 Hours
Mathematical Induction, Recursive Definitions. Fundamental Principles of Counting:
The Rules of Sum and Product, Permutations, Combinations The Binomial Theorem,
Combinations with Repetition,
Textbook 1: Ch 4: 4.1, 4.2 Ch 1.
Module 3
Relations and Functions: Cartesian Products and Relations, Functions Plain and One-to- 10 Hours
One, Onto Functions. The Pigeon-hole Principle, Function Composition and Inverse
Functions. Properties of Relations, Computer Recognition Zero-One Matrices and
Directed Graphs, Partial Orders Hasse Diagrams, Equivalence Relations and Partitions.
Textbook 1: Ch 5:5.1 to 5.3, 5.5, 5.6, Ch 7:7.1 to 7.4
Module-4
12 | P a g e
The Principle of Inclusion and Exclusion: The Principle of Inclusion and Exclusion, 10 Hours
Generalizations of the Principle, Derangements Nothing is in its Right Place, Rook
Polynomials. Recurrence Relations: First Order Linear Recurrence Relation, The Second
Order Linear Homogeneous Recurrence Relation with Constant Coefficients.
Textbook 1: Ch 8: 8.1 to 8.4, Ch 10:10.1 to 10.2
Module-5
Text Books:
1. Ralph P. Grimaldi: Discrete and Combinatorial Mathematics, , 5th Edition, Pearson Education. 2004.
Reference Books:
1. Basavaraj S Anami and Venakanna S Madalli: Discrete Mathematics A Concept based approach,
Universities Press, 2016
2. Kenneth H. Rosen: Discrete Mathematics and its Applications, 6th Edition, McGraw Hill, 2007.
3. Jayant Ganguly: A Treatise on Discrete Mathematical Structures, Sanguine-Pearson, 2010.
4. D.S. Malik and M.K. Sen: Discrete Mathematical Structures: Theory and Applications, Thomson,
2004.
5. Thomas Koshy: Discrete Mathematics with Applications, Elsevier, 2005, Reprint 2008.
13 | P a g e
DISCRETE MATHEMATICAL STRUCTURES 15CS35
Sol: Power Set: The collection of all subsets of a set A is called the power set
of A, and is represented P(A).
For instance, if A = {1, 2, 3,4}, then
P(A) = {, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3},{1,2,3},{2,3,4},
{1,3,4},{1,2,4}. A}.
2. Using laws of set theory show that A (A B) = A (A B) - (5m)
Jun 2015/Jan 2016
Sol:A (A B) = A (A B1) [i.e A B = A B1]
= A ( A B 1 )1 [i . e A B = A B 1 ]
= A (A1 U B) [Demorgans Law]
= (A A1) U (A B) [Distributive Law]
= U (A B) [i.e. A A1 = ]
= A B
3. In a survey of 260 college students, the following data were obtained: 64
had taken a mathematics course, 94 had taken a computer science course,
58 had taken a business course, 28 had taken both a mathematics and a
business course, 26 had taken both a mathematics and a computer science
course, 22 had taken both a computer science and a business course, and 14
had taken all three types
i. How many of these students had taken none of the three courses?
ii. How many had taken only a computer science courses ? - ( 1 1 m)
Jun 2015 / Jan 2016
Solution:
Given: U=260 |A|=64 |B|=94 |C|=58 |A C| = 28 |A B| = 26 |B C| = 22 |A B C |
= 14
|A U B U C| =? |B1| =?
|A U B U C| = A + B + C |A B| |B C| |A C| + |A B C|
= 64 + 94 + 58 26 22 28 + 14
= 154
i. |A U B U C| = U |A U B U C|
= 260 154
= 106
ii.|B1| = |B| - |B C| - |B A| + |A B C|
= 94 22 26 + 14 = 60
AUB=AB
Consider RHS, A B = { x / x A and x B }
= { x / x A and x B }
={x/x (A U B) }
=AUB
The union of compliment of 2 sets is equal to the compliment of intersection of the
2 sets.
AUB=A B
Consider LHS, A U B = { x / { x / x A or x B }
= { x / x A or x B }
={x/x (A B) }
6. In a survey of 260 college students, the following data were obtained: 64 had
taken a mathematics course, 94 had taken a computer science course, 58 had
taken a business course, 28 had taken both a mathematics and a business course,
26 had taken both a mathematics and a computer science course, 22 had taken
both a computer science and a business course, and 14 had taken all three types
of courses.
i. How many of these students had taken none of the three courses?
ii. How many had taken only a computer science courses (8m) june 2016
Solution:
Given: U=260 |A|=64 |B|=94 |C|=58 |A C| = 28 |A B| = 26 |B C| = 22 |A B C |
= 14
|A U B U C| =? |B1| =?
|A U B U C| = A + B + C |A B| |B C| |A C| + |A B C|
= 64 + 94 + 58 26 22 28 + 14
= 154
iii. |A U B U C| = U |A U B U C|
= 260 154
= 106
iv. |B1| = |B| - |B C| - |B A| + |A B C|
= 94 22 26 + 14
= 60
7. For any two sets A and B, prove the following (2m) june 2016
A (A B ) = A B
Solution: A (A B) = A (A B1) [i.e A B = A B1]
= A ( A B 1 )1 [i . e A B = A B 1 ]
= A (A1 U B) [Demorgans Law]
= (A A1) U (A B) [Distributive Law]
=U (A B) [i.e. A A1 = ]
= A B
8. Determine the sets A and B given that A B = {1, 2, 4}, B A = {7, 8} and
AUB = {1, 2, 4, 5, 7, 8, 9} (4m) jan 2015
Solution: set A
A = (A U B) (B A)
= [{1,2,4,5,7,8,9}] [{7,8}]
= {1, 2, 4, 5, 9}
Set B
B = (A U B ) (A B )
= [{1,2,4,5,7,8,9}] [{1,2,4}]
= {5, 7, 8, 9}
We see that |(M\P)-(M\P\C)| = 100-10 = 90, |(M\C)-(M\ P \C)| = 150-10 = 140 and |(P
\C)-(M \P \C)| = 75-10 = 65.
Then the region corresponding to students taking Mathematics courses only has
cardinality 300-(90+10+140) = 60. Analogously we compute the number of students
taking Ph ysics courses only (185) and taking Computer Science courses only (235). The
sum 60 + 185 + 235 = 480 is the number of students taking exactly one of those courses.
10. For any three sets A,B and C prove that (A-B)-C =A (BUC) = (A-C) (B-C) -6M
jan 2015
Solution: (A-B) C = (AB) C
= A (B C )
= A (B C )
= A (BC)
(A C) (B C) = (A C) (B C)
= (A C) (B C1)
= (A C) (BU C)
= [(A C) B)] U [(A C) C]
= [(A (CB)] U [A (CC)]
= [A (CUB) ] U (A)
= [A (BUC) ] U
= [A (B U C ) ]
= [A - (BUC)]
12. Determine the sets A and B given that A B = {1, 3, 7, 11}, B A = {2, 6,
8} and AB = {4, 9} (5m) june 2014
Solution: set A
A = (A B) + (AB)
= [{1, 3, 7, 11}] + [{4, 9}]
= {1, 3, 4, 7, 9, 11}
Set B
B = (B-A) + (AB)
= [{2, 6, 8}] [{4, 9}]
= {2, 4, 6, 8, 9}
1 1
13. Prove that: AB= (BA ) U (AB ) = (B-A) U (A-B). ( 4 m) june 2014
1 1
Solution: AB= (BA ) U (AB ) = (B-A) U (A-B).
Let A=P1 U P2 B=P2 U P3
B A = P3, A B = P1
Therefore (B A) U (A B) = P3 U P1 (2)
A=U - A = P3 U P4, AND B=U B = P1U P4
B A= P3, A B = P1 Therefore (B A1) U (A B1) = P3 U P1
(3)
From (1), (2) and (3), AB= (BA) U (AB) = (B-A) U (A-B).
14. Using Venn diagram, prove the following property of the symmetric difference:
A ( B C) = ( A B ) C ( 4 m) jan 2015
Solution: By using Venn diagram,
Where, A = P1 U P2 U P3 U P4 B = P2 U P3 U P5 U P6 C = P3 U P4 U P6 U P7
L.H.S (BC) = (B U C) (BC) = P2 U P4 U P5 U P7
A U (BC) = P1 U P3 U P2 U P4 U P5 U P7 A (BC) = P2 U P4
A (BC) = A U (BC) - A (BC) = P1 U P3 U P5 U P7.
R.H.S (AB) = (A U B) (B A) = P1 U P4 U P5 U P7
(A B) U C) = P1 U P4 U P5 U P6 U P3 U P7
(A B) C) = P4 U P6
(A B)C) = (A B) U C) - (A B) C) = P1 U P5 U P3 U P7
So that L.H.S = R.H.S Hence proved
15. Thirty cars are assembled in a factory. The options available are a transistor, an
air conditioner and power windows. It is known that 15 of the cars have
transistor, 8 of them have conditioners and 6 of them have power windows.
Moreover, 3 of them have all three options. Determine at least how many cars do
not have any options at all. ( 5 m) Jan 2016
Solution: Given data:
|U| = 30 Total cars |A| = 15 Transistors |B| =8 Air conditioners
|C|= 6 Power windows |A B C| = 3 All options
i) |A U B U C| = |A| + |B| + |C| - |A B| - |B C| - |C A|
+ |A B C|
Here A B, B C, C A is a subset of A B C
So
|A U B U C| |A| + |B| + |C| - 2|A B C| 15 + 8 + 6 -2(3) 29 6 = 23
1
(A U B U C) is the set of cars that do not have any option.
1
|A U B U C| |U|- |A U B U C|
30 23 = 7
Therefore a minimum of 7 cars has none of the options.
16. A survey on a sample of 25 new cars showed that the cars had the following
15 cars had air conditioners
12 cars had radios
11 cars had power windows
5 cars had air conditioners and power windows
9 cars had air conditioners and radios
4 cars had radios and power windows
3 cars had all the three options
Find the number of cars that had
i) only power windows
ii) at least one option ( 7 m) Jan 2016
Solution: Given data:
|U| = 25 Total cars
|A| = 15 Air conditioners
|R| = 12 Radios
|W|= 11 Power windows
|A R| = 9 Air conditioners and Radios
|A W| = 5 Air conditioners and Power windows
|R W| = 4 Radios and Power windows
|A R W| = 3 All options
i) only power windows:
|W| = |W A R |
= |W| - |A W| - |R W| + |A R W|
= 11 5 4 + 3
=5
5 CARS HAVE ONLY POWER WINDOWS
ii) At least one option:
|W U A U R| = |W| + |A| + |R| - |A R| - |A W| - |R W|
+ |A R W|
= 11 + 15 + 12 5 9 4 + 3
= 23
17. A survey of 500 television viewers of sports channel produced the following
information: 285 watch cricket, 195 watch hockey, 115 watch foot ball, 45 watch
cricket and foot ball, 70 watch cricket and hockey, 50 watch hockey and foot ball
and 50 do not watch any of the three kinds of games
i) How many viewers in survey watch all three kinds of games?
ii) How many viewers watch exactly one sport? (8m) Jan 2016
Solution: At least one:
|CU H U F| = |U| - |C U F U H|1
=500 50 = 450 do watch any of the games
|C U H U F| = |C| + |F| +|F| -|CF|-|CH|-|HF|+|CFH|
But |CFH| means those viewers who watch all the 3 games.
So, |CFH|= |C U H U F| -|C| - |H| -|F| +|CF|+|CH|+|HF|
= 4 5 0 2 8 5 1 9 5 1 1 5 +4 5 +7 0 +5 0
= 20
Therefore 20 viewers watch all the 3 games.
2) Only cricket viewers:
|C1| = |C H - F|
= |C|-|CF|-|CH|+|CFH|
= 285 -70 -45 +20
=190
3) only hockey viewers:
|H1| = | H - C - F|
= |H|-|HF|-|CH|+|CFH|
= 195 -50 -70 +20
= 95
18. The freshman class of a private engineering college has 300 students. It is known
that 180 can program in PASCAL, 120 in FORTRAN, 30 in c++, 12 in PASCAL
and c++, 18 in FORTRAN and c++, 12 in PASCAL and FORTRAN, and 6 in all
three languages If two students are selected at random, what is the probability
that they can
i) Both program in PASCAL?
ii) Both program only in PASCAL? ( 6 m) Jan 2016
300
Solution: the number of ways of selecting 2 students from 300 is c
2.
180
The number of ways of selecting 2 students from those who can program Pascal is c.
2
162
The number of ways of selecting 2 students who can program only in Pascal is c.
2
The probability of selecting two students both of whom can program in Pascal is
180 300
c / c
2 2
= 0 .3 5 9 O R 3 5 .9 %
The probability of selecting two students both of whom can program in Pascal only is
162 300
c / c
2 2
=0.291 OR 29.1%.
19. In a survey of 120 passengers, an airline found that 48 enjoyed wine with their
meals, 78 enjoyed mixed drinks, 66 enjoyed iced tea. In addition, 36 enjoyed any
given pair of these beverages and 24 enjoyed them all. If two passengers are
selected at random from thee survey sample of 120, what is the probability that
they both want only iced tea with their meals? ( 7 m) Jan 2016
Solution: from the information provided, we construct the Venn diagram .The sample
space constants of the pairs of passengers we can select from the sample of 120.
120
So |S| = c =7140
2
A) Only iced tea = T = | T W C |
1
= |T| -|TW| - |TC| - |TWC|
= 66 36 36 + 24 = 18
The Venn diagram indicates that there are 18 passengers who drink only ice tea.
18
So |A| = c = 153
2
Therefore p (A) = |A| / |S|
= 153 / 7140
= 51 / 2380.
B) Exactly 2 of the 3 type
Only T and C = |TC| - |TWC| .i
36 24 = 12
Only C and W = |WC| - |TWC| ..ii
36 24 = 12
Only W and T =|WT| - |TWC| iii
36 24 = 12
Adding i, ii, iii we get = 12 + 12 + 12
= 36 = |B|
36 120
Therefore p (B) = c / c
2 2
=3/4.
20. Find the probability of getting a sum different from 10 or 12 after rolling two
dice. (5m) Jan 2015
Solution : We can get 10 in 3 different ways:
4 + 6, 5 + 5, 6 + 4, so P (10) 3/36. Similarly we get that P (12) 1/36. Since they are
mutually exclusive events, the probability of getting 10 or 12 is P (10) + P (12) 3/36
+ 1/36 4/36 1/9. So the probability of not getting 10 or 12 is 1 1/9 8/9.
3. Complement : The set of elements (in the universal set) that do not b elong to a
g i v e n s et :
A = {x e U | x / e A } .
4. Difference or Relative Complement : The set of elements that b elong to a set but
not to another:
A - B = {x | (x e A) (x /e B)} = A B .
5. Symmetric Difference : Given two sets, their symmetric differ- ence is the set of
elements that b elong to either one or the other set but not both.
A B = {x | (x e A) (x e B)} .
22. A compuer services company has 300 programmers. It is known that 180 of these
can program pascal, 120 in FORTRAN, 30 in c++, 12 in pascal and c++, 18 in
FORTRAN and c++, 12 in pascal and FORTRAN and 6 in all the three.
a) If a programmer is selected at random what is the probability that she
can program in exactly two languages?
Sol:
25. Let p, q be primitives statements for which implication p q is false. Determine the
truth values of the following. Jun 2015 / Jan 2016
Sol: 5 marks
p q pv q qv p (p v q) (q v p)
T T T T T
T F T T T
F T T T T
F F F F T
26. By constructing the truth table. Show that the compound propositions pAND(~q V r)
Jun 2015 / Jan 2016
Sol: 5 marks
27. Prove the following logical statement is a tautology: Jun 2015 / Jan 2016 .
sol: 5 marks
28. Let p, q be primitives statements for which implication .June 2015 / Jan 2016
Sol: 5 marks
29. Discuss the basic connectives that are used in logic. (6m) Jun 2016
Solution: new proposition are often formed by starting with given propositions with the
aid of words or phrases like not, and, ifthen, and if and only if such words or
phrases w=are called connectives
a) Negation: a proposition obtained by inserting the word not
at an appropriate places in a given propositions called negation of given proposition and is
denoted by ~p ( p is any proposition).
b) Conjunction: a compound proposition obtained by combining two given propositions
by inserting the word and in between them is called conjunction (denoted by p ^ q)
c) Disjunction: a compound proposition obtained by inserting the word or in between
them is called disjunction (denoted by p v q)
d) Conditional: a compound proposition obtained by combining two given proposition
by using the word if and then at appropriate place is called a conditional proposition
and is denoted by p q
30. Given p and q statements, explain the following terms (7m) Jun 2016
a) Conjunction b) disjunction c) logically Equivalence d) tautology
Solution:
a) conjunction: a compound proposition obtained by combining two given propositions
by inserting the word and in between them is called conjunction (denoted by p ^ q)
b) Disjunction: a compound proposition obtained by inserting the word or in between
them is called disjunction (denoted by p v q)
c) Logical equivalence : Two propositions p and q are said to be logical equivalent where
p and q have the same truth value or equivalently the biconditional p q is tautology.
Then we denote p q.
d) Tautology: a compound proposition which is always true regardless of the truth values
of its components is called a Tautology.
p q pv q qv p (p v q) (q v p)
T T T T T
T F T T T
F T T T T
F F F F T
32. Define converse, inverse and contra positive of a statement: (4m) Jun 2016
Solution:
Consider a conditional (pq) , Then :
1) qp is called the converse of pq
2) pq is called the inverse of pq
3) qp is called the contrapositive of pq
4) The converse of a conditional prop osition p q is the prop osition q
p. As we have seen, the bi- conditional prop osition is equivalent
to the conjunction of a conditional prop osition an its converse.
p q (p q) (q p)
So, for instance, saying that John is married if and only if he has a
sp ouse is the same as saying if John is married then he has a sp ouse
and if he has a sp ouse then he is married.
33. Find the truth value of p,q,r for the following using truth tables:
(5m) Jun 2016
Sol:
36. Find the truth values for the following logical expressions: (4m) Jan 2015
Sol:
37. Write the truth table for the following: ( 8 m) jun 2014
Sol:
39. Verify whether the following logical expressions are tautology or contradiction
using truth tables: ( 6 m) jun 2014
Sol:
43. Prove the following logical statement is a tautology. (5m) Jan 2016
Sol:
MODULE-2
Sol:
13. Verify the rules of inference from the following truth tables: (6m) jun 2015
Sol:
15. Find converse inverse and contra positive of the logical expressions given
below: (4m) jun 2015
Sol:
Sol:
Sol:
19. For all positive integers n, prove that if n>=24, then n can be written as a sum
of 5s and 7s. (6m) Jun 2016
Sol:
i ) Basic Step:
24= (5+5) + (7+7)
This shows that s (24) is true
ii) Induction step: suppose s(n) is true
m = (5 + 5 + . )+ (7 + 7 + . )
if suppose m has r numbers of 5 and s numbers of 7.then we represent this as follows.
M + 1 = [(5 + 5 + . ) + (7 + 7 + . ) + 1 ]
r s
= [(5 + 5 + . ) + (7 + 7 + ) + (7 + 7 ) + 1 ]
r s-2
= [(5+5+.) + (7+7+)]
r+ 3 s-2
This shows that Q (m+1) is a sum of 7 and5.Thus s (m+1) is true.
n-1
21. By induction prove that !n 2 for all integers n1. ( 7 m) Jan 2015
n-1
Solution: Let p (n) be the predicate !n 2 where n0 =1.
= (k + 1) / 6 * (2k + 9) (K + 2)
25. A sequence an is defined by a1=3, an=an-1+an+1, for n>=2, find an explicit form:
Sol: (4m) Jun 2015
26. For n>=0 let fn denote the nth Fibonacci number. Prove that (4m) Jun 2015
F0+f1+f2+.+fn= Summation Fi= fn+2 -1
Sol:
MODULE-3
1. Let A= {1,2,3,4} and let R be the relation defined by R = {(x,y)| x,y belongs to
A, X<=y}. Determine whether R is reflexive, symmetric, Anti symmetric or
transitive. (5m) Jan 2016
Sol:
Reflexive if for all x e A, x R x. For instance on Z the relation equal to (=) is
reflexive.
2. Transitive if for all x, y , z e A, x R y and y R z implies x R z. For instance
equality (=) and inequality (<) on Z are transitive relations.
3. Symmetric if for all x, y e A, x R y = y R x. For instance on Z, equality (=) is
s ymmetric, but strict inequality (<) is not.
4. Antisymmetric if for all x, y e A, x R y and y R x implies x = y.
For instance, non-strict inequality () on Z is antisymmetric.
4. Let A={2,3,4,6,8,12,24} and let<= denotes the partial order of divisibility that
is x<=y means x|y. Let B = {4,6,12}. Determine: (4m) Jan 2016
a) All upper bounds of B
b) All lower bounds of B
c) Least upper bound of B
d) Greatest lower bound of B
Sol:
Similarly [(2,4)]={(1,5),(2,4),(3,3),(4,2),(5,1)}
[(1 , 1 )]= { (1 , 1 )}
6. Let A= {1,2,3,4,6} and r be the relation on A defined by(a,b) belongs to R if
and only if a is a multiple of b. write down R as a set of ordered pairs.
(4m) Jun 2016
So l u t i o n : From the way R has been defined
R= {(a,b) | a,b belongs to A and a is a multiple of b}
= {(1,1), (2,1), (2,2), (3,1),
(3,3),(4,1),(4,2),(4,4),(6,1),(6,2),(6,3),(6,6)}
Therefore, is symmetric
c. Let, (a, b) R (c, d) and (c, d) R (e, f)
=> a + b = c + d and c + d = e + f.
=>a + b = e + f
=> (a, b) R (e, f)
Therefore, R is transitive and
Therefore, R is an equivalence Relation.
10. A = {1, 2, 3} find
a. R1 = {(1, 1) (2, 2) (3, 3)}
b. R2 = {(1, 2) (2, 1) (1, 3) (3, 1) (2, 3), (3, 2)}
c. R3 = A x A ( 7 m) Jan 2015
Sol:
We have, A= {1, 2, 3}
a. R1 = {1, 1) (2, 2), (3, 3)}
Reflexive: a R a, V a A.
(1, 1) (2, 2) (3, 3) R
Hence, R is reflexive.
Symmetric: Let a R b
=> 1R2
2 is not Related to 1 and also b is not Related to a
Hence, R is not symmetric
Transitive: Let a R b and b R c
=> 1 R 2 and 2 R 3 but, 1 is not Related to 3 and
also a is not Related to c
Hence, R is not transitive.
Therefore, R is not an equivalence Relation.
b. R = {(1, 2), (2, 1) (1, 3) (3, 1) (2, 3) (3, 2)}
Reflexive: a R a V a A
Hence, R1 n R2 is transitive.
Therefore, R1 n R2 is an equivalence Relation.
13. Let A = {I, 2, 3, 4} and B = (A x A). Define a Relation R on B as (a, b) R (c, d)
if a + b = c +d. S.T. R is an equivalence relation and compute B/R.
Sol: (4m) Jun 2015
R {(1, 1)} = {(1, 1)} and B = {(1, 1) (1, 2) (1, 3) (1, 4)
R {(1, 2)} = {(1, 2), (2, 1)}
R { (1 , 3 )} = { (1 , 3 ), (3 , 1 ), (2 , 2 )}
R { (1 , 4 )} = { (1 , 4 ), (4 , 1 ), (2 , 3 ), (3 , 2 )}
R { (2 , 4 )} = { (2 , 4 ), (4 , 2 ), (3 , 3 )}
R {(3, 4)} = {(3, 4), (4, 3)}
R {(4, 4)} = {(4, 4)}
P = B/R = {R {(1, 1)}, R {(1, 2)}, R {(1, 3)}, R {(1, 4)}, R {(2, 4)}, R {(3, 4)}, R {4, 4)}
14. Let, A = {a, b, c}, B = {1, 2, 3}, R = {(a, 1) (b, 1) (c, 2) (c, 3)} S = {(a, 1), (a, 2)
(b, 1) (b, 2)} Compute R~, S~, R U S, R n S, R-1, S-1 where(R~ is R compliment)
sol: (6m) Jun 2015
A x B = { (a , l ) (a , 2 ) (a , 3 ) (b , 1 ) (b , 2 ) (b , 3 ) (c , l ) (c , 2 ) (c , 3 )}
R = {(a, 2) (a, 3) (b, 2) (b, 3) (c, 1)}
S = {(a, 3) (b, 3) (c, 1) (c, 2) (c, 3)}
R U S = {(a, 1) (b, 1) (c, 2) (c, 3) (a, 2) (b, 2)}
R n S = {a, 1) (b, 1)}
15. Let A = {1, 2, 3} Rand S be relations on A whose matrices are, (8m) Jun 2014
Sol:
101 011
MR = 011 and Ms = 110
000 000
Determine relations R, R U S, R n Sand S-l and their matrix representation.
R = { (1 , 1 ) (1 , 3 ) (2 , 2 ) ( 2 , 3 )}
S = {(1, 2) (1, 3) (2, 1) (2, 2) (3, 2)}
R = { (1 , 2 ) (2 , 1 ) (3 , 1 ) ( 3 , 2 ) (3 , 3 )}
010
MR~ = 100
111
S~ = {(1, 1) (2, 3) (3, 1) (3, 3)} (s compliment)
100
~
Ms = 001
101
111
MRUS = 111
010
R n S = { (1 , 3 ) (2 , 2 )}
001
MRnS = 010
000
S-1 = {(2, 1) (3, 1) (1, 2) (2, 2) (2, 3)}
010
MS-1 = 111
100
16. Let A = {a, b, c} and Rand S be relations on A whose matrices are given
below. Find the composite relation S o R, R o R, R o S, S o S and their
matrices. (8m) Jun 2014
Sol:
010
MR = 111
010
100
MS = 011
101
R = { (a , a ) (a , c ) (b , a ) (b , b ) (b , c ) (c , b )}
S = { (a , a ) (b , b ) (b , c ) (c , a ) (c , c )}
S o R = { (a , a ), (a , c ) (b , a ) (b , b ) (b , c ) (c , b ) (c , c ) }
19. Define reflexive transitive and symmetric relations with respect to quantifiers.
(5m) Jan 2014
Sol:
20. Draw the hasse diagram for the poset (p(u)) where u={1,2,3,4} (5m) Jan 2016
Sol:
21. Let A={1,2,3,6,9,18} and define R on A by xRy if x|y. Draw hasse diagram of
the poset. (5m) Jan 2016
Sol:
MODULE-4
Relations contd
1. Define the Cartesian product of two sets. For any non-empty sets A,B,C prove
that A X (B U C) = (A X B) U (A X C) (5m) Jan 2016
Sol:
Defn: In mathematics, a Cartesian product is a mathematical operation which
returns aset (or product set) from multiple sets. That is, for sets A and B, the
Cartesian product A B is the set of all ordered pairs (a, b) where a A and b B.
Assume (x,y) is an element of A X (B U C). This means x is an element of A and y
is an element of B or y is an element of C. Since (x,y) can be x as an element of A
and y as an element of B, (x,y) is an element of A X B. Since (x,y) can also have x
as an element of A and y as an element of C, (x,y) is an element of A X C.
A X (B intersect C)= (A X B) intersect (A X C)
2. Define the following with one example for each i) Function ii) one-to one
function iii) onto function. (6m) Jan 2016
Sol: function def: a function is a relation between a set of inputs and a set of
permissible outputs with the property that each input is related to exactly one
output.
Or
Definition (function): A function, denote it by f, from a set A to a set B is a
relation from A to B that satisfies
1. for each element a in A, there is an element b in B such that <a, b> is in the
relation, and
2. if <a, b> and <a, c> are in the relation, then b = c .
The set A in the above definition is called the domain of the function
and B its codomain.
Thus, f is a function if it covers the domain (maps every element of the domain)
and it is single valued.
(i) O ne -o ne de fn: one-to-one function is afunction that
preserves distinctness: it never maps distinct elements of its domain to the
same element of its codomain.
3. State the pigeonhole principle. An office employs 13 clerks. Show that at least
2 of them will have birthdays during the same month of the year.
(4m) Jan 2016
Sol: If m pigeons are put into m pigeonholes, there is an empty hole iff there's a
hole with more than one pigeon
Proof.
The number of friends of a person x is an integer k with 0 k n 1. If there is a
person y whose number of friends is n 1, then ever yone is a friend of y, that is,
no one has 0 friend. This means that 0 and n 1 cannot be simultaneously the
numbers of friends of some people in the group. The pigeonhole principle tells us
that there are at least two people having the same number of friends.
6. In each of the following cases sets A and B and a function f: A B are given.
Determine (in each case) whether f is oneto-one or onto (or both) (or
neither) (5m) Jun 2016
1 1
2 2
3 3
2. A = {a, b, c} B= {1, 2, 3, 4}
f = {(a, 1), (b, 1), (c, 3)}
neither onto nor one-one
3. A = {I, 2, 3, 4} B = {a, b, c, d}
f = {(1, a), (2, a), (3, d), (4, c)}
7. let A,B,C be any three non-empty sets and A=B=C={set of real numbers} f: A
( B , g: f: B ( C be function defined by f(a) = a+1 and g(b) = b2 + 2, find
a. gof (-2), b. fog (-2), c. gof(x) , d. gog(x) (8m) Jun 2016
sol:
a. gof(-2)= g[f(-2)] = g[-2+1] = g[-1] = (-1) 2 + 2 = 1 + 2 =3
10. Find the inverse function f -1, of f: AB given by (6m) Jan 2015
Sol:
A = B = {1, 2, 3, 4, 5}
f = {(1, 3), (2, 2), (3, 4), (4, 5), (5, 1)}
Solution:
Given f = {( 1 , 3), (2 , 2), (4 , 3) ,(5 , 4) , (1 , 5)}
f -1 = {(3 , 1), (2 , 2), (4 , 3) ,(5 , 4),(1 , 5 )}
Here, f -1 s relation from B to A and a function as well.
11. Let A = {1, 2, 3, 4} and B = {a, b, c, d}. Determine whether the following
functions from A to B are invertible or not
12. Prove that the symmetric difference is associative on sets. (5m) Jun 2014
Solution:
To prove, (A B) C = A (B C) we have to prove,
f A(B C) (x) = f (AB) C (x)
Now, f (AB) C(x) = fD C where D = A B
= fD + fC - 2 fD fC (by property 3 of characteristic function)
= fC + fD (1- 2 fC )
= fC + (fA + fB - 2 fA fB ) (1 - 2 fC ) (b y property 3)
= f C+ f A+ f B- 2 f Af B - 2 f Af C -2 f Bf C+ 4 f Af Bf C
= f A + (f B+ f C 2 f Bf C) -2 f A(f B+ f C 2 f Bf )C
= fA + (f B+ f C 2 f Bf C) (1-2fA)
=f A + fB C (1-2fA)
= f A + f BC -2fA f BC
= f A(B C)
R.H.S = f A(B C) (x) = f (AB) C (x)
(A B) C = A (B C)
13. Suppose the addresses of customers of a bank are recorded in 101 files on the
basis of hashing function .With the account number. As keys, determine the
file in which the address of the customer with the account no. 2473876 is
recorded ( 6 m) Jun 2014
Solution:
Given No of files = 101 n
The keys whose file is being searched is a = 2473876
r =?
We know that, h n (a ) = r
15. Prove that 151 integers are selected from {1,2,3,.3000} then the selection
must include two integers x,y where x|y or y|x. (4m) Jun 2015
Sol:
16. Let f,g:Z+->Z+ where for all x belongs to Z+ f(x)=x+1 and g(x)=max{1,x-1}
the maximum of 1 and x-1. State few properties. (8m) Jun 2015
Sol:
17. Let f: Z->N be defined by f(x)= 2x-1 if x>0 and -2x for x<=0 Prove that f is one
one and onto determine f-1 ( 6 m) Jun 2015
Sol:
18. Let f,g,h:Z->Z be defined by f(x)=x-1 and g(x)=3x h(x)= 0 even and 1 odd .
Determine the following: ( 6 m) Jan 2015
Sol:
MODULE-5
G ro up s
1. Define abelian group. For any group G pT G is abelian if and only if
(ab)2=a2b2 ( 8 m) Jan 2016
Sol:
This can be shown using the concept of left cosets of H in G. The left cosets are the
equivalence classes of a certain equivalence relation on G and therefore form a partition of
G. Specifically, x and y in G are related if and only if there exists h in H such that x = yh.
If we can show that all cosets of H have the same number of elements, then each coset of
H has precCSEly |H| elements. We are then done since the order of H times the number
of
cosets is equal to the number of elements in G, thereby proving that the order H divides
the order of G. Now, if aH and bH are two left cosets of H, we can define a map f : aH
bH by setting f(x) = ba-1x. This map is bijective because its inverse is given by f -1(y) =
ab-1y.
This proof also shows that the quotient of the orders |G| / |H| is equal to the index [G : H]
(the number of left cosets of H in G). If we write this statement as
|G| = [G : H] |H|,
then, seen as a statement about cardinal numbers, it is equivalent to the Axiom of choice.
4. Define abelian group. P T a group is abelian if and only if f or all a,b belongs
to G (a,b)-1=a-1b-1 ( 5 m) Jun 2016
5. Define a cyclic group. P T every cyclic group is abelian but converse is not
true. (6m) Jun 2016
Sol:
A cyclic group is a group that can be generated by a single element, in the sense that the
group has an element g (called a "generator" of the group) such that, when written
multiplicatively, every element of the group is a power of g (a multiple of g when the
notation is additive).
Let G be a cyclic group and g be a generator of G. for some integers m and m
Ab=gm=gn=gm+n=gn+m=gngm=ba
This shows G is abelian. Hence proved.
Image of a Group homomorphism(h) from G(left) to H(right). The smaller oval inside H
is the image of h. N is the kernel of h and aN is a coset of h.
In mathematics, given two groups (G, *) and (H, ), a group homomorphism from (G, *)
to (H, ) is a function h : G H such that for all u and v in G it holds that
where the group operation on the left hand side of the equation is that of G and on the
right hand side that of H.
From this property, one can deduce that h maps the identity element eG of G to the identity
element eH of H, and it also maps inverses to inverses in the sense that
h(u - 1) = h(u) - 1.
Hence one can say that h "is compatible with the group structure".
Isomorphism:
If the homomorphism h is a bijection, then one can show that its inverse is also a group
homomorphism, and h is called a group isomorphism
14. Let g= S4 for a=[ 12 3 4][2 3 4 1] Find a subgroup and all the left cosets.
(8m) Jun 2014
Sol:
Groups Codes
15. Define a ring and integral domain. (6m) Jan 2016
Solution: A ring is an Abelian group (R, +), together with a second binary operation *
such that for all a, b and c in R,
a * (b * c) = (a * b) * c
a * (b + c) = (a * b) + (a * c)
(a + b) * c = (a * c) + (b * c)
A ring is said to be an integral domain if R is a commutative ring with unity.
16. Let r be a commutative ring with unity. Prove that if and only if for all
a,b,c
belongs to r where a=/ 0 1b=ac=b=c. (8m) Jan 2016
Sol: R is an integral domain
Ab=ac=(ab-ac)=0
= a (b -c )= 0
= b -c = 0
=b=c
C o n v e rs e l y
Xy=0=xy=x.0
=y =0
This proves that R is an integral domain.
19. Prove that Zn is a field if and only if n is prime. (3m) Jun 2016
Solution: Suppose n is prime then for any integer a such that 0<a<n we have gcd (a,n)=1.
Dept. of CSE, SJBIT Page 53
DISCRETE MATHEMATICAL STRUCTURES 15CS35
Accordingly [a] is a unit of Zn. This means that every non zero element of Zn has a
multiplicative inverse. Therefore Zn is a field.
and
j-th codeword.
For example, the [n,k]-code C3 = {0, 01101, 10110, 11011} has a standard array as
follows:
0 01101 10110 11011
10000 11101 00110 01011
01000 00101 11110 10011
00100 01001 10010 11111
00010 01111 10100 11001
00001 01100 10111 11010
11000 10101 01110 00011
10001 11100 00111 01010
23. Define ring with unity and ring with zero divisor: (6m) Jan 2015
Sol:
Formally, a ring is an Abelian group (R, +), together with a second binary operation *
such that for all a, b and c in R,
a * (b * c) = (a * b) * c
a * (b + c) = (a * b) + (a * c)
(a + b) * c = (a * c) + (b * c)
also, if there exists a multiplicative identity in the ring, that is, an element e such that for
all a in R,
a*e=e*a=a
then it is said to be a ring with unity. The number 1 is a common example of a unity.
24. S is a subring of R if and only if for all a,b belongs to S we have a+b belongs to
S and ab belongs to S ( 6 m) Jun 2015
Solution:
25. If R is a ring wiyh unity and a,b are units of R, P T ab is a unit of R and
(ab)-1=b-1a-1 (6m) Jun 2015
Sol:
ASSIGNMENT QUESTIONS
1) For any three sets A,B and C prove that (A-B)-C =A (BUC) = (A-C) (B-C)
2) Determine the sets A and B given that A B = {1, 2, 4}, B A = {7, 8} and AUB =
{1, 2, 4, 5, 7, 8, 9}
3) Determine the sets A and B given that A B = {1, 3, 7, 11}, B A = {2, 6, 8} and
AB = {4, 9}
4) Prove that: AB= (BA1) U (AB1) = (B-A) U (A-B).
5) Determine the sets A and B given that A B = {1, 2, 4}, B A = {7, 8} and AUB =
{1, 2, 4, 5, 7, 8, 9}
6) Using Venn diagram, prove the following property of the symmetric difference:
7) Thirty cars are assembled in a factory. The options available are a transistor, an air
conditioner and power windows. It is known that 15 of the cars have transistor, 8 of
them have conditioners and 6 of them have power windows. Moreover, 3 of them have
all three options. Determine at least how many cars do not have any options at all.
8) Explain what you mean by a probability of an event E and then solve the following
problem. If one tosses a fair coin four times, what is the probability of getting two
heads and two tails?
9) The freshman class of a private engineering college has 300 students. It is known that
180 can program in PASCAL, 120 in FORTRAN, 30 in c++, 12 in PASCAL and c++,
18 in FORTRAN and c++, 12 in PASCAL and FORTRAN, and 6 in all three
languages If two students are selected at random, what is the probability that they can
i) Both program in PASCAL?
ii) Both program only in PASCAL?
10) In a survey of 120 passengers, an airline found that 48 enjoyed wine with their meals,
78 enjoyed mixed drinks, 66 enjoyed iced tea. In addition, 36 enjoyed any given pair of
these beverages and 24 enjoyed them all. If two passengers are selected at random from
the survey sample of 120, what is the probability that they both want only iced tea with
their meals?
11) The Ackermanns numbers A m, n are defined recursively for m, n N as follows.
A0,n = n+1 for n 0, A m,0 = A m-1,1 fo r m 1
Am,n = Am-1,p where p = Am,n-1, for m,n1
Prove that A1, n = n + 2 for all n 0.
12) Show that (p v q) (q v p) is a tautology.
13) Out of 30 students in a dormitory, 15 take an art course, 8 take a biology course, and 6
take a chemistry course. It is known that 3 students take all three courses. Show that 7
or more students take none of the course.
14) If N is the set of positive integers and R is the set of real numbers, examine which of the
following sets is empty :
{x | xN, 2x + 7 = 3}
{x | x R, x2 + 4 = 6}
{x | x R, x2 + 3x + 3 = 0}.
15) Using Venn diagrams, investigate the truth or falsity of :
i) A (B C) = (A B) (A C)
ii) A (B C) = (A B) (A C) for any three sets A, B, C.
16) Simplify the following :
i) A (BA)
-
ii) (A B) (A B) (A B C D).
17) A fair coin is tossed five times. What is the probability that the number of heads always
exceeds the number of tails as each outcome is observed.
18) If statement q has the truth value 1, determine all truth value assignments for the
primitive statements p, r, and s for which the truth value of the statement
19) Establish the validity or provide a counter example to show the invalidity of the
following arguments :
i) pq
p r
r
q
ii) p
pr
p (q r)
q s
s
20) Verify that [p(qr)][(pq)(pr)] is a tautology.
21) Write dual, negation, converse, inverse and contrapositive of the statement given below :
22) If Kabir wears brown pant, then he will wear white shirt. Test whether the following
argument is valid:
If Rams computer program is correct then he will be able to complete his computer
science assignment in at most two hours.
It takes Ram over two hours to complete his computer science assignment.
Therefore Rams computer program is incorrect.
23) Test whether the following argument is valid:
If Rams computer program is correct then he will be able to complete his computer
Dept. of CSE, SJBIT Page 2
DISCRETE MATHEMATICAL STRUCTURES 15CS35
[(p q) ( r s) (p r)] q s.
28) Show that the following argument is invalid by giving a counter example :
1) For the universe of all people, find whether the following is a valid statement:
All mathematics professors have studied calculus
Ramanujan is a mathematics professor
Therefore Ramanujan has studied calculus.
2) Define the Rule of Universal specification and the Rule of Universal Generalization.
x[ g(x) r(x)]
5) Determine if the argument is valid or not. All people concerned about the environment,
recycle their plastic containers. B is not concerned about the environment. Therefore, B
does not recycle his plastic containers.
i) x[p(x) q(x)]
17) Find a unique solution for the recurrence relation : 4an 5an1 = 0, n 1, a0 = 1.
n F(i-1) F(n+2)
Pro v e t h a t
i=1 2 i
= 1-
2n
.
19)
20)
21)
1) Let R and S are symmetric relations on the set A. Prove that intersection of these two is
also symmetric.
2) Define stirling number of the second kind . Let a={1,2,3,4,5,6,7} and B={w,x,y,z} find
the number of onto functions from A to B
3) Let T be the set of all triangles. Define a relation R on T by t1 R t2 if t1 and t2 have an
angle of same measure. Verify whether R is an equivalence relation.
4) Define Cartesian product of two sets. For nonempty sets A, B, C prove that,
A (B C) = (A B) (A C).
8) Let ABC be an equilateral triangle of side 1. Show that if we select 10 points in the
interior, there must be at least two points whose distance apart is less than 1/3.
9) Give an example of a relation from A to B B which is not a function.
10) How many onto functions are there from (i) A to B, (ii) B to A?
11) Write a function f : AC and a function g : CA. Find gof : AA.
12) Write an invertible function f : AC and find its inverse.
9) On the set of all lines in the plane, l1Rl2 if line l1 is perpendicular to live l2
10) On Z, xRy if x y is even.
11) For A = {1, 2, 3, 4}, let R = {(1, 1), (1, 2), (2, 3), (3, 3), (3, 4)} be a relation on A. Draw
the digraph of R2 and find the matrix M(R2).
12) Draw the Hasse diagram for all the positive integer division of 72.
13) Let A = {1, 2, 3, 4, 5, 6} {1, 2, 3, 4, 5, 6}. Define R on A by (x1, y1) R(x2, y2)
if x1y1 = x2y2. Verify that R is an equivalence relation on A.
14) Let A = {1, 2, 3, 4, 5} {1, 2, 3, 4, 5} and define R as
i) Verify that R is an equivalence relation on A.
ii) Determine the equivalence class [(1, 3)].
iii) Determine the partition induced by R.
15) Let A = {1, 2, 3, 6, 9, 12, 18} and define a relation R on A as xRy iff x|y. Draw the
Hasse diagram for the poset (A, R)
16) Let A = {1, 2, 3, 4}, B = {w, x, y, z} and C = {p, q, r, s}. Consider R 1= {(1, x), (2, w),
(3, z)}a relation from A to B, R2 = {(w, p), (z, q), (y, s), (x, p)} a relation from B to C.
What is the composite relation R1 R2 form A to C?
MODULE 5: Groups
1) Define acyclic group with an example. Prove that every cyclic group is abelian.6 marks
2) If (G, *) and (H,*) are groups with respective identities eG and eH , and f : G H is an
isomorphism, prove that f(eG) = eH.
3) Prove that in a group code the minimum distance between distinct code words is the
minimum of the weights of the nonzero elements of the code
4) For a group(G1), prove that it is abelian if (a, b)2 = a2,b2 for all a, bG.
0 1 2 3 4
5) Let A = . Verify that (A, A , A , A ) form an abelian group under matrix
-1 0
multiplication.
15) The (5m, m) five times repetition code has encoding function E : Z2m Z25m.
Decoding with D : Z25m Z2m is done by majority rule. With p = 0.05, what is the
probability for the transmission and correct decoding of the signal 110.
16) What is the minimum distance of a code consisting of the following code words :
17) 001010, 011100, 010111, 011110, 101001? What kind of errors can be detected?
18) The encoding function E : Z22 Z25 is given by the generator matrix
1 0 1 1 0
G = . What is the error detection capacity of the code?
0 1 0 1 1
19) Let R be a ring with unity and a, b be units in R. Prove that ab is a unit of R and that
21)
PART A
1 a. Let S = {21, 22, 23, .., 39, 40}. Determine the number of subsets A of S such that :
i) |A| = 5
ii) |A| = 5 and the largest element in A is 30
iii) |A| = 5 and the largest element is at least 30
Important Note : 1. On completing your answers, compulsorily draw diagonal cross lines on the remaining blank pages.
n
1 n
4 a. Prove i(i 1) n 1 nz+. (06 Marks)
i 1
b. Prove 2n < n! n > 3 and n z+. (06 Marks)
c. Define an integer sequence recursively by
a0 = a 1 = a 2 = 1
an = an1 + an3 n 3.
Prove that a n 2 ( 2 ) n n 0. (08 Marks)
PART B
5 Let A = {, , }, B = {, }, C = {, , }.
a. Find (AB)C, A(BC), (AB)C and A(BC). (08 Marks)
b. Give an example of a relation from A to B B which is not a function. (04 Marks)
c. How many onto functions are there from (i) A to B, (ii) B to A? (02 Marks)
d. i) Write a function f : AC and a function g : CA. Find gof : AA.
ii) Write an invertible function f : AC and find its inverse. (06 Marks)
6 a. Let A = {1, 2, 3, 4}, B = {w, x, y, z} and C = {p, q, r, s}. Consider R1 = {(1, x), (2, w), (3, z)}
a relation from A to B, R2 = {(w, p), (z, q), (y, s), (x, p)} a relation from B to C.
i) What is the composite relation R1 R 2 form A to C?
ii) Write relation matrices M(R1), M(R2) and M(R1 R2)
iii) Verify M(R1) M(R 2) = M(R1R2) (06 Marks)
b. Let A = {1, 2, 3, 6, 9, 12, 18} and define a relation R on A as xRy iff x|y. Draw the Hasse
diagram for the poset (A, R). (06 Marks)
c. Let A = {1, 2, 3, 4, 5} {1, 2, 3, 4, 5} and define R as (x1, y1)R(x2, y2) iff x1 + y1 = x2 + y2.
i) Verify that R is an equivalence relation on A.
ii) Determine the equivalence class [(1, 3)].
iii) Determine the partition induced by R. (08 Marks)
a b a b
8 a. If M 2 ( R ) , prove that c d is a unit of this ring if and only if ad bc 0.
c d
(08 Marks)
b. Let R be a ring with unity and a, b be units in R. Prove that ab is a unit of R and that
(ab)-1 = b-1a-1. (06 Marks)
c. Find multiplicative inverse of each (non-zero) element of Z7. (06 Marks)
*****
2 of 2