Mcasem I Discrete Mathematics
Mcasem I Discrete Mathematics
M.C.A.
SEMESTER – I
DISCRETE MATHEMATICS
1. Number Systems
Decimal Number Systems
Binary Number Systems
Hexadecimal Number Systems
Octal Number Systems
o Binary Arithmetic
4. Recurrence Relations
Towers of Hanoi, Iterations, Homogeneous linear equations with constant
coefficients, particular solution, difference table, finite order differences,
Line in a plane in general position
6. Classification of Languages
Overview of Formal Languages :
Representation of regular languages and grammars, finite state
machines
References :
1
NUMBER SYSTEM
Unit Structure
1.0 Objectives
1.1 Introduction
1.2 Decimal Number System
1.3 Binary number system
1.3.1 What is binary number system?
1.3.2 Decimal to binary conversion
1.3.3 Binary to decimal conversion
1.3.4 Decimal to binary fraction conversion
1.3.5 Binary to decimal fraction conversion
1.4 Octal Number System
1.4.1 What is octal number system?
1.4.2 Decimal to octal fraction conversion
1.4.4 Octal to decimal conversion and Octal to decimal fraction
conversion.
1.4.5 Octal to binary conversion
1.4.6 Binary to octal conversion
1.5 Hexadecimal Number System
1.5.1 What is hexadecimal number system?
1.5.2 Decimal to hexadecimal conversion
1.5.3 Hexadecimal to decimal conversion
1.5.4 Hexadecimal to binary conversion
1.5.5 Binary to hexadecimal conversion
1.5.6 Hexadecimal to octal conversion and octal to hexadecimal
conversion
1.6 Binary Arithmetic
1.6.1 Binary Addition
1.6.2 Binary Subtraction
1.6.3 Binary Multiplication
1.6.4 Binary division
1.7 Summary
1.8 Unit End Exercises
1.9 References
1.0 OBJECTIVES
1.1 INTRODUCTION
10 10011102
Example 1 : 0.62510 ?2
0.62510 0.1012
Example 2 : 0.8610 ?2
2 0.86 = 1.72 1
2 0.72 = 1.44 1
2 0.44 = 0.88 0
2 0.88 = 1.76 1
0.8610 0.11012
Example 3 : 50.710 ?2
Therefore
5010 1100102 0.710 0.10112
50.710 110010.10112
111011.1012 59.62510
Octal system was used to deal with the long strings of 1s and 0s in
binary. It is a base 8 system using the digits 0, 1, 2, 3, 4, 5, 6 and 7. Thus
each digit of an octal number can have only values 0 to 7.
The digit position in an octal number have weights as follows-
Octal
0
1
2
3
4
5
6
7 78 18 108
10
11
16
17 178 18 208
20
27 278 18 308
30
& so on
10
Example 1. 11910 = ?8
11910 = 1678
2. 253610 = ?8
253610 = 47508
1.4.3 Decimal to Octal fraction Conversion :
Steps:
1) Multiply the decimal fraction by 8.
2) Write the integer to the right of the product i.e. if
0.6 x 8 = 4.8 then place 4 to the right of the product.
3) The partial product is again multiplied by 8 and the
integer is placed to the right of the product.
4) Repeat the process till the partial products is seen or
till the required place of octal point.
11
Example 1 0.9610 = ?8
0.96 × 8 = 7.68 7
0.68 × 8 = 5.44 5
0.44 × 8 = 3.52 3
0.52 × 8 = 4.16 4
0.16 × 8 = 1.28 1
0.28 × 8 = 2.24
0.9610 = 0.753418
2. 0.562510 = ?8
0.5625 x 8 = 4.5 4
0.5 x 8 = 4.0 4
0.562510 = 0.448
3. 73.5210 = ?8
7310 = 1118
0.73.5210 = 111.41218
56 = 5 x 81 + 5 x 80 = 40 + 6 = 46
568 = 4610
12
2) 6428 = 6 × 82 + 4 × 81 + 4 × 80
= 6 × 64 + 4 × 8 + 2
= 384 + 32 + 2 = 41810
3) 0.5638 = ?10
0.563 = 5 x 8-1 + 6 x 8-2 + 3 x 8-3
5 6 3
= + +
8 64 512
= 0.625 + 0.09375 + 0.0058 59375
= 0.724609375
0.5638 = 0.72460937510
4) 111.41218 = ?10
111 = 1 x 8 + 1 x 81 + 1 x 80 = 64 + 8 + 1 = 73
2
Example 1 568
Successive Original Remainders Successive Original Remainders
Dividers Number & Dividers Number &
Partial Partial
quotients quotients
2 5 1 2 6 0
2 2 0 2 3 1
2 1 1 2 1
2 0 0
2
2
58 = 1012 68 = 1102
568 = 1011102
13
OR
Example 2 0.2168 = ?2
Successive Original Remainders Successive Original Remainders Successive Original Remainders
Dividers Number & Dividers Number & Dividers Number &
Partial Partial Partial
quotients quotients quotients
2 2 0 2 1 1 2 6 0
2 1 1 0 2 3 1
0 2 1
0
0.2168 = 0.0100011102
3) 576.128 = ?2
Successive Original Remainders Successive Original Remainders Successive Original Remainders
Dividers Number & Dividers Number & Dividers Number &
Partial Partial Partial
quotients quotients quotients
2 5 1 2 7 1 2 6 0
2 2 0 2 3 1 2 3 1
2 1 1 2 1 1 2 1 1
0 0 0
5768 = 1011111102
0.128
Successive Original Remainders Successive Original Remainders
Dividers Number Dividers Number
& Partial & Partial
quotients quotients
2 1 1 2 2 0
0 2 1 1
0
001 010
0.128 = 0.0010102
576.128 = 101111110.0010102
14
Example 1 11010112 = ?8
1101011
001 = 0 x 22 + 0 x 21 + 1 x 20 =0+0+1=1
101 = 1 x 22 + 0 x 21 + 1 x 20 =4+0+1=5
011 = 0 x 22 + 1 x 21 + 1 x 20 =0+2+1=3
11010112 = 1538
2) 0.0101012 = ?8
0.010101
010 = 0 x 22 + 1 x 21 + 0 x 20 =0+2+0=2
101 = 1 x 22 + 0 x 21 + 1 x 20 =4+0+1=5
0.0101012 = 0.258
3) 1101.111012 = ?
1101111
01
001101111
010
This will give 15.728 (check)
1101.111012 = 15.728
15
1076110 = 2 (10) 09
= 2 A 0916
2) 674710 = ?16
16
0.256 × 16 = 4.096 4
0.096 × 16 = 1.536 1
0.536 × 16 = 8.576 8
0.576 × 16 = 9.216 9
2) 97.23610 = ?16
16 97 1
16 6 6
0
9710 = 6116
0.236 × 16 = 3.776 3
0.776 × 16 = 12.416 12
0.416 × 16 = 6.656 6
0.656 × 16 = 10.496 10
17
2) AB716
= A x 162 + B x 161 + 7 x 160
= 10 x 256 + 11 x 16 + 7
= 274310
3) 61.3C6A16 = ?10
61 = 6 x 161 + 1 x 160 = 96 + 1 = 97
Example 1. 4C3F16 = ?2
C = 12 F = 15
2 4 0 2 12 0 2 3 1 2 15 1
2 2 0 2 6 0 2 1 1 2 7 1
2 1 1 2 3 1 0 2 3 1
0 2 1 1 2 1 1
0 0
100 1100 11 1111
4C3F16 = 01001100001111112
18
2) AB.CD16 = ?2
A = 10 B = 11 C = 12 D = 13
2 10 0 2 11 1 2 12 0 2 13 1
2 5 1 2 5 1 2 6 0 2 6 0
2 2 0 2 2 0 2 3 1 2 3 1
2 1 1 2 1 1 2 1 1 2 1 1
0 0 0 0
(1010) (1011) (1100) (1101)
AB.CD16 = 10101011.110011012
1101001100
(0011) (0100) (1100)
0011 = 0 x 23 + 0 x 22 + 1 x 21 + 1 x 20 = 2+1 = 3
0100 = 0 x 23 + 1 x 22 + 0 x 21 + 0 x 20 = 4
1100 = 1 x 23 + 1 x 22 + 0 x 21 + 0 x 20 = 12 = C
11010011002 = 34C16
2) 110101.11111012 = ?16
1101011111 01
(0011) (0101).(1111)(1010)
0011 = 0 x 23 + 0 x 22 + 1 x 21 + 1 x 20 = 3
0101 = 0 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 5
1111 = 1 x 23 + 1 x 22 + 1 x 21 + 1 x 20 = 15 = F
1010 = 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20 = 10 = A
110101.11111012 = 35.FA16
19
Example 1 : 3F216 = ?8
F = 15
2 3 1 2 15 1 2 2 0
2 1 1 2 7 1 2 1 1
0 2 3 1 0
2 1 1
0
(0011) (1111) (0010)
001111110010
001 = 0 × 22 + 0 × 21 + 1 × 26 = 1
111 = 1 x 22 + 1 x 21 + 1 x 20 = 7
110 = 1 x 22 + 1 x 21 + 0 x 20 = 6
010 = 0 x 22 + 1 x 21 + 0 x 20 = 2
(3F2)16 = 17628
2) 15278 = ?16
2 1 1 2 5 1 2 2 0 2 7 1
0 2 2 0 2 1 1 2 3 1
2 1 1 0 2 1 1
0 0
(001) (101) (010) (111)
001101010111
0011 = 0 x 23 + 0 x 22 + 1 x 21 + 1 x 20 = 3
0101 = 0 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 5
0111 = 0 x 23 + 1 x 22 + 1 x 21 + 1 x 20 = 7
15278 = 35716
20
3) 47.438 = ?16
2 4 0 2 7 1 2 4 0 2 3 1
2 2 0 2 3 1 2 2 0 2 1 1
2 1 1 2 1 1 2 1 1 0
0 0 0
(100) (111) (100) (011)
100111.100011
100111100
. 011
00100111.10001100
0010 = 0 x 23 + 0 x 22 + 1 x 21 + 0 x 20 = 2
0111 = 0 x 23 + 1 x 22 + 1 x 21 + 1 x 20 = 4 + 2 + 1 = 7
1000 = 1 x 23 + 0 x 22 + 0 x 21 + 0 x 20 = 8
1100 = 1 x 23 + 1 x 22 + 0 x 21 + 0 x 20 = 8 + 4 = 12 = C
47.438 = 27.8C16
Rules : 0+0=0
0+1=1
1+0=1
1+1=0 i.e. take it as 0 with a
carry of 1.
21
2) 10 110 3) 1010
+ 1 101 1000
100011 + 0110
0111
11111
*** * *
eg. 1) 110101 2) 10110
+ 101111 - 1101
000110 1001
* columns are borrowed from
** * ***
3) 11011.0 4) 1101110
- 1001.1 - 10111
10001.1 1010111
5) 1000101 6) 110011
- 101100 - 10110
11001 11101
1.6.3 Multiplication:
Rules : 0x0=0
0x1=0
1x0=0
1x1=1
3) 1111
x 111
1111
1111x
+ 1111xx
1101001
22
1.6.4 Division:
Division for binary numbers can be carried out by following same
rules as those of decimal system.
Ans: 101
23
1.7 SUMMARY
Computer uses only binary digits O and I. A binary digit is called a
bit. There are two states in a bit - O and 1. In this unit we have seen four
number systems. Decimal system has base 10, binary system - base 2,
octal system - base 8 and hexadecimal system has base 16. Three binary
digits correspond to one octal digit and four binary digits translate into one
hexadecimal digit. The following table shows the four systems.
24
25
26
1.9 REFERENCES
27
2
PROPOSITIONS AND LOGICAL
OPERATIONS
Unit Structure :
2.0 Objectives
2.1 Introduction
2.2 Propositions
2.3 Logical Operations or Logical Connectives
2.4 Logical Equivalence
2.5 Logical Implications:
2.6 Normal form and Truth Tables
2.7 Predicates and Quantifiers
2.8 Theory of Inference for the predicate Calculas
2.9 Mathematical Induction
2.10 Unit End Exercise
2.11 References
2.0 OBJECTIVES :
2.1 INTRODUCTION :
28
All of them are propositions except iv), v), ix) & x) sentences i), ii)
are true, where as iii), iv), vii) & viii) are false.
29
Compound statements :
30
P Q PQ
T T T
T F F
F T F
F F F
Example 3 :
then
P Q : Monsoon is very good this year and rivers are rising.
31
P Q PQ
T T T
T F T
F T T
F F F
Example 4 :
P : Paris is in France
Q : 23 6
then P Q : Paris is in France or 2 + 3 = 6.
Here, P Q is True since P is true & Q is False.
Thus, the disjunction P Q is false only when P and Q are both false.
If P is true then P is false and if P is false then P is true. The
truth table for Negation is as follows :
P P
T F
F T
Example 5 :
32
P Q PQ
T T T
T F F
F T T
F F T
33
Example 6 :
Then, P Q : If you are good in Mathematics then you are good in Logic.
1) Converse : Q P
If you are good in Logic then you are good in Mathematics.
2) Contrapositive : QP
If you are not good in Logic then you are not good in Mathematics.
3) Inverse : PQ
If you are not good in Mathematics then you are not good in Logic.
P Q PQ
T T T
T F F
F T F
F F T
34
Operator Precedence
1
2
3
4
5
Name Equivalance
1. Identity Laws PT P
PF P
2. Domination Laws PT T
PF F
3. Double Negation P P
4. Idempotent Laws PP P
PP P
5. Commutative Laws PQ QP
PQ QP
6. Associative Laws P Q R P Q R
P Q R P Q R
35
7. Distributive Laws P Q R P Q P R
P Q R P Q P R
8. De Morgan’s Laws P Q PQ
P Q PQ
9. Absorption Laws P P Q P
P P Q P
10. Negation Laws P P T
(Inverse / Complement) P P F
11. Equivalance Law P Q P Q Q P
12. Implication Law P Q P Q
13. Biconditional Property P Q P Q P Q
14. Contrapositive of Conditional P Q QP
statement
36
P Q (PQ) Q P)
(PQ)Q P)
(PQ) Q P)
, is a functionally complete set of connectives.
Similarly, you can prove that , is complete set of connectives.
Solution :
P Q P Q
T T T
T F T
F T T
F F F
37
Observe that if P is true (T) in rows 1 and 2 then P Q is also true (T) .
P P Q .
38
P Q PQ QP
T T T T T
T F F T F
F T T F F
F F T T T
P P P P
T F T
F T T
39
P P always takes value T for all possible truth value of P, it is a
tautology.
P P P P
T F F
F T F
P P always takes value F for all possible truth values of P, it is a
contradiction.
Example 13 : Show that p q and pq are logically equivalent.
1 2 3 4 5 6 7 8
P Q P Q PQ P Q P Q 67
T T F F T F F T
T F F T T F F T
F T T F T F F T
F F T T F T T T
We cab observe that the truth values of p q and p q
agree for all possible combinations of the truth values of p and q.
40
Solution:
i) The truth table for p q p q
P q pq pq p q p q
T T T T T
T F F T T
F T F T T
F F F F T
41
1 2 3 4 5 6
p q pq p q P q 36
T T T F F F F
T F T F T F F
F T T T F F F
F F F T T T F
All the entries in the last column are ‘F’. Hence it is contradiction.
42
T T F F F T
T F T T T F
F T F T F T
F F T T F T
The last entries are neither all ‘T’ nor all ‘F’.
p p q q is a neither tautology nor contradiction. It is a
contingency.
43
Example 16 :
Answer :
1) Consider, P ( P Q)
P (P Q ) (Implication law)
( P P) ( P Q) (Distributive law)
44
3) p Q R P Q
P Q R P Q Implication law
Note that for the same formula we may get different disjunctive
normal forms. So we introduce one or more normal forms called the
principle disjunctive normal form or sum of products canonical form
in the next definition. The advantage of constructing principle
disjunctive normal form is that for a given formula principle
disjunctive normal form is unique.
* Min term :
A min term in n propositional variables P1, P2, ……, Pn is
Q1 Q2 ....... Qn where each Qi is either Pi or Pi.
e.g.
The min terms in P1 & P2 are P1 P2, P1 P2, P1 P2,
P1 P2,
45
4. Use the above step until all elementary products are reduced to
sum of min terms.
Use idempotent laws to avoid repetition of min terms.
Example 17 :
1. P (P Q R)
2. whose truth table is given below
Row No. P Q R
1 T T T T
2 T T F F
3 T F T F
4 T F F T
5 F T T T
6 F T F F
7 F F T F
8 F F F T
Answer :
P P Q R P Q R P Q R P Q R
Therefore the canonical sum of products form of is
P Q R P Q R P Q R P Q R
P Q R P Q R P Q R P Q R
46
e.g. P Q, P Q P
Maxterm
A max term in n propositional variables P1 , P2 .......Pn is
Q1 Q2 ....... Qn where each Qi is either Pi or pi
Example 18
Obtain a conjunctive normal form of
1. P Q R
2. P R P Q
1) Consider
P Q R
P Q R
P Q R Implication law
P Q R De-Morgans law
P Q R De-Morgans law & Double negation
P Q R
2) P R P Q
Since, we know that
P Q P Q Implication law
P Q ( P Q) (Q P ) Implication law
P R P Q Q P
47
Proposition :
If values are assigned to all the variables in a predicate, the
resulting statement is a proposition.
e.g.
1. x 9 is a predicate
2. 4 < 9 is a proposition
Propositional Function :
The set A is called domain of P(x) and the set Tp of all elements of
A for which P (a) is true is called the truth set of P(x).
2.7.2 Quantifiers :
The expressions ‘ for all’ and ‘there exists’ are called quantifiers.
The process of applying quantifier to a variable is called quantification of
variables.
48
Universal quantification :
Existential quantification -
The existential quantification of a predicate P(x) is the statement
“There exists a value of x for which P(x) is true.”
e.g.
1) Let Q : x 1 4 . The existential quantification of Q(x), xQ( x)
is a true statement, because Q(2) is true statement.
I) x A p( x ) x A p ( x )
In other words, the following two statements are equivalent.
i) It is not true that, for all a A, P(a) is true.
49
II) x A p ( x ) x A p ( x )
VII) x ( P ( x ) Q ( x ) x ( P ( x) xQ ( x )
Example 19 :
Express the statement using quantifiers. “Every student in your school has
a computer or has a friend who has a computer.”
Solution :
We have
x(c( x) y (c( y ) F ( x, y ))
Example 20 :
Solution :
50
ii) Every polar bear that is found in cold regions has a white colour.
x (( B ( x) c( x )) A( x )) .
All but the final propositions in the argument are called hypothesis
or Premises.
51
e.g.
Let P: “You have a current password”
Q: “You can log onto the network”.
“You have a current password” therefore: You can log onto the
network” has the form …
.
PQ
P
Q
Where is the symbol that denotes ‘therefore we know that when P & Q
are proposition variables, the statement (( P Q ) P ) Q is a tautology.
52
5) P P ( P Q) Addition
PVQ
6) P Q ( P Q) P Simplification
P
7) P (( P ) (Q )) P Q Conjunction
Q
P Q
8) P Q ( P Q) (P R) (Q R Resolution
P R
QR
Example 21 :
Show that R S can be derived from the premises
(i) P (Q S ) (ii) ( R P) and iii) Q.
Solution :
Steps Reason
1 P (Q S ) Premise (i)
2 RP Premise (ii)
3 RP Line 2, implication
4 R (Q S ) Hypothetical Syllogism
5 R Q S Line 4, implication
6 R Q S Line 5, implication
7 Q Premise (iii)
8 R S Line 6, 7 and Disjunctive syllogism
9 R S Line 8, implication
Example 22 :
53
Solution :
Example 23 :
Consider the following argument and determine whether it is valid or not.
Either I will get good marks or I will not graduate. If I did not gradute I
will go to USA. I get good marks. Thus, I would not go to USA.
Solution :
Let P : I will get good marks.
Q : I will graduate.
R : I will go to USA
The conclusion is R.
The following steps checks is validity.
Steps Reason
1. PVQ … premise (i)
2. P V Q …Double negation
3. PQ Line 2, Implication
4. QR … premise (ii)
54
That is suppose we wish to show that P(n) is true for all integers n n0.
Example 24 :
Using principle of mathematical induction prove that…
n (n 1)
1) 1 + 2 + 3 + ….. + n = for all n 1
2
2) n3 - n is divisible by 3 for nZ+
3) 2n > n for all positive integers n.
55
4) n! 2n–1
If A1, A2, …… An be any n sets then Ai Ai
n n
5)
i 1 i 1
Solution :
n(n 1)
For all n, 1) Let P(n):123 n ,n1
2
Step 1 : Here n0 = 1
We must show that P (1) is true.
P (1) is the statement
1(1 1)
1
2
Which is clearly true.
Hence P(1) is true.
Step 2 :
Assume P(K) is true for K n.
K (K 1)
P(K) 1+ 2 + ….. + K = K1 …..(1)
2
Step 3 :
To show that P(K + 1) is true.
(K 1)((K 1) 1)
P(K+1) = 1 + 2 + ….. + (K + 1) =
2
Consider,
1 + 2 + ….. + ( K + 1) = 1 + 2 + ….. + K + (K +1)
K (K 1)
= + (K + 1) using eqn. (1)
2
K (K 1) 2(K 1)
1 + 2 + ….. + (K + 1) =
2
( K 1) ( K 2)
=
2
(K 1) ((K 1) 1)
=
2
Which is RHS of P(K + 1)
Thus, P(K + 1) is true.
By principle of mathematical induction it follows that P(n) is true
for all n1.
n (n 1)
1 + 2 + ….. + n =
2
2) Let P(n) : n3 – n is divisible by 3.
56
Step 2 :
Assume P(K) is true for K n
P(K): K3 – K is divisible by 3.
We can write K – k = 3m for m N. ……(1)
Step 3 :
We prove that P(K + 1) is true.
P(K + 1); (K + 1)3 – (K + 1) is divisible by 3.
Consider
(K + 1)3 – (K + 1) = K3 + 3K2 + 3K + 1 – K – 1
= K3 + 3K2 + 2K
= 3m + K + 3K2 + 2K (using (1))
= 3(m + K + K2)
57
Step I : For n = 1
1! = 1 2 1–1 = 20 = 1
P(1) is true.
n n
5) Let P(n) : Ai Ai
i 1 i 1
Step I : For n = 2,
2
LHS =
i 1
A i A1 A 2 A1 A 2
2
& RHS = Ai A1 A 2
i 1
LHS = RHS
Hence P(2) is true.
Step 2 : Assume P(K) is true for some K < n
k k
Ai Ai …..(1)
i 1 i 1
58
59
60
3
SET THEORY AND RELATION
Unit Structure
3.0 Objectives
3.1 Introduction
3.2. Definitions and Representation of sets
3.3 Diagrammatic Representation of a set
3.4 The Algebra of sets
3.5 The Computer representation of sets
3.6 Relations
3.7 Representation of Relations
3.8 Types of Relations
3.9 Relations and Partition
3.10 Unit End Exercise
3.0 OBJECTIVES:
3.1 INTRODUCTION:
61
62
Note: Two sets are said to be equal if and only if they have same
elements. E.g. If A = {2, 5, 7, 9 } and B = { 5, 2, 7, 9 }, then A and B are
equal.
Now we shall discuss various operations on sets. For this discussion, let U
be universal set and let A and B be two subsets of U.
Definition 3.2.9: Set of all elements, that are in A, but not in B, is called as
difference between A and B and denoted by
A – B. E.g. If A = {1, 4,7,8,9} and B = {4,9,11,13} then, A – B = {1,7, 8}.
Definition 3.2.13: Let A and B be two sets. The product set of A and B (or
Cartesian product of A and B), denoted by
A B, is set of all ordered pairs from A and B. Thus,
A B = {(a, b): a A, b B}.
E.g. Let A = { 1, 2, 3 } and B = { 4, 5} then
A B = {(1, 4), (1, 5), (2, 4), (2, 5), (3, 4), (3, 5)}.
3.3 DIAGRAMMATIC REPRESENTATION OF A SET:
63
U
B
A
Figure 3.2: A B
AC
64
A–B B
65
3.6 RELATIONS:
66
it with an ordered pair (a, b), where a A and b B. We also denote the
relationship with a R b, which is read as a related to b. The domain of R is
the set of all first elements in the ordered pair and the range of R is the set
of all second elements in the ordered pair.
Example 3.2: Suppose we say that two countries are adjacent if they have
some part of their boundaries common. Then, “is adjacent to”, is a relation
R on the countries on the earth. Thus, we have, (India, Nepal) R, but
(Japan, Sri Lanka) R.
Example 3.4: Let A be any set. Then A A and are subsets of A A and
hence they are relations from A to A. These are known as universal
relation and empty relation, respectively.
Definition 3.6.2: Let R be any relation from a set A to set B. The inverse
of R, denoted by R–1, is the relation from B to A which consists of those
ordered pairs, when reversed, belong to R. That is:
R–1 = {(b, a) : (a, b) R}
Example 3.5: Inverse relation of the relation in example 1.1 is, R–1 = {(x,
1), (x, 2), (y, 3), (z, 3)}.
Matrices and graphs are two very good tools to represent various
algebraic structures. Matrices can be easily used to represent relation in
any programming language in computer. Here we discuss the
representation of relation on finite sets using these tools.
67
x y z
1 1 0 0
2 1 0 0
3 0 1 1
4 0 0 0
Fig. 3.1
1 x
2 y
3
4 z
Fig 3.2
Thus, two ovals represent sets A and B respectively and we draw an arrow
from a A to b B, if a R b.
If the relation is from a finite set to itself, there is another way of pictorial
representation, known as diagraph.
1 2
3 4
Fig 3.3
The directed graphs are very important data structures that have
applications in Computer Science (in the area of networking).
68
1 a
x
2 b
3 y
c
4 d z
Fig 3.4
Thus, from the definition of composite relation and also from Fig 3.4, RS
will be given as below.
69
70
Example 3.18: Relation “is less than ( < )”, defined on the set of all real
numbers, is an asymmetric relation.
Example 3.21: Consider the set L of lines in the Euclidean plane. Two
lines in the plane are said to be related, if they are parallel to each other.
This relation is an equivalence relation.
Example 3.23 : Let A2,3,4,5 and let R 2,3 , 3,3 , 4,5 , 5,1
.
Is R symmetric, asymmetric or antisymmetric?
Solution :
a) R is not symmetric, since 2,3 R , but 3, 2 R ,
b) R is not asymmetric since 3,3 R
c) R is antisymmetric since if ab either
71
a, b Ror b, a R
23 3, 2 R
34 3, 4 R
45 5, 4 R
2 2,5 R
Example 3.24 : Determine whether the relation R on a set A is reflenive,
irreflenire, symmetric, asymmetric antisymmetric or transitive.
Solution :
1) R is reflexive because a a 02,a A
2) R is not irreflexive because 1 1 02 for 1 A ( A is the set
of all positive integers.)
3) R is symmetric because a b 2 b a 2 aRbbRa
4) R is not asymmetric because 5 4 2 and we have 4 5 2
5R44R5
5) R is not antisymmetric because 1R2 & 2R1 1R2 1 2 2 &
2R1 2 1 2 . But 12
6) R is not transitive because 5 R 4, 4 R 2 but 5 R 2
Solution :
As per above example we can prove that R is not reflexive, R is
irrflexive, symmetric, not asymmetric, not antisymmetric & not transitive
72
Example 3.23: Let A = {1, 2, 3, 4, 5}. The following sets form a partition
of A, as A = A1 A2 A3 and
A1 A1 andA2
A1 = {1, 2}; A2 = {3, 5}; A3 = {4}.
Example 3.24: Let A = {1, 2, 3, 4, 5, 6}. The following sets do not form a
partition of A, as A = A1 A2 A3 but
A2
A1 = {1, 2}; A2 = {3, 5}; A3 = {4, 5, 6}.
73
Example 3.25: Consider the partition defined in Example 3.23. Then the
equivalence relation as defined from the partition is:
R={(1, 1),(1, 2),(2, 1),(2, 2),(3, 3),(3, 5), (5, 3), (5, 5), (4, 4)}.
Example 3.27: Let A = {1, 2, 3, 4} and R = {(1, 1), (1, 2), (2, 1), (2, 2), (3,
4), (4, 3), (3, 3), (4, 4)}. We observe that R(1) = R(2) and R(3) = R(4) and
hence P = { {1, 2}, {3, 4} }.
74
75
4
PARTIAL ORDER RELATION
Unit Structure
4.0 Objectives
4.1 Introduction
4.2 Diagrammatic Representation of partial order relations and posets
4.3 Maximal, minimal elements and Lattices
4.4 Solved Problems
4.0 OBJECTIVES:
4.1 INTRODUCTION:
76
1 1 1 1 1
0 1 1 1 1
0 0 1 1 1
0 0 0 1 1
0 0 0 0 1
c
d
b
e
Fig. 4.1
77
Now, we shall draw Hasse diagram from the above diagrams using
following rules.
(i) Drop the reflexive loops
c
d
b
e
Fig. 4.2
c
d
b
e
Fig. 4.3
(iii)Drop arrows
c
d
b
e
Fig. 4.4
78
Note 4.1: In many cases, when the graphical representation is so oriented that all
the arrow heads point in one direction (upward, downward, left to right or right to
left). A graphical representation
in which all the arrowheads point upwards, is known as Hasse diagram.
Note 4.2: The reader is advised to verify that this relation is indeed a partial order
relation. Further,
arrive at the following Hasse diagram from the diagraph of a relation as per the
rules defined earlier.
3
2
Fig.4.5
10111
01111
M R 0011
0
00001
79
Solution :
Remove transitivity as
4 5
1 2
Example 4.6 :
4 5
2 3
Solution :
Here A = [1, 2, 3, 4, 5)
80
Then write all ordered pairs in upward direction. As (1, 2) R &
(2,4) R1, 4 R since R is transitive.
R1,1, 2,2 , 3,3, 4,4 , 5,5 ,1,2 , 2,4 , 2,4 ,1,4 ,1,3 , 3,5 ,1,5
Example 4.7: In the poset of example 4.4, subsets {1, 2, 4}; {1, 3, 6};
{1, 2, 6} and {1, 3, 9} are chains.
Example 4.8: In the poset of example 4.4, subsets {2, 9}; {3, 4}; {4, 6, 9}
are anti-chains.
Example 4.9: Let A = {2, 3, 5, 7, 11, 13, 17, 19} and the relation defined
on A be . Then poset (A, ) is a chain.
In this section, we discuss certain element types in the poset and hence a
special kind of poset, Lattice.
81
j k e h g
f
h i
b d
c
f g
a
b c e
d
a Fig. 4.7
Fig. 4.6
Definition 4.3.4: Let a, b be two elements in the poset (A, ). An element
c A, is said to be a least upper bound of a, b if a c and b c and if d is
an upper bound of a, b, then c d. E.g. In Fig 2.7, f is a least upper bound
of b and d.
Definition 4.3.5: Let a, b be two elements in the poset (A, ). An element
c A, is said to be a lower bound of a, b if c a and c b. E.g. In Fig
4.6, f, g are lower bounds of h and i.
Definition 4.3.6: Let a, b be two elements in the poset (A, ). An element
c A, is said to be a greatest lower bound of a, b if c a and c b and if
d is a lower bound of a, b, then d c. E.g. In Fig 4.7, c is a greatest lower
bound of e and g.
E.g. Fig. 4.6 is not a lattice, because j and k are two least upper bounds of
h and i, whereas Fig. 4.7 is a lattice.
82
Problem 4.1: Let (S, R) be a poset. Show that (S, R–1) is also a poset.
(S, R–1) is called as dual poset of (S, R).
Solution:
(i) Since a R a (partial order relation is reflexive), a R–1 a. (R –1 is
reflexive).
(ii) Let a, b S, where a b. If a R b, b R–1a.
a R b b R a (partial order relation is anti-symmetric)
1
a R b .
Thus, b R–1a a R–1 b (R –1 is anti-symmetric).
Problem 4.3: Which of the following pairs are comparable in the poset
+
(Z , | ).
(a) 5, 15 (b) 6, 9 (c) 8, 16 (d) 7, 7
Solution:
(a) (i) {0}and {1} (ii) {0, 1} and {1, 2}
(b) (i) 4, 6 (ii) 6, 8
83
3
5
2
1
Problem 4.6: Determine whether the poset represented by the following
Hasse diagrams, is a lattice. Justify your answer.
g
c
e
f
a b
84
Exercise:
1 0 1 0
1 0 0
0 1 1 0
(i) 0 (ii) 0 1 0
0 1 1 1 0 1
1 1 0 1
(iii)
a b
c d
a b
(iv)
85
b c d e
l m
k
j
g
i
h
d f
e
a b c
86
(i)
f
d
e
(ii)
87
(iii)
11. Prerequisites in the college for various subjects are one of the
partial ordering relations. We say A << B, if course A is a
prerequisite of course B. Consider the mathematics courses and
their prerequisites given below and draw a Hasse diagram based on
it. Decide whether given relation is Lattice.
Course Prerequisite
88
5
RECURRENCE RELATION
Unit Structure
5.0 Objectives
5.1 Introduction
5.2 Formulation of Recurrence Relation
5.3 Methods of solving recurrence relation
5.4 Unit End Exercises
5.0 OBJECTIVES:
5.1 INTRODUCTION:
Example5.1: The number of bacteria, double every hour, then what will
be the population of the bacteria after 10 hours? Here we can represent
number of bacteria at the nth hour be an. Then, we can say that an = 2an–1.
89
Example 5.3: Towers of Hanoi is a popular puzzle. There are three pegs
mounted on a board, together with disks of different sizes. Initially, these
discs are placed on the first peg in order of different sizes, with the largest
disc at the bottom and the smallest at the top. The task is to move the discs
from the first peg to the third peg using the middle peg as auxiliary. The
rules of the puzzle are:
Only one disc can be moved at a time.
This is a popular puzzle and we shall discuss its solution, using the one of
the techniques discussed in this chapter.
With these illustrations, we define recurrence relation now.
Example 5.6: With reference to Example 5.3, let Hn denote the number of
moves required to solve the puzzle with n discs. Let us define Hn
recursively.
Solution: Clearly, H1 = 1.
Consider top (n–1) discs. We can move these discs to the middle peg using
Hn–1 moves. The nth disc on the first peg can then moved to the third peg.
Finally, (n–1) discs from the middle peg can be moved to the third peg
with first peg as auxiliary in Hn–1 moves. Thus, total number of moves
needed to move n discs are: Hn = 2Hn–1 + 1. Hence the recurrence relation
for the Tower of Hanoi is:
Hn = 1 if n = 1.
Hn = 2Hn–1 + 1 otherwise.
90
Example5.7: Find recurrence relation and initial condition for the number
of bit strings of length n that do not have two consecutive 0s.
Solution: Let an denote the number of bit strings of length n that do not
contain two consecutive 0s. Number of bit strings of length one that
follow the necessary rule are: string 0 and string 1. Thus, a1 = 2. The
number of bit strings of length 2 is: string 01, 10 and 11. Thus, a2 = 3.
Now we shall consider the case n 3. The bit strings of length n that do
not have two consecutive 0s are precisely those strings length n–1 with no
consecutive 0s along with a 1 added 1 at the end of it (which is an–1 in
number) and bit strings of length n–2 with no consecutive 0s with a 10
added at the end of it (which is an–2 in number). Thus, the recurrence
relation is:
an = an–1 + an–2 for n 3 with a1 = 2 and a2 = 3.
91
Example 5.10: Find the recurrence relation to count the number of regions
created by n lines in a plane, such that each pair of lines has exactly one
point of intersection. Solve this recurrence relation.
nth line
n–1 lines
Then, as we observe from above diagram, if nth line intersects all n–1
lines, then new n regions are created. Thus, the recurrence relation is:
rn = rn–1 + n, with r1 = 2.
92
r k c1 r k 1 c2 r k 2 ck 1 r ck 0 .
The solutions of the equation are called as characteristic roots of
the recurrence relation.
(i) Roots are distinct, say s1 and s2. Then, it can be shown that
a n us1n vs2n is a solution to the recurrence relation, with
a1 us1 vs2 and a 2 us12 vs 22 .
(ii) Roots are equal, say s. Then it can be shown that a n (u vn) s n is
a solution to the recurrence relation.
93
Though, there are no hard and fast rules for finding particular
solution, depending upon the F(n), there are certain guidelines for
choosing a particular solution form and hence finding a particular solution.
These can be understood from the following theorem.
94
n
Example 5.16: Solve the recurrence relation an – 7an–1 + 10an–2 = 3 , with
a0 = 0 and a1 = 1.
Example 5.17: Find all the solutions of the recurrence relation an = 3an–1
+ 2n. What is its solution when a1 = 1?
95
Example 5.18: What form does a particular solution of the linear non-
homogeneous recurrence relation a n 6a n 1 9a n 2 F ( n ) have, when,
F (n ) 3n , F ( n ) n3n , F ( n ) n 2 2 n and F ( n ) (n 2 1)3n .
2. Let T(n) denote the time required to search among n elements. Assume
that n is power of 2. Let T(n) = T(n/2) if n 2 and T(1) = 1. Find
explicit formula for T(n).
96
97
Unit Structure
6.0 Objectives
6.1 Introduction
6.2 Binary Operation
6.3 Semigroup
6.4 Identity Element
6.5 Group
6.6 Subsemigroup
6.7 Products and Quotients of Semigroups
6.8 Homomorphism, Isomorphism and Automorphism of Semigroups
6.9 Homomorphism, lsomorphism and Automornhism of Monoids
6.10 Homomorphism, Isomorphism and Automorphism of Groups
6.11 Coset and Normal Subgroup
6.12 Unit End Exercises
7.0 OBJECTIVES:
7.1 INTRODUCTION:
98
6.3 SEMIGROUP
99
6.5 GROUP
6.6 SUBSEMIGROUP :
100
6.7 PERMUTATION
12345
For example denotes the permutation on the 5 symbols
53124
(1,2,3,4,5). maps 1 to 5, 2 to 3, 3 to 1, 4 to 2 and 5 to 4.
123456
i) . It can be expressed as a product of cycles -
234165
1234 56
1234 56
2341 65
Transposition :
18
37 25 46
18 13 17 25 46
101
Example 3 : Determine whether the following set together with the binary
operation is a semigroup, a monoid or neither. If it is a monoid, specify the
identity. If it is a semigroup or a monoid determine whether it is
commutative.
102
Solution :
i) A = set of all positive integers. a b max{a, b} i.e. bigger of a and b.
Associative Property :
Since a (b c) max{{a, b}, c} max {a, b, c}
= Max{a,{b, c} } = (a.b).c
is associative.
(A, ) is a semigroup.
103
* 1 2 3 6 9 18
1 1 2 3 6 9 18
2 2 2 6 6 18 18
3 3 6 3 6 9 18
6 6 6 6 6 18 18
9 9 18 9 18 9 18
18 18 18 18 18 18 18
104
105
ab
Closure Property : Since is even for a and b even. a b E . Hence
2
closure property is verified.
bc abc ab
Associative Property : Since a (b c) q c ( a b) c
2 4 2
is associative. (E, ) is a semigroup.
2a
Existence of identity : 2 E is the identity because 2 a = a a E
2
(E, ) is a monoid.
ab ba
Commutative property : Since , we have a b b a Hence is
2 2
commutative.
106
= aa–1 ae = a
= e aa–1 = e
Similarly we can prove (b–1a–1)(ab) = e.
Hence (ab) –1 = b–1 a–1
107
Example 7 : Show that if every element in a group is its own inverse, then
the group must be abelian. [Dec-02] [5]
OR
108
Example 9 : Show that a group (G, ) is abelian if and only if for a, bG,
( a b) 2 a 2 b 2 [Nov-06]
Example 10 : If (G, ) be an abelian group, then for all a, bG, show that
( a b) n a n b n .
We will use the method of induction. Let P(n) be the property that for all
a, bG;
( a b) n a n b n
109
1 2 3 4 5 6
Example 12 : Let A = { 1, 2, 3, 4, 5, 6} and P = be
2 4 3 1 5 6
permutation on A
a) Write P as a product of disjoint cycles.
b) Find P–1.
c) Find the smallest positive integer k such that Pk=1A.
[May-02][4]
110
1 2 3 4 5 6
Solution: Let P =
2 4 3 1 5 6
(a) P = (1 2 4)(3)(5)(6)
(b) PP–1 = 1
1 2 3 4 5 6 1 2 3 4 5 6
=
2 4 3 1 5 6 1 2 3 4 5 6
1 2 3 4 5 6
P–1 =
4 1 3 2 5 6
(c) P2 =
1 2 3 4 5 61 2 3 4 5 6 1 2 3 4 5 6
=
2 4 3 1 5 6 2 4 3 1 5 6 4 1 3 2 5 6
P3 = p2p =
1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6
=
4 1 3 2 5 6 2 4 3 1 5 6 1 2 3 4 5 6
Smallest k=3
111
Example 14 : Let S={x|x is a real number and x0, x1}. Consider the
following functions fi : SS, i=1,2,---,6 [Nov-05]
1 1 1
f1 ( x) x, f 2 ( x) 1 x, f3 ( x) , f 4 ( x) , f5 ( x) 1 ,
x 1 x x
x
f6 ( x)
x 1
Show that G = {f1, f2, f3, f4, f5, f6) is a group under the operation of
composition. Give the multiplication table of G.
(i) Closure property : Since all the elements in the table G, closure
property is satisfied.
(ii) Associative property : Since composition of functions is
associative, associative property is satisfied.
(iii) Existence of identity : From the table we observe that f1G is the
identity.
(iv) Existence of inverse : From the table we observe that
f1–1 = f1, f2–1 = f2, f3–1 = f3, f4–1 = f5, f5–1 = f4, f6–1 = f6
i.e. every element of G has inverse in G. Hence G is a group.
112
Solution:
0 1 2 3 4
0 0 1 2 3 4
1 1 2 3 4 0
2 2 3 4 0 1
3 3 4 0 1 2
4 4 0 1 2 3
113
Solution:
a) Let H= set of all even integers.
We know, additive inverse of an even number is even and sum of
two even integers is also even. Thus for a,bH we have ab–1H.
Hence H is a subgroup of G.
Solution :
(i) Let a, a H a a–1 H. i.e. e H
The identity element H.
(ii) Let e, a H ea–1 H. i.e. a–1 H
Every element has inverse H.
(iii) Let a, b H. b–1 H. a(b–1) –1 H. i.e. ab H.
Closure property is satisfied.
(iv) Every element in H is also in G. And G is a group. So associative
property is satisfied by the elements of H. Hence associative
property is satisfied by the elements of H.
Hence H is a group. But H is a subset of G. H is a subgroup
of G.
114
Theorem 6.1 :
If (S, ) and (T, ’) are semigroups, then (S T, ”) is a semigroup,
where ” is defined by (s1,t1) ”(s2,t2) = s1 * s 2 ,t1 * ' t 2
Theorem 6.2 :
If S and T are monoids with identities es and eT, respectively, then, S T
is a monoid with identity (es, eT)
Theorem 6.3 :
Let R be congruence relation on the semigroup (S, ). Consider the
relation from S/RS/R to S/R in which the ordered pair ([a], [b]) is, for a
and b in S, related to [a b].
115
116
Theorem 6.4 : Let (S, ) and (T, ’) be monoids with identity e and e’,
respectively. Let f : S T be an isomorphism. Then f(e) = e’.
Similarly, since a e a ,
b f (a) f (e a) f (e * a) f (e) ' a
117
Theorem 6.5: Let (S, ) and (T, ’) be monoids with identity e and e’,
respectively. Let f : S T be a homomorphism. Then f(e) = e’.
Proof : If t1, and t2 are any elements of F(S’), then there exist s1 and s2 in
S’ with
t l= f(s1) and t2 = f(s2).
Therefore,
t1 t2 f ( s1 ) f ( s2 ) f ( s1 s2 ) f ( s2 s1 ) f ( s2 ) f ( s1 ) t2 t1
Hence (T, ') is also commutative.
Solution :
ya2 GaGst
Step 2 :
f(a)ya 2
f is onto.
118
Solution :
Step-1: Show that f is 1-1.
f a ( x) axa 1
Consider fa(x) = fa(y) for x, y G
axa–1 = aya–1 definition of f
x=y left and right cancellation laws
f is 1- 1
yaxa 1GxGs.t.
Step 2 :
fa (x)axa 1
f is onto.
119
Solution :
i) Let f(a)=f(b)
a–1 = b–1 a = b f is 1- l.
1
ii) aGa G
x1 G
f x x 1
f is onto.
iii) Let a,bG. f(a) = a–1, f(b) = b–1 and f(ab) = (ab) –1
by
definition of f.
f(ab) = (ab) –1
= b–1a–1 reversal law of inverse
–1 –1
= a b G is abelian
= f(a)f(b) definition of f.
f is a homomorphism.
Since f is 1-1 and homomorphism, it is isomorphism.
Solution:
Step -1 Show that f is 1-l.
Consider f(x) = f(y) for x, yG
5x = 5y definition of f
x=y f is 1-1
5xG,x G
Step 2 :
s.t.f(x)5x
f is onto.
120
For x y G
f(x) = 5x, d(y) = 5y and f(x+y) – 5(x+y)
Consider f(x+y) = 5(x+y) for x, y G
= 5x + 5y
f(x+y) = f(x) + f(y)
f is homomorphism.
Since f is 1-1 and homomorphism, it is isomorphism.
OR
Show that the group G = (R,+) is isomorphic to G’ = (R+, x) where R is
the set of real numbers and R+ is a set of positive real numbers.
Solution :
Example 27 : Let G = {e, a, a2, a3, a4, a5} be a group under the operation
of aiai ar , where i + j r(mod 6). Prove that G and Z6 are isomorphic
[May-07]
Solution :
121
Example 28 : Let T be set of even integers. Show that the semigroups (Z,
+) and (T, +) are isomorphic. [May-05]
3) F is homorphism
F (x + y) = 2 (x + y)
= 2x + 2y
= f(x) + f(y)
f is honomorphism.
122
Example 29 : For the set A = {a,b,c} give all the permutations of A. Show
that the set of all permutations of A is a group under the composition
operation.
Left Coset : Let (H, ) be a subgroup of (G, ). For any a G, the set of
aH defined by aH {a h / h H } is called the left coset of H in G
determined by the element aG. The element a is called the representative
element of the left coset aH.
Right Coset : Let (H, ) be a subgroup of (G, ). For any a G, the set
of Ha defined by
Hah* a | h H
123
Theorem 6.7: Let (H, ) be a subgroup of (G, ). The set of left cosets of
H in G form a partition of G. Every element of G belongs to one and only
one left coset of H in G.
Theorem 6.8 : The order of a subgroup of a finite group divides the order
of the group.
1 2 3 1 2 3 1 2 3
f0 , f1 , f3
1 2 3 1 3 2 3 2 1
1 2 3 1 2 3 1 2 3
f3 , f4 , f5
2 1 3 2 3 1 3 2 1
Let us prepare the composition table.
0 f 0 f1 f 2 f3 f 4 f5
f0 f 0 f1 f 2 f3 f 4 f5
f1 f1 f0 f4 f5 f2 f3
f2 f2 f3 f0 f4 f3 f1
f3 f3 f4 f5 f0 f1 f2
f4 f4 f3 f1 f2 f5 f0
f5 f5 f2 f3 f1 f0 f4
From the table it is clear that {f0, f1}, {f0, f2,}, {f0, f3) and {f0, f4, f5} are
subgroups of (S3, 0): The left cosets of {f0, f1} are {f0, f1}, {f2, f5}, {f3, f4}.
While the right cosets of {f0, f1} are {f0, f1}, {f2, f4}, {f3, f5}. Hence {f0,
f1} is not a normal subgroup.
Similarly we can show that {f0, f2} and {f0, f1} are not normal subgroups.
124
On the other hand, the left and right cosets of {f0, f4, f5} are {f0, f4, f5} and
{f1, f2, f3}.
Hence {f0, f4, f5} is a nomal subgroup.
Solution : Let
1 2 3 1 2 3 1 2 3
f0 , f1 , f3
1 2 3 1 3 2 3 2 1
1 2 3 1 2 3 1 2 3
f3 , f4 , f5
2 1 3 2 3 1 3 2 1
H={f0, f2}
Left Cosets of H in G :
f0H = {f0f0, f0f2} = {f0, f2} f1H = {f1f0, f1f2} = {f1, f4}
f2H = {f2f0, f2f2} = {f2, f0} f3H = {f3f0, f3f2} = {f3, f5}
f4H = {f4f0, f4f2} = {f4, f1} f5H = {f5f0, f5f2} = {f5, f3}
Right Cosets of H in G
Hf0 = {f0f0, f2f0} = {f0, f2} Hf1 = {f0f1, f2f1}={f1, f3}
Since f1 H Hf1 , H is not a normal subgroup of G.
Example 32 : Consider the dihedral group (D4, 0). Find the subgroup of
1 2 3 4
D4 generated by Is it normal subgroup. Find the left cosets
2 3 4 1
of D4.
[Dec-99][6]
Solution: D4 = {f1, f2, f3, f4, f5, f6, f7, f8}
125
1) Determine whether the set Q, the set of all rational number with
the binary operation of addition is a group. If it is a group,
determine if it abelian, specify the identity and the inverse of a
general element.
ab
2) If G is a set of all not-zero real numbers and a b , show that
2
(G, ) is an abelian group. [May-05]
3) Let G be a set of integers between 1 and 15 which are co-prime to
5. Find the multiplication table of G. Find 2–1, 7–1, 11–1. Is G
cyclic? [May-05]
4) Check whether it is an abelion group in each of the following
cases-
i) R, set of real numbers where a * b = a + b +7
ii) 5 = Q × Q with operation defined as (a, b) * (c, d) = (ac, ad + b).
5) Determine whether the following sets along with the binary
operation, form a group. If it is a group, state the identity, and the
inverse of an element a. If it is not a group, state the reason why ?
[Oct-03]
i) Set is P(S) = set of all subsets of S where S is a non-empty
set. The operation is that of union.
ii) Set of all non-zero real numbers, under the operation of
multiplication.
6) Let H be a subgroup of a group G. Define the following [Oct-03]
i) Left coset of H in G.
ii) Right coset of H in G.
G
7) If G is a finite group then prove that a e .
126
Unit Structure :
7.0 Objectives
7.1 Introduction
7.2 Group Code
7.3 Additional Results From Boolean Matrices
7.4 Decoding And Error Correction
7.5 Maximum Likelihood Technique
7.6 Unit End Exercise
7.0 OBJECTIVES :
7.1 INTRODUCTION :
Let B 0,1
be the set of bits. Every character or symbol can be
represented by sequence of elements of B. Message are coded in O’s and
1’s and then they are transmitted. These techniques make use of group
theory. We will see a brief introduction of group code in this chapter. Also
we will see the detection of error in transmitted message.
127
0 1
0 0 1
1 1 0
Important Terminology :
1) Encoding Function :
The function e is called an (m, n) encoding function. It means that
every word in Bm as a word in Bn.
2) Code word :
If bBm then e(b) is called the code word
3) Weight :
For xBn the number of 1’s in x is called the weight of x and is
denoted by x .
e.g. i) x10011B5 w x 3
ii) x001B 3 w x
128
e.g. if x,yB5
x00101,y10110
xy10011
w(xy)3
5) Hamming Distance :
Let x,yBm . The Hamming Distance x, y between x and y is
the weight of xy . It is denoted by xy . e.g. Hamming distance
between x & y can be calculated as follows : if x = 110110, y = 000101
xy = 110011 so xy = 4.
6) Minimum distance :
Let x,yBn . then minimum distance = min d x,y /x,yBn .
Let x1,x 2 x n are the code words, let any x i,
i 1 n is a
transmitted word and y be the corresponding received word. Then yx k
if d x k , y is the minimum distane for k = 1, 2, --- n. This criteria is
known as minimum distance criteria.
7) Detection of errors :
Let e : Bm Bn mn is an encoding function then if minimum
distane of e is ( k + 1) then it can detect k or fewer errors.
8) Correction of errors :
Let e : Bm Bn mn is an encoding function then if minimum
distance of e is (2k + 1) then it can correct k or fewer errors.
Weight of a code word : It is the number of 1’s present in the given code
word.
Hamming distance between two code words : Let x x1 x2 ...xm and
y y1 y2 ... ym be two code words. The Hamming distance between
them, x, y , is the number of occurrences such that xi yi for i 1,m .
129
where
zi 1 if y1, yi 2 , yi 4 has at least two 1’s.
0 if y1, yi 2 , yi 4 has less than two 1’s.
Determine d y for the word y in B6 .
(a) y 111011 (b) y 010100
where
bm 1 0 if b is even.
= 1 if b is odd.
130
Since Ran (e) CBn and if (Ran (e), ) is a group then Ran(e) is a
subgroup of Bn. If an encoding function e : B m B n (n < n) is a group
code, then the minimum distance of e is the minimum weight of a nonzero
codeword.
131
(a) Mod-2 Addition : Consider the set B with +. Now let D dij
where
Here + is addition in B.
For example
1 0 1 0 1 1 0 1 0 1 1 0
0 1 1 0 1 1 0 1 0 1 1 1
1 0 0 1 0 1 1 1 1 1 1 0
132
N x B n x H 0 is a normal subgroup of Bn .
whose last r rows form r r identity matrix is called a parity check matrix.
where
x1 b1h11 b2 h21 ...bm hm1
x2 b1h12 b2h22 ...bm hm 2
………………………………….
xr b1h1r b2 h2r ...bm hmr
Corollary 7.2 : eH B m eH b b B m is a subgroup of Bn .
133
Since Bm 2m .
x , x ,...,x
1 2 2m
If the received word is x1 , we compute x x1 for 1 i 2m
i ,
and choose the first code word, say it is x , such that
s
m
1i 2
min x ,x1
i
x ,x
s
1
That is, x is a code word that is closest to x1 , and the first in the
s
d associated with e by
d xt b
134
1 1 0
0 1 1
Example 7.7 : Let m 2,n 5 and H 1 0 0 . Determine the
0 1 0
0 0 1
group code e H : B2 B5 . [May-07]
. Then e 00 00x1x 2 x 3
Solution : We have B2 00,01,10,11
where
x1 0.1 0.0 0
x2 0.1 0.1 0
x3 0.0 0.1 0
e 00 00000
Now,
e 01 01x1x2 x3
where
x1 0.1 1.0 0
x2 0.1 1.1 1
x3 0.0 1.1 1
e 01 01011
Next
e 10 10 x1x2 x3
x1 1.1 0.0 1
x2 1.1 1.0 1
x3 1.0 0.1 0
e 10 10110
e 11 11101
135
1 0 0
0 1 1
1 1 be a parity check matrix. determine
Example 7.8 : Let H 1
1 0 0
0 1 0
0 0 1
the 3,6 group code e H : B3 B6 .
Solution : First find e 000 ,e 001 ,e 010 ,e 011 ,e 100 ,e 101 ,
e 110 ,e 111 .
e 000 000000 e 100 100100
e 001 001111 e 101 101011
e 010 010011 e 110 110111
e 100 011100 e 111 111000
Compute
x , xt 00000 11110 11110 4
1
min x , x 1 x , x
i 2
t t
136
(b) xt 10011
Compute
x , xt 00000 10011 11101 4
1
min x , x 1 x , x
i 4
t t
(c) xt 10100
Compute
x , xt 00000 10100 10100 2
1
min x , x 1 x , x
i 3
t t
0 1 1
1 0 1
Example 7.10 : Let H 1 0 0 be a parity check matrix. decode the
0 1 0
0 0 1
following words relative to a maximum likelihood decoding function
associated with eH : (i) 10100, (ii) 01101, (iii) 11011.
Solution : The code words are e 00 00000,e 01 00101,e 10 10011,
e 11 11110 . Then N 00000,00101,10011,11110
. We implement
the decoding procedure as follows. Determine all left cosets of N in B5,
137
as rows of a table. For each row 1, locate the coset leader i , and rewrite
the row in the order.
1,i
Example 7.11 : Consider the 2,4 encoding function e as follows. How
many errors will e detect? [May-06]
Solution :
1100 ---
Example 7.12 : Define group code. Show that 2,5 encoding function
e : B2 B5 defined by e 00 0000,e 10 10101,e 11 11011 is a
group code. [May-06]
Example 7.13 : Define group code. show that 2,5 encoding function
e : B2 B5 defined by e 00 00000,e 01 01110,e 10 10101 ,
138
e 11 11011 is a group code. Consider this group code and decode the
following words relative to maximum likelihood decoding function.
(a) 11110 (b) 10011. [Apr-04]
(a) xt 11110
x , xt x xt 00000 11110 11110 4
1 1
(b) xt 10011
x , xt x xt 00000 10011 10011 3
1 1
139
1 0 0
0 1 1
1 1 be a parity check matrix. Determine
Example 7.14 : Let H 1
1 0 0
0 1 0
0 0 1
the 3,6 group code e H : B3 B6 .
Solution : B3 000,001,010,011,100,101,110,111
eH 000 000000e H 001 001111e H 010 010011
eH 011 011100eH 100 100100eH 101 101011
eH 110 110111e H 111 111000
Solution :
140
Solution :
Solution :
141
Solution : B2 00,01,10,11
eH 00 00 x1x2 x3 where x1 0.1 0.0 0
x2 0.1 0.1 0
x3 0.0 0.1 0 eH 00 00000
(1) xt 01110
x , xt x xt 00000 01110 01110 3
1 1
142
(2) xt 11101
x , xt x xt 00000 11101 11101 4
1 1
(3) xt 00001
x , xt x xt 00000 00001 00001 1
1 1
(2) xt 11000
x , xt x xt 00000 11000 11000 2
1 1
1 1
0 1
Example 7.19 : Let H be a parity check matrix. decode 0110
1 0
0 1
relative to a maximum likelihood decoding function associated with e H .
[Dec-04]
143
Solution : eH : B2 B5
B2 00,01,10,11
eH 00 00 x1x2 where x1 0.1 0.0 0
x2 0.1 0.1 0 eH 00 0000
x , xt x xt 0000 0110 0110 2
1 1
(1) xt 10100
x , xt x xt 00000 10100 10100 2
1 1
144
x , xt x xt 10011 10100 00111 3
3 3
to xt and 1 i 4
(2) xt 01100
x , xt x xt 00000 01101 01101 3
1 1
closest to xt and 1 i 4
The first in their list in the list and e 01 x . So we define maximum
2
1 1
0 1
Example 7.21 : Let H 1 0 be a parity check matrix. [Dec-02]
1 0
0 1
i) Determine the 3,5 group code eH : B3 B5 .
ii) Construct the decoding table and decode the following words using
maximum likelihood technique – 1) 00111, 2) 10111, 3) 11001
145
Solution : (i) e H : B3 B5 .
B3 000,001,010,011,100,101,110,111
eH 000 000 x1x2 where x1 0.1 0.0 0.1 0
x2 0.1 0.1 0.0 0 eH 000 00000
x , xt x xt 00111 3
1 1
x , x x x 00001 1
2 2
t t
x , x x x 01110 3
3 3
t t
146
x , xt x xt 01000 1
4 4
x , x x x 10100 2
5 5
t t
x , x x x 10010 2
6 6
t t
x , x x x 11101 4
7 7
t t
x , x x x 11011 4
8 8
t t
x , xt x xt 10111 4
1 1
x , x x x 10001 2
2 2
t t
x , x x x 11110 4
3 3
t t
x , x x x 11000 2
4 4
t t
x , x x x 00100 1
5 5
t t
x , x x x 00010 1
6 6
t t
x , x x x 01101 3
7 7
t t
x , x x x 01011 3
8 8
t t
x , xt x xt 11001 3
1 1
x , x x x 11111 5
2 2
t t
x , x x x 10000 1
3 3
t t
x , x x x 10110 3
4 4
t t
x , x x x 01010 2
5 5
t t
x , x x x 01100 2
6 6
t t
x , x x x 00011 2
7 7
t t
147
x , xt x xt 00101 2
8 8
Min x ,xt x , xt and e 010 x d xt 010 .
i 3 3
1 1 0
1 0 1
0 1 be a parity check matrix. determine
Example 7.22 : Let H 1
1 0 0
0 1 0
0 0 1
the corresponding group code.
B3 000,001,010,011,100,101,110,111
eH 000 000000,eH 001 001011,eH 010 010101,eH 011 011111
eH 100 100110,eH 101 101110,eH 110 110011,eH 111 111000 .
(i) Min distance of a group code = min weight of non-zero code word = 3
k 1 3 k 2
The group code can detect at the most 2 or fewer errors.
and let x t be transmitted codeword. Find x , xt , take minimum.
i
If
i
Min x , xt x ,xt
s
then maximum likelihood decoding
148
Solution : (i)
(ii)
x , x1 x x1 000000 101101 101101 4
1 1
149
x , x1 x x1 110001 101101 0111000 3
8 8
Min x , x1 x x1 . Thus x is the code word that is closest
i 5 5
to x1 and e 011 x .
5
x , x1 x x1 000000 011011 011011 4
1 1
Min x , x1 x x1 . Thus x is the code word that is closest
i 3 3
to x1 and e 011 x .
3
150
1 0 0
1 1 0
0 1 1
Example 7.24 : Let H be a parity check matrix.
1 0 0
0 1 0
0 0 1
Decode the following words relative to a maximum likelihood decoding
function associated with eH : (i) 011001, (ii) 101001, (iii) 111010.
1 0 0
1 1 0
0 1 1
Example 7.25 : Let H be a parity check matrix. [Nov-06]
1 0 0
0 1 0
0 0 1
Determine the 3,6 encoding function e H : B3 B6 . Decode the words
011001 relative to a maximum likelihood decoding function associated
with eH .
Solution : Let eH : B3 B6
B3 000,001,10,11,100,101,110,111
x , x1 x x1 0110001 3
1 1
x , x x x 010010 2
2 2
1 1
x , x x x 001111 4
3 3
1 1
x , x x x 00100 1
4 4
1 1
151
x , x1 x x1 111101 5
5 5
x , x x x 110110 4
6 6
1 1
x , x x x 101011 4
7 7
1 1
x , x x x 1000000 1
8 8
1 1
Min x , x1 x x1 . Thus x is the code word that is closest
i 4 4
to x1 and e 011 x .
4
x , x1 x x1 101001 3
1 1
x , x x x 100010 2
2 2
1 1
x , x x x 111111 6
3 3
1 1
x , x x x 110100 3
4 4
1 1
x , x x x 001101 3
5 5
1 1
x , x x x 000110 2
6 6
1 1
x , x x x 011011 4
7 7
1 1
x , x x x 010000 1
8 8
1 1
Min x , x1 x x1 . Thus x is the code word that is closest
i 8 8
to x1 and e 111 x .
8
152
0 1 1
1 0 1
Example 7.26 : Let H 1 0 0 be a parity check matrix.
0 1 0
0 0 1
Decode the following words relative to a maximum likelihood decoding
function associated with eH : (i) 10100, (ii) 01101, (iii) 11011.
Solution :
x 000000000,x 011101100, x 101110001,
1 2 3
Let
x 110001111 .
4
000 000 000 011 101 100 101 110 001 110 001 111
000 000 000 - 011 101 100 101 110 001 110 001 111
011 101 100 - 110 011 101 101 100 011
101 110 001 - 011 111 110
110001111
153
011
101
3) Let H100 be a panty check matrix. decode the following
010
101
words related to maximum likelihood technique associated with eH @
a) 10100 b) 01101 c) 11011
154
CLASSIFICATION OF LANGUAGE
[Syllabus : Classification of Languages : Overview of Languages,
Representation of regular languages and grammars, Finite state machines.]
Unit Structure
8.0 Objectives
8.1 Introduction
8.2 Strings and regular expression
8.3 Regular sets
8.4 Languages
8.5 Classification of phrase structure Grammer
8.6 Representation of special grammars and languages :
8.7 Regular Grammars and Regular Expression
8.8 Finite State Machines
8.9 Moore Machine (recognition machine)
8.10 Unit End Exercises
8.11 References
8.0 OBJECTIVES:
8.1 INTRODUCTION:
Example 8.1 : Let A = {Sachin, Saurav, Virat, well, runs, fields, quickly,
slowly}.
155
Example 8.2 : Let A = {0,1}. Show that following expressions are all
0* 01 00 * 01 *1
*
regular expressions over A. a) b)
c) 01 * (01 1) *
For this case in particular, the sequences in A* are not written with
commas. We assume that A* contains empty sequence or empty string,
containing no symbols, and we denote this string by .
Catenation :
If w1 = s1,s2....sn and w2 = t1,t2…..tk are elements of A* for some set
A, we define the catenation of w1, and w2 as the sequence s1,s2…..sn
t1,t2…..tk. The catenation of w1, with w2 is written as w1,.w2 or w1w2 and is
another element of A*. Note that if wA* then w* = w and *w = w.
This property is convenient and is one of the main reasons for defining the
empty string .
156
Example 8.3: Let A={0, 1}. Find regular sets corresponding to the three
regular expressions (a) 0*(01)* (b) 00* (01)*l (c) (01)*(011*)
157
Solution:
(a) The set corresponding to 0*(01)* consists of al1 sequences of 0’s
and l’s. Thus the set is A*.
(b) The expression 00*(01)*1 corresponds to the set of all sequences
of 0’s and 1’s that begin with at least one 0 and end with at least
one 1.
(c) The expression (01)*(Olvl*) corresponds to the set of all sequences
of 0’s and 1’s that either repeat O1 a total n 1 times, or begins
with a total of n 0 repetitions of 01 and end with some number
k 0 of 1’s. This set includes, for example the strings 1111, 01,
0l0l01, 010101011111 and 011.
8.4 LANGUAGES :
158
PP' is called a Production of G. then P & P’ are called the left and
right sides of the production of G.
For example - derivation tree for the derivation of “the hungry rabbit eats
quickly” can be given as :
Sentence
159
Derivation tree :
160
Solution :
(i) To drive sentences in L(G), it is necessary to perform successive
substitutions, using (1), (2) and (3) until all symbols are eliminated other
than the terminal symbols a, b and c.
v0
aw
abbw
abbbbw
abbbbbbw
abbbbbbc
i.e. ab6c
The derivation tree for ab6c is shown below. It is not a binary tree :
161
Solution: We may continue to use (1) any number of times, but we must
eventually use production (2) to eliminate v0.
Repeated use of (1) will result in a string of the form anv0bn; i.e.
there are equal number of a’s and b’s.
Example 8.7
Determine whether the word cbab belongs to the language
generated by the grammar G(V,S, 0 , ) where V = [a, b, c, A, B, C,
S], T = [ a, b, c], S is the starting symbol & the productions are
SAB
ACa
BBa
BCb
Bb
Ccb
Gb
Solution : SAB
SCab by using ACa
ScbaB by using C ab
S cbab by using B b
162
2. Type 1: if for any production w1, w2, the length of w, is less than or
equal to the length of w2. (where length of a string is the number of
words in that string).
163
Example 8.8 :
In BNF notation, the productions of example 4 appear as follows :
sentence noun verbphrase
noun Ramesh/Seema
verbphrase verb adverb
verb drives/Jogs
adverb carelessly/rapidly/frequently
Note that the left-hand side of a production may also appear in one
of the strings on the right-hand side.
164
Example 8.9 :
Let V = {v0, w, a, b, c} S = {a, b, c} and let be the relation on V*
given by
1. v0 aw. 2. w bbw 3. w c
Consider the phase structure grammar G = (V, S, v0, ).
Write the production rules using BNF notations.
Let S = {0, l, 2, 3, 4, 5, 6, 7, 8, 9, .}
Let V be the union of S with the set
N = {decimal-number, decimal-fraction, unsigned-integer, digit}
165
Example 8.11
G = (V, S, identifier, )
N = {identifier, remaining, digit, letter}
S = {a, b, …..,z, 0, l, 2, …..,9} .
V = NS
1. <identifier>:: = <letter> | <letter> <remaining>
2. <remaining>::.=.<letter>|<digit>|<letter><remaining>|<digit>
<remaining>
3. <letter> :: = a | b | c |…|z
4. <digit>:: = 0|1|2|3|4|S|6|7|8|9
166
(iv) w ab ab w
The syntax diagram for this production is shown in figure (iv).
Solution :
(i)
(ii)
(iii)
(iv)
Example 8.13 : For the grammar specified below describe precisely the
language, L(G), produced. Also give the BNF and the corresponding
syntax diagram for the productions of the grammar. [May-03, May-05]
G = (v,S,v0, )
V={v0,a,b), S={a,b)
: v0 aav0
v0 a
v0, b
(ii) BNF
<v0>:: =. aa<v0>~ | a | b
167
Example 8.14 : For the grammar specified below describe precisely the
language, L(G), produced. Also give the BNF and corresponding syntax
diagram for the productions of the grammar.
G = (v,S,v0, )
V = (v0, v1, x, y, z), S = {x, y, z}
: v0 xv0
v0 yv1,
v1 yv1,
v1 z
(ii) BNF
V0 ::= x V0 y V1
V1 ::= y V1 z
168
Suppose that we have a finite set S ={s0,sl, ... ,Sn] , a finite set I,
and for each xI, a function fx:SS. Let F ={fx,/xI}. The triplet (S,I,F)
is called a finite state machine, S is called the state set of the machine and
the elements of S are called states. The set I is called the input set of the
machine. For any input xI, the function fx describes the effect that this
input has on the states of the machine and is called a state transition
function. Thus, if the machine is in state si. and input x occurs, the next
state of machine will be fx(si).
Since the next state fx(si) is uniquely determined by the pair (si, x)
there is a function F:SXIS given F(si, x) = fx(si)
Example 8.15 : Let S={s0, s1} and I = {0, 1}. Define f0 and f1 as follows :
f0(s0) = s0, f0(s1) = s1, f1(s0) = s1 f1(s1) = s0
This finite state machine has two states s0s1, and accept two
possible inputs 0 and 1. Give transition table. Also draw diagraph of the
finite state machine. [Nov-06]
0 1
s0 s0 s1
s1 s1 s0
169
a b
s0 s0 s1
s1 s2 s0
s2 s1 s2
Solution :
Example 8.17 : Consider the finite state machine M whose transition table
is shown below
a b c
s0 s0 s0 s0
s1 s2 s3 s2
s2 s1 s0 s3
s3 s3 s2 s3
Solution :
170
Example 8.19 : Draw the diagraph of the machine whose state transition
table is shown. Remember to label the edges with the appropriate inputs.
M = (S, I, F, s0, F) where S ={s0, s1, s2, s3}, I ={0, 1} and transition
function is given in the table. [May-05]
State Input
0 1
s0 s0 s1
s1 s0 s2
s2 s0 s0
s3 s2 s1
Example 8.20 : Draw the state transition diagram for the following
S = {s0, s1, s2, s3), I = {a, b; c}. [Dec-02, May-07]
a b c
s0 s0 s0 s0
s1 s2 s3 s2
s2 s1 s0 s3
s3 s3 s2 s3
171
Example 8.21 : Draw the diagraph of the machine whose state transition
table is shown. Remember to label the edges with the appropriate inputs.
[Dec-04]
a b
s0 s1 s0
s1 s2 s0
s2 s2 s0
Example 8.22 : Draw the diagraph of the machine whose state transition
table is shown: [Oct-03]
A B
s0 s1 s0
s1 s2 s0
s2 s2 s0
Solution: The state transition digraph is shown below.
Example 8.23 : Draw the diagraph of the machine whose state transition
table is shown. Remember to label the edges with the corresponding
inputs.
172
M = (S, I, F),where S = {s0, s1, s2, s3}, I ={0, 1} and the transition
function is given below in table
State Input
0 1
s0 s0 s1
s1 s0 s2
s2 s0 s0
s3 s2 s1
Example 8.24 : Construct the state transition table of the finite state
machine whose diagraph is shown below.
State Input
0 1
S0 S1 S0
S1 S1 S2
S2 S3 S2
S3 S3 S4
S4 S4 S2
173
Example 8.25 : Construct the transition table of the finite state machine
whose diagraph is. [Dec.-04, Nov-06]
State Input
A B C
s0 s0 s1 s2
s1 s2 s1 s3
s2 s3 s3 s1
s3 s3 s3 s2
Example 8.26 : Construct the state transition table of the finite state
machine whose diagraph is shown.. [Oct.-03, May-06]
State Input
0 1
S0 S0 S1
S1 S2 S1
S2 S2 S3
S3 S3 S3
174
Example 8.27: Construct the state transition table of the finite state
machine whose diagraph is shown below. [Apr-04]
State Input
F T
S0 S0 S1
S1 S1 S1
S2 S2 S1
Example 8.28: Let the state transition table for a finite state machine be
[Dec-02, Nov-05,May 06, May-07]
State Input
0 1
S0 S0 S1
S1 S1 S2
S2 S2 S3
S3 S3 S0
List values of the transition function fw for (i) w = 01001, (ii) w = 11100.
0 1 0 0 1
S0 S0 S1 S1 S1 S2 fw(S0) = S2
0 1 0 0 1
S1 S1 S2 S2 S2 S3 fw(S1) = S3
0 1 0 0 1
S2 S2 S3 S3 S3 S0 fw(S2) = S0
0 1 0 0 1
S3 S3 S0 S0 S0 S1 fw(S3) = S1
175
1 1 1 0 0
S0 S1 S2 S3 S3 S3 fw(S0) = S3
1 1 1 0 0
S1 S2 S3 S0 S0 S0 fw(S1) = S0
1 1 1 0 0
S2 S3 S0 S1 S1 S1 fw(S2) = S1
1 1 1 0 0
S3 S0 S1 S2 S2 S2 fw(S3) = S2
a b c
S0 S0 S0 S0
S1 S2 S3 S2
S2 S1 S0 S3
S3 S3 S2 S3
176
Example 8.31 : Define finite state automaton. Construct the state diagram
for the finite-state automaton M = (S,I,s0,F) where S = {s0, s1, s2, s3};
I = {0,1}, F = {s0, s3} and the transition function f is given in the table.
[May-03]
f
State
Input
0 1
S0 S0 S1
S1 S0 S2
S2 S0 S0
S3 S2 S1
Solution: The state diagram for the finite state automaton is shown below.
11) Construct a finite state machine that gives a 1 as its output bit if
and only if the last three bits received are all 1’s. [Oct-03]
8.11 REFERENCES :
ii) ab a * b
*
iii) a*b b *
2) Let A = [a, b, c]. Give the regular set corresponding to the regular
expression given i) ab cb* ii) a bb c
*
177
a) State Input b) 0 1 2
F T s0 s0 s2 s1
s0 s0 s1 s1 s1 s3 s2
s1 s2 s1 s2 s2 s1 s3
s2 s0 s2 s3 s3 s3 s2
5) Let I = [0, 1] and S = [a, b]. construct all possible state transition
tables of finite - state machines that have S as state set and I as input set.