`International Journal of Mathematics and Mathematical SciencesVolume 2012, Article ID 174372, 10 pageshttp://dx.doi.org/10.1155/2012/174372`
Research Article

## Properties of Carry Value Transformation

1Department of Basic Science and Humanities, Silicon Institute of Technology, Silicon Hills, Patia, Bhubaneswar 751024, India
2Department of Computer Science, Institute of Mathematics and Applications, Andharua, Bhubaneswar 751003, India
3P.G. Department of Mathematics, Utkal University, Bhubaneswar 751004, India

Received 28 December 2011; Accepted 20 January 2012

Copyright © 2012 Suryakanta Pal et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Carry Value Transformation (CVT) is a model of discrete deterministic dynamical system. In the present study, it has been proved that (1) the sum of any two nonnegative integers is the same as the sum of their CVT and XOR values. (2) the number of iterations leading to either or does not exceed the maximum of the lengths of the two addenda expressed as binary strings. A similar process of addition of modified Carry Value Transformation (MCVT) and XOR requires a maximum of two iterations for MCVT to be zero. (3) an equivalence relation is shown to exist on which divides the CV table into disjoint equivalence classes.

#### 1. Introduction

The notion of transformation is very important in mathematics. Accordingly, in the literature, one finds many kinds of transformations with interesting properties. Carry Value Transformations (CVTs) and Modified Carry Value Transformations (MCVTs) are two challenging transformations which currently have assumed much significance because of their applications in fractal formation [1], designing new hardware circuits for arithmetic operations [2], and so forth. Similar kind of transformations such as Extreme Value Transformation (EVT) [3], 2-Variable Boolean Operation (2-VBO) [4], Integral Value Transformation (IVT) [5] are also used to manipulate strings of bits and applicable in pattern formations [3, 4], solving Round Rabin Tournaments problem [6], Collatz-like functions [5], and so forth. All these applications in diversified domain motivated us to study the mathematical properties of these kinds of transformations.

The hardware circuit for arithmetic operations as designed in [2] is based on a result that after finite number of iterations, either CVT of the two nonnegative integers is equal to 0 or their XOR value is equal to 0. But no mathematical proof regarding this result was discussed in [2]. This important result has been proved in this paper. Section 2 provides the basic concepts of CVT, MCVT, and XOR earlier defined in [1, 2]. In Section 3, it is proved that addition of any two nonnegative integers expressed as binary numbers is the same as addition of their CVT and their XOR values. This result is also shown to be true for any base of the number system. In Section 4, it is proved that in a successive addition of CVT and XOR of any two nonnegative integers, the maximum number of iterations required to get either CVT = 0 or XOR = 0 is equal to the length of the bigger integer expressed as a binary string. Further, in the same section, it is shown that MCVT of any two nonnegative integers = 0 requires a maximum of two iterations. In Section 5, an equivalence relation is defined using the concept of CVT, and the equivalence classes obtained due to it are presented.

#### 2. Definitions of CVT and MCVT in Binary Number System

Let “” and “” be decimal representations of the binary strings and , respectively, where each for all and be the set of all possible binary strings of length on the set . In binary number system, CVT as discussed in [1] is a mapping defined by , whereas MCVT in [1] is a mapping defined by . That is, to find out CVT, we perform the bit wise XOR operation of the operands to get a string of sum-bits (ignoring the carry-in while performing the addition of and ) and simultaneously the bit wise ANDing of the operands to get a string of carry-bits, the latter string is padded with a “0” on the right is called the CVT of these operands as shown in Figure 1, and MCVT is only the ANDing values except the bit “0” padded on the right, and thus the relation between these two operation is .

Figure 1: Carry generated in th column counted from LSB is saved in th column.

For example, suppose we want to find out the CVT of two numbers say 23 and 27. First of all, we have to find out the binary representation of these numbers, that is, and .

The carry value is computed as in Figure 2.

Figure 2: Carry generated in th column is saved in th column for .

Thus, , and . It may be noted that in any number system, CVT and MCVT are mapping from to , where is set of nonnegative integers.

##### 2.1. Extensions of CVT, MCVT, and XOR Operations for Arbitrary Number System

For any number system in base , CVT of any two nonnegative integers and is defined by an integer , where for . Similarly, MCVT of a and b in base is the CVT value except the padding bit 0 in the least significant bit position. That is and the definition of XOR operation in binary number system can be extended for any number system in base as , where + is the usual addition in decimal number system.

For example, in ternary number system, , , .

#### 3. Properties of CVT and XOR

We have observed in the last example that and . Now , that is, . In general, we prove the following.

Theorem 3.1. , where and are any two nonnegative integers.

Proof. Suppose and are the binary representations of and both expressed using  bits. Then, for . We will prove that sum of the contribution of and in is the same as the sum of the contribution of and in , where . The place values of and in and are and , respectively. So the total contributions of both and in is . The binary variable and can have four choices, and their place values are shown in Table 1.
From third column and seventh column, it can be verified that the total contribution of and in is the same as the sum of the contribution of and in for . Therefore, .

Table 1: Shows the contributions in calculating the sum in different cases.

