Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Permutation-Group

My Research paper on permutation group

Uploaded by

satyamjana05
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Permutation-Group

My Research paper on permutation group

Uploaded by

satyamjana05
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

1 Permutation group

Right from our school days we know that a permutation of n different


elements is nothing but an arrangement of those elements in any
order. For example, if we consider three elements x1 , x2 , x3 , then we
can arrange them in any of the following six manners only.

x1 x2 x3 x2 x1 x3 x3 x1 x2 x1 x3 x2 x2 x3 x1 x3 x2 x1

Each of these arrangements of x1 , x2 , x3 is called a permutation. Note


that each of these arrangements can be described as a bijective func-
tion from the set S = {x1 , x2 , x3 } onto itself as shown below:

x1 → x1 x1 → x2 x1 → x3 x1 → x1 x1 → x2 x1 → x3
x2 → x2 x2 → x1 x2 → x1 x2 → x3 x2 → x3 x2 → x2
x3 → x3 x3 → x3 x3 → x2 x3 → x2 x3 → x1 x3 → x1
We now extend this idea over an arbitrary set of elements.

Definition 1. Let A be a nonempty set. A permutation of A


is a bijective function(mapping) of A onto itself.

Definition 2. A group G is called a permutation group on a


nonempty set A if the elements of G are some permutations of
A and the group operation is the composition of two functions.
1
Let us now consider permutation of a finite set. Suppose for any
positive integer n, In denotes the finite set {1, 2, 3, . . . , n}. For ex-
ample, I3 = {1, 2, 3}. Now any permutation on In is a bijective
function on {1, 2, 3, . . . , n}. The set of all permutations on In forms
a group under the binary operation ‘composition of two functions’.
This permutation group is called the symmetric group on n ele-
ments and is denoted by Sn. Let α ∈ Sn. Generally we demonstrate
α in the following way:

1 −→ α(1)
2 −→ α(2)
α : 3 −→ α(3)
...

n −→ α(n)

where α(i) denotes the image of i under α, for all i = 1, 2, . . . , n.


But it is sometimes convenient to describe this permutation by means
of the following notational device:
 
1 2 3 ... n
α=  .
α(1) α(2) α(3) . . . α(n)

2
This notation is due to Cauchy and is called the two-row nota-
tion. In the upper row, we list all the elemets of In and in the lower
row under each element i ∈ In, we write the image of the element,
i.e., α(i). It is easy to compute the number of elements of Sn. There
are n choices of α(1). Once α(1) has been chosen, there are n − 1
possibilities for α(2)(since α(1) 6= α(2)). After chossing α(2), there
are exactly n − 2 possibilities for α(3). Continuing this way we see
that Sn must have n(n − 1)(n − 2).....3.2.1 = n! elements. The
two-row notation of permutations is quite convenient while doing
computations, such as determining the composition of permutations.
Let
   
1 2 ... n 1 2 ... n
α=  and β =  .
α(1) α(2) . . . α(n) β(1) β(2) . . . β(n)

Now the composition α ◦ β is also a permutation on In defined by



(α ◦ β)(i) = α β(i) for all i ∈ In. Then,

3
   
1 2 ... n 1 2 ... n
α◦β =  ◦ 
α(1) α(2) . . . α(n) β(1) β(2) . . . β(n)

 
1 2 ... n
=   .
     
α β(1) α β(2) . . . α β(n)

Example 3. In this example we consider the group S3, the ele-


ments of this group being all the permutations on I3 = {1, 2, 3}.
As the number of bijective functions of I3 onto itself is 3! = 6,
we have |S3| = 6. We now enlist below the permutations on
I3 = {1, 2, 3}.
     
1 2 3 1 2 3 1 2 3
e=  α=  β= 
1 2 3 2 3 1 3 1 2
     
1 2 3 1 2 3 1 2 3
γ=  δ=  σ= 
1 3 2 2 1 3 3 2 1
We now show some computations regarding the composition or prod-
uct of elements of S3.
     
1 2 3 1 2 3 1 2 3
γ◦δ =   ◦   =   = β.
1 3 2 2 1 3 3 1 2
4
The following calculation of δ ◦ γ reveals an important fact.
     
1 2 3 1 2 3 1 2 3
δ◦γ = ◦ =  = α.
2 1 3 1 3 2 2 3 1
We find that γ ◦ δ 6= δ ◦ γ. Hence S3 is a noncommutative group.

Theorem 4. If n is a positive integer such that n ≥ 3, then the


symmetric group Sn is a noncommutative group.

Let us now introduce a convention towards simplifying the two-row


notation of a permutation. Consider the permutation
 
1 2 3 ... n
α=  .
α(1) α(2) α(3) . . . α(n)

i
If α(i) = i, then we drop the column . For example, let α =
α(i)
 
1 2 3 4
 . Here α(1) = 1 and α(3) = 3. So we denote α by
1 4 3 2
   
2 4 1 3 4
 . Hence if we write α =   ∈ S5, then we mean the
