Pell Coding and Pell Decoding Methods with Some Applications

8 downloads 130 Views 157KB Size Report
Jun 14, 2017 - NT] 14 Jun 2017. PELL CODING AND PELL DECODING METHODS WITH. SOME APPLICATIONS. N˙IHAL TAS*, SÜMEYRA UC¸AR, AND ...
arXiv:1706.04377v1 [math.NT] 14 Jun 2017

PELL CODING AND PELL DECODING METHODS WITH SOME APPLICATIONS ˙ ¨ ˙ ¨ ¨ NIHAL TAS¸*, SUMEYRA UC ¸ AR, AND NIHAL YILMAZ OZG UR Abstract. We obtain a new coding and decoding method using the generalized Pell (p, i)-numbers. The relations among the code matrix elements, error detection and correction have been established for this coding theory. We give two new blocking algorithms using Pell numbers and generalized Pell (p, i)-numbers.

1. Introduction Recently, in [2], the generalized Pell (p, i)-numbers have been defined by the following recurrence relations Pp(i) (n) = 2Pp(i) (n − 1) + Pp(i) (n − p − 1); n > p + 1, 0 ≤ i ≤ p, p = 1, 2, 3, . . . , (1.1) with the initial terms Pp(i) (1) = · · · = Pp(i) (i) = 0, Pp(i) (i + 1) = · · · = Pp(i) (p + 1) = 1. For i = p = 1, the generalized Pell (1, 1)-number corresponds to the (n + 1)-th classical Pell number defined as Pn+1 = 2Pn + Pn−1 , n ∈ Z+ with the initial terms P0 = 0, P1 = 1. For the basic properties of these numbers, one can see [2] and [3]. 2010 Mathematics Subject Classification. 68P30, 14G50, 11T71, 11B39. Key words and phrases. Coding/decoding method, Pell number, generalized Pell (p, i)number, blocking algorithm. *Corresponding author: N. TAS¸ Balıkesir University, Department of Mathematics, 10145 Balıkesir, TURKEY e-mail: [email protected]. 1

¨ ¨ N. TAS ¸ , S. UC ¸ AR, AND N. YILMAZ OZG UR

2

√ √ It is known that γ = 1 + 2 and δ = 1 − 2 are the roots of the characteristic equation of the Pell recurrence relation t2 − 2t − 1 = 0. Using these roots it can be given the Binet formula for the Pell number by Pn = with

γ n − δn γ−δ

Pn+1 = γ. n→∞ Pn The Pell P -matrix of order 2 is given by the following form: " # 2 1 P = . 1 0 lim

The n-th power of the P -matrix and its determinant are given by " # P P n+1 n Pn = Pn Pn−1

(1.2)

and Det(P n ) = Pn+1 Pn−1 − Pn2 = (−1)n .

In [2], it was introduced the  2  1   A=  0  ..  . 0

and computed     An = Gn =   

(p)

matrix A in the following form  0 ··· 0 1 0 ··· 0 0    . . .. . . 0  . 1  ..  .. . 0 .  ··· · · · 0 1 0 (p+1)×(p+1) (p)

(p)

Pp (n + p + 1) Pp (n + 1) Pp (n + 2) (p) (p) (p) Pp (n + p) Pp (n) Pp (n + 1) .. .. .. . . . (p) (p) (p) Pp (n + 2) Pp (n − p + 2) Pp (n − p + 3) (p) (p) (p) Pp (n + 1) Pp (n − p + 1) Pp (n − p + 2)

··· ··· .. . ··· ···

(1.3)

(p)

Pp (n + p) (p) Pp (n + p − 1) .. . (p) Pp (n + 1) (p) Pp (n)

      

.

(p+1)×(p+1)

(1.4)

Using the matrices given in the equations (1.3) and (1.4), we get Det(An ) = Det(Gn ) = (−1)n(p+2) , for n > 0.

(1.5)

PELL CODING AND PELL DECODING METHODS

3

