2

Following on from my own example question in one of my previous posts I now want to better understand how to find the order of an element in a cyclic group G.

So in my previous example we had the group $G = \mathbb{Z}_{59}^{\times}$

I want to work out the order of 11 in group G. How would one compute and calculate this?

So far, I assume that you do 11^1 mod 59, 11^2 mod 59, 11^3 mod 59,..., 11^n mod 59 = 0?

Would be amazing to see how this would be computed and what other capabilities cyclic groups have

3 Answers3

7

If you just want to compute the order of $11\pmod {59}$:

Note that $58=2\times 29$ so the possible orders are $1,2,29,58$. Easy to see that $11^2\equiv 3 \pmod {59}$ so we just need to consider $11^{29}$.

To do that we remark that $$11^2\equiv 3\implies 11^4\equiv 9\implies 11^8\equiv 22$$

(all congruences $\pmod {59}$ of course).

Continuing we have $$11^{16}\equiv 22^2\equiv 12$$

And now we get $$11^{24}\equiv 11^{16}\times 11^8\equiv 12\times 22\equiv 28$$

And then $$11^{29}\equiv 11\times 11^4\times 11^{24}\equiv 11\times 9\times 28\equiv 58\equiv -1$$

Thus we have eliminated all the possible orders except $58$ so the order of $11\pmod {59}$ is $58$.

Note: there's nothing unique about the preceding calculations. This path looked short to me, but there might well be others as good or better.

lulu
  • 70,402
  • thank you for your answer but i am sorry but where did the 58 come from and how did you know the possible orders were 1,2,29,58? – user23473433819233d Aug 14 '19 at 00:30
  • 1
    The order of your group is $58$ (it is all the integers $\pmod {59}$ except for $0$). The order of an element in any finite group divides the order of the group. – lulu Aug 14 '19 at 00:32
  • @Mike Well, how do you eliminate $29$ as a possible order? $4$ has order $29$ $\pmod {59}$, for instance. – lulu Aug 14 '19 at 00:34
  • So if i had group Z*67 then the order of group is 66? 67-1 – user23473433819233d Aug 14 '19 at 00:35
  • 1
    Yes. For any prime $p$ the multiplicative group $\pmod p$ has order $p-1$. – lulu Aug 14 '19 at 00:35
  • I see that makes sense, so once you do p-1 then you find all the multiples for p-1 which becomes the order? after that apply it to 11? i do not understand why you chose 29 as the exponent value – user23473433819233d Aug 14 '19 at 00:38
  • Well, the order must divide $p-1$, which is $58$ in this case. Factoring that we see that the order must be one of $1,2,29,58$. These are all the factors! Of course, if you replace $59$ by a large prime, this can all be quite difficult. – lulu Aug 14 '19 at 00:40
  • @lulu Good Point, forgot to check that. – Mike Aug 14 '19 at 00:41
  • i understand @lulu but then why did you specifically do 11^29 as opposed to say 11^2 or 11^58? – user23473433819233d Aug 14 '19 at 00:42
  • Well, $11^2$ was easy, that's just $3$. There's no point computing $11^{58}$...that's clearly $1$ (that would be true for any non-zero residue). So that just leaves $29$. – lulu Aug 14 '19 at 00:43
  • 1
    If you are doing this in a spreadsheet, or in a program, you can just list all the powers of $11\pmod {59}$. At each stage, all you are doing is multiplying by $11$ and reducing, so each step is easy...but of course there are a lot of steps. – lulu Aug 14 '19 at 00:45
  • no but then you calculated 11^2 etc. my question is why did you not multiple the result of 11^2 11^58 11^2 11^29 and then do the modulo of that result – user23473433819233d Aug 14 '19 at 00:45
  • No idea what you mean. As I say, $11^{58}$ is clearly $1$, so why include it in your product? – lulu Aug 14 '19 at 00:46
  • 1
    As I said in the post, however, you could compute $11^{29}$ in multiple ways. I just picked a path that looked good to me. Try a different one! – lulu Aug 14 '19 at 00:47
  • I should say: Iterated squaring, which is what I did here, is a very standard method of modular computation. – lulu Aug 14 '19 at 00:49
  • @user23473433819233d Curiously here it is actually easier to use baby-giant steps - I added an answer showing that. – Bill Dubuque Aug 14 '19 at 18:11
  • @lulu I think I get it now! :) So basically we compute all the possible powers, i.e. 1,2,29,58 and see which one gives one. Whichever one gives an output of -1 or 1 is the final answer right? – user23473433819233d Aug 14 '19 at 20:05
  • @BillDubuque I think I get it now! :) So basically we compute all the possible powers, i.e. 1,2,29,58 and see which one gives one. Whichever one gives an output of -1 or 1 is the final answer right? – user23473433819233d Aug 14 '19 at 20:05
  • Well...not the possible powers but the possible orders. And we are looking for the least of the possible orders that gives $1$. – lulu Aug 14 '19 at 20:06
  • @lulu I get it now I think! So long as any one of the possible orders gives 1 then the power that gave 1 is the answer? I'm so very close to understanding the answer but I will upvote and accept your answer but please please please explain whether the final answer was 58 because it gave 1? – user23473433819233d Aug 14 '19 at 23:11
  • Not quite. It's $58$ because it is the smallest power that gives $1$. The "smallest" part is critical there. Any integer $n$, prime to $59$, satisfies $n^{58}\equiv 1\pmod {59}$. – lulu Aug 14 '19 at 23:44