4 2 4 1 3
 
1 2 3 4 5
permutation α =  .
4 2 1 3 5
5
Definition 5. A permutation σ on In = {1, 2, . . . , n} is called
a k-cycle or cycle of length k if there exist distinct elements
i1 , i2 , . . . , ik in In such that

σ(i1 ) = i2 , σ(i2 ) = i3 , σ(i3 ) = i4 , . . . , σ(ik−1 ) = ik ,

σ(ik ) = i1 and σ(x) = x for all x ∈ In r {i1 , i2 , . . . , ik }.

A k-cycle with k = 2 is called a transposition.

If a permutation σ on In is a k-cycle, we shall denote it by


(i1 i2 . . . ik ). We shall refer to this new notation as cycle notation.
For example,  
1 2 3 4 5 6
σ=  
3 5 2 4 1 6
is a permutation on I6 = {1, 2, 3, 4, 5, 6} such that:

σ(1) = 3, σ(3) = 2, σ(2) = 5, σ(5) = 1, σ(4) = 4, σ(6) = 6.

Hence, σ is a 4-cycle and we denote σ by (1 3 2 5). Observe that:

(1 3 2 5) = (3 2 5 1) = (2 5 1 3) = (5 1 3 2).

or, σ : 1 → 3 → 2 → 5 → 1
6
 
1 2 3 4
Consider now the permutation α =  . For this permu-
3 4 1 2
tation α(1) = 3, α(3) = 1 whereas α(2) = 4, α(4) = 2. Hence α is
not a k-cycle.
Since k-cycles are nothing but special type of permutations, they
can be composed, i.e., multiplied just like any two permutations.
Consider the cycles σ = (243) and δ = (1265). Then

σ : 2 → 4 → 3 → 2 and σ(x) = x when x 6= 2, 4, 3 and,

δ : 1 → 2 → 6 → 5 → 1 and δ(x) = x when x 6= 1, 2, 5, 6.

In other words, we can look upon σ and δ as mappings in the following


manner:
2→4 1→2
4→3 2→6
σ : 3→2 δ : 6→5
x→x 5→1
when x 6= 2, 4, 3 x→x
when x 6= 1, 2, 5, 6

7
Again viewed as permutations in a two-row notation, σ and δ are as
follows:
   
1 2 3 4 5 6 1 2 3 4 5 6
σ=   and δ =  .
1 4 2 3 5 6 2 6 3 4 1 5
Now  
1 2 3 4 5 6
σδ = σ ◦ δ =  .
4 6 2 3 1 5
It is worth noticing that while calculating σδ, we first consider the
image of δ on the elements of I6 and then on that image set, we
δ σ
further consider the image of σ. Hence σ ◦ δ : 1 −→ 2 −→ 4 .
Notice that under σδ,

1 → 4 → 3 → 2 → 6 → 5 → 1

Hence in this case σδ is a 5-cycle.

But in general, product of two cycles may not be a cycle. To


show this we consider the product of σ = (5 6) and δ = (3 2 4) from
S6. Then  
1 2 3 4 5 6
σδ = σ ◦ δ =  
1 4 2 3 6 5
is not a cycle.
8
Using the cycle notation we now write the elements of S3 as follows:
   
1 2 3 1 2 3
e=  = (1) α=  = (1 2 3)
1 2 3 2 3 1
   
1 2 3 1 2 3
β=   = (1 3 2) γ =   = (2 3)
3 1 2 1 3 2
   
1 2 3 1 2 3
δ=  = (1 2) σ=  = (1 3)
2 1 3 3 2 1
Hence,
S3 = {e, (1 2), (1 3), (2 3), (1 2 3), (1 3 2)}

consists of one 1-cycle, three 2-cycles and two 3-cycles.


Note that the identity permutation e in the above example
could have been represented as (2) or (3) also.

Definition 6. Two cycles (i1 i2 . . . it ) and (j1 j2 . . . jk ) of Sn are


said to be disjoint if {i1 , i2 , . . . , it } ∩ {j1 , j2 , . . . , jk } = ∅.

Example 7. The cycles (2 4 3 5) and (1 6 8) are disjoint cycles,


whereas the cycles (4 5 3 2) and (1 3 8) are not disjoint.

We have the following theorems.

9
Theorem 8. Let α and β be any two disjoint cycles in Sn. Then,
αβ = βα.

Theorem 9. Any nonidentity permutation α ∈ Sn (n ≥ 2) can


be expressed as a product of disjoint cycles, where each cycle is
of length ≥ 2.

Next we consider a cycle α = (2 4 3 5) in S6. Under this permuta-


tion we have
α : 2 → 4 → 3 → 5 → 2

and x → x whenever x ∈ I6 r{2, 4, 3, 5}. Now consider the 2-cycles


(2 5), (2 3), (2 4). Let α1 = (2 5), α2 = (2 3) and α3 = (2 4). Consider
the product
α1 α2 α3 = (2 5)(2 3)(2 4).

Under this product,