Recently, Fibonacci coding theory has been introduced and studied in many aspects (see [1], [4], [6], [7], [8] and [11] for more details). For example, in [7], A. P. Stakhov presented a new coding theory using the generalization of the Cassini formula for Fibonacci p-numbers and Qp -matrices. Later B. Prasad developed a new coding and decoding method followed from Lucas p matrix [5]. More recently it has been obtained a new coding/decoding algorithm using Fibonacci Q-matrices called as “Fibonacci Blocking Algorithm” [9]. In [10], using R-matrices and Lucas numbers, it has been given “Lucas Blocking Algorithm” and the “Minesweeper Model” related to Fibonacci Qn -matrices and R-matrices. Motivated by the above studies, the main purpose of this paper is to develop a new coding and decoding method using the generalized Pell (p, i)-numbers. The relations among the code matrix elements, error detection and correction have been established for this coding theory with p = i = 1. As an application, we give two new blocking algorithms using Pell and generalized Pell (p, i)-numbers.

2. Pell Coding and Decoding Method In this section, we present a new coding and decoding method using the generalized Pell (p, i)-numbers. In our method, the nonsingular square matrix M with order (p + 1), where p = 1, 2, 3, . . . corresponds to our message matrix. We consider the matrix Gn of order (p + 1) as coding matrix and its inverse matrix (Gn )−1 as a decoding matrix. We introduce Pell coding and Pell decoding with transformations M × Gn = E and E × (Gn )−1 = M, respectively, where E is a code matrix. Now we give an example of Pell coding and decoding method. Let M be a message matrix of the following form: # " m1 m2 , M= m3 m4 where m1 , m2 , m3 , m4 are positive integers.

¨ ¨ N. TAS ¸ , S. UC ¸ AR, AND N. YILMAZ OZG UR

4

Let p = i = 1 and n = 3 in order to construct the coding matrix Gn : # " # " # " (1) (1) (1) (1) P1 (n + 2) P1 (n + 1) P1 (5) P1 (4) 12 5 = = . G3 = (1) (1) (1) (1) 5 2 P1 (n) P1 (4) P1 (3) P1 (n + 1) Then we find inverse of G3 : (G3 )−1

1 = 12.2 − 5.5

"

2 −5 −5 12

#

=

"

−2 5 5 −12

#

.

Now, we calculate the code matrix E. " #" # " # m1 m2 12 5 12m1 + 5m2 5m1 + 2m2 E = M × G3 = = , m3 m4 5 2 12m3 + 5m4 5m3 + 2m4 where e1 = 12m1 + 5m2 , e2 = 5m1 + 2m2 , e3 = 12m3 + 5m4 and e4 = 5m3 + 2m4 . Finally, the code matrix E is sent to a channel, the message matrix M can be obtained by decoding as the following way " #" # e1 e2 −2 5 M = E × (G3 )−1 = e3 e4 5 −12 " # " # −2e1 + 5e2 5e1 − 12e2 m1 m2 = = . −2e3 + 5e4 5e3 − 12e4 m3 m4 Notice that the relation between the code matrix E and the message matrix M is Det(E) = Det(M × Gn ) = Det(M) × Det(Gn ) = Det(M) × (−1)n(p+2) . 3. The Relationships between the Code Matrix Elements for p=i=1 We write E and M as follows: " #" # " # (1) (1) m1 m2 P1 (n + 2) P1 (n + 1) e1 e2 E = M × Gn = = (1) (1) m3 m4 e3 e4 P1 (n + 1) P1 (n) and M = E × (Gn )−1 = 1 = (−1)n(p+2)

"

"

e1 e2 e3 e4 (1)

#

1 (−1)n(p+2) (1)

"

(1)

(1)

P1 (n) −P1 (n + 1) (1) (1) −P1 (n + 1) P1 (n + 2) (1)

(1)

#

e1 P1 (n) − e2 P1 (n + 1) −e1 P1 (n + 1) + e2 P1 (n + 2) (1) (1) (1) (1) e3 P1 (n) − e4 P1 (n + 1) −e3 P1 (n + 1) + e4 P1 (n + 2)

#

,

PELL CODING AND PELL DECODING METHODS

5

