Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $\mathit{PERM\text{-}POWER} = \{ \langle p, q, t\rangle \mid p = q^t \}$ where $p$ and $q$ are permutations on $\{1, \ldots, k\}$ and $t$ is a binary integer. How do I prove that $\mathit{PERM\text{-}POWER}$ is in P?

share|cite|improve this question

Computing the $t$th power of a permutation is as simple as writing the permutation as a product of disjoint cycles (clearly doable in polynomial time), computing the $t$ modulo each cycle length (also clearly polynomial in the length of $t$, say by grade-school division bit for bit), and iterating each cycle remainder number of times (polynomial even if you don't try to be smart about it, because the remainder will be smaller than $k$, so there are $O(k^2)$ operations even for naive iteration). Finally compose the iterated cycles (again using $O(k^2)$ operations when doing it naively).

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.