α3 α2 α1
2 −→ 4 −→ 4 −→ 4
3α 2 α 1 α
4 −→ 2 −→ 3 −→ 3
3α 2 α 1 α
3 −→ 3 −→ 2 −→ 5
3α 2 α 1 α
5 −→ 5 −→ 5 −→ 2
α3 α2 α1
x −→ x −→ x −→ x
10
when x 6= 2, 3, 4, 5.

Then,

α1 α2 α3 : 2 → 4 → 3 → 5 , → 2 and x → x for the rest.

Consequently, α1 α2 α3 = (2 4 3 5).

In this way we can show that any cycle (i1 , i2 , . . . , ik ), k ≥ 3 can


be expressed as (i1 ik )(i1 ik−1 ) . . . (i1 i2 ). Indeed we may have the
following theorem.

Theorem 10. Any cycle of length ≥ 2 is either a transposition


(i.e., 2-cycle) or can be expressed as a product of transpositions.

Combining the last two theorems we state the following:

Theorem 11. Any nonidentity permutation of Sn (n ≥ 2) is


either a transposition or can be expressed as a product of trans-
positions.

Definition 12. A permutation α ∈ Sn is called an even per-


mutation if α can be expressed as a product of an even number
of 2-cycles and a permutation α ∈ Sn is called an odd permu-
tation if α is either a 2-cycle or can be expressed as a product of
11
an odd number of 2-cycles. The set of all even permutations in
Sn forms a group. This group is called the alternating group
and is denoted by An.

Note that according to the above definition the identity permu-


tation is an even permutation. We now merely state the following
theorem, which is a very important property of a permutation.

Theorem 13. Any permutation in Sn is either an odd permuta-


tion or an even permutation, but never both.

. Let α ∈ Sn. To find the order of α, we need to compute


α, α2, α3, . . . , until we find the first positive integer m, such that αm
becomes the identity permutation e. For example, let us consider the
group
S3 = {e, (12), (1 3), (2 3), (1 2 3), (1 3 2)}.

Note that (1 2 3)◦(1 2 3) = (1 3 2) 6= e and (1 2 3)◦(1 2 3)◦(1 2 3) = e,


whence order of (1 2 3) is 3. In a similar manner, we may show that
the order of (1 3 2) is also 3.
Let us now consider (1 2) ∈ S3. Observe that, (1 2) ◦ (1 2) = e
whence order of (1 2) is 2. Similarly, order of (1 3) as well as of (2 3)
12
is 2. So we see that the order of 2-cycles in S3 is 2, and the order of
3-cycles in S3 is 3. Indeed, we have the following general result.

Theorem 14. Let n ≥ 2 and σ ∈ Sn be a cycle. Then σ is a


k-cycle if and only if order of σ is k.

Observe that, for a permutation α ∈ Sn, which is not a cycle itself,


a direct process to find the smallest positive integer m, for which
αm = e, may be a very tedious task. However, we can decompose
α into disjoint cycles, and then compute the order of each of them,
which is nothing but the length of the respective cycles , and then
use them to find the order of α. The next result will throw some
light in this regard.

Theorem 15. Let σ ∈ Sr , r ≥ 2 and σ = σ1 ◦ σ2 ◦ . . . ◦ σk be


a product of disjoint cycles. Suppose o(σi ) = ni , i = 1, 2, . . . , k.
Then o(σ) = lcm(n1 , n2 , . . . , nk ).

2 Dihedral group Dn

Definition 16. A group G is called nth dihedral group if G is


generated by two elements a, b such that
13
(i)o(a) = n, o(b) = 2
(ii) ba = a−1b.

It is easy to see that any two nth dihedral groups are isomorphic.
Hence there exists only one nth dihedral group . We denote the nth
dihedral group by Dn.

Example 17. Consider the symmetric group S3. The elements


of S3 are {(1), (12), (13), (23), (123), (132)}. Here α = (123) is
an element of order 3 and β = (23) is an element of order 2,
also βα = (23)(123) = (13) = (132)(23) = (123)−1(23) = α−1β.
Hence the subgroup < α, β > generated by {α, β} is D3. But we
can show that < (123), (23) >= {(1), (12), (13), (23), (123), (132)}.
Hence S3 = D3.

Let us now describe the group D4. This group is generated by two
elements a, b such that
(i)o(a) = 4, o(b) = 2,
(ii) ba = a−1b.

Theorem 18. (i)Every element of D4 is of the form aibj , 0 ≤


i < 4, 0 ≤ j < 2.
14
(ii) D4 has exactly 8 elements.
(iii) D4 is a non commutative group.

Example 19. Consider the symmetric group S4. Here α =


(1234) is an element of order 4 and β = (24) is an element of or-
der 2 Then α2 = (1234)(1234) = (13)(24) and α3 = (1234)(13)(24) =
(1432) = α−1. Now βα = (24)(1234) = (14)(23) and α−1β =
(1432)(24) = (14)(23) = βα . Hence the subgroup < α, β >
generated by {α, β} is D4. We can show that < (1234), (24) >=
{(1), (1234), (13)(24), (1432), (24), (1234)(24) = (12)(34), (1234)2(24) =
(13)(24)(24) = (13), (1234)3(24) = (1432)(24) = (14)(23)}. Hence
D4 is a proper subgroup with 8 elements of S4.