for n = 2k + 1. Because m1 , m2 , m3 , m4 are positive integers, we get (1)

(1)

m1 = −e1 P1 (n) + e2 P1 (n + 1) > 0, (1)

(1)

(3.1)

m2 = e1 P1 (n + 1) − e2 P1 (n + 2) > 0,

(3.2)

m3 = −e3 P1 (n) + e4 P1 (n + 1) > 0,

(3.3)

m4 = e3 P1 (n + 1) − e4 P1 (n + 2) > 0.

(3.4)

(1)

(1)

(1)

(1)

Using (3.1) and (3.2), we find (1)

(1)

P (n + 1) e1 < 1 (1) < . (1) e2 P1 (n + 1) P1 (n) P1 (n + 2)

(3.5)

Using (3.3) and (3.4), we get (1)

P1 (n + 2) (1)

P1 (n + 1)

(1)


3 2

Using the chosen n, we write the following character table according to mod29 (this table can be extended according to the used characters in the message matrix). We begin the “n” for the last character. A B C D E F G H I J n + 28 n + 27 n + 26 n + 25 n + 24 n + 23 n + 22 n + 21 n + 20 n + 19 K L M N O P Q R S T n + 18 n + 17 n + 16 n + 15 n + 14 n + 13 n + 12 n + 11 n + 10 n + 9 U V W X Y Z 0 : ) n+8 n+7 n+6 n+5 n+4 n+3 n+2 n+1 n Now we explain the following new coding and decoding algorithms. Pell Blocking Algorithm

PELL CODING AND PELL DECODING METHODS

9

Coding Algorithm Step 1. Divide the matrix M into blocks Bi (1 ≤ i ≤ m2 ). Step 2. Choose n. Step 3. Determine bij (1 ≤ j ≤ 4). Step 4. Compute det(Bi ) → di . Step 5. Construct K = [di , bik ]k∈{1,3,4} . Step 6. End of algorithm. Decoding Algorithm Step 1. Compute P n . Step 2. Determine pj (1 ≤ j ≤ 4). Step 3. Compute p1 bi3 + p3 bi4 → ei3 (1 ≤ i ≤ m2 ). Step 4. Compute p2 bi3 + p4 bi4 → ei4 . Step 5. Solve (−1)n × di = ei4 (p1 bi1 + p3 xi ) − ei3 (p2 bi1 + p4 xi ). Step 6. Substitute for xi = bi2 . Step 7. Construct Bi . Step 8. Construct M. Step 9. End of algorithm. In the following example we give an application of the above algorithm for b > 3. Example 5.1. Let us consider the message matrix for the following message text: “MATH IS SWEET:)” Using the message text, we get the following  M A T  0 I S  M =  S W E T : )

message matrix M :  H 0    . E  0 4×4

Coding Algorithm: Step 1. We can divide the message text M of size 4 × 4 into the matrices, named Bi (1 ≤ i ≤ 4), from left to right, each of size is 2 × 2 : # # " # " # " " E E S W T H M A . and B4 = , B3 = , B2 = B1 = ) 0 T : S 0 0 I

10

¨ ¨ N. TAS ¸ , S. UC ¸ AR, AND N. YILMAZ OZG UR

  Step 2. Since b = 4 > 3, we calculate n = 2b = 2. For n = 2, we use the following “letter table” for the message matrix M : M 18 S 12

A 1 W 8

T 11 E 26

H 23 E 26

0 4 T 11

I 22 : 3

S 12 ) 2

0 4 . 0 4

Step 3. We have the elements of the blocks Bi (1 ≤ i ≤ 4) as follows: b11 b21 b31 b41

= 18 = 11 = 12 = 26

b12 b22 b32 b42

=1 = 23 =8 = 26

b13 b23 b33 b43

=4 = 12 = 11 =2

b14 b24 b34 b44

= 22 =4 . =3 =4

Step 4. Now we calculate the determinants di of the blocks Bi : d1 d2 d3 d4

= det(B1 ) = 392 = det(B2 ) = −232 . = det(B3 ) = −52 = det(B4 ) = 52

