Syntax: levi(i; j; k)
Example | Syntax | Output |
---|---|---|
ε1 2 3 | levi(1; 2; 3) | 1 |
ε2 1 3 | levi(2; 1; 3) | -1 |
ε0 5 2 | levi(0; 5; 2) | -1 |
ε1 1 2 | levi(1; 1; 2) | 0 |
επ e 7 8 | levi(pi; E; 7; 8) | -1 |
Levi-Civita returns 1 if (i; j; k;…) is an even permutation of its corresponding ordered sequence, -1 if it is an odd permutation, and 0 if at least two indices have the same value.
Calc Board uses the Bubble Sort Algorithm to determine whether it needs and even or odd number of permutations to get to the ordered sequence of indices.