Theorem 20. The dihedral group Dn is isomorphic to the sub-


group < α, β > of Sn, where
 
1 2 3. . . i... n−1 n
α = (123....n) and β =  
1 n n − 1 . . . n + 2 − i. . . 3 2
and the number of elements of Dn is 2n.

Let n ≥ 3. Let Symn be the set of all symmetries of a regular


n-gon. Symmetry operation means an action that leaves the object
looking unchanged. Symn is a group under composition of functions.
15
Observe that the equilateral triangle has 6 symmetries. Two of them
are rotations and three are reflections. If we denote ρ120 by ρ, then
clearly ρ2 = ρ240 and ρ3 = i. Again, if we denote a reflection by β,
it is not difficult to verify that other two reflections are βρ and βρ2.
It follows immediately that S3 = Sym3 = D3
At this stage, one may be tempted to think that the group Sym4
all symmetries of a square should give us the group S4. That this is
not the case can be seen from the fact that the transformation on I4
given by the permutation
 
1 2 3 4
α=   ∈ S4
2 3 1 4
is not an isometry of the square. The above mentioned transforma-
tion does not preserve the distance between the vertices 1 and 3 of a
square.
It can be shown that all of the 24 members of the group S4 do
not fix the square1. So what are the symmetries of a square? Let
us first examine geometrically. It is not difficult to see that apart
from the trivial symmetry, a square is linearly symmetric only about
1
The group S4 can be looked upon as the group of symmetries of a regular tetrahedron. This is a solid
object with four faces, each an equilateral triangle.

16
four lines. These are the lines along the perpendicular bisectors of the
opposite sides and the lines along the diagonals, it has three rotational
symmetries about the meeting point of the diagonals, through angles
90◦, 180◦ and 270◦ respectively.
As we have done before, here also it can be shown that if ρ90
be taken as ρ and if we denote a reflection by β, then the eight
symmetries of a square can be represented as {i, ρ, ρ2, ρ3, βρ3, βρ2,
βρ, σ} where ρ4 = β 2 = i and βρ = ρ−1β. This group hρ, σi with
eight elements is the group D4. Hence Sym4 = D4.
Proceeding as above we can show that the group Sym5 of all
symmetries of a regular pentagon is D5, where D5 is the set of all
symmetries of a regular pentagon. More precisely, D5 is generated
by two elements: one is the rotation by angle 2π
5 = 72◦, denoted by
ρ; the other is the reflection along a fixed axis, denoted by σ. There
are three relations among ρ and β
ρ5 = i, β 2 = i and βρ = ρ−1β. D5 is a noncommutative group
with 10 elements {i, ρ, ρ2, ρ3, ρ4, βρ4, βρ3, βρ2, βρ, β}.

17
3 Check digit Schemes

Identification numbers are everywhere today: International Standard


Book Numbers (ISBNs), International Article Numbers (EANs),Universal
Product Codes (UPCs), Student IDs, Driver license numbers, Credit
card numbers, Bank account numbers, are but a few examples. One
feature to all of these Identification numbers is the inclusion of an
extra digit, called a check digit, designed to detect errors in read-
ing/typing the Identification number. When a machine (or a human)
reads/types information, there is always the possibility of the infor-
mation being read/typed incorrectly. We list some common errors
commited while reading/typing identification numbers. Here we list
some of them.
• Single Digit Error (Transcription Error): This error occurs when
only a single digit in the whole identification number is misread/typed
wrongly. For example, 8901063026162 typed as 8201063026162.
Here the digit 9 is incorrectly typed as 2.
•Single Transposition Error: It occurs when the ith and the (i +
1)th digits are replaced by the (i + 1)th and the ith respectively. For

18
example, 8901063026162 typed as 8901036026162 . Here the
digits 6 and 3 are transposed and this is a transposition error.
•Twin Error: This error occurs when two consecutive identical
digits are incorrectly typed as two other identical digits. For exam-
ple, 8177564803 typed as 8199564803. Here the digits 77 are
incorrectly typed as 99.
There are other common errors also such as
•jump transpositions errors, such as 132 → 231,
•jump twin errors, such as 131 → 232,
•phonetic errors, such as 60 → 16 (”sixty” to ”sixteen”).
Here we will discuss some schemes which help in decting some of
these common errors.

3.1 ISBN

The International Standard Book Number or the ISBN, in


short was introduced in the world in 1972 and in India this system
was put into operation in January 1985 by Raja Rammohan National
Agency for ISBN . One may usually find the ISBN of a book in the
first few pages of the book. It appears as a string of digits.

19
An ISBN is assigned to each edition and variation (except reprint-
ings) of a book. The ISBN is 13 digits long if assigned after January
1, 2007, and 10 digits long if assigned before 2007.