Step 5. Using Step 3 and Step 4 we  392  −232  K=  −48 52

obtain the following matrix K :  18 4 22 11 12 4   . 12 11 3  26 2 4

Step 6. End of algorithm. Decoding algorithm: Step 1. By (1.2) we know that " # " # P P 5 2 3 2 P2 = = . P2 P1 2 1 Step 2. The elements of P 2 are denoted by

p1 = 5, p2 = 2, p3 = 2 and p4 = 1. Step 3. We compute the elements ei3 to construct the matrix Ei : e13 = 64, e23 = 68, e33 = 61 and e43 = 18.

PELL CODING AND PELL DECODING METHODS

11

Step 4. We compute the elements ei4 to construct the matrix Ei : e14 = 30, e24 = 28, e34 = 25 and e44 = 8. Step 5. We calculate the elements xi : (−1)2 (392) = 30(90 + 2x1 ) − 64(36 + x1 ) ⇒ x1 = 1. (−1)2 (−232) = 28(55 + 2x2 ) − 68(22 + x2 ) ⇒ x2 = 23. (−1)2 (−52) = 25(60 + 2x3 ) − 61(24 + x3 ) ⇒ x3 = 8. (−1)2 (52) = 8(130 + 2x4 ) − 18(52 + x4 ) ⇒ x4 = 26. Step 6. We rename xi as follows: x1 = b12 = 1, x2 = b22 = 23, x3 = b32 = 8 and x4 = b42 = 26. Step 7. We construct the block matrices Bi : " # " # " # " # 18 1 11 13 12 8 26 26 B1 = , B2 = , B3 = and B4 = . 4 22 12 4 11 3 2 4 Step 8. We obtain the message matrix M :     M A T H 18 1 11 23  4 22 12 4   0 I S 0      M = . =  12 8 26 26   S W E E  T : ) 0 11 3 2 4 Step 9. End of algorithm.

Now we give an application of generalized Pell (p, i)-numbers using blocking method. Assume that matrices Bi and Ei are of the following forms: # # " " ei1 ei2 bi1 bi2 . and Ei = Bi = ei3 ei4 bi3 bi4

12

¨ ¨ N. TAS ¸ , S. UC ¸ AR, AND N. YILMAZ OZG UR

We use the " matrix #Gn defined in (1.4) and rewrite the elements of this matrix g1 g2 as Gn = . The number of the block matrices Bi is denoted by b. g3 g4 According to b, we choose the number n as follows: n = p + 2. Generalized Pell Blocking Algorithm Coding Algorithm We consider coding algorithm like as the Pell Blocking coding algorithm. Decoding Algorithm Step 1. Compute Gn . Step 2. Determine gj (1 ≤ j ≤ 4). Step 3. Compute g1 bi3 + g3 bi4 → ei3 (1 ≤ i ≤ m2 ). Step 4. Compute g2 bi3 + g4 bi4 → ei4 . Step 5. Solve (−1)n(p+2) × di = ei4 (g1 bi1 + g3 xi ) − ei3 (g2 bi1 + g4 xi ). Step 6. Substitute for xi = bi2 . Step 7. Construct Bi . Step 8. Construct M. Step 9. End of algorithm. We choose p = i = 1 in the following example. Example 5.2. Let us consider the message matrix for the following message text: “HAPPY BIRTHDAY TO YOU:)” Using the message text, we get the following message matrix 

    M =     Coding Algorithm:

 H A P P Y 0  B I R T H D   A Y 0 T O 0   . Y O U : ) 0    0 0 0 0 0 0  0 0 0 0 0 0 6×6

PELL CODING AND PELL DECODING METHODS

13

Step 1. We can divide the message text M of size 6 × 6 into the matrices, named Bi (1 ≤ i ≤ 9), from left to right, each of size is 2 × 2 :

B1 = B4 B7

"

H A B I

#

, B2 =

"

# Y 0 , B3 = , H D # " # T O 0 , B6 = , : ) 0 # " # 0 0 , B9 = . 0 0

P P R T

"

