Skip to content

OrderOfElement ​

The order of a group element, the least n ≥ 1 with gng^n the identity, or Infinity when there is none.

OrderOfElement(g)The Monoid protocol's member for the order of an element, answered by whichever type g belongs to.
Typed signatures
TypePackageApplies
(any) -> unknownresiduesreplaces structureson IntegerMod, ResidueClass
(any) -> unknownstructuresalways

Domain: Structures

Details
  • The Monoid protocol's member: a type conforms by saying how it finds the order of one of its values. Not named Order, which is Wolfram's comparison Order[a, b].
  • A permutation's order is the lcm of its cycle lengths: PermutationOrder's value.
  • A unit of Z/m\mathbb{Z}/m, a ResidueClass, has MultiplicativeOrder's value. A non-unit has no order (no power of it reaches 1) and stays unevaluated.
  • Among the exact numbers, only roots of unity have finite order: 1 has order 1, −1-1 has order 2, ii and −i-i have order 4, and every other rational or Gaussian rational has infinite order. An inexact or symbolic number stays unevaluated.
  • A matrix stays unevaluated: finite order is detectable by repeated multiplication, but infinite order is not, so none is guessed.

Examples

Basic #

the one-line word 312312 is a 3-cycle

live ↗
InOrderOfElement(Permutation⁡([3,1,2]))\mathrm{OrderOfElement}({\operatorname{Permutation}}([3, 1, 2]))Out33

33 generates (Z/7)×(\mathbb{Z}/7)^\times

live ↗
InOrderOfElement(3‾7)\mathrm{OrderOfElement}(\overline{3}_{7})Out66

in the multiplicative group of the complex numbers

live ↗
InOrderOfElement(−1)\mathrm{OrderOfElement}(-1)Out22

i4=1i^4 = 1

live ↗
InOrderOfElement(i)\mathrm{OrderOfElement}(i)Out44
Scope #

a 2-cycle and a 3-cycle: lcm⁡(2,3)\operatorname{lcm}(2,3)

live ↗
InOrderOfElement(Permutation⁡([2,1,4,5,3]))\mathrm{OrderOfElement}({\operatorname{Permutation}}([2, 1, 4, 5, 3]))Out66

only the identity has order 1

live ↗
InOrderOfElement(Permutation⁡([1,2,3,4]))\mathrm{OrderOfElement}({\operatorname{Permutation}}([1, 2, 3, 4]))Out11

52=25≡1(mod8)5^2 = 25 \equiv 1 \pmod 8

live ↗
InOrderOfElement(5‾8)\mathrm{OrderOfElement}(\overline{5}_{8})Out22

the class of 1 has order 1

live ↗
InOrderOfElement(1‾9)\mathrm{OrderOfElement}(\overline{1}_{9})Out11

−1≡10(mod11)-1 \equiv 10 \pmod{11}

live ↗
InOrderOfElement(−1‾11)\mathrm{OrderOfElement}(\overline{-1}_{11})Out22

(−i)4=1(-i)^4 = 1

live ↗
InOrderOfElement(−i)\mathrm{OrderOfElement}(-i)Out44

the identity

live ↗
InOrderOfElement(1)\mathrm{OrderOfElement}(1)Out11
Properties #

no power of 22 is 11

live ↗
InOrderOfElement(2)\mathrm{OrderOfElement}(2)Out∞∞

(1/2)n(1/2)^n never reaches 1

live ↗
InOrderOfElement(12)\mathrm{OrderOfElement}(\frac{1}{2})Out∞∞

(3+4i)/5(3+4i)/5 has modulus 1 but is no root of unity

live ↗
InOrderOfElement(35+45i)\mathrm{OrderOfElement}(\frac{3}{5}+\frac{4}{5}i)Out∞∞

the same value as PermutationOrder

live ↗
InOrderOfElement(Permutation⁡([2,4,1,3]))=PermutationOrder(Permutation⁡([2,4,1,3]))\mathrm{OrderOfElement}({\operatorname{Permutation}}([2, 4, 1, 3]))=\mathrm{PermutationOrder}({\operatorname{Permutation}}([2, 4, 1, 3]))OutTrue\mathrm{True}

the same value as MultiplicativeOrder

live ↗
InOrderOfElement(10‾21)=MultiplicativeOrder(10,21)\mathrm{OrderOfElement}(\overline{10}_{21})=\mathrm{MultiplicativeOrder}(10, 21)OutTrue\mathrm{True}
Possible issues #

gcd⁡(10,22)=2\gcd(10, 22) = 2, so no power of 1010 is 11 mod 2222

live ↗
InOrderOfElement(10‾22)\mathrm{OrderOfElement}(\overline{10}_{22})OutOrderOfElement(10‾22)\mathrm{OrderOfElement}(\overline{10}_{22})

this matrix has order 4, but a matrix is left unevaluated

live ↗
InOrderOfElement([[0,−1],[1,0]])\mathrm{OrderOfElement}(\bigl\lbrack\bigl\lbrack0, -1\bigr\rbrack, \bigl\lbrack1, 0\bigr\rbrack\bigr\rbrack)OutOrderOfElement([[0,−1],[1,0]])\mathrm{OrderOfElement}(\bigl\lbrack\bigl\lbrack0, -1\bigr\rbrack, \bigl\lbrack1, 0\bigr\rbrack\bigr\rbrack)

a float is not known to be exactly a root of unity

live ↗
InOrderOfElement(0.5)\mathrm{OrderOfElement}(0.5)OutOrderOfElement(0.5)\mathrm{OrderOfElement}(0.5)

nothing is known about x

live ↗
InOrderOfElement(x)\mathrm{OrderOfElement}(x)OutOrderOfElement(x)\mathrm{OrderOfElement}(x)
About
Examples20
CrosswalkWikipediaMathWorldmathlib4

See also: PermutationOrder, MultiplicativeOrder