Feluda Samagra
Publisher: Ananda publisher
ISBN-10 81-7756-480-3
ISBN-13 978-81-7756-480-8

Antaheener Antajamee
Publisher: National Book Trust.
ISBN 978-81-237-6664-5
The digits of an ISBN are arranged in four groups (for an ISBN-10) or
five groups (for an ISBN-13), which are sometimes (but not always)
separated by hyphens. At present, an ISBN-13 is always prefixed by
the digits 978 or 979.

Formally we describe an ISBN-10 in the following way:

20
An ISBN-10 is an expression

x1x2x3 · · · x9x10 (1)

of ten digits divided into four blocks;

1. The first block indicates the language or country of origin where


it is published,
2. The second block specifies the publishing company,
3. The third block is the number assigned to the book by the
publisher, and
4. The final block consists of only one digit called the check digit.

For all i = 1, 2, . . . , 9, xi is one of the digits 0, 1, 2, 3, . . . , 9.


However, for the check digit x10 there are eleven possible values:
0, 1, 2, . . . , 10. If the check digit is 10, then it is denoted by the ro-
man numeral X. Therefore,

x10 ∈ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, X}. (2)

We now explain how to assign a check digit to a particular book.


Suppose the first nine digits x1, x2, x3, . . . , x9 of ISBN-10 have been
21
chosen. The check digit x10, which is one of 0, 1, 2, 3, . . . , 9, X, is
determined by the following congruence

1x1 + 2x2 + · · · + 8x8 + 9x9 + 10x10 ≡ 0(mod 11).


That is,1x1 + 2x2 + · · · + 8x8 + 9x9 ≡ x10(mod 11).

Example. In this example, we consider the ISBN-10


81 − 203 − 1147 − x10.
The check digit x10 is one of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, X
and it satisfies
1·8+2·1+3·2+4·0+5·3+6·1+7·1+8·4+9·7 ≡ x10 (mod11).

8 + 2 + 6 + 0 + 15 + 6 + 7 + 32 + 63 ≡ x10 (mod11).

139 ≡ x10 (mod11).

This implies x10 = 7.


Thus, the ISBN-10 of this book is 81 − 203 − 1147 − 7.
ISBN-13 :978-0-306-40615-7 The check digit x13, which is

22
one of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 is determined by the following congru-
ence
1x1 + 3x2 + 1x3 + 3x4 + ...... + 3x12 + 1x13 ≡ 0(mod 10).
Hence x13 ≡ −(1x1 + 3x2 + 1x3 + 3x4 + ...... + 3x12)(mod 10)
For example the ISBN-13 check digit x13 of 978-0-306-40615 is
calculated as follows:
x13 ≡ −(1.9 + 3.7 + 1.8 + 3.0 + 1.3 + 3.0 + 1.6 + 3.4 + 1.0 + 3.6 +
1.1 + 3.5)(mod 10)
≡ −93(mod 10)
≡ 7 (mod 10).Hence x13 = 7.
ISBN-10 is capable of detecting all single digit errors and all trans-
position errors involving adjacent digits. However in ISBN-10 scheme
this success is achieved by introducing X to handle the case where
10 is obtained modulo 11.

3.2 EAN-13

Many of the products sold in super market contain identification


numbers coded with bars which are read by optical scanners.

23
Example. EAN of Britannia Cream Cracker is

8 901063 026162

Here 890 identifies the country INDIA

1063 identifies the company BRITANNIA INDUSTRIES Ltd


02616 identifies the product Cream Cracker. This number is
given by the company to the product.
2 identifies the Check digit of this number.
The method of calculating the check digit is discussed below .

An EAN-13 of 13 digits is of the form

x1x2 · · · x12x13,

24
where xi’s are integers such that 0 ≤ xi < 10. The 13th digit, x13,
is the check digit.
Consider the following EAN-13 for some product

8 901063 026162 (3)

Here the 13th digit, 2, is the check digit. We now explain how this
check digit is obtained.
In an EAN 8 901063 026162 the check digit x13 is an integer such
that 0 ≤ x13 < 10 and it satisfies the congruence:
(1x1 + 3x2 + 1x3 + 3x4 + ....... + 1x11 + 3x12 + 1x13) ≡ 0(mod10)
For this EAN-13, the check digit must satisfy
x13 ≡ −(1 · 8 + 3 · 9 + 1 · 0 + 3 · 1 + 1 · 0 + 3 · 6 + 1 · 3 +

3 · 0 + 1 · 2 + 3 · 6 + 1 · 1 + 3 · 6) = −98(mod10).
This implies that x13 + 98 ≡ 0(mod10) ,where 0 ≤ x13 < 10.
Hence, the check digit is 2.

25
3.3 Luhn algorithm

The Luhn algorithm or Luhn formula, also known as the ”modulus


