# Patent

## Title
Method and system for coding information

## Abstract

A method and an apparatus are described for coding information, the method comprising obtaining a list of integers to be encoded; determining a hyper-pyramid having a dimension adapted to encode the list of integers, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers of the list of integers and by the dimension of the hyper-pyramid which is equal to the number of integers of the list of integers minus one; indexing the list of integers in the hyper-pyramid using an indexing system; and providing an indication of the indexing of the list of integers in the hyper-pyramid.

## Background
CROSS REFERENCE TO RELATED APPLICATIONS
This patent application is a National Phase Application of PCT International Application No. PCT/CA2012/001042, International Filing Date Nov. 13, 2012, claiming priority of Canadian Patent Application No. 2,758,243, entitled “Method and apparatus for encoding information” which was filed Nov. 10, 2011, which are hereby incorporated by reference in their entirety.
FIELD OF THE INVENTION
This invention relates to the field of coding. More specifically, the innovation relates to a method and system for coding information through a hyper-pyramid.
BACKGROUND OF THE INVENTION
Let xo, . . . , n be integers belonging to a list of integers and X the generated integer. Encoding a natural list of integers into a single integer and its inverse function is equivalent to finding encoding and decoding functions which provide the following correspondence:

Code(xo, . . . , n)→XDecode(X)→xo, . . . , n 