# " A Y 0 = , B5 = Y O U " # " 0 0 0 0 = , B8 = 0 0 0 0

#

"

Step 2. Since p = 1, we calculate n = 3. For n = 3, we use the following “letter table” for the message matrix M :

H 24 A 2 0 5

A 2 Y 7 0 5

P 16 0 5 0 5

P 16 T 12 0 5

Y 7 O 17 0 5

0 5 0 5 0 5

B 1 Y 7 0 5

I 23 O 17 0 5

R 14 U 11 0 5

T 12 : 4 0 5

H 24 ) 3 0 5

D 28 0 . 5 0 5

Step 3. We have the elements of the blocks Bi (1 ≤ i ≤ 9) as follows: b11 b21 b31 b41 b51 b61 b71 b81 b91

= 24 = 16 =7 =2 =5 = 17 =5 =5 =5

b12 b22 b32 b42 b52 b62 b72 b82 b92

=2 = 16 =5 =7 = 12 =5 =5 =5 =5

b13 b23 b33 b43 b53 b63 b73 b83 b93

=1 = 14 = 24 =7 = 11 =3 =5 =5 =5

b14 b24 b34 b44 b54 b64 b74 b84 b94

= 23 = 12 = 28 = 17 =4 . =5 =5 =5 =5

¨ ¨ N. TAS ¸ , S. UC ¸ AR, AND N. YILMAZ OZG UR

14

Step 4. Now we calculate the determinants di of the blocks Bi : d1 d2 d3 d4 d5 d6 d7 d8 d9

= det(B1 ) = 550 = det(B2 ) = −32 = det(B3 ) = 76 = det(B4 ) = −15 = det(B5 ) = −112 . = det(B6 ) = 70 = det(B7 ) = 0 = det(B8 ) = 0 = det(B9 ) = 0

Step 5. Using Step 3 and Step 4 we  550   −32   76   −15   K =  −112   70   0    0 0

obtain the following matrix K :  24 1 23  16 14 12   7 24 28   2 7 17    5 11 4  .  17 3 5   5 5 5    5 5 5  5 5 5

Step 6. End of algorithm. Decoding algorithm: Step 1. Using the equation (1.4) we have " # (p) (p) Pp (n + p + 1) Pp (n + 1) Gn = (p) (p) Pp (n + p) Pp (n) and G3 =

"

(1)

(1)

P1 (5) P1 (4) (1) (1) P1 (4) P1 (3)

#

=

"

12 5 5 2

#

.

Step 2. The elements of G3 are denoted by g1 = 12, g2 = 5, g3 = 5 and g4 = 2. Step 3. We compute the elements ei3 to construct the matrix Ei : e13 = 127, e23 = 228, e33 = 428, e43 = 169, e53 = 152, e63 = 61, e73 = 85, e83 = 85 and e93 = 85.

PELL CODING AND PELL DECODING METHODS

15

Step 4. We compute the elements ei4 to construct the matrix Ei : e14 = 51, e24 = 94, e34 = 176, e44 = 69, e54 = 63, e64 = 25, e74 = 35, e84 = 35 and e94 = 35. Step 5. We calculate the elements xi : (−1)(550) = 51(288 + 5x1 ) − 127(120 + 2x1 ) ⇒ x1 = 2. (−1) (−32) = 94(192 + 5x2 ) − 228(80 + 2x2 ) ⇒ x2 = 16. (−1) (76) = 176(84 + 5x3 ) − 428(35 + 2x3 ) ⇒ x3 = 5. (−1) (−15) = 69(24 + 5x4 ) − 169(10 + 2x4 ) ⇒ x4 = 7. (−1) (−112) = 63(60 + 5x5 ) − 152(25 + 2x5 ) ⇒ x5 = 12. (−1) (70) = 25(204 + 5x6 ) − 61(85 + 2x6 ) ⇒ x6 = 5. (−1)0 = 35(60 + 5x7 ) − 85(25 + 2x7 ) ⇒ x7 = 5. (−1)0 = 35(60 + 5x8 ) − 85(25 + 2x8 ) ⇒ x8 = 5. (−1)0 = 35(60 + 5x9 ) − 85(25 + 2x9 ) ⇒ x9 = 5. Step 6. We rename xi as follows: x1 = b12 = 2, x2 = b22 = 16, x3 = b32 = 5, x4 = b42 = 7, x5 = b52 = 12, x6 = b62 = 5, x7 = b72 = 5, x8 = b82 = 5, x9 = b92 = 5.