10” or ”mod 10” algorithm, is a simple checksum formula used to
validate credit card numbers. It was created by IBM scientist Hans
Peter Luhn.
The algorithm is in the public domain and is in wide use today.
Most credit cards and many government identification numbers use
the algorithm as a simple method of distinguishing valid numbers
from mistyped or otherwise incorrect numbers. We describe how
check digits are assigned in credit cards as well as show how they are
used to verify the validity of credit cards. There are different types
of Credit cards, for example Master card, Visa, American Express
etc.

We first note that the identification numbers of different credit,


debit cards have different lengths and different prefixes.

In a Master Card, the identification number consists of 16 dig-

26
its and the number starts with 51, 52, 53, 54, or 55.

A Visa card is of the length 13 or 16 and the identification num-


ber starts with the digit 4.

American Express Card numbers start with 37 or 34 and


the number is of length 15.

All of the above credit cards use Luhn algorithm to determine


check digit, and in all the cases the check digit is the right most digit
in the number.

In a Master Card.
1. If the digit in the second place is 1, then the digits from the
2nd place to the 3rd place represents the bank number.
2. If the digit in the second place is 2, then the digits from the
2nd place to the 4th place represents the bank number.
3. If the digit in the second place is 3, then the digits from the
2nd place to the 5th place represents the bank number.

27
4. If the digit in the second place is any digit other than 1, 2 or
3, then the digits from 2nd place to 6th place represents the bank
number.
For example, in the Master Card number

5548 3742 7983 0696

the second digit is 5. Hence, the digits from 2nd place to 6th place
denote the bank number, i.e., the bank number is 54837.
The digits after the bank number up to 15th place are the account
number of the card holder. For the above card the account number
of the card holder is 42 7983 069.
In the case of Visa cards, digits from 2nd place to 6th place denote
the identification number of the bank and digits from 7th place to
12th place or 7th place to 15th place denote the account number,
and the digit in the 13th or 16th place is the check digit.
To determine the check digit for Master Card and Visa etc we use
the following algorithm known as Luhn algorithm.
28
Step 1: Starting from the second digit from the right and moving
towards the left, multiply every alternate digit by 2.
Step 2: Add the individual digits comprising the products ob-
tained in Step 1.
Step 3: Add all of the digits of the card not multiplied with 2 in
Step 1.
Step 4: Add the results obtained in Step 2 and Step 3.
Step 5: If s is the sum obtained in Step 4, then solve the congru-
ence s ≡ 0(mod10) to obtain the check digit ak , where 0 ≤ ak < 10.
We can determine if the check digit of a given credit card is valid
by using Steps 1-5. If the credit card number is valid, then the sum
s obtained in Step 4 must satisfy s ≡ 0(mod10).
Let us explain this algorithm with the help of following example.
Example Consider a card with the following identification num-
ber
5546 1997 2335 5004

Suppose the check digit is x Then the identification number of this


card is
5546 1997 2335 500x
29
Step 1: Starting from the second digit from the right and moving
towards the left, multiply every alternate digit by 2. The digits to be
multiplied with 2 are underlined 5546 1997 2335 500x.)

0 · 2 = 0, 5 · 2 = 10, 3 · 2 = 6, 2 · 2 = 4, 9 · 2 = 18, 1 · 2 =
2, 4 · 2 = 8, 5 · 2 = 10.
Step 2: Add the individual digits comprising the products ob-
tained in Step 1. (For example, the product 0 · 2 = 0, and so the
sum of the digits of the product 0 is 0. The product 5 · 2 = 10, and
so the sum of the digits of the product 10 is 1 + 0 = 1. Similarly,
the product 9 · 2 = 18 and so the sum of the digits in this product is
1 + 8 = 9.)
0 + 1 + 6 + 4 + 9 + 2 + 8 + 1 = 31

Step 3: Add all of the digits of the card not multiplied with 2 in
Step 1.
0 + 5 + 3 + 7 + 9 + 6 + 5 + x = 35 + x

Step 4: Add the results from Step 2 and Step 3.

31 + 35 + x = 66 + x

30
Now 66 + x ≡ 0(mod10) holds for 0 ≤ x < 10 if x = 4. Hence, the
check digit of the identification number of this card is 4.

Example
4386 2496 0156 1102

is a credit card number of a Bank.This is a VISA card. We show


how to find check digit. Let x be the check digit of this identification
number. Then the identification number is

4386 2496 0156 110x