2

To the general question: I don't think you're going to get an answer as simple as you want. For background, see Wikipedia: Multiplicative order .

For the complexity of a mature algorithm, see https://rosettacode.org/wiki/Multiplicative_order and this previous answer: Algorithms for finding the multiplicative order of an element in a group of integers mod m

Chris Culter
  • 26,806
1

Worth note: Shanks baby-giant step works in a group knowing only an order bound, e.g. $\!\!\bmod 59\!:$

$\qquad\,\ \begin{array}{c | c } r & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline 11^{\large r}\! & 1 & 11 & 3 & 33 & 9 & \color{#0a0}{40} & 27 & \color{#c00}2 \end{array}\ $ via $\ 11^{\large\color{} 2}\equiv 3\,$ so $\!\!\begin{align}&\ \ 1\to \ \ 3\to\ 9\, \ldots\\ &\ \ \ \ \ \ 11\to 33\to 99\!\equiv\! \color{#0a0}{40}\,\ldots\end{align}$

$\qquad\ \ \, \begin{array}{c | c } q & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline \color{#c00}2^{\large q} & 2 & 4 & 8 & 16 & 32 & 5 & 10 & 20 & \color{#0a0}{40} \end{array}\ $ as above, all trivial modular writhmetic.

Hence $\, 11^{\large 5} \equiv \color{#0a0}{40}\equiv 2^{\large 9}\equiv (11^{\large 7})^{\large 9}\,\Rightarrow\, \bbox[6px,border:1px solid #c00]{1\equiv 11^{\large 63-5}\equiv 11^{\large 58}}$

and $58$ is the least, else for smaller $\,7q\!-\!r\!:\ 11^{\large 7q-r}\equiv 1\,\Rightarrow\, 2^{\large q}\equiv 11^{\large r}$ contra table values.

This may be faster than the other methods since here all arithmetic is trivial $ $ [$2\cdot n\,$ or $\,3\cdot n$].

But generally this method will be less efficient than using divisibility constraints and/or deeper ideas (e.g. the Order Test implicitly used in lulu's answer or, by Euler's criterion $\,11^{\large 29}\!\equiv (11\,|\,58)\equiv -1\,$ by a quick Legendre symbol computation). However, the baby-giant step method is well-worth knowing since it proves useful in various contexts.

See here for general algorithms for order computation (some of which use this and related ideas).

J. W. Tanner
  • 60,406
Bill Dubuque
  • 272,048