(A) General Proof for an Arbitrary Number System
Let and be two numbers from a number system with base , and let CVT() = . We will prove that sum of the contribution of and in is the same as the sum of the contribution of and in for .
Note that the individual place values of and in and are and , respectively. So the total contributions for both and in is . Two cases arise: case and case . In both cases, the contributions from and in remain , whereas in they differ; for the first case it is and for the second case it is . The value of is zero in the first case, whereas in the second case it is 1 so that the respective contributions of in are 0 and . It can be summarised in a table as shown in Table 2.
From third column and last column of Table 2, it can be seen that sum of the contribution of and in is the same as the sum of the contribution of and in for . Therefore, .

Table 2: Shows the contributions in calculating the sum for two possible cases.

#### 4. Convergence Behavior of CVT and MCVT

##### 4.1. Convergence of CVT

Let be defined as for all . Consider the iterative scheme , . In this section, we will prove an important theorem which states that the sequence generated by the iterative scheme , converges to . The convergence behavior of CVT and XOR values of different order pairs are shown in Table 3.

Table 3: Generated sequences of CVT and XOR values.

The sequences generated from the ordered pair in Table 3 may be interpreted as 127 + 65 = 130 + 62 = 4 + 188 = 8 + 184 = 16 + 176 = 32 + 160 = 64 + 128 = 0 + 192. These generated sequences are named as the orbit of the order pair . Figure 3 shows the state transition diagrams (STDs) of some of the points and their orbits.

Figure 3: Showing the state transition diagrams (STDs) of three order pairs , and as shown in Table 3.

Observations:(1)in any number system, CVT = 0 in any iteration in its previous iteration the sum of the corresponding bits of CVT and XOR is always less than the base of that number system;(2) if two numbers expressed in binary are complement to each other, then their CVT = 0. But the converse is not true;(3)if XOR value is 0 in any iteration, then CVT = 0 in the next iteration;(4)the points in a single orbit are collinear as shown in Figure 3.

According to the definition of CVT for any two -bit numbers, CVT will be of at most () bits. It seems that the recursive procedure of the CVT + XOR of two nonnegative integers always increases the length of the CVT by 1 in each iteration but it is not true, which is clear from the next proof.

Lemma 4.1. If the maximum length of two nonnegative integers in binary representation is n then the CVT and XOR values in each iteration expressed in binary strings must be of length at most ().

Proof. Let and be two nonnegative integers with length at most in their binary representations. Let and be two numbers to be added in th iteration while performing the repeated sum of CVT and XOR. Suppose the number of (valid) bits in (rejecting the zeros in the left of the first nonzero bit) in an iteration. The smallest number with valid () bits is . So, .
Since (from Theorem 3.1), . Since , so
The maximum number with  bits is 111···11 = .
Maximum value of is :
From (4.1) and (4.2), we get which is absurd. Thus, our assumption was wrong, and hence all CVTs will be of at most bits in every iteration.
Same logic can be applied to XOR operation also, that is, if we write CVT in place of XOR in above proof, we also get an absurd result for XOR. Therefore, all XOR operations are of at most  bits in every iteration.

Lemma 4.2. In any iteration if there is a “0” in CVT at th position (counted from right), then there must be a “0” in th position in the next iteration while forming the subsequent CVTs. The number of zeros in the CVT increases by at least one in each iteration.

Proof. Suppose a CVT contains 0 at th position in any iteration. In the next iteration, this 0 will be added to either 0 or 1 of XOR value obtained in the previous iteration. When we form CVT, th position of CVT will be either or . Thus, we get a 0 in the th position of the newly formed CVT. Thus, once a “0” appears in a CVT in any iteration, then “0” appears in all subsequent CVT’s in all subsequent iterations, but the position will be shifted by one in each iteration. By definition of CVT, one additional zero is added to the rightmost position in each iteration. So number of zero increases by at least one in a CVT in each iteration.

Lemma 4.3. If a and b are of maximum n binary bits, then the number of iterations required to get is at most .

Proof. By Lemma 4.1, all CVTs will be of at most  bits in all iterations.
By Lemma 4.2, once a “0” appears in a CVT in any iteration, then this zero will appear in all the subsequent CVT’s in all subsequent iterations, but the position will be shifted by one in each iteration.
Also the number of zero in CVT increases by at least one in each iteration, the  bits in CVT will be converted to zeros in at most -iterations.

Note. If and are of maximum binary bits and Hamming distance between and is , then in one iteration. Otherwise, if Hamming distance between two selected numbers is for , then number of iterations required to get is at most .

Lemma 4.4. If a and b are of maximum n binary digits and in th iteration, then in the th iteration.

Proof. Let us assume that in the th iteration and suppose in the th iteration. Then at least, one bit of the XOR in th iteration must be “1”. It is sure that in the th iteration (where or ) of successive addition, XOR bit must be 1, and the corresponding carry bit must be 1 which is impossible. So our assumption was wrong. Thus, in the th iteration. Hence proved.

Combining Lemmas 4.3 and 4.4, we have proved the following theorem.