A coding system consists of establishing a law of correspondence, called code, between the information to be represented and the obtained numbers, such that for each information usually corresponds to a single number from which it will be possible to retrieve the original information.
Some coding strategies are based on some bijective function mechanisms, for example those in the Fundamental Theorem of Arithmetic or those in methods to generated numbers through polynomials. In the first instance, the uniqueness of the decomposition of a number into a product of prime factors is the bijection's key mechanism. In the second instance, the uniqueness of the decomposition of a number into a sum of elementary numbers must first be established.
For example, Fibonacci coding concatenates a list of integers in a single binary number such that the separators between integers are represented by the binary pattern 11.



  
    
      Fibonacci
      ⁢
      
        
      
      ⁢
      
        (
        
          [
          
            1
            ,
            2
            ,
            3
            ,
            9
            ,
            8
            ,
            7
          
          ]
        
        )
      
    
    →
    
      
        
          {
          11011001110001100001101011
          }
        
        2
      
      →
      
        
          {
          57088107
          }
        
        10
      
    
  




  
    
      11
      
        {
        1
      
    
    ⁢
    
      011
      
        {
        2
      
    
    ⁢
    
      00111
      
        {
        3
      
    
    ⁢
    
      00011
      
        {
        9
      
    
    ⁢
    
      000011
      
        {
        8
      
    
    ⁢
    
      01011
      
        {
        7
      
    
  



The person skilled in the art will appreciate that, in general, beyond the theoretical choice of encoding method, the length of the list to be encoded and the dimension of integers to be treated should be considered an essential problem from the practical and applicative points of view.
The person skilled in the art will also appreciate that apart from the problem of compression of the integer list, the generated code size, i.e. the number of representative digits, is a fundamental element in the choice of coding methods.
Given the dimension of data to be processed and levels of computational complexity encountered, performance loss, especially during decoding phases, is almost immediate and disqualifies some theoretically interesting methods regarding the initial coding phase.
Various encoding methods addressing different theoretical problems like the compression, transmission, structuration or encryption of data, the properties of generated codes can be very different in each case.
In coding systems which preserve indexing, the law of correspondence is an order relation which calculates the rank of a list or sequence of integers, and allows classifying and sorting of this list from a unique integer which, in turn, can be decoded to restore the list.
The person skilled in the art will appreciate that there are many possible coding applications. In particular, the ordering of certain sequences of integers is generally the first objective of coding methods using indexing.
Sequences to be ordered essentially belong to the field of combinatorics, e.g. combinations or permutations that must be ordered.
There are numerous applications, ranging from linear algebra, algebraic geometry and graph theory, to the sorting of dictionaries in alphabetical order or enumeration and positioning of combinations in game theory.
How to index a lattice is particularly important in routing problems and parallel algorithms. Thus, the routing can be defined as a software or hardware mechanism that routes information between the source and destination in a communication network incompletely connected, static or dynamic: it selects the best paths in a network, it manages conflicts, and finally it ensures that messages arrive well and in the proper order.
The addressing of data as well as its data structure storage areas in databases or data structures is the basis of numeric information access and its structuring.
The interest of coding information by indexing is to overcome any physical memory organization problem, prior to data manipulation. The physical organization is typically based on the notions of tables or lists whose structure, size and memory location must be explicitly declared. In contrast, coding by indexing enables an implicit description of the information through the properties of the encoded number. For example, the representation of the information in spreadsheets uses standard file formats which specify the convention according to which information is encoded for storage. These formats, such as the Comma Separated Value, describe explicitly how the information should be saved.
The person skilled in the art will appreciate furthermore that the lattice indexing functions can be used as powerful hash functions. To optimize information access, using mathematical functions called hash functions, hashing methods allow a table index to be computed directly from an alphanumeric string called the key. The area of the memory directly indexed thus contains the information associated with the key or a new set of addresses, allowing to indirectly access these addresses.
The person skilled in the art will also appreciate that electronic identification is increasingly used to ensure the traceability of objects, food or living beings. The various kinds of identifiers are for registration, for indexing information: the primary key, or else for the connection. Coding-by-indexing systems are particularly well suited to these types of problems because, in particular, they facilitate alphanumeric sorting and allow rapid identification in databases.
Finally, functions for encoding or mathematical pairing provide the foundation of encryption systems and of the biunique relationship between the operation of coding and decoding. The use of properties of coded numbers such as the prime factor decomposition of a number, may also serve as an independent or complementary approach.
In positional coding, positional number systems are used for coding and decoding vectors of integers from a base of numeration greater than the cardinal number count k−1 of the coding alphabet. The result for encoding the vector (α0, . . . , αk) in base k will be

IB=α0·Bk+α1·Bk−1+ . . . +ak·B0 

For example, if the integers (1, 2, 3, 4, 5, 6, 7, 8, 9) are associated with letters of the alphabet (A, B, C, D, E, F, G, H, I), the following code will be obtained, 2·106+1·105+2·104+2·103+1·102+7·101+5·100→{2122175}10 corresponding to the word BABBAGE encoded in base 10. In this case, because the alphabet does not exceed the number of digits available, the resulting code is a simple substitution of letters in the word by the corresponding digits. By enriching the alphabet, the computation of polynomials becomes necessary, such as encoding the letters on more than one digit, for example, in hexadecimal numeration with A=10, B=11 . . . .
The person skilled in the art will appreciate that the encoding of a list of integers can be realized from modular representation of integers, called “Residue Number System” i.e. (RNS).
The RNS system is defined from a set of relatively prime integers, called modules and denoted {m0, m1, . . . , mn}. Therefore GCD (mi,mj)=1, with i≠j. An integer X can then be represented by a set of integers called residues {r0, r1, . . . , rn,} such that xi=X mod mi where 0≦xi<mi. Moreover, this representation is unique for X≦M−1 with M=Πi=0n−1mi.
The coding principle is to consider the list of integers to encode as a list of residues and to find the associated decimal representation. To find modules greater than the respective integers of the list, we can use a sequence of successive primes, which are all greater than their residues or start with the first prime number immediately above the maximum integer in the list to encode. The example below shows the encoding of the 5-dimensional projective point with the homogeneous coordinates [69, 78, 73, 71, 77, 65], starting with the module 73. The encoding function, called Chinese, is essentially a function which solves a system of congruencies from a set of residues.

Chinese([69,78,73,71,77,65],[73,79,83,89,97,101])→{252617134512}

252617134512 mod 73=69 . . . 252617134512 mod 101=65

The decoding of the decimal number not being unique, it follows that we must know the triplet (Code, initial module, length of the list) to perform the decoding. The triplet will be therefore noted {2526171345121}(73,55). The list could be encoded with an infinity of other triplets such as {412251249819}(79,5), 79, being in this case the first integer is greater than 78.
Cantor coding is associated with the notion of pairing function, which was developed to address the problem of countability of natural numbers. Cantor's pairing function is reduced to a second degree polynomial with the X and Y coordinates of the Cartesian plane as variables. Using this formula, FIG. 1 shows the order in which each pair of coordinates is associated with the indices. For example, IK2(1,2)→8. It is possible to obtain another pairing polynomial by substituting y by x, in which case we obtain IK2(1,2)→7.




  
    I
    
      K
      2
    
  
  =
  
    
      
        
          (
          
            x
            +
            y
          
          )
        
        *
        
          (
          
            x
            +
            y
            +
            1
          
          )
        
      
      2
    
    +
    y
  




A boustrophedon version is illustrated in FIG. 1b. 
The Cantor pairing function, which allows encoding and decoding of a pair of integers, has been extended to any number of integers in two different ways. The first is by regrouping successively integers by forming pairs of pairs of integers. Based on the initial Cantor encoding function, this method has the advantage of simplicity; a polynomial of degree 2 generates n-degree polynomials. This exponential growth affects in particular the dimension of the calculated indices. An alternative to this approach is the n-dimensional extension of the pairing function. An expression based on binomial coefficients is presented by Cegielski and Richard, in the following form:




  
    K
    ⁡
    
      (
      
        
          x
          1
        
        ,
        ...
        ⁢
        
          
        
        ,
        
          x
          k
        
      
      )
    
  
  =
  
    
      (
      
        
          
            
              
                x
                1
              
              +
              ...
              +
              
                x
                k
              
              +
              k
              -
              1
            
          
        
        
          
            k
          
        
      
      )
    
    +
    
      (
      
        
          
            
              
                x
                1
              
              +
              ...
              +
              
                x
                
                  k
                  -
                  1
                
              
              +
              k
              -
              2
            
          
        
        
          
            
              k
              -
              1
            
          
        
      
      )
    
    +
    ...
    +
    
      (
      
        
          
            
              
                x
                1
              
              +
              
                x
                2
              
              +
              1
            
          
        
        
          
            2
          
        
      
      )
    
    +
    
      
        (
        
          
            
              
                x
                1
              
            
          
          
            
              2
            
          
        
        )
      
      .
    
  




Unfortunately the n-dimensional Cantor pairing function is not bijective. Some vectors of integers of different dimensions can generate the same encoded number. This problem also exists with the pairing of successive pairs. In this case and by convention, we can add a new coordinate, as arity of the initial vector. In Ernesto Pascal's coding, an integer N can be represented in a unique way for a certain degree n as follows:




  
    N
    =
    
      
        (
        
          
            
              
                x
                n
              
            
          
          
            
              n
            
          
        
        )
      
      +
      ...
      +
      
        (
        
          
            
              
                x
                2
              
            
          
          
            
              2
            
          
        
        )
      
      +
      
        (
        
          
            
              
                x
                1
              
            
          
          
            
              1
            
          
        
        )
      
    
  
  ,
  
    
      x
      n
    
    >
    ...
    >
    
      x
      2
    
    >
    
      x
      1
    
    ≥
    0.
  




The number 1000 will be represented for example by the sequence (12, 9, 8, 7, 6, 5, 3)Cns7 corresponding to the first seven columns of the Pascal's triangle or by the sequence {19, 8, 3}Cns3 corresponding to the first three columns. Therefore, this coding applies to strictly decreasing sequences of integers and is used to solve the problem of lexicographic ordering of r-combinations of a1, a2, . . . , ak of {1, 2, . . . , r}. The formula can be slightly modified to calculate the index of a given combination in the form of an increasing sequence of integers, in which case the following is obtained:




  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  -
  
    (
    
      
        
          
            r
            -
            
              a
              1
            
          
        
      
      
        
          k
        
      
    
    )
  
  -
  
    (
    
      
        
          
            r
            -
            
              a
              2
            
          
        
      
      
        
          
            k
            -
            1
          
        
      
    
    )
  
  -
  ...
  -
  
    (
    
      
        
          
            r
            -
            
              a
              2
            
          
        
      
      
        
          2
        
      
    
    )
  
  -
  
    
      (
      
        
          
            
              r
              -
              
                a
                k
              
            
          
        
        
          
            1
          
        
      
      )
    
    .
  




There is therefore a need for a method of encoding information which solves at least one problem of the prior art.



LIST OF FIGURES
FIG. 1a illustrates Cantor ordering while FIG. 1b illustrates the boustrophedon Cantor ordering.
FIGS. 2A and 2B illustrate De Gua de Malves's triangle and its projective extension.
FIGS. 3A and 3B illustrate a pyramidal lattice and the labeling of projective coordinates.
FIG. 4 illustrates an embodiment of the coding and decoding system.
FIG. 5 illustrates an implementation of the GLOBAL algorithm and an implementation of the LOCAL algorithm.
FIG. 6 illustrates recursive trees for




  
    (
    
      
        
          4
        
      
      
        
          2
        
      
    
    )
  
  .




FIG. 7 illustrates the positional indexing of T3,2 in quaternary base.
FIG. 8 illustrates the expansion of large integers.
FIG. 9 illustrates the numeric order for the T4,3 lattice.
FIG. 10 illustrates an implementation of the NUMORD algorithm.
FIG. 11 shows a decomposition of a pyramidal number.
FIG. 12 illustrates an implementation of the ORDNUM algorithm.
FIG. 13 illustrates the lexicographic encoding of the T4,3 lattice.
FIG. 14 illustrates an implementation of the LEXORD algorithm.
FIG. 15 illustrates an implementation of the ORDLEX algorithm.
FIG. 16 shows the Gray projective encoding (4,3).
FIG. 17 illustrates an implementation of the GRAORD algorithm.
FIG. 18 illustrates the path of T4,3 in the Gray projective order.
FIG. 19 illustrates an implementation of the ORDGRA algorithm.
FIG. 20 illustrates an implementation of the VN2VVM algorithm and VM2VN algorithm.
FIG. 21 illustrates the




  
    (
    
      
        
          6
        
      
      
        
          4
        
      
    
    )
  
   




combinatorial tree.

FIG. 22 shows the




   
  
    (
    
      
        
          6
        
      
      
        
          4
        
      
    
    )
  




tree and numeric labels.

FIG. 23 shows the




   
  
    (
    
      
        
          6
        
      
      
        
          4
        
      
    
    )
  




tree and the lexicographic labels.

FIG. 24 illustrates an example of a combinatorial projective subspace.
FIG. 25 illustrates an example of bijection between projective points and the combinations.
FIG. 26 illustrates an example of generating both projective and binary combinations.
FIG. 27 illustrates the Euclidean and affine coordinates of a Cantor point.
FIG. 28 illustrates the taxonomy for orderings.
FIG. 29 illustrates Cantor paths.
FIG. 30 illustrates a possible implementation of the method for encoding information.
FIG. 31 illustrates some spiral paths.
FIG. 32 shows an implementation of the SPIORDc algorithm and ORDSPIc algorithm.
FIG. 33 illustrates an implementation of the SPIORDa and ORDSPIa algorithms.
FIG. 34 illustrates a spiral chain for T6,3.
FIG. 35 illustrates a mechanism of convolution.
FIG. 36 illustrates Vandermonde's convolution for




   
  
    
      (
      
        
          
            9
          
        
        
          
            3
          
        
      
      )
    
    .
  




FIG. 37 shows an implementation of the CRKREC algorithm.
FIG. 38 illustrates an implementation of the XENUME algorithm and YENUME algorithm.
FIG. 39 shows an implementation of the COMBO algorithm.
FIGS. 40A and 40B show the indexing change of the Pascal's triangle.
FIG. 41 shows an implementation of the PRODYN algorithm.
FIG. 42 shows an implementation of the MATPRT algorithm.
FIGS. 43a and 43b illustrate a matrix multiplication between columns.
FIG. 44 shows a curve that, for a given dimension, represents the values of the binomial coefficients.
FIG. 45 shows an implementation of the ENCDEC algorithm and DIGBIN algorithm.
FIG. 46 shows an implementation of the NUMFCT algorithm.
FIG. 47 shows an implementation of the DRVREC algorithm.
FIG. 48 shows an implementation of the DRVSYM algorithm.
FIG. 49 shows an implementation of the BINRP4 algorithm.
FIG. 50 shows an implementation of the BINRPNi algorithm and RPNBINi algorithm.
FIG. 51 shows an implementation of the GLOBALo and LOCALo algorithms.
FIG. 52 shows an implementation of the ORDNUMo and ORINUMo algorithms.
FIG. 53 shows an implementation of the INDCOM and COMIND algorithms.
FIG. 54 shows an implementation of the MPLNUM algorithm.



SUMMARY
According to one aspect of the invention, there is disclosed a method for encoding information, the method comprising obtaining a list of integers to be encoded; determining a hyper-pyramid having a dimension adapted to encode the list of integers, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers in the list of integers, and by the dimension of the hyper-pyramid which is equal to the number of integers in the list minus one; indexing the list of integers in the hyper-pyramid using an indexing system; and providing an indication of indexing of the list of integers in the hyper-pyramid.
According to one embodiment, the method further comprises providing a list of alphanumeric codes and transforming the list of alphanumeric codes into the list of integers to encode.
According to one embodiment of the method, the indexing system allows each vertex of the plurality of the vertices of said hyper-pyramid to be indexed.
According to one embodiment of the method, the indication of the indexing of the list of integers in the hyper-pyramid includes an integer representing the index of projective point in the indexing system, m being the total degree of said list of integers and n being the number of integers in the list.
According to one embodiment, the method further comprises converting the integer representing the projective point in the indexing system into combinatorial coordinates mx and nx.
According to one embodiment, the method further comprises processing m, the total degree of the list of integers, and n, the number of integers in the list of integers into an integer Y representing an overall index.
According to one embodiment, the method further comprises summing the integer Y representing an overall index with the integer representing the index of the projective point, in order to provide a total index Z. The indication of the indexing of the hyper-pyramid includes the total index Z. According to one embodiment of the method, the list of integers is obtained from a file.
According to one embodiment of the method, the step of providing the indication of the indexing in the hyper-pyramid includes storing said indication of the indexing in a file.
According to one embodiment of the method, the step of providing the indication of the list of integers in the hyper-pyramid includes transmitting the indication of the indexing of the list of integers to a processing unit via a network.
According to one embodiment the method further includes providing a list of integers and generating the list of whole numbers using the list of integers.
According to one embodiment, the step of providing the indication of the indexing of the list of integers in the hyper-pyramid includes displaying the indication of the indexing on a display.
According to one embodiment, the method is used for compressing a string of characters associated with said list of integers.
According to one embodiment, the method is used for coding a list of lists, the method comprising an iterative use of the method for coding a list of lists.
According to one embodiment, the method is used for encrypting a list of integers, wherein the indexing of the list of integers corresponds to an encryption of the list of integers.
According to one aspect, a method is described for decoding information encoding using the method for encoding the information disclosed above, the method comprising obtaining an indication of the indexing of the list of integers in the hyper-pyramid; obtaining an indication of an indexing system used to generate said indication of the indexing of the list of integers in the hyper-pyramid; determining, using the indexing system and the indication of the indexing of the list of integers, said list of integers; and providing said list of integers.
According to another aspect of the invention, a computer comprising a display unit, a processor, a data storage unit comprising a program configured to be executed by the processor to encode information, the program comprising instructions for obtaining a list of integers to be encode; instructions for determining a hyper-pyramid having a dimension adapted for encoding the list of integers, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers in the list, and by the dimension of the hyper-pyramid that is equal to the number of integers in the list of integers minus one; instructions for indexing the list of integers in the hyper-pyramid using an indexing system; and instructions for providing an indication of an indexing of the list of integers in the hyper-pyramid.
According to another aspect of the invention, a non-transitory computer storage medium for storing programming instructions executable by a processor, which when executed will cause the execution by the processor of a method for encoding information, the method comprising obtaining a list of integers to be encoded; determining a hyper-pyramid having a dimension adapted for encoding the list of integers, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers of the list of integers and the dimension of the hyper-pyramid which is equal to the number of integers in the list of integers minus one; indexing the list of integers in the hyper-pyramid using an indexing system; and providing an indication of the indexing the list of integers in the hyper-pyramid.
An advantage of the system described is that it is an “e pluribus unum” polymorphic system, since it is a combined system capable of both coding and indexing but also of transcoding between coding systems based on the combinatorial binomial coefficients.
An advantage of the system described is that it addresses the problem of the coding/indexing/transcoding of integer lists without any predefined combinatorial structures as well as of specific lists with predefined combinatorial structures such as lists of coefficients of polynomials or lists of combinations without repetitions.
Another advantage of the described system is that it can work in dual mode, in bijective encoding mode Code (X)→Y and Decode (Y)→X or in encryption mode (X)→Y Decode (Y, key 1, key 2)→X.
Another advantage of the described system is that it can provide a solution to various problems such as: the nature and dimension of the data, the dimension of the encoding/decoding program, and the size and properties of the generated code.
Concerning the nature and dimension of the data, the described method may allow the use of structured or unstructured data of any size.
In terms of dimension of encoding/decoding programs, it is possible to implement the computer code by a few dozens of instructions and by using a standard library for arbitrary precision arithmetic such as the GNU Multiple Precision Arithmetic Library (GMP).
Regarding the dimension of the generated code, there is no exponential growth in memory, either in compressed or uncompressed mode, because no use is made of primes factorization or calculations based on exponential functions.
In terms of coding and decoding performances, it may be possible to employ new generation optimized algorithms for the calculation and search of binomial coefficients in Pascal's triangle.
Regarding properties of the generated code, the code generated may be used as multi-use indexation system for at least one of the following examples: ordering lists of integers, routing architectures, data addressing and hashing, electronic identification and cryptography.
DETAILED DESCRIPTION
The person skilled in the art will appreciate that Pascal's triangle has many properties. In particular, for the enumeration of monomials of a homogeneous polynomial of degree m in n dimensions:




  
    Cr
    ⁡
    
      (
      
        m
        ,
        n
      
      )
    
  
  =
  
    
      (
      
        
          
            
              m
              +
              n
            
          
        
        
          
            n
          
        
      
      )
    
    =
    
      
        
          
            (
            
              m
              +
              1
            
            )
          
          ⁢
          
            ...
            ⁡
            
              (
              
                m
                +
                n
              
              )
            
          
        
        
          n
          !
        
      
      .
    
  




It is also to be noted that Cr(m,n)=Cr(n,m) and consequently the following expression Cr(r,r) is obtained for the central binomial coefficient of the line r, Cr(r,r). Moreover, the sum of the binomial coefficients of this line is defined by:




  
    
      ∑
      
        k
        =
        0
      
      r
    
    ⁢
    
      
    
    ⁢
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
  
  =
  
    
      2
      r
    
    .
  




The calculation of a binomial coefficient from the binomial coefficients in the adjacent left column or from those in the oblique diagonal which is just above respectively yields:




  
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
    =
    
      
        ∑
        
          i
          =
          0
        
        
          r
          -
          1
        
      
      ⁢
      
        
      
      ⁢
      
        (
        
          
            
              i
            
          
          
            
              
                k
                -
                1
              
            
          
        
        )
      
    
  
  ,
  
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
    =
    
      
        ∑
        
          i
          =
          0
        
        
          r
          -
          1
        
      
      ⁢
      
        
      
      ⁢
      
        
          (
          
            
              
                
                  k
                  +
                  i
                
              
            
            
              
                i
              
            
          
          )
        
        .
      
    
  




In addition, the recurrence formula for calculating a binomial coefficient by using its two above neighbors allows building a naive algorithm generating the Pascal's triangle, this formula being expressed as follows:




  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    
      
        (
        
          
            
              
                r
                -
                1
              
            
          
          
            
              
                k
                -
                1
              
            
          
        
        )
      
      +
      
        
          (
          
            
              
                
                  r
                  -
                  1
                
              
            
            
              
                k
              
            
          
          )
        
        ⁢
        
          
        
        ⁢
        avec
        ⁢
        
          
        
        ⁢
        r
      
    
    ≥
    1.
  




The pyramidal numbers are figurate numbers, i.e. decomposed, and represented by points distributed on regular polytopes. Pascal's triangle is formed from triangular, tetrahedral and generally hypertetrahedral numbers.
The disclosed system is designed from the idea of using combinatorial properties of Pascal's triangle and the algebraic properties of projective extensions in n-dimensions of the De Gua de Malves' analytic triangle, as a general system of indexing and coding for the lists of whole numbers. For this, the bijective correspondence between the monomials of a polynomial Pm,n and the points of a lattice Tm,n will be used. The monomial ordering of this polynomial will therefore be equivalent to the ordering of the lattice points. FIGS. 2A and 2B show the transition between the original triangle described by De Gua and this projective extension in two dimensions for a third degree curve.
Definition and Properties of Pyramidal Lattice
The individual skilled in the art will appreciate that a pyramidal lattice, directly related to the concept of pyramidal number, is both a combinatorial structure as well as an algebraic geometric structure in n-dimensions. Lattices are represented in the form of hyper-pyramids, such as the tetrahedrons of FIGS. 3A and 3B or the triangles of FIGS. 2A and 2B. A tetrahedral pyramid lattice, with the following mathematical notation Tm,n, corresponding to the line m+n and column m of Pascal's triangle, is associated to each binomial coefficient




  
    (
    
      
        
          
            m
            +
            n
          
        
      
      
        
          m
        
      
    
    )
  
  .




It is therefore a hypertetrahedral projective configuration in n-dimensions with





  
    (
    
      
        
          
            m
            +
            n
          
        
      
      
        
          m
        
      
    
    )
  
   




linearly dependent homogeneous points. The lattice points are arranged in a combinatorial manner, in sub-lattice of dimension n−1 and of degree ranging from 0 to m−1 (diagonal sum formula). Each lattice is located in the Pascal's triangle by means of the couple (m,n) or by the summation of all points of all previous lattices, what we call the global index. The number of points, i.e. the associated pyramidal number, is by definition equal to the number of monomials of a homogeneous polynomial of degree m in n dimensions. The projective homogeneous coordinates of the points of a lattice Tm,n can be interpreted as the exponents of the monomials of an associated polynomial of degree m and dimension n. Each cell of the Pascal's triangle is associated with a hyper-pyramid, whose number of vertices is equal to the number located in the cell.

Monomial Ordering of Homogeneous Polynomials

A monomial xnm from x0, x1, . . . , xk is defined as the product xnm=xn0m0xn1m1 . . . xnkmk and the total degree of xnm is define as |m|=m0+m1+, . . . , +mk if vm=mk, mk−1, . . . , m0 represents the vector of the exponents, and vn=n0, n1, . . . , nk represents the vector of the indices of variables where n0≦n1 . . . ≦nk.
The Euclidean definitions for monomial orderings of non-homogeneous polynomials are based on the notion of lexicographic order and on the total degree of monomials, i.e. the sum of the exponents of the variables. By combining these two paradigms, in particular, we obtain the lexicographic order, then the graded lexicographic order, then the graded reverse lexicographic order. In the case of homogeneous polynomials, all monomials by definition have the same total degree, and the ordering of monomials can be realized from two lexicographic orderings in a dual projective space, one using the exponents and the other the indices, (the monomials being represented in tensorial notation). In this case, the reverse lexicographic orderings are only variations of ascending and descending orderings.
Numeric order will be the name of the lexicographic order on the exponents such that vmαnum if and only if the left-most non-zero value of vmα−vmβ is negative.
Numlex order will be the name of the numeric order on the exponents such that: vm=mk, mk−1, . . . , m0 with m0≦m1 . . . ≦mk.
Combinatorial order will be the name of the numeric order on the exponents such that: vm=mk, mk−1, . . . , m0 with m0<m1 . . . <mk.
Lexicographic order will be the name of the lexicographic order on the indices of variables such that vnαlex vnβ if and only if the left-most non-zero value is negative.
If the De Gua Malves polynomials in FIGS. 2A and 2B which corresponds to a Euclidean curve of the third degree is ordered in lexicographic order of its coefficients, we obtain the following sequence
a, b·y, c·x, e·y2, f·x·y, g·x2, h·y3, i·x·y2, k·x2·y, l·x3.
After having replaced x by x0/x2 and y by x1/x2, taking the common denominator for all terms and finally keeping the numerators, the homogeneous representation of the polynomial is obtained:
a·x23, b·x1x22, c·x0x22, e·x12x2, f·x0x1x2, g·x02x2, h·x13, i·x0x12, k·x02x1, l·x03.
By choosing vma=3, 0, 0, vmb=2, 1, 0 . . . vm1=0, 0, 3, it is possible to obtain the following sequences of monomials, first in reverse numeric order, and then in numeric order:
a, b, c, e, f, g, h, i, k, l
l, k, i, h, g, f, e, c, b, e.
By choosing vna=2, 2, 2, vnb=1, 2, 2 . . . vn1=0, 0, 0, we obtain the following sequence in lexcograpic order: l, k, g, i, f, c, h, e, b, a.
Principles of Combinatorial Coding
By using combinatorial and projective properties of lattices, it is possible to define a general system for indexing the monomials of the polynomials and to simultaneously use it as the coding system for lists of natural numbers, i.e. the coordinates. The person skilled in the art will appreciate that by transposition of the integers in any alphanumeric codes, the coding system may be extended to encode text and strings of alphanumeric characters.
The disclosed system is therefore based on the following principles:

    
    
        1. Each point of a lattice (m,n), also called a vertex of a hyper-pyramid, is associated with a vector with homogeneous coordinates of following type [a0:a1: . . . : an]. The sum of the coordinates is equal to m. The position of a cell in Pascal's triangle and therefore of the hyper-pyramid and hyper-surface which are linked to it, is given by the row and column of Pascal's triangle. Lines and columns which are associated with a cell of Pascal's triangle correspond to the degrees and dimensions of the associated algebraic polynomials. Each vertex of the same pyramid, its supporting structure, has a signature formed of an equal number of coordinates whose sum represents the degree and the number itself the spatial dimension minus one. In combinatorial theory, this signature can be interpreted either as the projective coordinates of the vertex belonging to the pyramid or as the exponents of the monomials of the polynomial representing the associated hyper-surface, or even as the indices of the variables composing the monomials of this polynomial.
        2. The vector whose homogeneous coordinates of type [a0:a1: . . . : an] is considered as the vector of exponents of a monomial of total degree m, belonging to a polynomial of degree m in n dimensions.
        3. Each lattice is associated with a path covering the points in a determined order, also called indication of the indexing, these points being located on particular Hamiltonian paths which visit all the lattice points, according to an embodiment of the invention.
        4. The local index of any monomial is considered the index of the homogeneous associated point, i.e. the rank of the point, as in the order in which the points of the selected path are visited.
        5. According to one embodiment of the invention, any coordinate vector is encoded or decoded locally through the 3-tuple formed by the local index, total degree of the vector and the dimension (n+1).
        6. According to one embodiment of the invention, any coordinate vector is encoded or decoded globally, with the total index obtained by adding the local index and the global index.
        7. According to one embodiment of the invention, the notion of coordinate vector is extended to any set of natural numbers representing any kind of alphanumeric code.
        8. The coding involves determining some bijective numbering systems or indexing systems for messages, by performing a double numbering, first in the Pascal's triangle, of the hyper-pyramid associated with the given message, i.e. the pyramid of support, and thereafter of the point-vertex of the pyramid whose signature represents the message. The integer or the n-tuple, generally the triplet of integers, resulting from this double numbering represents the encoded message in the indexed representation. The coding can be based on different methods of numbering and visiting points-vertices on the same pyramidal supporting structure and therefore the resulting code differs from one method to another.
        9. The decoding involves determining from the code the supporting pyramid of the message first and then the signature of the point-vertex belonging to the pyramid. This double location can be done only by knowing a priori the chosen visiting method for numbering the points on the supporting pyramid.
    
    


Thus and as described below, it is possible to define a method for encoding of information, the method comprising of obtaining a list of integers to be encoded; determining a hyper-pyramid having a dimension adapted for encoding the integers list, the hyper-pyramid having a plurality of vertices such that the degree of the hyper-pyramid is equal to the sum of the integers in the list and that the dimension of the hyper-pyramid is equal to the number of the integers belonging to the list, minus one; realizing the indexing of the list of integers in this pyramid through an indexing system; and providing an indication of indexing in the hyper-pyramid.
In an embodiment, the integers list is obtained from a file. The individual skilled in the art will appreciate that various types of files can be used to store the list of integers.
It will also be appreciated that the step of providing the indexing of the integers list in the hyper-pyramid may include, in an embodiment, the storage of the indexing in a file. The individual skilled in the art will appreciate that various types of files can be used for storage.
Alternatively, it will also be appreciated that the step for providing the indexing of the integers list in the hyper-pyramid may include, in one embodiment, the transmission of the integers list to a processing unit via a network. The individual skilled in the art will appreciate that various types of networks can be used. In fact, the network may comprise at least one of following networks; local area network, metropolitan area network and wide area network. In one embodiment, the transmission will take place through the Internet.
It will also be appreciated that in one embodiment, an indication of indexing the list of integers in the hyper-pyramid includes displaying said indication on a screen.
The individual skilled in the art will appreciate that a method is described for decoding coded information using the previously described method to encode the information. In this case, the method will include the steps to obtain the indication of indexing the integers list in the hyper-pyramid. The method further includes the step of obtaining an indication of an indexing system used for generating said indication of the indexing list of integers in the hyper-pyramid.
This method will also include the step of determining by means of the indexing and of the indication of an indexing system used, said integers list, and finally, the step of providing that list of integers.
The diagram of FIG. 4 illustrates an embodiment which allows providing of more options for encoding and decoding a list of integers <. , . . . , .>.
In particular, the CODE function is a family of coding functions that index the list of integers <. , . . . , .> with respect to the lattice Tm,n where m is the total degree of the list and n−1 is its length. The result is a triplet <X, m, n>, X representing the integer corresponding to the index of the projective point which has the initial list of integers as input as its vector of homogeneous coordinates.
The person skilled in the art will appreciate that the calculated index is different depending on the encoding method adopted. Depending on the case, the triplet may be provided to the DECODE function which will return the original list or this list then separated into two parts to form a whole number Z which can be decoded by bijection without any other information.
The left part of the diagram in FIG. 4 shows another way to create a single integer W, allowing a bijective decoding. This is a family of functions noted K22, which processes the pairing in two steps, first in pairing m and n, then in pairing the resulting integer value with X. Some decoding functions in two-dimensions, when applied successively, can then be used to restore the original code.
The right part of the diagram in FIG. 4 corresponds to a bijective encoding-decoding scheme coupled to a combinatorial compression mechanism. In this case, the triplet <X, m, n> is first converted to a quadruplet, the integer X being replaced by specific combinatorial coordinates mx and nx. The quadruplet mx, nx, m, n then encoded by a four-dimensional encoding scheme in order to generate a code C. Such a bijective code can be decoded by a four-dimensional reverse decoding scheme.
The compression principle resides in the significant decrease of the polynomial function degrees between the quadruplet and the triplet, and this largely compensates for the increase of one additional character between the triplet and the quadruplet.
Indexing a lattice allows encoding the degree and the dimension of the lattice using a single integer. The indexing of a lattice Tm,n can be performed by counting the number of cells in the Pascal's triangle which precede the cell with coordinates x=m and y=m+n corresponding to the binomial coefficient




  
    (
    
      
        
          
            m
            +
            n
          
        
      
      
        
          m
        
      
    
    )
  
  .




Thus, we take the number of cells in the triangle preceding line m of the lattice, and add the degree of the lattice corresponding to its column is carried. The formula found corresponds to Cantor's indexing of the natural numbers in the Cartesian plane.





  
    I
    c
  
  =
  
    
      
        
          (
          
            m
            +
            n
          
          )
        
        *
        
          (
          
            m
            +
            n
            +
            1
          
          )
        
      
      2
    
    +
    m
  




Global and Total Indexation

The global indexing ensures the bijective correspondence between the points of a lattice and their indexing in an n-dimensional space. Instead of calculating the number of cells preceding the binomial coefficient belonging to the lattice, the total number of points of all previous lattices is calculated. Using




  
    
      
        ∑
        
          k
          =
          0
        
        r
      
      ⁢
      
        
      
      ⁢
      
        (
        
          
            
              r
            
          
          
            
              k
            
          
        
        )
      
    
    =
    
      2
      r
    
  
  ,




and noting that 20+ . . . +2r=2r+1, the formulation of the global index Ig is obtained by summing the number of lattice points from lines 0 to m+n−1 with the number lattice points of the line m+n going from 0 to m:





  
    I
    g
  
  =
  
    
      2
      
        m
        +
        n
      
    
    +
    
      
        ∑
        
          i
          =
          0
        
        
          m
          -
          1
        
      
      ⁢
      
        
      
      ⁢
      
        
          Cm
          ⁡
          
            (
            
              i
              ,
              
                m
                +
                n
                -
                1
              
            
            )
          
        
        .
      
    
  




The total number plus one of points preceding the lattice T7,5, will be obtained as follows:

Ig(5,2)→(128−1)+(1+7+21+35+35)+(1)=227.

The global index added to the local index, i.e. the rank of the point in the lattice, gives the total index of the point, which allows the retrieval of the encoded initial vector without storing the degree and dimension of the lattice. It should be noted that the bijective property of encoding and decoding mechanisms comes with a certain price in terms of size and computation time for the generated indices. On this last point, optimized versions of the GLOBAL and LOCAL algorithms will be presented further below as well as several methods for calculating the local index.
The person skilled in the art will appreciate, as illustrated in FIG. 5 in the GLOBAL algorithm, that the variable ind is equivalent to the total number of lattice points preceding the line of the Tm+n,m lattice, and the variable acc is equivalent to the sum of the binomial coefficients on the line of the lattice. The LOCAL decoding function illustrated in FIG. 5 performs the reverse search by locating on Pascal's triangle the line preceding the lattice and then isolating the lattice on the line.
The different recursive formulations of the binomial coefficients allow us to consider the recursive trees calling functions as ordering systems for points of a lattice.
In all cases, the conditions for halting the recursion will be




  
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
    =
    1
  
  ,
  
    k
    =
    r
  
  ,
  
    
      or
      ⁢
      
        
      
      ⁢
      
        (
        
          
            
              r
            
          
          
            
              k
            
          
        
        )
      
    
    =
    1
  
  ,
  
    k
    =
    0
  
  ,




in which case the number of terminal leaves all equal to one will necessarily be equal to the desired binomial coefficient. FIG. 6 illustrates the recursive calls of functions corresponding to the following equations for calculating the binomial coefficient





  
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
    =
    
      
        ∑
        
          i
          =
          0
        
        
          r
          -
          1
        
      
      ⁢
      
        
      
      ⁢
      
        (
        
          
            
              i
            
          
          
            
              
                k
                -
                1
              
            
          
        
        )
      
    
  
  ,
  
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
    =
    
      
        
          ∑
          
            i
            =
            0
          
          
            r
            -
            1
          
        
        ⁢
        
          
        
        ⁢
        
          
            (
            
              
                
                  
                    k
                    +
                    i
                  
                
              
              
                
                  i
                
              
            
            )
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            (
            
              
                
                  r
                
              
              
                
                  k
                
              
            
            )
          
          ⁢
          
            (
            
              
                
                  
                    r
                    -
                    1
                  
                
              
              
                
                  
                    k
                    -
                    1
                  
                
              
            
            )
          
        
      
      +
      
        (
        
          
            
              
                r
                -
                1
              
            
          
          
            
              k
            
          
        
        )
      
    
  




with r≧1, calculating the binomial coefficient





   
  
    
      (
      
        
          
            4
          
        
        
          
            2
          
        
      
      )
    
    .
  




Binomial coefficients corresponding to each node of the tree provide the number of terminal leaves of their respective subtrees. Different algorithms for tree reading or traversal therefore provide indexing algorithms for terminal leaves. By establishing a correspondence between the production of terminal leaves and lattice points, it is possible to obtain an ordering of the latter. In particular, the deep traversal of trees involves processing the root of the tree and recursively traversing the left and right subtrees of the root. In the cases of prefixed or lexicographic depth traversal, the root is processed before the recursive calls on left and right subtrees.

Projective Positional Coding

The representation of numbers in positional notation is used to encode the sequence of homogeneous coordinates representing a point. Let N be the number, ai the symbol i and b the basis of numeration




  N
  =
  
    
      
        ∑
        
          i
          =
          0
        
        n
      
      ⁢
      
        
      
      ⁢
      
        
          a
          i
        
        ⁢
        
          b
          i
        
        ⁢
        
          
        
        ⁢
        with
        ⁢
        
          
        
        ⁢
        0
      
    
    ≤
    
      a
      i
    
    ≤
    
      b
      -
      1.
    
  




The basis of numeration m+1 is used, here m is the degree of the n-dimensional lattice, and ai is the homogeneous coordinate with rank i.
The positional index IP of the point belonging to the lattice with coordinate vector [x0: . . . : xn] is:




  
    I
    p
  
  =
  
    
      
        1
        m
      
      ⁢
      
        
          ∑
          
            i
            =
            0
          
          n
        
        ⁢
        
          
        
        ⁢
        
          
            
              x
              i
            
            ⁡
            
              (
              
                m
                +
                1
              
              )
            
          
          
            n
            -
            i
          
        
      
    
    =
    
      
        
          ∑
          
            i
            =
            0
          
          n
        
        ⁢
        
          
        
        ⁢
        
          (
          
            
              x
              i
            
            ⁢
            
              
                ∑
                
                  j
                  =
                  1
                
                
                  n
                  -
                  i
                
              
              ⁢
              
                
              
              ⁢
              
                
                  (
                  
                    
                      
                        
                          n
                          -
                          j
                        
                      
                    
                    
                      
                        n
                      
                    
                  
                  )
                
                ⁢
                
                  m
                  j
                
              
            
          
          )
        
      
      +
      1.
    
  




FIG. 7 shows the example of the indexing of the two-dimensional cubic curves from FIGS. 2A and 2B. The indices are calculated in base-4. For example, the point [2:0:1] is represented by the index




  
    
      
        2.
        ⁢
        
          
            (
            4
            )
          
          2
        
      
      +
      
        0.
        ⁢
        
          
            (
            4
            )
          
          1
        
      
      +
      
        1.
        ⁢
        
          
            (
            4
            )
          
          0
        
      
    
    3
  
  =
  11.




The maximum index of the lattice being equal to 16 for a total of 10 points, the figure shows a hollow indexing, i.e. having some integers missing in the numbering.

The person skilled in the art will appreciate that the hollow indexing phenomenon is one of the disadvantages of positional coding. Indeed, for a lattice Tm,n, the growth of the ratio ρm,n between the maximum index (m+1)n of positional coding and maximum corresponding index for a combinatorial coding is:




  
    ρ
    
      m
      ,
      n
    
  
  =
  
    
      
        
          (
          
            m
            +
            1
          
          )
        
        n
      
      
        (
        
          
            
              
                m
                +
                n
              
            
          
          
            
              m
            
          
        
        )
      
    
    =
    
      
        
          
            n
            !
          
          ⁢
          
            
              (
              
                m
                +
                1
              
              )
            
            
              n
              -
              1
            
          
        
        
          
            (
            
              m
              +
              2
            
            )
          
          ⁢
          
            (
            
              m
              +
              3
            
            )
          
          ⁢
          
            ...
            ⁡
            
              (
              
                m
                +
                n
              
              )
            
          
        
      
      .
    
  




FIG. 8 illustrates representative curves of ρ depending on the growth of m and n. These allow us to visualize the expansion of the number of digits required for positional coding. We obtain, for example, a value of ρ10,10 equal to




  
    285311670611
    184756
  
  .




The algebraic ring structure for polynomials allows to immediately show the additive homomorphism of positional coding with IP(A+B)=IP(A)+IP(B). Indeed, let us consider the points A with coordinates [a0: . . . : an] and B with coordinates [b0: . . . : bn], using the properties of associativity and distributivity, it is possible to verify the following relationship:




  
    
      I
      p
    
    ⁡
    
      (
      
        A
        +
        B
      
      )
    
  
  =
  
    
      
        
          1
          m
        
        ⁢
        
          
            ∑
            
              i
              =
              0
            
            n
          
          ⁢
          
            
          
          ⁢
          
            
              
                a
                i
              
              ⁡
              
                (
                
                  m
                  +
                  1
                
                )
              
            
            i
          
        
      
      +
      
        
          1
          m
        
        ⁢
        
          
            
              b
              i
            
            ⁡
            
              (
              
                m
                +
                1
              
              )
            
          
          i
        
      
    
    =
    
      
        1
        m
      
      ⁢
      
        
          ∑
          
            i
            =
            0
          
          n
        
        ⁢
        
          
        
        ⁢
        
          
            
              (
              
                a
                +
                b
              
              )
            
            i
          
          ⁢
          
            
              
                (
                
                  m
                  +
                  1
                
                )
              
              i
            
            .
          
        
      
    
  




These properties related to an additive homomorphism equally extend to linear combinations of the type λ0A+λ1B. The coding of point 11 in FIG. 7 is obtained from the linear combination of 1 and 16, with respective weights of 1 and 2 thus giving:



  
    
      
        
          1.1
          +
          2.16
        
        
          1
          +
          2
        
      
      →
      11
    
    ;
  




  
    
      
        
          1.
          ⁡
          
            [
            
              0
              ⁢
              
                :
              
              ⁢
              0
              ⁢
              
                :
              
              ⁢
              3
            
            ]
          
        
        +
        
          2.
          ⁡
          
            [
            
              3
              ⁢
              
                :
              
              ⁢
              0
              ⁢
              
                :
              
              ⁢
              0
            
            ]
          
        
      
      
        1
        +
        2
      
    
    →
    
      
        [
        
          2
          ⁢
          
            :
          
          ⁢
          0
          ⁢
          
            :
          
          ⁢
          1
        
        ]
      
      .
    
  



Coding in Numeric Order

The definition of numeric order suggests a simple algorithm for computing the index of a projective point based on the counting, column after column, of the position of that point's coordinates. The leftmost nonzero difference in the exponent vectors of two projective points vmα−vmβ being negative, one simply has to count from left to right, column after column, the index of each coordinate, and to then carry out the summation in order to find the final index of the point. For example, to calculate the index of the point [1:2:1:0] of the lattice T4,3 in FIG. 11, fifteen zeros before the number 1 of the first column will be counted, four zeros with three number 1's before the number 2 of the second column and one zero before the number 1 of the third column. The index 23 or 11=(34−23) will be obtained according to the chosen indexing convention, i.e. ascending or descending.
It will be appreciated that the lattices Tm,n are recursively decomposed into sub-lattice, Tm,n, Tm−1,n−1, . . . , T0,n−1, which involves the decomposition of the representative polynomial of a hypersurface into hypersurfaces polynomials of decreasing degrees in the lower dimensional space.
In addition, vectors of exponents are grouped in m+1 tables corresponding to monomials of polynomials representing the hypersurfaces of decreasing degree. FIG. 11 shows the decomposition by tables of a lattice (4.3). The last three columns represent exponent vectors of the lattices (4,2), (3,2), (2,2), (1,2) and (0,2).
Finally, the generated tables are, in turn, broken down into tables with lower dimension and so forth. The last two columns of the exponent vectors thus represent the monomials of homogeneous polynomials in 1 dimension.




  
    I
    n
  
  =
  
    
      ∑
      
        i
        =
        1
      
      n
    
    ⁢
    
      
    
    ⁢
    
      
        Cm
        ⁡
        
          (
          
            
              m
              -
              1
              -
              
                
                  ∑
                  
                    j
                    =
                    1
                  
                  i
                
                ⁢
                
                  
                
                ⁢
                
                  vn
                  ⁡
                  
                    [
                    j
                    ]
                  
                
              
            
            ,
            
              n
              +
              1
              -
              i
            
          
          )
        
      
      .
    
  




The NUMORD algorithm, shown in FIG. 10, corresponds to the previous contracted equation. The second loop destined to accumulate iteratively the degree of the exponent vector is indeed absorbed within the first loop by instruction 4.
In order to simplify the programming code, the projective dimension equal to the vector length, minus one, is supplied as argument. By means of an example, FIG. 11 allows to visualize, step by step, the execution of the NUMORD function.

NUMORD([1,0,2,1,1,1],5)→{210}num 

The index {210}num5 is the result of the summation of pyramidal numbers performed at lines 1-6 of the algorithm in FIG. 10.





  〈
  
    
      (
      
        
          
            9
          
        
        
          
            5
          
        
      
      )
    
    ,
    
      (
      
        
          
            8
          
        
        
          
            4
          
        
      
      )
    
    ,
    
      (
      
        
          
            5
          
        
        
          
            3
          
        
      
      )
    
    ,
    
      (
      
        
          
            3
          
        
        
          
            2
          
        
      
      )
    
    ,
    
      (
      
        
          
            1
          
        
        
          
            1
          
        
      
      )
    
  
  〉




This sequence shows the concept of pyramidal composition of the numeric index, illustrated using the table and Pascal's triangle in FIG. 11. The decoding of calculated indices, as presented earlier, will be essentially based on the principle of pyramidal decomposition of the proposed number, i.e. the search for the cascading sequence of the pyramidal numbers which composes it.
The following examples for indexing points belonging to lattices T4,3, T6,4, T55,9, and T54,9 illustrate in particular the non bijective nature of the numeral coding.

NUMORD([1,2,1,0],3)→{11}num 

NUMORD([4,0,1,0,1],4)→{11}num 

NUMORD([1,2,3,4,5,6,7,8,9,10],9)→{22724037001}num 

NUMORD([0,2,3,4,5,6,7,8,9,10],9)→{22724037001}num















i
x[i]
ind
m
n



















1
1
84
6
5


2
0
14
5
4


3
2
4
5
3


4
1
1
3
2


5
1
0
2
1









Decoding in Numeric Order

The decoding algorithm is based on reversing the indexing the process featured in lines 1 to 6 of the NUMORD function. The objective for calculating the numeric signature vm of the exponents is to first find the successive pyramidal numbers that were used to calculate the Numeric index. To find the greatest pyramidal number used in the composition Imnum, we must look for the largest pyramidal number which is less than or equal to it in column m of Pascal's triangle. Once this number is found along with his rank in the column, the first exponent of the sought signature is obtained and this is done from column to column by decreasing each time the starting index. These steps are illustrated by the table above with the calculation of the numeric signature {210}5. The last exponent of the signature is calculated simply by subtracting the sum of the exponents found from the degree of the index.
The following examples illustrate the enumeration of T4,3, lattice points from FIG. 11, indexed from 0 to 34=Cr(4,3)−1, and the enumeration of the lattice points in FIGS. 2A and 2B, indexed from 0 to 9=Cr(3,2)−1.

ORDNUM([34−k,4,3])→[0,0,0,4],[0,0,1,3], . . . [4,0,0,0],k=0, . . . , 34

ORDNUM([9−k,3,2])→[0,0,3],[0,1,2], . . . [3,0,0],k=0, . . . , 9

Coding in Lexicographic Order

In order to perform coding in lexicographic order, the lattice is decomposed into sub-lattices Tm−1,n−1, Tm−1,n−2, . . . , Tm−1,0, which is equivalent to decomposing the representative polynomial of a hypersurface into polynomials of hypersurfaces having lesser degrees and belonging to lesser dimensions. Next, the vm index vectors are grouped into n tables corresponding to monomials of polynomials representing hypersurfaces of decreasing degree. FIG. 13 shows the decomposition by tables of the lattice T4,3. The 4 tables respectively correspond to lattices T3,3, T3,2, T3,1, and T3,0, belonging to cubics in dimensions n=3, . . . , 0. Finally, generated tables are in turn broken down into lower degree tables in decreasing dimensions.




  
    I
    l
  
  =
  
    
      ∑
      
        i
        =
        0
      
      
        m
        -
        1
      
    
    ⁢
    
      
    
    ⁢
    
      
        C
        n
      
      ⁡
      
        (
        
          
            m
            -
            i
          
          ,
          
            n
            -
            1
            -
            
              vm
              ⁡
              
                [
                
                  i
                  +
                  1
                
                ]
              
            
          
        
        )
      
    
  




FIG. 13 illustrates the block decomposition of a lattice (4, 3). The signatures of length 4 beginning with either x0, x1, x2, or x3 form four blocks with




  
    
      (
      
        
          
            
              4
              +
              3
              -
              1
            
          
        
        
          
            3
          
        
      
      )
    
    =
    20
  
  ,
  
    
      (
      
        
          
            
              4
              +
              2
              -
              1
            
          
        
        
          
            2
          
        
      
      )
    
    =
    10
  
  ,
  
    

  
  ⁢
  
    
      (
      
        
          
            
              4
              +
              1
              -
              1
            
          
        
        
          
            1
          
        
      
      )
    
    =
    4
  
  ,
  
    
  
  ⁢
  
    
      and
      ⁢
      
        
      
      ⁢
      
        (
        
          
            
              
                4
                +
                0
                -
                1
              
            
          
          
            
              0
            
          
        
        )
      
    
    =
    1
  




as their respective sizes. The signature vm=1,1,2,3 has the following for index:

C(4,(3−1)−1)+C(3,(3−1)−1)+C(2,(3−1)−2)+C(1,(3−1)−3)={10}lex.

The execution of the LEXORD([0,1,1,2],4,3)→{23})lex function is shown in the following table:


















Comb


i
acci
m-i
d-vm[i + 1]
(m, d-i + 1)







0
15
4
2




  
    (
    
      
        
          6
        
      
      
        
          2
        
      
    
    )
  
  =
  15






 


1
19
3
1




  
    (
    
      
        
          4
        
      
      
        
          1
        
      
    
    )
  
  =
  4






 


2
22
2
1




  
    (
    
      
        
          3
        
      
      
        
          1
        
      
    
    )
  
  =
  3






 


3
23
1
0




  
    (
    
      
        
          1
        
      
      
        
          0
        
      
    
    )
  
  =
  1













The LEXORD algorithm is described in FIG. 14.
Decoding in Lexicographic Order
The ORDLEX algorithm which allows to perform decoding in lexicographic order is described in FIG. 15.
The following examples illustrate the enumeration of the lattice points of FIG. 13, indices . . . then the enumeration of the lattice points in FIG, indices . . . .

ORDLEX([34−k,4,3])→[0,0,0,0],[0,0,0,1], . . . [3,3,3,3],k=0, . . . ,34.

ORDLEX([9−k,3,2])→[0,0,0],[0,0,1], . . . [2,2,2],k=0, . . . ,9.

Gray's Projective Encoding

The sum of the variations between consecutive codes generated for numeric encoding is non constant. For example, the sum of the variations between the codes 34 and 33 of the lattice T4,3 is equal to 0, 0, 0, 4−0, 0, 1, 3→0 while being equal to 0, 0, 4, 0−0, 1, 0, 3→1 between the codes 30 and 29. Gray's projective encoding eliminates these differences of variations, and generally removes the jumps between non-consecutive points a lattice. The distance between these points on the lattice is in fact greater than one. The principle of projective Gray encoding is essentially a substitution of subtrees having an odd indexing by their symmetric in the recursive tree. This replacement being recursive, the operation will be repeated for each leaf, as long as its successive parents will have an odd indexing. Therefore, sub-trees with an even number of successive odd parents will not have to be changed, two symmetric substitutions cancelling each other out.
It will be appreciated that in projective Gray coding, the sum of the exponents of the Vni+1,−Vni vector obtained from two consecutive points is null, and the Hamming distance between two consecutive exponent vectors is equal to 2.
FIG. 16 illustrates a projective Gray coding for the lattice (4,3).
The algorithm shown in FIG. 17 is a modified version of the algorithm illustrated in FIG. 10. Line 4 tests the parity of each exponent of the input signature (type 0 function). In the case of an odd exponent, the indexing is reversed on line 7 and the variable s changes sign. Its value being equal to 1 or −1 allows taking into account the even or odd number of already processed exponents, and thus identifying sub-trees with an even number of the successive parents with odd parity, who then do not need be changed.
FIG. 18 illustrates the path of the T4,3 lattice points in projective Gray coding. The different sections show a succession of paths, which will be named boustrophedon Cantor paths. The indexing in projective Gray coding of the point 10 for the lattice T6,4 and the lattice T2,4 is obtained as follows:

GRAORD([4,0,1,0,1],4)→{10}gra;

GRAORD([0,0,1,0,1],4)→{10}gra.

Projective Gray Decoding

An implementation of Gray's projective decoding algorithm is illustrated in FIG. 19 by the ORDGRA function.
The following example illustrates the enumeration of T4,3 lattice points from FIG. 16 indexed from 0 to 34=Cr(4,3)−1:

ORDGRA([34−k,4,3])→+[0,0,0,4], . . . [3,0,0,1],[4,0,0,0,0],k=0, . . . ,34.

Direct and Dual Transcoding

It will be appreciated that the operation of transcoding a coding system to another, can be achieved by changing any of them, by simple conversion between the exponent vector Vn and the coordinate vector Vm, or by a direct equivalence between indexing functions. In the first case, we shall be speaking about dual transcoding, performed by two functions, VN2VM and VM2VN, and we shall have the following equivalences formed from the lexicographic and Numeric signatures:

Snum[Cm(m,n)−i]=VmVn(Slex[i−1]);

Slex[Cm(m,n)−i]=VnVm(Snum[i−1]).

For example, if:

Snum[Cm(7,4)−168]=[1,1,4,1,0] et Slex[168−1]=[0,1,2,2,2,2,3], il sera obtenu:[1,1,4,1,0]←VM2VN([0,1,2,2,2,2,3]).

Transcoding between vectors is shown in FIG. 20.

Recursive Production of an Ordering

Given the symmetry of Pascal's triangle




  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    (
    
      
        
          r
        
      
      
        
          
            r
            -
            k
          
        
      
    
    )
  




and the equivalences between the recursive decompositions by column and diagonal, a recursive tree is associated with two symmetric binomial coefficients. FIG. 21 shows the recursive structure





   
  
    (
    
      
        
          6
        
      
      
        
          4
        
      
    
    )
  




identical to that of





   
  
    
      (
      
        
          
            6
          
        
        
          
            2
          
        
      
      )
    
    .
  




The nodes a(i,j) are indexed with width i and depth j and number of leaves of the corresponding subtrees are directly calculated from i and j. Any function I(i,j) then allows labeling of the tree nodes and produces a type of ordering for the terminal leaves of the tree. If one opts for the same tree traversal both lexicographic and prefix, we then obtain the indexing in Numeric order for a quartic curve in two dimensions





   
  
    
      (
      
        
          
            6
          
        
        
          
            4
          
        
      
      )
    
    ,
  




or the indexing in lexicographic order of an hyperquadric in four dimensions





   
  
    (
    
      
        
          6
        
      
      
        
          2
        
      
    
    )
  




or finally the indexing in lexicographic order of 4-combinations without repetition for 6 objects. The recursive generation of an ordering therefore ends up associating with a binomial coefficient, a triplet consisting of a traversal order of the recursive tree, a function for indexing the nodes of the tree and finally a selection of the combination type with or without repetitions.

Indexing Functions of Recursive Trees

The Numeric indexing, i.e. Numlex and combinatorial functions, may be derived sequentially from one another. The resulting geometric interpretation uses transformations between projective, affine and Euclidean spaces.
Numeric and Numlex Orderings
The algorithm for the Numeric index consists of incrementing the indices of the nodes having the same level, starting from zero, as long as they have the same parent. Hence, the traversal of the tree is realized from left to right and from top to bottom. The index of the last level is obtained by deducting the sum of the indices of the previous levels of the degree of the tree, which ensures the homogeneity of the produced numeric points. To move from numeric encoding space to numlex encoding space, we must use transition matrices N2Xn that match the vertices of simplexes of numeric projective spaces with the vertices of projective subspaces with monotonically increasing sequences for coordinates. For example, the vertex [1:0:0:0] of a 3-dimensional projective simplex is associated with the vertex [1, 1, 1, 1]. The matrix multiplication of an n-dimensional projective point with the matrix N2Xn−1 generates in all cases a point with increasing coordinates. Noting X2Nn the matrix inverse which allows going from a NUMLEX space to a numeric space, the following transition matrices will be obtained.




  
    
      N
      ⁢
      
        
      
      ⁢
      2
      ⁢
      X
    
    =
    
      [
      
        
          
            1
          
          
            1
          
          
            1
          
          
            ...
          
          
            1
          
        
        
          
            0
          
          
            1
          
          
            1
          
          
            ...
          
          
            1
          
        
        
          
            0
          
          
            0
          
          
            1
          
          
            ...
          
          
            1
          
        
        
          
            ⋮
          
          
            ⋮
          
          
            ⋮
          
          
            ⋱
          
          
            ⋮
          
        
        
          
            0
          
          
            0
          
          
            0
          
          
            ...
          
          
            1
          
        
      
      ]
    
  
  ,
  
    
      X
      ⁢
      
        
      
      ⁢
      2
      ⁢
      N
    
    =
    
      [
      
        
          
            1
          
          
            
              -
              1
            
          
          
            0
          
          
            ...
          
          
            0
          
        
        
          
            0
          
          
            1
          
          
            
              -
              1
            
          
          
            ...
          
          
            0
          
        
        
          
            0
          
          
            0
          
          
            1
          
          
            ...
          
          
            0
          
        
        
          
            ⋮
          
          
            ⋮
          
          
            ⋮
          
          
            ⋱
          
          
            ⋮
          
        
        
          
            0
          
          
            0
          
          
            0
          
          
            ...
          
          
            1
          
        
      
      ]
    
  




For example, the Numeric projective point [α0:α1:α2:α3] will therefore transformed into a NUMLEX point [α0,α0+α1,α0+α1+α2,α0+α1+α2+α3] by the matrix product with the matrix N2X3. The point [5:2:0:4] will in turn transformed into the NUMLEX point [5:7:7:11] and his lexicographic index will be calculated from its coordinates as follows:




  
    
      (
      
        
          
            
              4
              +
              
                (
                
                  11
                  -
                  1
                
                )
              
            
          
        
        
          
            4
          
        
      
      )
    
    +
    
      (
      
        
          
            
              3
              +
              
                (
                
                  7
                  -
                  1
                
                )
              
            
          
        
        
          
            3
          
        
      
      )
    
    +
    
      (
      
        
          
            
              2
              +
              
                (
                
                  7
                  -
                  1
                
                )
              
            
          
        
        
          
            2
          
        
      
      )
    
    +
    
      (
      
        
          
            
              1
              +
              
                (
                
                  5
                  -
                  1
                
                )
              
            
          
        
        
          
            1
          
        
      
      )
    
  
  =
  
    
      1001
      +
      84
      +
      28
      +
      5
    
    =
    1118.
  




Numeric and Combinatorial Orders

We move from the Numeric order to the combinatorial order by performing a linear combination between the NUMLEX points and the point [0, 1, 2, . . . , n−2, n−1]. This is equivalent to adding each coordinate of the NUMLEX point with his rank, equivalent to the level in the recursive tree. FIG. 24 illustrates the presence of the combinatorial subspace for 3-combinations for the unit simplex in projective space in three dimensions.
This subspace is represented by the vertices of its own simplex, obtained by projective linear transformation of the vertices belonging to the unit simplex in the projective starting space. The following linear transformation is obtained:




  
    [
    
      
        
          1
        
        
          0
        
        
          0
        
        
          0
        
      
      
        
          0
        
        
          1
        
        
          0
        
        
          0
        
      
      
        
          0
        
        
          0
        
        
          1
        
        
          0
        
      
      
        
          0
        
        
          0
        
        
          0
        
        
          1
        
      
    
    ]
  
  ->
  
    
      [
      
        
          
            1
          
          
            2
          
          
            3
          
          
            4
          
        
        
          
            0
          
          
            2
          
          
            3
          
          
            4
          
        
        
          
            0
          
          
            1
          
          
            3
          
          
            4
          
        
        
          
            0
          
          
            1
          
          
            2
          
          
            4
          
        
      
      ]
    
    .
  




The points belonging to the combinatorial space and obtained by any combination of two of the vertices of the simplex have therefore coordinates belonging to a strictly increasing sequence. It is possible to establish the following equivalence theorem:
The indexing of a k-combination for an r-alphabet {0, . . . , r−1} is equivalent, by projective transformation, to the numeric indexing of the lattice Tr−k,k.
FIG. 25 illustrates the numeric indexing of a lattice T2,3 equivalent to the indexing of




   
  
    (
    
      
        
          5
        
      
      
        
          3
        
      
    
    )
  




3-combinations from an 5-alphabet 0, . . . , 4. In higher dimensions, for example, the 2172 numeric point with the following coordinates [2, 4, 1, 2, 0, 3] belonging to the lattice T12,5 is converted into numlex point [2, 6, 7, 9, 9, 12] by multiplication with the matrix N2X5, and is then added with the point [0, 1, 2, 3, 4] to give the combinatorial point [2, 7, 9, 12, 13, 17]. It is possible to verify that the position of the combination [2, 7, 9, 12, 13] for the alphabet 0, 1, . . . , 17−1 is indeed





  2172
  =
  
    
      (
      
        
          
            
              17
              -
              3
            
          
        
        
          
            5
          
        
      
      )
    
    +
    
      (
      
        
          
            
              17
              -
              8
            
          
        
        
          
            4
          
        
      
      )
    
    +
    
      (
      
        
          
            
              17
              -
              10
            
          
        
        
          
            3
          
        
      
      )
    
    +
    
      (
      
        
          
            
              17
              -
              13
            
          
        
        
          
            2
          
        
      
      )
    
    +
    
      
        (
        
          
            
              
                17
                -
                14
              
            
          
          
            
              1
            
          
        
        )
      
      .
    
  




The equivalence between the Numeric and combinatorial algorithms enables to use the ORDNUM numeric coding, as fast algorithms allowing the generation of combinations. Those above, particularly, are based on enumerative algorithms of type HAKMEM175 (R. Schroeppel, M. Beeler, R. W. Gosper. Hakmem. Technical report, Massachusetts Institute of Technology, 1972), which allow to generate a new combinations from the previous combination, represented in binary form. Because this type of algorithm, to generate the combinations, enumerates in ascending order, the numbers having the same number of bits 1 in their binary representation, the result is that the optimized algorithm ORDNUM can also be used for this purpose. FIG. 26 illustrates the enumerative generation of projective points for a lattice T2,3 corresponding to a 3-dimensional quadric. The 10 points, by projective transformation in combinatorial subspace, form the 3-combinations taken from a set of 5 in the alphabet 0, . . . , 4. The relationship with the binary representation of combinations calculated with the HAKMEM algorithm ensues with a transposition of the indices for the combinations listed in a decreasing order in the direction of reading.
Numeric and Cantor Orders.
Using the previous results, it is possible to transcode the Cantor's coding from the numeric coding by moving from the projective space to Euclidean space. Using the matrix notation, the transformation from a numeric point [α0:α1: . . . : αn] of projective space into Euclidean space is in fact made by the product of this point by the transition matrix P2E where |α| is the degree of the point. The matrix E2P will allow the reverse operation to go from Euclidean space to projective space:




  
    
      P
      ⁢
      
        
      
      ⁢
      2
      ⁢
      E
    
    =
    
      [
      
        
          
            1
          
          
            0
          
          
            0
          
          
            ...
          
          
            
              1
              
                
                α
                
              
            
          
        
        
          
            0
          
          
            1
          
          
            0
          
          
            ...
          
          
            
              1
              
                
                α
                
              
            
          
        
        
          
            0
          
          
            0
          
          
            1
          
          
            ...
          
          
            
              1
              
                
                α
                
              
            
          
        
        
          
            ⋮
          
          
            ⋮
          
          
            ⋮
          
          
            ⋱
          
          
            ⋮
          
        
        
          
            0
          
          
            0
          
          
            0
          
          
            ...
          
          
            
              1
              
                
                α
                
              
            
          
        
      
      ]
    
  
  ,
  
    
      E
      ⁢
      
        
      
      ⁢
      2
      ⁢
      P
    
    =
    
      
        [
        
          
            
              1
            
            
              0
            
            
              0
            
            
              ...
            
            
              
                -
                1
              
            
          
          
            
              0
            
            
              1
            
            
              0
            
            
              ...
            
            
              
                -
                1
              
            
          
          
            
              0
            
            
              0
            
            
              1
            
            
              ...
            
            
              
                -
                1
              
            
          
          
            
              ⋮
            
            
              ⋮
            
            
              ⋮
            
            
              ⋱
            
            
              ⋮
            
          
          
            
              0
            
            
              0
            
            
              0
            
            
              ...
            
            
              
                
                α
                
              
            
          
        
        ]
      
      .
    
  




The result is the following homogeneous point:




  
    [
    
      
        α
        0
      
      :
      
        
          α
          1
        
        :
        
          ...
          :
          
            
              (
              
                
                  α
                  0
                
                +
                
                  α
                  1
                
                +
                ...
                +
                
                  α
                  n
                
              
              )
            
            
              
              α
              
            
          
        
      
    
    ]
  
  ≡
  
    
      [
      
        
          α
          0
        
        :
        
          
            α
            1
          
          :
          
            ...
            :
            
              
                α
                
                  n
                  -
                  1
                
              
              :
              1
            
          
        
      
      ]
    
    .
  




The Euclidean point obtained by eliminating the last coordinate equal to 1, [α0:α1: . . . : αn−1] is then the point of Cantor in the n−1 dimension. Therefore, an equivalence is established, between the Cantor coding of the reverse list K(xk, . . . , x1) and the numeric encoding. To do so, it will be noted that the Cantor recursive tree is obtained by removing the last level of the numeric recursive tree, i.e. the level that allows the homogeneous representation of the numeric point.




  
    
      K
      ⁡
      
        (
        
          
            x
            n
          
          ,
          ...
          ⁢
          
            
          
          ,
          
            x
            1
          
        
        )
      
    
    =
    
      
        
          I
          num
        
        ⁡
        
          (
          
            
              x
              1
            
            ,
            ...
            ⁢
            
              
            
            ,
            
              x
              n
            
          
          )
        
      
      +
      
        (
        
          
            
              
                m
                +
                n
                -
                1
              
            
          
          
            
              n
            
          
        
        )
      
    
  
  ,
  
    m
    =
    
      
        ∑
        
          i
          =
          1
        
        n
      
      ⁢
      
        
      
      ⁢
      
        
          x
          i
        
        .
      
    
  




By continuing the example:




  
    
      
        K
        ⁡
        
          (
          
            1
            ,
            3
            ,
            2
            ,
            4
          
          )
        
      
      ->
      
        
          (
          
            
              
                
                  10
                  +
                  4
                  -
                  1
                
              
            
            
              
                4
              
            
          
          )
        
        +
        
          (
          
            
              
                
                  6
                  +
                  4
                  -
                  2
                
              
            
            
              
                3
              
            
          
          )
        
        +
        
          (
          
            
              
                
                  4
                  +
                  4
                  -
                  3
                
              
            
            
              
                2
              
            
          
          )
        
        +
        
          (
          
            
              
                
                  1
                  +
                  4
                  -
                  4
                
              
            
            
              
                1
              
            
          
          )
        
      
    
    =
    782
  
  ,




it is possible to check that





  
    I
    num
  
  =
  
    
      67
      +
      
        (
        
          
            
              
                10
                +
                4
                -
                1
              
            
          
          
            
              4
            
          
        
        )
      
    
    =
    782.
  




It should be noted that the first term of the equation:





  
    
      K
      ⁡
      
        (
        
          1
          ,
          3
          ,
          2
          ,
          4
        
        )
      
    
    ->
    
      
        (
        
          
            
              
                10
                +
                4
                -
                1
              
            
          
          
            
              4
            
          
        
        )
      
      +
      
        (
        
          
            
              
                6
                +
                4
                -
                2
              
            
          
          
            
              3
            
          
        
        )
      
      +
      
        (
        
          
            
              
                4
                +
                4
                -
                3
              
            
          
          
            
              2
            
          
        
        )
      
      +
      
        (
        
          
            
              
                1
                +
                4
                -
                4
              
            
          
          
            
              1
            
          
        
        )
      
    
  
  =
  782




must be subtracted to obtain an indexing of the lattice points in the range between 0 and the total number of points.

The equation




  
    (
    
      
        
          
            r
            -
            
              a
              i
            
          
        
      
      
        
          k
        
      
    
    )
  
  =
  
    (
    
      
        
          
            m
            -
            1
            -
            
              
                ∑
                
                  j
                  =
                  1
                
                i
              
              ⁢
              
                
              
              ⁢
              
                vn
                ⁡
                
                  [
                  j
                  ]
                
              
            
          
        
      
      
        
          
            n
            +
            1
            -
            i
          
        
      
    
    )
  




is used to obtain the second equivalence K(xn, . . . , x2)=Inum(x1, . . . , xn), which establishes a relationship between the Cantor encoding for a list, the numeric encoding of the reverse list preceded by any integer. This equivalence is illustrated by the following example which allows to find the Cantor coding K3 from the function NUMORD([x0, x1, x2, x3], 3) used in symbolic mode:





  
    
      
        K
        3
      
      =
      
        
          
            m
            0
          
          1
        
        +
        
          
            
              m
              1
            
            ⁡
            
              (
              
                
                  m
                  1
                
                +
                1
              
              )
            
          
          2
        
        +
        
          
            
              
                m
                2
              
              ⁡
              
                (
                
                  
                    m
                    2
                  
                  +
                  1
                
                )
              
            
            ⁢
            
              (
              
                
                  m
                  2
                
                +
                2
              
              )
            
          
          6
        
      
    
    ;
    
      
        with
        ⁢
        
          
        
        ⁢
        
          m
          0
        
      
      =
      
        x
        ⁢
        
          
        
        ⁢
        3
      
    
  
  ,
  
    
      m
      1
    
    =
    
      
        m
        0
      
      +
      
        x
        ⁢
        
          
        
        ⁢
        2
      
    
  
  ,
  
    
      m
      2
    
    =
    
      
        m
        1
      
      +
      
        x
        ⁢
        
          
        
        ⁢
        1.
      
    
  




Taxonomy and Hamiltonian Order

Previous equivalences allow to establish a taxonomy of the coding systems which correspond to different orders of indexing. FIG. 28 shows the numlex orders, and combinatorial as special cases of numeric order, while the Cantor order is itself a special case of the combinatorial order. It is possible to extend this classification by introducing a Hamiltonian order which will also include the order of projective Gray, himself regarded as a generalization of the Cantor boustrophedon order. New orders based on spiral curves filling the space will be described below.
Searching Hamiltonian Chains on the Lattice
The person skilled in the art will appreciate that the local indexing for a lattice depends on the type of visiting path for all its points. Some of these methods include in particular those associated with the theory of space-filling curves.
Spiraled Cartesian Pairing Function
The function of spiral pairing shown in FIG. 31 allows indexing of integer pairs. The Cartesian plane is traversed in a spiral manner as illustrated in FIG. 31. In this case, polynomials for indexing the pairs of coordinates in the coordinate plane must be searched.
It will be appreciated that the generation of the spiral takes place iteratively by means of a 45 degree set square, turned of π/2, then changed of scale, then translated of one unit, so as to ensure the continuity of the curve.




  
    Z
    ⁡
    
      (
      
        x
        ,
        y
      
      )
    
  
  =
  
    {
    
      
        
          
            
              4
              ⁢
              
                x
                2
              
            
            -
            
              3
              ⁢
              x
            
            +
            y
          
        
        
          
            
              si
              ⁢
              
                
              
              ⁢
              x
            
            >
            
              0
              ⁢
              
                
              
              ⁢
              et
              ⁢
              
                
                  
                
                ⁢
                
                  
                
              
              ⁢
              
                
                y
                
              
            
            <=
            
              
              x
              
            
          
        
      
      
        
          
            
              4
              ⁢
              
                y
                2
              
            
            -
            y
            -
            x
          
        
        
          
            
              si
              ⁢
              
                
                  
                
                ⁢
                
                  
                
              
              ⁢
              y
            
            >
            
              0
              ⁢
              
                
              
              ⁢
              et
              ⁢
              
                
                  
                
                ⁢
                
                  
                
              
              ⁢
              
                
                x
                
              
            
            <=
            
              
              y
              
            
          
        
      
      
        
          
            
              4
              ⁢
              
                x
                2
              
            
            -
            x
            -
            y
          
        
        
          
            
              si
              ⁢
              
                
              
              ⁢
              x
            
            <
            
              0
              ⁢
              
                
              
              ⁢
              et
              ⁢
              
                
              
              ⁢
              
                
                y
                
              
            
            <=
            
              
              x
              
            
          
        
      
      
        
          
            
              4
              ⁢
              
                y
                2
              
            
            -
            
              3
              ⁢
              y
            
            +
            x
          
        
        
          
            
              si
              ⁢
              
                
              
              ⁢
              y
            
            <
            
              0
              ⁢
              
                
              
              ⁢
              et
              ⁢
              
                
              
              ⁢
              
                
                x
                
              
            
            <=
            
              
              y
              
            
          
        
      
    
  




Point 44 has 6 as integer square root, which corresponds to the sixth set square of the spiral having the point 36=6.6 as a vertex. The point 44 is located between the vertex 36 (even square) and the following vertex 49 (odd square). Being greater than the angular intermediate point 42=7.6, it is located on the lower horizontal section of the spiral. The variables i and j are then calculated from the angular intermediate point 42, i is therefore calculated from the formula for the index of the lower left corner of the spiral IBg=2i(2i+1)=42, i=3 and j is calculated from the difference between the given number and the lower left index, i.e. j=44−42=2. The calculation of the pair [x,y] is completed by bringing the values i and j in the preceding formulas j=x+i and i=−y. The final result is [x,y]=[j−i,−i]=[−1,−3]. The following example illustrates the use of both encoding and decoding functions SPIORDc and ORDSPIc, using the spiral manner in the Cartesian plane.

SPIORDc([−1509123456789,82739987654321])→{27383622228148684752295686632}se 

ORDSPIc(27383622228148684752295686632)→[−1509123456789,82739987654321]

Affine Function for the Spiral Pairing

FIG. 32 describes an implementation of an algorithm SPIORDc for Cartesian encoding and ORDSPIc for Cartesian spiral decoding.




  
    Z
    ⁢
    
      (
      
        x
        ,
        y
      
      )
    
  
  =
  
    {
    
      
        
          
            
              
                y
                ⁡
                
                  (
                  
                    
                      9
                      ⁢
                      y
                    
                    -
                    7
                  
                  )
                
              
              2
            
            +
            x
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              y
            
            <
            
              0
              ⁢
              
                
              
              ⁢
              and
              ⁢
              
                
              
              ⁢
              x
            
            <=
            
              2
              ⁢
              y
            
          
        
      
      
        
          
            
              
                x
                ⁡
                
                  (
                  
                    
                      9
                      ⁢
                      x
                    
                    -
                    7
                  
                  )
                
              
              2
            
            +
            y
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              x
            
            >
            
              0
              ⁢
              
                
              
              ⁢
              and
              ⁢
              
                
              
              ⁢
              y
            
            <=
            
              2
              ⁢
              
                x
                o
              
            
          
        
      
      
        
          
            
              (
              
                
                  9
                  ⁢
                  
                    
                      (
                      
                        x
                        -
                        y
                      
                      )
                    
                    2
                  
                
                -
                x
                -
                y
              
              )
            
            2
          
        
        
          otherwise
        
      
    
  




FIG. 33 describes an implementation of an encoding algorithm SPIORDa and of the decoding algorithm ORDSPIa, both using the spiral manner in the affine plane.
Projective Function of Spiral Pairing
It is possible to construct a spiral order in n dimensions by recursively defining some chains of chains of spiral curves, the first spiral curves being one-dimensional, then two-dimensional and so on. FIG. 34 shows a spiral order of a lattice (6,4) for a sextic surface in 3 dimensions. The junctions between the two-dimensional spirals which are stacked, are alternated, sometimes between the beginnings and sometimes between the ends of the spirals. To obtain spiral chains in four dimensions, we must glue together spiral lattices in 3-dimensions, first with a point, then a lattice (0,4) then a lattice (1,4), then a lattice (2,4), etc.
Optimizations for Calculating Binomial Coefficients
The person skilled in the art will appreciate that fast calculation of binomial coefficients is essential in all encoding and decoding functions presented herein. The recursive or iterative functions based on the simple relations attached to the Pascal's triangle are excellent candidates for the fast calculation of binomial coefficients of a small size. They are no longer sufficient for calculations involving large integers and should be improved or replaced. It is the reason why optimized versions and algorithmic improvements, essential to reducing computational time will be presented below.
Recursive Formulation
The recursive formulation of additive type




  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    
      
        (
        
          
            
              
                r
                -
                1
              
            
          
          
            
              
                k
                -
                1
              
            
          
        
        )
      
      +
      
        
          (
          
            
              
                
                  r
                  -
                  1
                
              
            
            
              
                k
              
            
          
          )
        
        ⁢
        
          
        
        ⁢
        with
        ⁢
        
          
        
        ⁢
        r
      
    
    ≥
    1
  




is the basis for the construction of Pascal's triangle. In this case, the recursive binary tree has many associated redundant branches and has a maximum depth of r−1. These properties give to the algorithm a time complexity of order equivalent to the binomial coefficient





   
  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  




itself. Consequently, the computation time becomes immediately prohibitive and can be only controlled by using call tables that store the called functions, their arguments and results. This mechanism of optimization borrowed from the theory of compilation is contained in particular in the MAPLE symbolic language and can break the computational complexity by eliminating redundant calls present in the recursive calculation of binomial coefficients or also in the Fibonacci numbers. By passing to an additive-multiplicative generalizing formula





  
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
    =
    
      
        
          (
          
            
              
                
                  r
                  -
                  1
                
              
            
            
              
                
                  k
                  -
                  1
                
              
            
          
          )
        
        +
        
          
            (
            
              
                
                  
                    r
                    -
                    1
                  
                
              
              
                
                  k
                
              
            
            )
          
          ⁢
          
            
          
          ⁢
          with
          ⁢
          
            
          
          ⁢
          r
        
      
      ≥
      1
    
  
  ,




a new recursive formulation of maximum depth r−k which minimizes redundant calls, will be presented. It will be shown that this approach can be considered as a variant of the optimized recursive version for the Vandermonde convolution. Applying formula





  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    
      
        (
        
          
            
              
                r
                -
                1
              
            
          
          
            
              
                k
                -
                1
              
            
          
        
        )
      
      +
      
        
          (
          
            
              
                
                  r
                  -
                  1
                
              
            
            
              
                k
              
            
          
          )
        
        ⁢
        
          
        
        ⁢
        with
        ⁢
        
          
        
        ⁢
        r
      
    
    ≥
    1
  




repetitively on the binomial coefficients of the isosceles rectangle triangle, with sides of dimension equal to d, the following relation is obtained:





  
    (
    
      
        
          r
        
      
      
        
          s
        
      
    
    )
  
  =
  
    
      ∑
      
        i
        =
        0
      
      
        k
        ≤
        s
      
    
    ⁢
    
      
        (
        
          
            
              
                r
                -
                k
              
            
          
          
            
              
                s
                -
                i
              
            
          
        
        )
      
      ⁢
      
        
          (
          
            
              
                k
              
            
            
              
                i
              
            
          
          )
        
        .
      
    
  




The latter is obtained by observing, as shown in FIG. 35, that the binomial coefficient to the lower tip of the triangle may be calculated from the binomial coefficients of any of the above lines. This can be done by multiplying the binomial coefficients of this line with a suitable scaling factor, for example a0=1·d0+3·d1+3·d2+1·d3. These multiplicative factors due to redundancy of the binary recursive formula 8 which is applied line by line, and one binomial coefficient after the other, are simply the binomial coefficients of the expansion of (x+y). FIG. 34 shows the binary tree for the application of the formula




  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    
      
        (
        
          
            
              
                r
                -
                1
              
            
          
          
            
              
                k
                -
                1
              
            
          
        
        )
      
      +
      
        
          (
          
            
              
                
                  r
                  -
                  1
                
              
            
            
              
                k
              
            
          
          )
        
        ⁢
        
          
        
        ⁢
        with
        ⁢
        
          
        
        ⁢
        r
      
    
    ≥
    1
  




on the four sides of a triangle. The successive duplications of the binomial coefficients provide the suites of the following multiplicative factors {1}, {1, 1}, {1, 2, 1}, {1, 3, 3, 1} and the following equalities a0=1·a0, a0=1·b0+1·b1, a0=1·c0+2·c1+1·c2, a0=1·d0+3·d1+3·d2+1·d3. By putting s=k in the formula





  
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
    =
    
      
        
          (
          
            
              
                
                  r
                  -
                  1
                
              
            
            
              
                
                  k
                  -
                  1
                
              
            
          
          )
        
        +
        
          
            (
            
              
                
                  
                    r
                    -
                    1
                  
                
              
              
                
                  k
                
              
            
            )
          
          ⁢
          
            
          
          ⁢
          with
          ⁢
          
            
          
          ⁢
          r
        
      
      ≥
      1
    
  
  ,




the following recursive intermediate form is obtained.





  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    
      ∑
      
        i
        =
        0
      
      k
    
    ⁢
    
      
        (
        
          
            
              
                r
                -
                k
              
            
          
          
            
              
                k
                -
                i
              
            
          
        
        )
      
      ⁢
      
        
          (
          
            
              
                k
              
            
            
              
                i
              
            
          
          )
        
        .
      
    
  




To ensure the existence of a right triangle associated with each binomial coefficient of Pascal's triangle, the leftmost symmetric coefficient on a line must be maintained using the symmetry property of binomial coefficients




  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    
      (
      
        
          
            r
          
        
        
          
            
              r
              -
              k
            
          
        
      
      )
    
    .
  




The following equation is then obtained for k≦r:





  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    
      ∑
      
        i
        =
        0
      
      k
    
    ⁢
    
      
        (
        
          
            
              
                r
                -
                k
              
            
          
          
            
              
                min
                ⁢
                
                  
                
                ⁢
                
                  (
                  
                    
                      k
                      -
                      i
                    
                    ,
                    
                      r
                      -
                      k
                      -
                      
                        (
                        
                          k
                          -
                          i
                        
                        )
                      
                    
                  
                  )
                
              
            
          
        
        )
      
      ⁢
      
        
          (
          
            
              
                k
              
            
            
              
                
                  min
                  ⁡
                  
                    (
                    
                      i
                      ,
                      
                        k
                        -
                        i
                      
                    
                    )
                  
                
              
            
          
          )
        
        .
      
    
  




The latter may ultimately be considered as a variant of the optimized recursive Vandermonde convolution which is expressed by:




  
    (
    
      
        
          
            p
            +
            q
          
        
      
      
        
          c
        
      
    
    )
  
  =
  
    
      ∑
      
        k
        =
        0
      
      c
    
    ⁢
    
      
        (
        
          
            
              p
            
          
          
            
              
                c
                -
                k
              
            
          
        
        )
      
      ⁢
      
        
          (
          
            
              
                q
              
            
            
              
                k
              
            
          
          )
        
        .
      
    
  




The algorithm of FIG. 37, uses three halt conditions depending on the values of k. They were deinterleaved for easier reading of code. From the point of view of theoretical programming, the algorithm also works without using the min( ) function useless in the classic formulation of Vandermonde, but useful in the reduction of recursive calls.
By performing the following successive substitutions k=i, c=k, q=k, and r=p+k we obtain equivalences between the relations




  
    
  
  ⁢
  
    
      (
      
        
          
            r
          
        
        
          
            k
          
        
      
      )
    
    =
    
      
        
          ∑
          
            i
            =
            0
          
          k
        
        ⁢
        
          
            (
            
              
                
                  
                    r
                    -
                    k
                  
                
              
              
                
                  
                    k
                    -
                    i
                  
                
              
            
            )
          
          ⁢
          
            (
            
              
                
                  k
                
              
              
                
                  i
                
              
            
            )
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            (
            
              
                
                  
                    p
                    +
                    q
                  
                
              
              
                
                  c
                
              
            
            )
          
        
      
      =
      
        
          ∑
          
            k
            =
            0
          
          c
        
        ⁢
        
          
            (
            
              
                
                  p
                
              
              
                
                  
                    c
                    -
                    k
                  
                
              
            
            )
          
          ⁢
          
            (
            
              
                
                  q
                
              
              
                
                  k
                
              
            
            )
          
        
      
    
  




and then

    
    
        between the relations
    
    






  
    (
    
      
        
          
            p
            +
            q
          
        
      
      
        
          c
        
      
    
    )
  
  =
  
    
      
        ∑
        
          k
          =
          0
        
        c
      
      ⁢
      
        
          (
          
            
              
                p
              
            
            
              
                
                  c
                  -
                  k
                
              
            
          
          )
        
        ⁢
        
          (
          
            
              
                q
              
            
            
              
                k
              
            
          
          )
        
        ⁢
        
          
        
        ⁢
        and
        ⁢
        
          
        
        ⁢
        
          (
          
            
              
                r
              
            
            
              
                k
              
            
          
          )
        
      
    
    =
    
      
        ∑
        
          i
          =
          0
        
        k
      
      ⁢
      
        
          (
          
            
              
                
                  r
                  -
                  k
                
              
            
            
              
                
                  min
                  ⁡
                  
                    (
                    
                      
                        k
                        -
                        i
                      
                      ,
                      
                        r
                        -
                        k
                        -
                        
                          (
                          
                            k
                            -
                            i
                          
                          )
                        
                      
                    
                    )
                  
                
              
            
          
          )
        
        ⁢
        
          
            (
            
              
                
                  k
                
              
              
                
                  
                    min
                    ⁡
                    
                      (
                      
                        i
                        ,
                        
                          k
                          -
                          i
                        
                      
                      )
                    
                  
                
              
            
            )
          
          .
        
      
    
  




FIG. 35 shows the different possible convolutions among the lines of Pascal's triangle, with the recursion which starts from the pair of lines {r−k,k}, i.e. {6,3}. To be able to use in the Vandermonde convolution, the intermediate lines between the lines r−k and k, it would be necessary to choose a pair {r−k−i, k+i} which verifies





  
    
      r
      -
      
        2
        ⁢
        k
      
    
    2
  
  ≥
  i
  ≥
  0




and therefore introduce an integer division by 2 in the recursion algorithm. In this example, we should have consequently i=1 there will be and thus the opportunity to start the recursion in the modified algorithm with the couple of lines {5,4}.

Iterative Formulations

There are three iterative formulations to calculate the binomial coefficients from additions, subtractions, multiplications and divisions. It will be appreciated by the person skilled in the art that the formulation by column is in all basic algorithmic implementations.




  
    
      C
      y
    
    ⁡
    
      (
      
        m
        ,
        n
      
      )
    
  
  =
  
    
      ∏
      
        i
        =
        1
      
      n
    
    ⁢
    
      
    
    ⁢
    
      
        (
        
          m
          +
          i
        
        )
      
      /
      
        i
        .
      
    
  




However the formulation per line is mainly used for the calculation of the binomial expansion of Newton:




  
    
      C
      x
    
    ⁡
    
      (
      
        m
        ,
        n
      
      )
    
  
  =
  
    
      ∏
      
        i
        =
        1
      
      m
    
    ⁢
    
      
    
    ⁢
    
      
        (
        
          m
          +
          n
          +
          1
          -
          i
        
        )
      
      /
      
        i
        .
      
    
  




Finally, the formulation is based on the diagonal symmetry property of binomial coefficients for repetitions.




  
    
      C
      d
    
    ⁡
    
      (
      
        m
        ,
        n
      
      )
    
  
  =
  
    
      
        C
        y
      
      ⁡
      
        (
        
          n
          ,
          m
        
        )
      
    
    =
    
      
        ∏
        
          i
          =
          1
        
        m
      
      ⁢
      
        
      
      ⁢
      
        
          (
          
            n
            +
            i
          
          )
        
        /
        
          i
          .
        
      
    
  




FIG. 38 illustrates an embodiment of a computing algorithm of binomial coefficients by row XENUME and by column YENUME.
The binomial coefficient




  
    (
    
      
        
          9
        
      
      
        
          6
        
      
    
    )
  
  =
  84




will be obtained after the sixth iteration, by Cy(6,3) in column 3, at the end of the sequence YENUME(3,9)→1, 4, 10, 20, 35, 56, 84 or alternatively after the fourth iteration through Cx(6,3) in the line 9, at the end of the sequence XENUME(3,9)→1, 9, 36, 84. The computation time proportional to the iterations leads generally to perform fast calculation using the function Cx in the case where m>n by means of Cy only if m≦n. This calculation may ultimately be realized by the function Cd that requires the same number of iterations as Cx by construction of Pascal's triangle. The sequence to obtain the binomial coefficient





  
    (
    
      
        
          9
        
      
      
        
          6
        
      
    
    )
  
  =
  84




will thus be 1, 7, 28, 84. The generalization of this example therefore leads to use the symmetry property for the optimization of the number of iterations of the binomial coefficient and to use in both cases a single function for the calculation:





  
    
      C
      r
    
    ⁡
    
      (
      
        m
        ,
        n
      
      )
    
  
  =
  
    {
    
      
        
          
            
              
                C
                y
              
              ⁡
              
                (
                
                  m
                  ,
                  n
                
                )
              
            
          
          
            
              
                if
                ⁢
                
                  
                
                ⁢
                m
              
              >
              n
            
          
        
        
          
            
              
                C
                y
              
              ⁡
              
                (
                
                  n
                  ,
                  m
                
                )
              
            
          
          
            
              
                if
                ⁢
                
                  
                
                ⁢
                m
              
              ≤
              n
            
          
        
      
      .
    
  




This optimization of the first number of iterations being made, it is possible to further reduce this number by half by putting the equation




  
    
      C
      y
    
    ⁡
    
      (
      
        m
        ,
        n
      
      )
    
  
  =
  
    
      ∏
      
        i
        =
        1
      
      n
    
    ⁢
    
      
    
    ⁢
    
      
        (
        
          m
          +
          i
        
        )
      
      /
      i
    
  




in the form of a product of difference of two squares. For a given product, having an odd number 2k+1 of terms,





  
    
      (
      
        m
        +
        1
      
      )
    
    1
  
  ⁢
  
    
      (
      
        M
        +
        2
      
      )
    
    1
  
  ⁢
  
    
  
  ⁢
  ...
  ⁢
  
    
  
  ⁢
  
    
      (
      
        m
        +
        
          2
          ⁢
          
            
          
          ⁢
          k
        
      
      )
    
    
      2
      ⁢
      
        
      
      ⁢
      k
    
  
  ⁢
  
    
      (
      
        m
        +
        
          2
          ⁢
          
            
          
          ⁢
          k
        
        +
        1
      
      )
    
    
      
        2
        ⁢
        
          
        
        ⁢
        k
      
      +
      1
    
  




after performing the change of variables m=M−k−1, we obtain





  
    
      (
      
        M
        -
        k
      
      )
    
    1
  
  ⁢
  
    
      (
      
        M
        -
        k
        +
        1
      
      )
    
    2
  
  ⁢
  
    
  
  ⁢
  ...
  ⁢
  
    
  
  ⁢
  
    M
    
      k
      +
      1
    
  
  ⁢
  
    
  
  ⁢
  ...
  ⁢
  
    
  
  ⁢
  
    
      (
      
        M
        +
        k
        -
        1
      
      )
    
    
      2
      ⁢
      
        
      
      ⁢
      k
    
  
  ⁢
  
    
      
        (
        
          M
          +
          k
        
        )
      
      
        
          2
          ⁢
          
            
          
          ⁢
          k
        
        +
        1
      
    
    .
  




By grouping all terms with the exception of M as the difference of two squares:




  
    
      (
      M
      )
    
    1
  
  ⁢
  
    
      (
      
        
          M
          2
        
        -
        
          1
          2
        
      
      )
    
    2.3
  
  ⁢
  
    
      (
      
        
          M
          2
        
        -
        
          2
          2
        
      
      )
    
    4.5
  
  ⁢
  
    
  
  ⁢
  ...
  ⁢
  
    
  
  ⁢
  
    
      
        (
        
          
            M
            2
          
          -
          
            k
            2
          
        
        )
      
      
        2
        ⁢
        
          
        
        ⁢
        
          k
          ·
          
            (
            
              
                2
                ⁢
                
                  
                
                ⁢
                k
              
              +
              1
            
            )
          
        
      
    
    .
  




The same operation is obtained for a product having an even number 2k of terms and so it is obtained:




  
    
      (
      M
      )
    
    1
  
  ⁢
  
    
      (
      
        M
        -
        k
      
      )
    
    1
  
  ⁢
  
    
      (
      
        
          M
          2
        
        -
        
          1
          2
        
      
      )
    
    2.3
  
  ⁢
  
    
      (
      
        
          M
          2
        
        -
        
          2
          2
        
      
      )
    
    4.5
  
  ⁢
  
    
  
  ⁢
  ...
  ⁢
  
    
  
  ⁢
  
    
      
        (
        
          
            M
            2
          
          -
          
            
              (
              
                k
                -
                1
              
              )
            
            2
          
        
        )
      
      
        2
        ⁢
        
          
        
        ⁢
        
          k
          ·
          
            (
            
              
                2
                ⁢
                
                  
                
                ⁢
                k
              
              +
              1
            
            )
          
        
      
    
    .
  




By dividing at each iteration, by 2i(2i+1), the algorithm of the function for the optimized algorithm of the binomial coefficient calculation is then presented in FIG. 39.
Deferred Divisions
Depending on the performances of the multiplication and division, it is possible to envisage variants of previous algorithms, by deferring and limiting the exact divisions. Simply independently calculate denominators that are factorials and divide by the result at the end of algorithms or intermediately if you want to control the expansion of large integers during the computation. This approach is also useful in designing parallel algorithms.
FIG. 39 illustrates an embodiment of a computation algorithm by means of product of differences of squares.
Calculation by Dynamic Programming
The calculation of binomial coefficients can be performed without multiplication and division using the recurrence pattern




  
    (
    
      
        
          r
        
      
      
        
          k
        
      
    
    )
  
  =
  
    
      (
      
        
          
            
              r
              -
              1
            
          
        
        
          
            
              k
              -
              1
            
          
        
      
      )
    
    +
    
      (
      
        
          
            
              r
              -
              1
            
          
        
        
          
            k
          
        
      
      )
    
  




and by means of the storage memory. The necessary operations are the addition and the assignment, and the number of steps required to calculate a binomial coefficient is mn+1⁄2(m(m+3))+n+1.

The principle is that a calculation scheme of binomial coefficients be established and shall be based on a horizontal rectangular representation of Pascal's triangle. The evaluation of the binomial coefficients is then done column by column rather than row by row. The algorithm used thus consists in visiting the cells of only one rectangle as shown in FIG. 40B. The desired binomial coefficient is located at the tip of the rectangle and is calculated from the binomial coefficients of the preceding columns.
An implementation of the dynamic programming algorithm is illustrated in FIG. 41.
Additive and Multiplicative Method
By using the multiplication operator, it is possible from the rectangular representation of Pascal's triangle to develop methodologies for calculating binomial coefficients based on fast exponentiation of particular triangular matrices. For this purpose, we use the binomial theorem of Newton extended to the square commutative matrices, namely (M+I)r where I is the identity matrix. The application of the formula is used to express the powers of triangular matrices filled only with 1's, from matrices expressed in terms of binomial coefficients, and we obtain




  M
  =
  
    
      
        [
        
          
            
              1
            
            
              0
            
            
              0
            
            
              ...
            
            
              0
            
          
          
            
              1
            
            
              1
            
            
              0
            
            
              ...
            
            
              0
            
          
          
            
              1
            
            
              1
            
            
              1
            
            
              ...
            
            
              0
            
          
          
            
              ⋮
            
            
              ⋮
            
            
              ⋮
            
            
              ⋱
            
            
              ⋮
            
          
          
            
              1
            
            
              1
            
            
              1
            
            
              ...
            
            
              1
            
          
        
        ]
      
      
        m
        +
        1
      
    
    =
    
      
        [
        
          
            
              1
            
            
              0
            
            
              0
            
            
              ...
            
            
              0
            
          
          
            
              
                (
                
                  
                    
                      
                        m
                        +
                        1
                      
                    
                  
                  
                    
                      1
                    
                  
                
                )
              
            
            
              1
            
            
              0
            
            
              ...
            
            
              0
            
          
          
            
              
                (
                
                  
                    
                      
                        m
                        +
                        2
                      
                    
                  
                  
                    
                      2
                    
                  
                
                )
              
            
            
              
                (
                
                  
                    
                      
                        m
                        +
                        1
                      
                    
                  
                  
                    
                      1
                    
                  
                
                )
              
            
            
              1
            
            
              ...
            
            
              0
            
          
          
            
              ⋮
            
            
              ⋮
            
            
              ⋮
            
            
              ⋱
            
            
              ⋮
            
          
          
            
              
                (
                
                  
                    
                      
                        m
                        +
                        n
                      
                    
                  
                  
                    
                      n
                    
                  
                
                )
              
            
            
              
                (
                
                  
                    
                      
                        m
                        +
                        n
                        -
                        1
                      
                    
                  
                  
                    
                      
                        n
                        -
                        1
                      
                    
                  
                
                )
              
            
            
              
                (
                
                  
                    
                      
                        m
                        +
                        n
                        -
                        2
                      
                    
                  
                  
                    
                      
                        n
                        -
                        2
                      
                    
                  
                
                )
              
            
            
              ...
            
            
              1
            
          
        
        ]
      
      .
    
  




Given the symmetric structure of the matrix with respect to its diagonal, the matrix product of two matrices for any power is simplified in the MATPRT function (see FIG. 42) which uses in the calculations only two vectors Vn0 et Vn1 corresponding to the first columns of the two matrices, and stores the result in the vector Wn.
For example, the matrix product of the 3rd and the 31st column of Pascal's triangle is shown in rectangular form. The last number of the resulting vector Wn will be evaluated based on the matrix product between two powers of the matrix M. In this case, the number 8436 will be evaluated from the power 4 and 32 of the initial matrix whose representative vector is [1, 1, 1, 1].

MATPRT([1,4,10,20],[1,32,528,5984],3)→[1,36,666,8436]

The naive method in this case consists in calculating all the successive powers of M until the desired power, in the following sequence:

MATPRT([1,1,1,1,],[1,1,1,1],3)→WM2=[1,2,3,4];

MATPRT([1,1,1,1],[1,2,3,4],3)→WM3=[1,3,6,10];

MATPRT([1,1,1,1],[1,r, . . . , . . . ],3)→WMP=[1,1+r, . . . , . . . ].

Minimizing the number of matrix products for the sought binomial coefficient involves finding the best decomposition into a sequence of integers for the corresponding power.
The algorithmic strategy is then to calculate any binomial coefficient by a minimum number of matrix multiplications between columns. Various methods to select the columns can be used with some borrowed to fast exponentiation techniques. In fact, these ones are based on the following relation applied both to integers and square matrices.

ae=α0+ . . . +αk=aα0a. . . aαk.

The exponent e is decomposed into a sequence of integers by means of different numeration bases or by other techniques such as Zeckendorf decomposition based on Fibonacci numbers. FIGS. 43a and 43b illustrate this principle for the matrix computation of the binomial coefficients with a binary decomposition of the exponent (FIG. 43a) or a Zeckendorf decomposition (FIG. 43b). For a binary decomposition of the exponent, only the columns 20, 21, 22, . . . , 22k will be used to perform the matrix product. Therefore, the binomial coefficient




  
    (
    
      
        
          90
        
      
      
        
          4
        
      
    
    )
  
  =
  2555190




will be calculated according to the following steps:

    
    
        The binomial coefficient is first expressed in Pascal's triangle shown in rectangular form
    
    






  
    
      (
      
        
          
            90
          
        
        
          
            4
          
        
      
      )
    
    →
    
      
        
          (
          
            
              
                
                  90
                  -
                  4
                
              
            
            
              
                4
              
            
          
          )
        
        R
      
      →
      
        
          (
          
            
              
                86
              
            
            
              
                4
              
            
          
          )
        
        R
      
    
  
  ;




    
    
        The index of the column, starting from the 1 value, is then represented in binary form which can show the powers of 2 used in the binary decomposition.

86+1=87→{1010111}2→{26,0,24,0,22,21,20};

        A series of matrix products involving successive matrix powers is performed:

M87=M64×M16×M4×M2×M1 

ultimately, to get the desired power of the matrix revealing the desired binomial coefficient as the last element of the first column of the matrix:

    
    






  
    M
    
      64
      +
      16
      +
      4
      +
      2
      +
      1
    
  
  =
  
    
      M
      87
    
    =
    
      
        [
        
          
            
              1
            
            
              0
            
            
              0
            
            
              0
            
            
              0
            
          
          
            
              87
            
            
              1
            
            
              0
            
            
              0
            
            
              0
            
          
          
            
              3828
            
            
              87
            
            
              1
            
            
              0
            
            
              0
            
          
          
            
              113564
            
            
              3828
            
            
              87
            
            
              1
            
            
              0
            
          
          
            
              2555190
            
            
              113564
            
            
              3828
            
            
              87
            
            
              1
            
          
        
        ]
      
      .
    
  




The exercise can be repeated, this time using a Zeckendorf decomposition

87→{55,21,8,3}Zk 

with the gain of a matrix multiplication compared to the binary decomposition:

M87=M55×M21×M8×M3 

In both cases, the efficiency and minimization of the calculations involved require a simple iterative scheme for calculating powers of intermediate matrices. In general, each matrix used in the resulting matrix product will be obtained from the matrix or matrices calculated previously. An iterative scheme similar to Mi=Mi×Mi will one to calculate the matrix product on the fly for a binary decomposition, while an iterative scheme similar to Mi=Mi×Mi−1 will be used for a Zeckendorf decomposition with powers equal to successive Fibonacci numbers.
An implementation of the simplified matrix product algorithm is shown in FIG. 42.
Calculation by Means of Factorization
It will be appreciated by the person skilled in the art that the criteria for divisibility of binomial coefficients can be exploited to find fast factorization and obtain the binomial coefficient by multiplying the factors found. For the calculation of large binomial coefficients, the best known algorithm is based on a Lucas' theorem on the prime factorization of binomial coefficients (P. Goetgheluck. Computing binomial coefficients. The American Mathematical Monthly, 94 (4):360-365, 1987.)
Position of a Number in Pascal's Triangle
The search for the position of a given number, i.e. the identification of two binomial coefficients adjacent to this number in a row or in a given column, is the foundation of the decoding techniques presented. This problem is indeterminate when the row or column is not specified because there may be several identical entries in Pascal's triangle. If n is the number of a known column, this involves finding for a certain value y0 and y=0, the positive root of a polynomial function given by the following equation:




  y
  =
  
    
      y
      0
    
    -
    
      
        
          
            (
            
              m
              +
              1
            
            )
          
          ⁢
          
            (
            
              m
              +
              2
            
            )
          
          ⁢
          
            
          
          ⁢
          ...
          ⁢
          
            
          
          ⁢
          
            (
            
              m
              +
              n
            
            )
          
        
        
          n
          !
        
      
      .
    
  




In this form, the graph of the function is translated to obtain the location of the root on the y-axis. FIG. 44 illustrates the search for the position of number 20 in the fourth column of Pascal's triangle for a graph of the function this time without translation. The graph result shows that the abscissa intersection of the ordinate line 20 with the curve lies between the values 2 and 3. The number 20 is consequently located between the binomial coefficients




  
    (
    
      
        
          
            4
            +
            2
          
        
      
      
        
          4
        
      
    
    )
  
  =
  
    
      15
      ⁢
      
        
      
      ⁢
      and
      ⁢
      
        
      
      ⁢
      
        (
        
          
            
              
                4
                +
                3
              
            
          
          
            
              4
            
          
        
        )
      
    
    =
    35.
  




The Naive Method

The naive method is the application of the iterative formula




  
    
      C
      r
    
    ⁡
    
      (
      
        m
        ,
        n
      
      )
    
  
  =
  
    {
    
      
        
          
            
              C
              y
            
            ⁡
            
              (
              
                m
                ,
                n
              
              )
            
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              m
            
            >
            n
          
        
      
      
        
          
            
              C
              y
            
            ⁡
            
              (
              
                n
                ,
                m
              
              )
            
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              m
            
            ≤
            n
          
        
      
    
  




with a stopping test when the value of the binomial coefficient calculated exceeds the value of the input data.

Elements in a column are therefore iteratively visited until the discovery of a binomial coefficient greater than the given number. If the theoretical complexity is linear, the estimate of the computational costs for completion of calculation must take into account the operations of addition, multiplication and exact division for the large integers.
Spigot Algorithm
Some types of diophantine equations have the common property of having a single root with a value greater than one, and being continuously differentiable. An algorithm to find this root is proposed concerning any kind of diophantine equation of the form y0=P(x) where P(x) is a polynomial with nonnegative integer coefficients and which has one positive root. Among the specific equations that meet these criteria are, in particular, the following equations:

Pm(x)=x(x+k·1) . . . (x+k(m−1), Sm(x)=1m+2m+ . . . +(x−1)m.

When k=1, Pm(x) is found in many problems related to the existence of exact powers which are equal to a series of consecutive integers and at the heart of the Erdös-Selfridge theorem (P. Kirschenhofer A T. Pintér, R F Tichy Yu, F. Bilu, B. Brindza and A. Schinzel. Diophantine Equations and Bernouilli Polynomials Compositio Mathematica, 131 (2): . . . 173-188 2002). When k=0, Pm(x) comes down to the classic exponential equation and finding integer nth roots, the equation Sm(x) is related to Bernoulli numbers.
Principles
The principle is to improve the naive method described previously by searching first quickly the number of digits of the positive root of the Diophantine equation, then calculating one after the other missing digits. The searching of the number of digits is done by calculating the sign of the function for successive powers of 10 of the variable x. The order of convergence is therefore automatically adjusted to the degree of the function. The missing digits require no more than 10 times the number of digits of the root function and evaluations.
FIG. 45 illustrates an implementation of the ENCDEC spigot algorithm.
Noting that the index returned by ENCDEC(1,x) is 0, it is obtained, for example ENCDEC(496,5)→+6, and in general it is verified that the position of the central binomial coefficient follows the identity:

ENCDEC(Comb(x,x),x)→x. 

On the other hand, by substituting the function Comb into the function NUMFCT(x,n,0) (algorithm in FIG. 46) in the ENCDEC and DIGBIN functions, and considering NUMFCT(x, n, 0), it is possible to perform the extraction of the integer nth root of x, using the generalization of the ENCDEC function to find solutions of certain Diophantine families of equations.
Analytical Methods Analytical methods for n=1, 2, 3, 4 may be useful, depending on the performance of the extraction of integer square and cube roots. This is the case for example in two dimensions, for the reverse function of the Cantor pairing function




  
    I
    
      K
      2
    
  
  =
  
    
      
        
          (
          
            x
            +
            y
          
          )
        
        *
        
          (
          
            x
            +
            y
            +
            1
          
          )
        
      
      2
    
    +
    y
  




which determines the coordinates of a point identified by its index. Let the equation





  
    
      
        y
        0
      
      -
      
        
          
            (
            
              m
              +
              1
            
            )
          
          *
          
            (
            
              m
              +
              2
            
            )
          
        
        
          2
          !
        
      
    
    =
    0
  
  ,




we first search for the positive real value of





  
    m
    0
  
  =
  
    
      
        
          -
          3
        
        +
        
          
            (
          
          ⁢
          1
        
        +
        
          8
          ⁢
          y
          ⁢
          
            
          
          ⁢
          0
        
      
      )
    
    2
  




that indicates between which of the diagonals in the Cantor pattern the desired point is found. The integer part of m0 which is equal to the index of the diagonal preceding the desired point, allows establishing the following correspondences with the equation





  
    
      I
      
        K
        2
      
    
    =
    
      
        
          
            (
            
              x
              +
              y
            
            )
          
          *
          
            (
            
              x
              +
              y
              +
              1
            
            )
          
        
        2
      
      +
      y
    
  
  ,




and to determine the coordinates of the given point:




  
    
      y
      =
      
        
          y
          0
        
        -
        
          
            
              (
              
                
                  ⌊
                  
                    m
                    0
                  
                  ⌋
                
                +
                1
              
              )
            
            *
            
              (
              
                
                  ⌊
                  
                    m
                    0
                  
                  ⌋
                
                +
                2
              
              )
            
          
          
            2
            !
          
        
      
    
    ;
  




  
    x
    =
    
      
        ⌊
        
          m
          0
        
        ⌋
      
      +
      1
      -
      
        y
        .
      
    
  



The point with the index 11 will give a value of └m0┘=3 for the coordinates [3,1]. The analytical formulas for values n=3, 4 will be illustrated below in the methods of binomial decomposition of a number.
Numeric Method
The convergence of computing the position of a point can be significantly accelerated by finding the roots of the binomial function using an iterative scheme with the successive derivatives of the function. An algorithm of Newton-Raphson type whose principles could be extended to algorithms of Householder types, having higher orders of convergence is presented below. Regardless of the selected algorithm, it must be designed for integer calculation and adapt to a function of any degree. For this, a recursive algorithm for calculating the k-th derivative of the function is determined which calculates the value of the derivative function, without having to use pre-calculations to solve symbolic expressions.
The recursive expression for the k-th derivative of the binomial function




  
    (
    
      
        
          
            m
            +
            n
          
        
      
      
        
          m
        
      
    
    )
  
   




is:





  
    
      n
      !
    
    ⁢
    
      f
      
        (
        n
        )
      
      
        (
        k
        )
      
    
  
  =
  
    {
    
      
        
          
            0
          
          
            
              
                if
                ⁢
                
                  
                
                ⁢
                n
              
              <
              
                0
                ⁢
                
                  
                
                ⁢
                or
                ⁢
                
                  
                
                ⁢
                k
              
              <
              0
            
          
        
        
          
            1
          
          
            
              
                if
                ⁢
                
                  
                
                ⁢
                n
              
              =
              
                
                  1
                  ⁢
                  
                    
                  
                  ⁢
                  and
                  ⁢
                  
                    
                  
                  ⁢
                  k
                
                =
                1
              
            
          
        
        
          
            
              
                
                  f
                  
                    (
                    
                      n
                      -
                      1
                    
                    )
                  
                  
                    (
                    k
                    )
                  
                
                ⁡
                
                  (
                  
                    m
                    +
                    n
                  
                  )
                
              
              +
              
                kf
                
                  (
                  
                    n
                    -
                    1
                  
                  )
                
                
                  (
                  
                    k
                    -
                    1
                  
                  )
                
              
            
          
          
            otherwise
          
        
      
      .
    
  




FIG. 47 illustrates an implementation of an algorithm for recursive calculation of the kth derivative DRVREC.

!f(m)=(m+1)(m+2) . . . (m+7)

DRVREC(7,3)→210m4+3360m3+19320m2+47040m+40614

FIG. 48 shows an implementation for degree n of an algorithm based upon Newton-Raphson methods.




  
    DRVSYM
    ⁡
    
      (
      4
      )
    
  
  →
  
    x
    -
    
      
        (
        
          
            
              (
              
                x
                +
                1
              
              )
            
            ⁢
            
              (
              
                x
                +
                2
              
              )
            
            ⁢
            
              (
              
                x
                +
                3
              
              )
            
            ⁢
            
              (
              
                x
                +
                4
              
              )
            
          
          -
          
            24
            ⁢
            
              
            
            ⁢
            
              y
              0
            
          
        
        )
      
      
        (
        
          
            
              (
              
                
                  
                    (
                    
                      
                        2
                        ⁢
                        
                          
                        
                        ⁢
                        x
                      
                      +
                      3
                    
                    )
                  
                  ⁢
                  
                    (
                    
                      x
                      +
                      3
                    
                    )
                  
                
                +
                
                  
                    (
                    
                      x
                      +
                      1
                    
                    )
                  
                  ⁢
                  
                    (
                    
                      x
                      +
                      2
                    
                    )
                  
                
              
              )
            
            ⁢
            
              (
              
                x
                +
                4
              
              )
            
          
          +
          
            
              (
              
                x
                +
                1
              
              )
            
            ⁢
            
              (
              
                x
                +
                2
              
              )
            
            ⁢
            
              (
              
                x
                +
                3
              
              )
            
          
        
        )
      
    
  




Pyramidal Representation of Integers

Using calculation functions allowing to locate any integer in a given column of Pascal's triangle, it is possible to perform the general function of decoding an integer into the Pascal representation. The decoding of a number in the quaternary representation, being a frequent operation which is essential in the compression process of general lists of integers, a purely analytical decoding will be described first, by using the principles discussed above. In this case, a sequential decoding is obtained where the successive binomial coefficients β3, . . . ,0 are calculated from positive integer roots of the equation




  y
  =
  
    
      y
      0
    
    -
    
      
        
          (
          
            m
            +
            1
          
          )
        
        ⁢
        
          (
          
            m
            +
            2
          
          )
        
        ⁢
        
          
        
        ⁢
        ...
        ⁢
        
          
        
        ⁢
        
          (
          
            m
            +
            n
          
          )
        
      
      
        n
        !
      
    
  




for the degrees 4, . . . , 1 of the variable m.

In an analogous manner to the two dimensions, with the index of the diagonal preceding the point corresponding to the given number, those integer values represent the index of the hyperplane, plane, line and diagonal point preceding the desired point.



  
    
      β
      0
    
    =
    
      (
      
        
          
            
              1
              +
              
                (
                
                  y
                  -
                  1
                
                )
              
            
          
        
        
          
            1
          
        
      
      )
    
  




  
    
      β
      1
    
    =
    
      (
      
        
          
            
              2
              +
              
                ⌊
                
                  (
                  
                    
                      3
                      2
                    
                    +
                    
                      
                        1
                        2
                      
                      ⁢
                      
                        
                          1
                          +
                          
                            8
                            ⁢
                            
                              
                            
                            ⁢
                            y
                          
                        
                      
                    
                  
                  )
                
                ⌋
              
            
          
        
        
          
            2
          
        
      
      )
    
  




  
    
      
        β
        2
      
      =
      
        (
        
          
            
              
                3
                +
                
                  ⌊
                  
                    (
                    
                      
                        
                          1
                          3
                        
                        ⁢
                        
                          P
                          
                            1
                            3
                          
                        
                      
                      +
                      
                        1
                        
                          P
                          
                            1
                            3
                          
                        
                      
                      -
                      2
                    
                    )
                  
                  ⌋
                
              
            
          
          
            
              3
            
          
        
        )
      
    
    ,
    
      P
      =
      
        
          81
          ⁢
          
            
          
          ⁢
          y
        
        +
        
          3
          ⁢
          
            
              
                -
                3
              
              +
              
                729
                ⁢
                
                  
                
                ⁢
                
                  y
                  2
                
              
            
          
        
      
    
  




  
    
      β
      3
    
    =
    
      (
      
        
          
            
              4
              +
              
                ⌊
                
                  (
                  
                    
                      
                        -
                        5
                      
                      2
                    
                    +
                    
                      
                        1
                        2
                      
                      ⁢
                      
                        
                          5
                          +
                          
                            4
                            ⁢
                            
                              
                                1
                                +
                                
                                  24
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  y
                                
                              
                            
                          
                        
                      
                    
                  
                  )
                
                ⌋
              
            
          
        
        
          
            4
          
        
      
      )
    
  



In the previous example where the combinatorial code was 1118, the decoding will be done in the following sequence:



  
    
      
        β
        3
      
      ⁡
      
        (
        y
        )
      
    
    =
    
      
        
          β
          3
        
        ⁡
        
          (
          1118
          )
        
      
      =
      
        
          (
          
            
              
                
                  4
                  +
                  10
                
              
            
            
              
                4
              
            
          
          )
        
        =
        1001
      
    
  




  
    
      
        β
        2
      
      ⁡
      
        (
        y
        )
      
    
    =
    
      
        
          β
          2
        
        ⁡
        
          (
          
            1118
            -
            1001
          
          )
        
      
      =
      
        
          (
          
            
              
                
                  3
                  +
                  6
                
              
            
            
              
                3
              
            
          
          )
        
        =
        84
      
    
  




  
    
      
        β
        1
      
      ⁡
      
        (
        y
        )
      
    
    =
    
      
        
          β
          1
        
        ⁡
        
          (
          
            1118
            -
            1001
            -
            84
          
          )
        
      
      =
      
        
          (
          
            
              
                
                  2
                  +
                  6
                
              
            
            
              
                2
              
            
          
          )
        
        =
        28
      
    
  




  
    
      
        β
        0
      
      ⁡
      
        (
        y
        )
      
    
    =
    
      
        
          β
          0
        
        ⁡
        
          (
          
            1118
            -
            1001
            -
            84
            -
            28
          
          )
        
      
      =
      
        
          (
          
            
              
                
                  1
                  +
                  4
                
              
            
            
              
                1
              
            
          
          )
        
        =
        5
      
    
  



The vector [(4+1),(6+1),(6+1),(10+1)] is then multiplied by the matrix X2N, to restore the original code[5:2:0:4].
If the spigot method is used, the BINRP4 function as illustrated in FIG. 49, will be first defined as the finding the position of any integer in the column 4, and then decrements the number from the found index, to determine the position of this new number in the column 3, this process being continued until the first column can be reached. The indices found are equivalent to 4-dimensional affine Cantor coordinates. For the previous example, BINRP4(1118)→{5, 7, 7, 11}, corresponds to the vector previously obtained by the analytical method. Similarly, the quaternary binomial representation of the number 100 will be {100}bin4=(0, 4, 4, 5) and its quaternary decomposition will be




  {
  
    
      (
      
        
          
            0
          
        
        
          
            1
          
        
      
      )
    
    ,
    
      (
      
        
          
            5
          
        
        
          
            2
          
        
      
      )
    
    ,
    
      (
      
        
          
            6
          
        
        
          
            3
          
        
      
      )
    
    ,
    
      (
      
        
          
            8
          
        
        
          
            4
          
        
      
      )
    
  
  }




that is {100}Bin4={0, 10, 20, 70)}.

FIG. 49 illustrates an implementation of an algorithm for combinatorial decomposing BINRP4 of a quaternary number.
It will then be possible to extend the function BINRP4 to n-ary decomposition of a number to obtain the general function BINRPN and its reverse function RPNBIN that recompose a number given from Pascal form to a decimal form.
FIG. 50 illustrates an implementation of an algorithm (BINRPNi) for an n-ary pyramidal representation.
For example BINRPNi(125,5)→{4, 4, 4, 4, 4} thus {125}bin5={4, 4, 4, 4, 4}, and reciprocally RPNBINi([4, 4, 4, 4, 4], 5)→125.
Moreover, given the equivalences demonstrated above, it is possible to replace the functionality of lexicographic decoding (ORDLEX( )) by:




  
    ORDLEX
    ⁡
    
      (
      
        [
        
          x
          ,
          m
          ,
          n
        
        ]
      
      )
    
  
  ≡
  
    
      
        [
        
          n
          ,
          ...
          ⁢
          
            
          
          ,
          n
        
        ]
      
      
        {
        m
      
    
    -
    
      
        BINRPNi
        ⁡
        
          (
          
            x
            ,
            m
          
          )
        
      
      .
    
  




Finally, it is possible to obtain the functions of encoding and decoding for the combinatorial numeration system in 4.4.1, by substituting a by a+ind in the two lines of BINRPNi and Comb(vn[n−i+1]−1,i) by Comb(n−vn[m+1−i]−i,i) in RPNBINi.
Algorithmic Optimizations
The person skilled in the art will appreciate that elimination of inner loops is the first level of algorithmic optimization. The basic principle is to replace a double loop which calls the function to calculate a binomial coefficient by a single loop in which the binomial coefficient is calculated iteratively.
Implementation in the Case of a General List of Integers
Principle of Combinatorial Compression
Some different encoding types are presented which, according to the diagram disclosed before, allow the encoding of any list of integers via a single integer, the total index or by a triplet consisting of the local index of the list, its total degree and its length. The total index corresponds to the absolute numbering of a projective point representing the list to encode in the projective hyperspace. The person skilled in the art will appreciate that this algorithm is very efficient but quickly generates very large integers. Following the demonstrated equivalences between Numeric encoding and Cantor coding, it is also possible to choose an alternative strategy by encoding the triplet {X, m, n} in a single integer to ensure the bijective correspondence for encoding/decoding. It will be possible to do so using, for example, a three-dimensional Cantor coding, or a two-dimensional Cantor coding with two successive iterations. The implicit knowledge of the particular encoding method chosen will allow to perform the decoding. Another method is to replace number X by its two-dimensional Cantor coordinates mX,nX and then to encode the quadruplet {mX, nX, m, n} with a four-dimensional Cantor coding. By replacing the triplet by a quadruplet, there will be a limited expansion effect of the generated code size: the length of the list for coding is simply incremented by one, but a significant compression, due to the lowering of total degree of the list to be coded. Let indeed a total weight of the triplet of




  
    
      
        
          (
          
            
              m
              X
            
            +
            
              n
              X
            
          
          )
        
        *
        
          (
          
            
              
                m
                X
              
              ⁢
              
                n
                X
              
            
            +
            1
          
          )
        
      
      2
    
    +
    
      m
      X
    
    +
    m
    +
    n
  
  ,




by expressing X in terms of its Cantor coordinates, the total degree of the quadruplet will be lowered to mX+nX+m+n.

FIG. 51 illustrates an implementation of an algorithm for the optimization of the global coding (GLOBALo) and local coding (LOCALo).
FIG. 52 illustrates an implementation of an algorithm for numeric decoding (ORDNUMo and ORINUMo).
FIG. 53 illustrates an implementation of an algorithm for coding and decoding in compressed mode (INDCOM).
By taking again an example which is already being used in the case 4.1, the projective point [69, 78, 73, 71, 77, 65] of degree equal to 433, of dimension equal to 5, the following indices are obtained:

INum={55014101437}(433,5) 

ITot={1419606883389857208104148062281258856159455782592418086487285545 274686109596480318996466895925319463985864300012238628776356963859010}z 

and in compressed mode,

ICom==INDCOM([69,78,73,71,77,65],5)→{507098669008328947049}C.

Representation of Lists of Lists

The recursive application of the function INDCOM allows encoding lists of lists. Given L0, L1, . . . , Ln a set of lists of integers of respective dimensions n0, n1, . . . , nn, a coding of first level will be defined as:

INDCOM([INDCOM(L0,n0),INDCOM(L1,n1), . . . ,INDCOM(Ln,nn)],n).

The Representation of Integers

Besides the representation of the integers by spiral pairing functions, it is possible to consider the theoretical representation of signed integers, by means of pair representation. This approach leads particularly to double the length of the initial vector by preceding each integer by an integer indicating the sign and by extension its type. It is possible, for example, to use the 0 convention for a positive integer, 1 for a negative integer, 2 for an irrational, 3 for an imaginary, etc. The list {−1,2,7,−3,5} will be encoded in an interlaced form {1, 1, 0, 2, 0, 7, 1, 3, 0, 5} and with a compressed index of {6592155939510}C.
The person skilled in the art will appreciate that signed integers can be encoded by means of a list of integers. In such a case, a list of signed integers is encoded by means of a list of unsigned integers.
Alphabetical Sort
The numeric order allows creating dictionaries with alphanumeric sorting. For this, the principle is to transform all dictionary words into codewords of identical lengths and weights. The words to be sorted alphabetically will be associated with projective points of the same lattice. The length will be the one of the longest word, and the weight, the one of the heaviest word. To sort, for example, the words: ART, ARA, BRAS, ARABE, ARABIC, ARABICA, encoded with an alphabet of 26 letters, the index of each letter corresponding to its position in the alphabet, the following points which correspond to them on the lattice T40,7, will be sorted. The maximum length will be inherited from the word ARABICA and the maximum weight from the word BRAS.

ART→[1,18,20,0,0,0,0,1]→{45609855}Inum;

ARA→[1,18,1,0,0,0,0,20]→{45662979}Inum;

BRAS→[2,18,1,19,0,0,0,0]→{38531317}Inum;

ARABE→[1,18,1,2,5,0,0,13]→{45658898}Inum;

ARABICA→[1,18,1,2,9,3,1,5]→{45658530}Inum.

By reversing the sorting, so that the descending order of the numeric coding is respected, the following alphabetically sorted sequence will be obtained:

45662979,45658898,45658898,45658530,45609855,38531317→ARA,ARABE,ARABICA,ART,BRAS.

Hashing

It will be appreciated by the person skilled in the art that the indexing functions described above can be advantageously used as hash functions in the same manner as the classical polynomial hash function built from the equation:

H(x)=(α0·Bk+α1·Bk−1+ . . . +αk·B0)mod N. 

In this case, B will be commonly taken equal to a power of 2, for example equal to 256 and N equal to a prime number. By the same way, by pairing combinatorial indexing functions to the modulo operator, the following values will be obtained from the previous sequence. The choice of N may cause collision cases and a hash table fill rate more or less important.

15662979,45658898,45658530,45609855,38531317→11,12,8,5,6

Applications for Polynomials

Literal Representation

To represent the polynomial in the form of a character string has certain advantages, especially for preserving the initial representation of the polynomial in factored form, or by preserving its type of notation, for example in reverse Polish notation. In return, the subsequent algorithmic processing of the polynomial must pass through a simple classical compilation process of arithmetic expression type. A basic encoding, character by character, can therefore be obtained from a reduced alphabet like {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, x, +, −, *, /, ′(,), #} this one being made up of digits, arithmetic operators, parentheses, the variable x and the sharp character used as a separator. The alphabet will be extended to letters of the alphabet if the polynomial is designed for symbolic processing. A numeric code being assigned to each symbol of the alphabet, the table of equivalence of the alphabet with n characters will simply be a list of integers n+1. Consequently, the maximum weight of this list will be (n+1)2 The following example shows the homogeneous equation of a torus of radii a and b centered at the origin of the Euclidean frame:

Tore=(x02+x12+x22−(b2−a2)*x32)−4*a2*(x02+x12)*x32.

The list of 56 integers with a total degree of 3789, representing the torus equation in the UNICODE encoding system is:

LTore={40,120,48,94,50,43,120,49,94,50,43,120,50,94,50,45,40,98,94,50,45,97,94,50,41,42,120,51,94,50,41,94,50,45,52,42,97,94,50,42,40,120,48,94,50,43,120,49,94,50,41,42,120,51,94,50}(Unicode).

The numeric encoding of LTore is performed by NUMORD(LTore,56−1) which produces a numeric local index:

INum={430498654249915943678023780125509627688494209313620775647407 4479473688920429540259225190355106304329193124705002316203895665}(3789,55).

Structured Representation

The problems of algorithmic performances are narrowly related to the chosen representations, and the memory problems are partly caused by losses due to hollow polynomials. The vector L, representing numerical expansion of the torus polynomial for the radii a=2 and b=1, permits visualization of the different problems related to the vectoral representation: the order of coefficients corresponding the chosen order on the monomials, the presence of nul coefficients specific to hollow polynomials, and finally the management of coefficient signs that escape coding of integers greater than zero.

L=[1,0,2,0,1,0,0,0,0,2,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,−10,0,−10,0,0,6,0,

After coding the negative values of the vector L, the numerical code of the new vector interlaced interlaced from the torus is:

INum={191438651803617499325873813948513}(46,69) 

In order to overcome this type of problem, and considering that the null coefficients influence only the dimension of the vector to be coded and not its degree, it is possible to adopt an addressing strategy in cascading sequence. A hashing table without collisions having a dimension equal to the number of coefficients Cm(m,n) is created for a polynomial having a degree m in n dimension. This table contains the addresses, coded as integers, on information specific to the monomials. This information, stored separately, can be therefore the signed Numeric values of the coefficients, but also pointers to functions of symbolic calculation of the coefficients, or the indices of relational databases to establish geometric constraints between different polynomials (CADCAM variational).

T0=[k0,0,k2,0,k4,0,0,0,0,k9,0,k11,0,0,k14,0,0,0,0,0,0,0,0,0,0,k25,0,k27,0,0,k30,0,0,0,k34]

Coding Vectors and Hollow Polynomials

The encoding of hollow vectors can be achieved in several different ways. The most common method is called representation “rank-and-value” described by Lehmer (D. H. Lehmer. The machine tools of combinatorics. In E. F. Beckenbach, editor, Applied Combinatorial Mathematics, pages 5-31. Wiley, New York 1964). In this case, the encoding is performed by a series of pairs of integers indicating the rank et the value of each integer in the entire hollow list. A zero is placed at the end of the list to signify the end of the message. The previous table T0 is coded as follows:

T00=0,k0,2,k2,4,k4,9,k9,11,k11,14,k14,25,k25,27,k27,30,k30,34,k34,0.

The positions of non-zero values can be encoded separately using for example the technique of combinatorial compression. Thus, there will be the compressed code for storing the locations of non-zero values of T0:

35,0,2,4,9,11,14,25,27,30,34→{1836997097013699578176773581776}C.

It is also possible to use the Pascal coding for the descending sequences, but by storing separately the vector length:

34,30,27,25,14,11,9,4,2,0→{148139661}Pas 

Symbolic Product of Multivariate Polynomials

The fast indexing functions of monomials that allow to process the product of two multivariate polynomials by means of the direct indexing of vectors must then be used. The MPLNUM algorithm, illustrated in FIG. 54, uses the numeric indexing algorithm by multiplying each monomial of the first polynomial by each polynomial of the second, in what has come to be known as the naive algorithm for the multiplication of two polynomials. One of the advantages of the presented algorithm is that it can be easily extended to multiplication of hollow vectors.
The symbolic algorithm for the multiplication of two multivariate polynomials is based on the basic operation of the product of two monomials, on the indexing the resulting monomial and on the summing the monomials of the same rank. The MPLNUM function performs the symbolic product of two polynomials in a given dimension. The degree of the resulting polynomial dgr calculated in line 1 and the numbers of monomials of the two multiplied polynomials as well as of the resulting polynomial are calculated from line 2 to line 9. The reset of all the terms of the resulting vector to zero is carried out at the line 10. A loop is made on the number lga of monomials of the polynomial named A, at line 11 and on the number lgb of monomials of the polynomial named B, at the line 12.
The signatures in numeric order of the two polynomials A and B are obtained at the lines 13 and 14. The multiplication of the monomials is performed by adding the signatures siga and sigb at the line 15. The index for the resulting monomial is calculated at the line 16. Finally, the resulting monomials of the same rank are summed and accumulated in the vector associated with the resulting polynomials at the line 17.
The following example illustrates the multiplication in the two-dimension projective plane of a second-degree curve (conic) by a first-degree curve (line), which gives a curve of the third degree (a degenerate cubic). Let y2a the conic curve equation y2a=a0x02+a1x0x1+a2x12+a3x0x2+a4x1x2+a5x22 and yb1 the straight line equation vb1=b0x0+b1x1+b2x2, the




  10
  =
  
    (
    
      
        
          5
        
      
      
        
          3
        
      
    
    )
  




coefficients 0, 0, 3,0,1,2, . . . ,3, 0, 0 of the cubic curve y3c are obtained in the numeric order,

MPLNUM([a0,a1,a2,a3,a4,a5],[b0,b1,b2],2,1,2)→[a0*b0,a0*b1+a1*b0,a1*b1+a2*b0,a2*b1,a0*b2+a3*b0,a1*b2+a3*b1+a4*b0,a2*b2+a4*b1,a3*b2+a5*b0,a4*b2+a5*b1,a5*b2].

Implementation of the Method Disclosed

It will be appreciated by the person skilled in the art that the method as disclosed above to encode the information as well as the method to decode the information encoded by the method disclosed above may be implemented in various ways.
In particular, these methods can be implemented for example in a computer 300 as shown in FIG. 30. Computer 300 may include, for example, a processor 310, a data bus 312, a data storage unit 314, a communication port 316, a display unit 318 and a keyboard 320.
In this example, the processor 310 is adapted to process instructions. The person skilled in the art will appreciate that various types of processors can be used to perform the processing of instructions.
The data storage unit 314 is configured to store data. The person skilled in the art will appreciate that various types of storage devices can be used to provide such storage.
The communication port 316 is used to exchange information between the computer 300 and another processing unit not shown in FIG. 30. The person skilled in the art will appreciate that the communication port 316 depends on the type of connection used between the computer 300 and the other processing unit.
The display unit 318 is used for displaying data to a user. The person skilled in the art will appreciate that various types of display unit can be used.
The keyboard 320 is used to allow a user to input data into the computer 300. Again, the person skilled in the art will appreciate that various types of keyboards can be used.
It will be understood that the processor 310, the data storage unit 314, the communication port 316, the 318 display and keyboard unit 320 are operatively connected together via data bus 312.
In fact and in one embodiment, the storage unit 314 comprises an operating system 322. The operating system 322 may be of different types.
The storage unit 314 further comprises a program 324 which can be executed by the processor 310 and whose execution allows encoding the information. It will be appreciated by the person skilled in the art that a program whose execution will decode information can also be stored in the storage unit 314.
The program for encoding the information comprises instructions for obtaining a list of integers to be encoded. It will be appreciated that the list of integers to be encoded may be obtained in various ways. In one embodiment, the entire list will be input by a user via the keyboard 320. In another embodiment the entire list will be obtained from a file read out of the storage unit 314 or received through the communication port 316.
The program for encoding the information further comprises instructions for determining a hyper-pyramid having a dimension adapted to encode the entire list, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers of the list of integers, and by the dimension of the hyper-pyramid that is equal to the number of integers in the list of integers minus one.
The program for encoding the information comprises instructions to index the list of integers in this pyramid by means of an indexing system. As mentioned before, different systems may be used for indexing.
The program for encoding the information includes instructions for providing an indication of indexing the list of integers in the hyper-pyramid in order to thereby encode said integers in the list. It will be appreciated that the indication of indexing of the list of integers in the hyper-pyramid may be provided in various ways. For example, an indication of indexing the list of integers can be displayed on the display unit 318 (e.g., a screen). Alternatively, the indication of indexing the list of integers can be stored in a file in the storage unit 314 or it can be transmitted via the communication port 316 to another processing unit.
It will be appreciated that a storage device may be provided for storing a set of instructions executable by a processor to perform a method for encoding information. The method comprising obtaining a list of integers to encode; determine a hyper-pyramid having a dimension adapted to encode the list of integers, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers of the list of integers, and by the dimension of the hyper-pyramid which is equal to the number of integers in the list minus one; indexing the list of integers in this pyramid through an indexing system; and providing an indication of indexing the list of integers in the hyper-pyramid in order to thereby encode said integers of the list.

## Claims

1. A computer-implemented method for encoding information, the method comprising:
obtaining, by a processor, a list of integers to be encoded;
determining, by the processor, a hyper-pyramid having a dimension adapted to encode the list of integers, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers in the list of integers, and by the dimension of the hyper-pyramid which is equal to the number of integers in the list minus one;
indexing, by the processor, the list of integers in the hyper-pyramid using an indexing system; and
providing, by the processor, an indication of the indexing of the list of integers in the hyper-pyramid.

2. The computer-implemented method of claim 1, further comprising:
providing, by the processor, a list of alphanumeric codes; and
transforming, by the processor, the list of alphanumeric codes into the list of integers to encode.

3. The computer-implemented method of claim 1, wherein the indexing system allows an indexing of each vertex of the plurality of vertices of said hyper-pyramid.

4. The computer-implemented method of claim 1, wherein the indication of the indexing of the list of integers in the hyper-pyramid comprises an integer representing the index of the projective point in the indexing system, m being the total degree of said list of integers and n being the number of integers in the list of integers.

5. The computer-implemented method of claim 4, further comprising converting, by the processor, the integer representing the projective point in the indexing system into combinatorial coordinates mx and nx.

6. The computer-implemented method of claim 4, further comprising processing, by the processor, m, the total degree of the list of integers, and n, the number of integers in the list of integers into an integer Y representing an overall index.

7. The computer-implemented method of claim 6, further comprising summing, by the processor, the integer Y representing an overall index with the integer representing the index of the projective point, in order to provide a total index Z, the indication of the indexing of the hyper-pyramid comprising the total index Z.

8. The computer-implemented method of claim 1, wherein the list of integers is obtained from a file.

9. The computer-implemented method of claim 1, wherein the step of providing the indication of the indexing in the hyper-pyramid comprises storing, by the processor, said indication of the indexing in a file.

10. The computer-implemented method of claim 1, wherein the step of providing the indication of the indexing of the list of integers in the hyper-pyramid comprises transmitting, by the processor, the indication of the indexing of the list of integers to a second processor via a network.

11. The computer-implemented method of claim 1 further comprising
providing, by the processor, a list of integers; and
generating, by the processor, the list of whole numbers using the list of integers.

12. The computer-implemented method of claim 1, wherein providing the indication of the indexing of the list of integers in the hyper-pyramid comprises displaying said indication of the indexing on a display.

13. The use of the computer-implemented method of claim 1 to compress a string of characters associated with said list of integers.

14. A computer-implemented method for coding a list of lists, the method comprising an iterative use of the computer-implemented method as claimed in claim 1 for coding a list of lists.

15. The use of the computer-implemented method of claim 1 to encrypt a list of integers, wherein the indexing of the list of integers corresponds to an encryption of the list of integers.

16. A computer-implemented method for decoding information encoded using the computer-implemented method for encoding the information as set forth in claim 1, the method comprising:
obtaining, by the processor, an indication of the indexing of the list of integers in the hyper-pyramid;
obtaining, by the processor, an indication of an indexing system used to generate said indication of the indexing of the list of integers in the hyper-pyramid;
determining, using the indexing system used and the indication of the indexing of the list of integers, said list of integers; and
providing, by the processor, said list of integers.

17. A computer comprising:
a display unit;
a processor;
a data storage unit comprising a program configured to be executed by the processor to encode information, the program comprising:
instructions for obtaining a list of integers to be encoded;
instructions for determining a hyper-pyramid having a dimension adapted for encoding the list of integers, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers of the list, and by the dimension of the hyper-pyramid which is equal to the number of integers in the list of integers minus one;
instructions for indexing the list of integers in the hyper-pyramid using an indexing system; and
instructions for providing an indication of an indexing of the list of integers in the hyper-pyramid.

18. A non-transitory computer storage medium for storing programming instructions executable by a processor, which when executed will cause the execution by the processor of a method for encoding information, the method comprising
obtaining a list of integers to be encoded;
determining a hyper-pyramid having a dimension adapted to encode the list of integers, the hyper-pyramid having a plurality of vertices whose number is determined by the degree of the hyper-pyramid, which is equal to the sum of the integers of the list of integers and by the dimension of the hyper-pyramid which is equal to the number of integers in the list of integers minus one;
indexing the list of integers in the hyper-pyramid using an indexing system; and
providing an indication of the indexing of the list of integers in the hyper-pyramid.