Step 1: Starting from the second digit from the right and moving
towards the left, multiply every alternate digit by 2. (The digits to
be multiplied with 2 are underlined.

4386 2496 0156 110x

Step 2:Add the individual digits comprising the products obtained


in Step 1: → 31.
31
Step 3: Add all of the digits of the card not multiplied with 2 in
Step 1.: → 27+x
Step 4: Add the results from Step 2 and Step 3.

31+27+x=58+x

Now 58 + x ≡ 0(mod10) holds for 0 ≤ x < 10 if x = 2. Hence, the


check digit of the identification number of this card is 2.

SBI Cash ATM-Cum- Debit card (Maestro)

6220180158000163424

Let us find check digit ( the last digit) of this identification num-
ber. Suppose x denotes the check digit, where 0 ≤ x < 10.

622018015800016342x
Step 1: Starting from the second digit from the right and moving
towards the left, multiply every alternate digit by 2.

32
2 · 2 = 4, 3 · 2 = 6, 1 · 2 = 2, 0 · 2 = 0, 8 · 2 = 16, 1 · 2 =
2, 8 · 2 = 16, 0 · 2 = 0, 2 · 2 = 4.
Step 2: Add the individual digits comprising the products ob-
tained in Step 1. 4 + 0 + (1 + 6) + 2 + (1 + 6) + 0 + 2 + 6 + 4 = 32
Step 3: Add all of the digits of the card not multiplied with 2 in
Step 1. 6 + 2 + 1 + 0 + 5 + 0 + 0 + 6 + 4 + x = 24 + x
Step 4: Add the results from Step 2 and Step 3. 32 + 24 + x

Now 56 + x ≡ 0(mod10) holds for 0 ≤ x < 10 if x = 4. Hence,


the check digit of the identification number of this card is 4.

Note.If a single digit is changed to another, the total sum must


change, whether or not that digit is multiplied by 2. A single-digit er-
ror is always detected as each possible digit has a unique contribution
and the sum cannot change by a multiple of 10.
The Luhn algorithm will also detect almost all transposition errors
of adjacent digits. It will not, however, detect transposition of the
two-digit sequence 09 to 90 (or vice versa). It will detect 7 of the 10
possible twin errors (it will not detect (22, 55), (33, 66), (44, 77).

33
3.4 Verhoeff algorithm

We have pointed out that single digit error and transposition error are
the most common errors committed in entering identification num-
ber. The modulus 10 method and the EAN-13 scheme fail to detect
all transposition errors. Although modulus 11 method is successful
in detecting single digit error and transposition error, it has a disad-
vantage. It uses a symbol X to represent 10.The Verhoeff method
not only detects all single digit transcription and transposition errors
but also works for identification number of any length and uses only
decimal digits unlike the modulus 11 method. Unlike the methods
described so far which use ordinary arithmetic, the Verhoeff method
uses permutations and non-commutative dihedral group D5 of or-
der 10 operations to evaluate the check digit. This coding scheme
is being used by ‘AADHAAR’ to give a UID (Unique Identification
Number) to each citizen of India .The basic idea of this scheme is as
follows. First, instead of using standard addition modulo 10 or 11,
as is common in other check digit schemes, the Verhoeff Scheme uses

34
the group D5 of order 10 as represented in the following table.
The table of D5
 
∗ | ρ 0 ρ1 ρ2 ρ3 ρ4 βρ4 βρ3 βρ2 βρ1 β
 
 
− − − − − − − − − − − − 
 
 
 ρ0 | ρ 0 ρ1 ρ2 ρ3 ρ4 βρ4 βρ3 βρ2 βρ1 β 
 
 
 ρ1 | ρ 1 ρ2 ρ3 ρ4 ρ0 βρ3 βρ2 βρ1 β βρ4 
 
 
 2
ρ | ρ 2 ρ3 ρ4 ρ0 ρ βρ2 βρ1 β βρ4 βρ3


 
 3
ρ | ρ3 ρ4 ρ0 ρ1 ρ2 βρ1 β βρ4 βρ3 βρ2


 
 4 4 0
ρ1 ρ2 ρ3 βρ4 βρ3 βρ2 βρ1

ρ
 | ρ ρ β 

 4 
βρ | βρ4 β βρ1 βρ2 βρ3 ρ0 ρ4 ρ3 ρ2 ρ1 
 
 
βρ3 | βρ3 βρ4 β βρ1 βρ2 ρ1 ρ0 ρ4 ρ3 ρ2 
 
 
βρ2 | βρ2 βρ3 βρ4 β ρ ρ2 ρ1 ρ0 ρ4 ρ3 
 
 
 1
βρ | βρ1 βρ2 βρ3 βρ4 β ρ3 ρ2 ρ1 ρ0 ρ4


 
β | β βρ1 βρ2 βρ3 βρ4 ρ4 ρ3 ρ2 ρ1 ρ0

Then replace the elements in the D5 table with the digits 0 to 9


keeping the elements in the same order as in the table of D5:
ρ0 → 0, ρ1 → 1, ρ2 → 2, ρ3 → 3, ρ4 → 4, βρ4 → 5,

35
βρ3 → 6, βρ2 → 7, βρ1 → 8, β → 9.
 
∗ | 0 1 2 3 4 5 6 7 8 9
 
 
− − − − − − − − − − − 
 
 
0 | 0 1 2 3 4 5 6 7 8 9
 
 
1 | 1 2 3 4 0 6 7 8 9 5
 
 
2 | 2 3 4 0 1 7 8 9 5 6
 
 
3 | 3 4 0 1 2 8 9 5 6 7
 
 
 
4 | 4 0 1 2 8 9 5 6 7 8
 
 
5 | 5 9 8 7 6 0 4 3 2 1
 
 
6 | 6 5 9 8 7 1 0 4 3 2
 
 
7 | 7 6 5 9 8 2 1 0 4 3
 
 
8 | 8 7 6 5 9 3 2 1 0 4
 
 
9 | 9 8 7 6 5 4 3 2 1 0

Third,the following table which represents inverse of a digit in the


group D5.  
j 0 1 2 3 4 5 6 7 8 9
 
inv(j) 0 4 3 2 1 5 6 7 8 9

36
Part 1: Assigning check digit. Let the number to which the check
digit is to be assigned be anan−1an−2.....a2,where 0 ≤ ai ≤ 9, 2 ≤
i ≤ n . Consider the permutation σ which will be used in the Verho-
eff scheme. Evaluate σ n−1(an) ∗ σ n−2(an−1) ?σ n−3(an−2) ∗ ..... ∗ σ(a2)
using the binary operation ∗ given in the group table of D5 and the
permutation σ = (15894270)(36) ( or any other suitable permutation
such as (0)(14)(23)(58697)). Let the result obtained be m (it is a sin-
gle digit number). Then calculate the inverse of m , i.e., the number
a1 for which a1 ∗ m = 0. The inverse of m is the check digit a1 which
is to be appended to the end of the number anan−1an−2.....a2.
Part 2: Checking if the identification number anan−1an−2.....a2a1 has
been interpreted correctly. For this calculate σ n−1(an) ∗ σ n−2(an−1) ∗
σ n−3(an−2) ∗ ..... ∗ σ(a2) ∗ a1. If the result is zero, then the number
is correct. If not, there is an error.

37
Example 21. Let the number which is to be assigned the check
digit be 53660508771 and the permutation σ = (15894270)(36)
 
0 1 2 3 4 5 6 7 8 9
σ= .
1 5 7 6 2 8 3 0 9 4
To find the check digit a1,we first calculate σ 11(5) ∗ σ 10(3) ∗
σ 9(6) ∗ σ 8(6) ∗ σ 7(0) ∗ σ 6(5) ∗ σ 5(0) ∗ σ 4(8) ∗ σ 3(7) ∗ σ 2(7) ∗ σ 1(1).
Now σ 11(5) ∗ σ 10(3) ∗ σ 9(6) ∗ σ 8(6) ∗ σ 7(0) ∗ σ 6(5) ∗ σ 5(0) ∗ σ 4(8) ∗
σ 3(7) ∗ σ 2(7) ∗ σ 1(1)
=4∗3∗3∗6∗7∗0∗4∗7∗5∗1∗5
=2∗0∗6∗4∗4∗3∗5∗0∗1∗6
= 6[Here ∗ is the group operation defined in the group table D5]
From the group table we find that 6 ∗ a1 = 0 holds for a1 = 6.
Hence the check digit for the given number is 6 and hence the
correct identification number in this scheme is 536605087716

We can show that the Verhoeff scheme detects all single digit errors
and this does not depend on the permutation used in the scheme.
To see this ,we observe that a correct identification number
anan−1an−2..ai...a2a1,where a1 is the check digit satisfies
σ n−1(an) ∗ σ n−2(an−1) ∗ σ n−3(an−2) ∗ .. ∗ σ i−1(ai) ∗ ... ∗ σ(a2) ∗ a1 = 0
38
If ai is replaced by b and the resulting string
anan−1an−2..b...a2a1
is a correct identification number, then
σ n−1(an) ∗ σ n−2(an−1) ∗ σ n−3(an−2) ∗ .. ∗ σ i−1(b) ∗ ... ∗ σ(a2) ∗ a1 = 0
Then we find that σ i−1(ai) = σ i−1(b). Since σ is bijective function
it follows that ai = b. Hence the Verhoeff scheme detects all single
digit errors. We can also show that the above scheme can also detect
all transposition errors of adjacent digits.
The main weakness of the Verhoeff algorithm is its complexity, it
is little more complicated to implement.
A Unique Identification is merely a string assigned to an entity
that identifies the entity uniquely. The plan is to assign a Unique ID
to every person residing in India. Biometric identification system and
checks would be used to ensure that each individual is as-signed one
and only UID and the process of generating a new UID would ensure
that duplicates are not issued as valid UID numbers.The Verhoeff
Scheme is used for this purpose.
References

39
[1] Joseph Kirtland, Identification numbers and check digit schemes,
The Mathematical Society of America, 2001.

[2] J Verhoeff, Error detecting decimal codes, Mathematical Cen-


tre Track, Vol.29, The Mathematical Centre, Amsterdam, 1969.

[3] Hemant Kanankia, Srikant Nathamuni, Sanjay Sarma, A UID


numbering scheme, May 2010. (www.uidai.gov.in)

[4] Gallian J.A., Check Digit Methods, International Journal


of Applied Education,5(40),1989,503-505

[5] Gallian J.A., Errors Detection Methods, ACM Computing Sur-


veys 28(3) 1996,504-517.

40

You might also like