Theorem 4.5. Let be defined as . Then, the iterative scheme , converges to for any initial choice . Further, for any nonnegative integers “” and “” (where ), the number of iterations required to get either or is at most the length of “” when expressed as a binary string.

##### 4.2. Convergence of MCVT

The following theorem gives the number of iterations required for .

Theorem 4.6. The procedure of calculating the MCVT and XOR values of any two nonnegative integers requires a maximum of two iterations to get their .

Proof. Let and be two -bits number. In the first iteration, we get and .
Let and . Then in the second iteration, we get and . We will show that .
From Table 4, it can be verified that:
If for all , then in one iteration. Hence proved.

Table 4: Showing calculation of MCVT.

#### 5. An Equivalence Relation is Defined Using the Notion of CVT

Let be a finite subset of for some nonnegative integer , and let be a relation on defined as and requiring equal number of iterations for their or .

It can be easily verified that the relation is reflexive, symmetric, and transitive on the set . Therefore, is an equivalence relation on .

We have calculated the number of iterations required for the set of ordered pair in , where and constructed Figure 4 using a two-step procedure as follows.

Figure 4: Showing the number of iterations required for either or .

Step 1. Write all the integers in ascending order in both, uppermost row and leftmost column of Figure 4.

Step 2. Compute number of iterations required for any ordered pair to get either or and store it in the position .

From Figure 4, we have observed that:(1)the matrix is symmetric;(2)if we consider Figure 4 as 4 quadrants, each quadrant is a symmetric matrix. Again if each quadrant is divided further into 4 smaller quadrants, then also the 1st quadrant is the same as the 3rd quadrant. Hence a self-similar fractal behaviour is noticed in Figure 4;(3)in a block of size , there are no ordered pairs in the 2nd quadrant which transform into or in -iterations.

In Figure 4 divides the set into disjoint equivalence classes.

For , there is one equivalence class and .

For , there are two equivalence classes , where Here, .

For , there are three equivalence classes , and :

For , there are four equivalence classes , and :

For , there are five equivalence classes , and :

From above, we conclude that if we take a block of size , then(1)number of ordered pairs for which or in one iterations is for ;(2)number of ordered pairs for which or in iterations is for .

#### 6. Conclusion and Future Research Work

In the present paper, we have proved some important results on Carry Value Transformation (CVT) and Modified Carry Value Transformation (MCVT). Firstly, it has been proved that for any base of the number system, the sum of any two nonnegative integers is the same as the sum of their CVT and XOR values. This result is actually the correctness proof of the algorithm based on which the adder circuit is designed in [2]. Our second result, that is, “the number of iterations leading to either or does not exceed the maximum of the lengths of the two addenda expressed as binary strings” is about the efficiency at which the hardware circuit designed in [2] will produce the addition result. The state transition diagrams (STDs) and certain observations on CVT and MCVT are found out. Our third result such as addition of Modified Carry Value Transformation (MCVT) and XOR requires a maximum of two iterations for MCVT to be zero, is an interesting result for MCVT. A new equivalence relation is obtained on the set which divides the CV Figure 4 into disjoint equivalence classes.

In future we propose to study the following aspects:(1)investigating into the state transition diagrams (STDs) of different IVTs;(2)extending the domain of CVT from nonnegative integers to real numbers and complex numbers;(3)exploring the behaviour of hybrid IVTs and their applications;(4)explaining the relationship of IVTs with cellular automata.

#### Acknowledgments

The authors would like to acknowledge Professor P. Pal Choudhury and Sk. Sarif Hassan, Indian Statistical Institute, Kolkata for motivating us to work further in the domain of CVT and IVT.

#### References

1. P. P. Choudhury, S. Sahoo, B. K. Nayak, and Sk. S. Hassan, “Carry value transformation: application in fractal formation,” in Proceedings of the IEEE International Advance Computing Conference (IACC '09), pp. 2613–2618, Patiala, India, March 2009.
2. P. P. Choudhury, S. Sahoo, and M. Chakraborty, “Implementation of basic arithmetic operations using cellular automaton,” in Proceedings of the 11th International Conference on Information Technology (ICIT '08), pp. 79–80, Bhubaneswar, India, December 2008.
3. P. P. Choudhury, S. Sahoo, B. K. Nayak, and Sk. S. Hassan, “Act of CVT and EVT in the formation of number-theoretic fractals,” International Journal of Computational Cognition, vol. 9, no. 1, pp. 1–8, 2011.
4. S. Sahoo, I. Mohanty, G. Chowdhary, and A. Panigrahi, “2-variable Boolean operation—its use in pattern formation,” Nonlinear Sciences. In press. http://arxiv.org/abs/1008.2530.
5. Sk. S. Hassan, P. P. Choudhury, S. Das, R. Singh, and B. K. Nayak, “Collatz function like integral value transformations,” Alexandria Journal of Mathematics, vol. 1, no. 2, 2010.
6. P. P. Choudhury, S Sahoo, B. K. Nayak, and Sk. S. Hassan, “Theory of rule 6 and its application to round robin tournament,” International Journal of Computational Cognition, vol. 8, no. 3, pp. 33–37, 2010.