16

¨ ¨ N. TAS ¸ , S. UC ¸ AR, AND N. YILMAZ OZG UR

Step 10. We construct the block matrices Bi : " # " # " # 24 2 16 16 7 5 B1 = , B2 = , B3 = , 1 23 14 12 24 28 " # " # " # 2 7 5 12 17 5 B4 = , B5 = , B6 = , 7 17 11 4 3 5 " # " # " # 5 5 5 5 5 5 B7 = , B8 = , B9 = . 5 5 5 5 5 5 Step 11. We obtain  24 2   1 23   2 7 M =  7 17    5 5 5 5

the following message matrix M :   H A P 16 16 7 5   14 12 24 28   B I R    5 12 17 5  = A Y 0  11 4 3 5    Y O U   5 5 5 5   0 0 0 0 0 0 5 5 5 5

Step 9. End of algorithm.

 P Y 0  T H D   T O O  . : ) 0    0 0 0  0 0 0

6. Conclusion We have presented two new coding and decoding algorithms using the generalized Pell (p, i)-numbers. Combining these algorithms together, we can generate a new mixed algorithm such as “Minesweeper model” introduced in [10]. Furthermore it is possible to develop new mixed models using Fibonacci and Lucas blocking algorithms given in [9] and [10]. References [1] M. Basu, B. Prasad, The generalized relations among the code elements for Fibonacci coding theory, Chaos, Solitons Fractals 41 (2009), no. 5, 2517–2525. [2] E. Kılı¸c, The generalized Pell (p, i)-numbers and their Binet formulas, combinatorial representations, sums, Chaos, Solitons Fractals 40 (2009), 2047–2063. [3] T. Koshy, Pell and Pell-Lucas numbers with applications, Springer, Berlin (2014). [4] S. Prajapat, A. Jain, R. S. Thakur, A Novel Approach For Information Security With Automatic Variable Key Using Fibonacci Q-Matrix, IJCCT 3 (2012), no. 3, 54–57. [5] B. Prasad, Coding Theory on Lucas p Numbers, Discrete Mathematics, Algorithms and Applications 8 (2016), no.4, 17 pages.

PELL CODING AND PELL DECODING METHODS

17

[6] A. Stakhov, V. Massingue, A. Sluchenkov, Introduction into Fibonacci Coding and Cryptography, Osnova, Kharkov (1999). [7] A. P. Stakhov, Fibonacci matrices, a generalization of the Cassini formula and a new coding theory, Chaos, Solitons Fractals 30 (2006), no. 1, 56–66. [8] B. S. Tarle, G. L. Prajapati, On the information security using Fibonacci series, International Conference and Workshop on Emerging Trends in Technology (ICWET 2011)TCET, Mumbai, India. ¨ ur, O. ¨ O. ¨ Kaymak, A new coding/decoding algorithm using [9] N. Ta¸s, S. U¸car, N. Y. Ozg¨ Fibonacci numbers, submitted for publication. ¨ ur, A new cryptography model via Fibonacci and Lucas numbers, [10] S. U¸car, N. Ta¸s, N. Y. Ozg¨ submitted for publication. [11] F. Wang, J. Ding, Z. Dai, Y. Peng, An application of mobile phone encryption based on Fibonacci structure of chaos, 2010 Second WRI World Congress on Software Engineering. Balıkesir University, Department of Mathematics, 10145 Balıkesir, TURKEY E-mail address: [email protected] Balıkesir University, Department of Mathematics, 10145 Balıkesir, TURKEY E-mail address: [email protected] Balıkesir University, Department of Mathematics, 10145 Balıkesir, TURKEY E-mail address: [email protected]