A permutation of $n$ is a one-to-one and onto function $p$ from $\{0,1,2,\dots,n-1\}$ to itself, such that $p(i) = p(j)$ if and only if $i=j$.  The identity permutation is given by $p(i) = i$ for $0 \leq i &lt; n$. How to check whether $P$ can be written as some power of permutation $Q$ (i.e find $j$ such that $P=Q^j$, $P$ and $Q$ are permutation and given in problem)?
Suppose there are $2$ permutations given by $p$ and $q$. I need to check whether $p$ belongs to the group generated by $q$, and if so, it's representation in a power of $q$. In other words, I've been given $p$ and $q$, I need to check whether $\exists i \in \{ 0,...,|q|-1 \} \text{ such that } p = q^i$ I know that if $m = \gcd(i, |q|)$, then $|q^i| = \frac{|q|}{m}$. Now, say that such an $i$ exists. Then, $$ |p| = \frac{|q|}{\gcd(i, |q|)} \Rightarrow \gcd(i, |q|) = \frac{|q|}{|p|} $$ Thus, a necessary condition for such an $i$ to exist is: $|p|$ divides $|q|$ Say that this holds, and $\frac{|q|}{|p|} = r$, where r is an integer. Then we just have to solve $\gcd(i, |q|) = r$ for $ i \in \{ 0,...,|q|-1 \}$. Can this be done? If not manually, then by some efficient algorithm? (Note: Just looping over all values of $i$ is not efficient as $i$ may be very large) Edit: Another way I can think of solving this is by writing both $p$ and $q$ as product of disjoint cycles: $$ p = c_1c_2\ldots c_k \text{ and } q = d_1d_2\ldots d_l $$ And thus, as disjoint cycles commute: $$ p^i = c_1^ic_2^i\ldots c_k^i $$ How to proceed after this?
Is it possible to prove a null hypothesis? Improving upon ArcGIS Buffer/Dissolve performance? I've seen papers (e.g., in Science) where the first two authors are listed in non-alphabetical order, and yet there are asterisks behind their names to say that they contributed equally.   It seems strange to me, because if the two authors are in alphabetical order, then it could be that the first author contributed more or the two contributed equally, and this can be made clear with asterisks in the paper if it's the latter case. When they're in non-alphabetical order, however, if someone only sees the author list without seeing the paper, he/she will likely assume that the first author contributed most.  So my question is: Are there particular reasons why people do that? (This  is related, but I don't think the answers there get to my question.) overbrace/underbrace but with an arrow instead Is there a similar command to \overbrace{foo}^{bar} but instead of braces, an arrow pointing up/down?  EDIT: Here's a little demonstration of how I'd expect something like this to work:    And possible syntax would be \overarrow{a=b}^{\text{theorem X}} I've read  and am interested in this line:     You should never use normal sudo to start graphical applications as Root.   Why? What is the difference? Please provide a simple explanation, as I'm just a normal desktop user. Which is correct: "he don't" or "he doesn't"? Which one is correct in a sentence?        He don't    He doesn't      I guess "he doesn't" should be correct because he is third person singular but I've seen some people using do with he. Which one is correct? The more I read about this, the more confused I become. Illuminance, as I understand it,  measured in lux, is the perceived brightness of light on a surface. It's what you'd measure with an incident light sensor. Luminance, then, is how much reflected light you'd perceive looking at that surface. This is what the light meter in a camera measures. Am I correct so far?  In both cases, the word "perceived" is important, because the scales are weighted using a  to map wavelengths to . However, in the case of illuminance, there's only actual perception if your eye happens to be the surface in question.  I can basically grasp this, but then I come across charts saying things like "family living room: 50 lux". Wait, hold on! Does that really mean that the typical lights in a house are that bright, or is it just confused and wrong, or am I confused and wrong?  If you're not taking pictures of light sources directly, why would an incident light meter reading ever be useful in photography? Reflected light recorded on film or by a sensor is usually what makes a photograph. So, if I have an incident light meter, how does that reading relate meaningfully to my camera settings?  Since incident light meters are sold and used, this implies that there must be some useful conversion. But this is where my brain explodes. Google tells me that 1 lumen equals 1 candela, so therefore 1 lumen/m² (i.e. 1 lux) must equal 1 candela/m2 (i.e. 1 nit). But clearly something is missing from this. There's something called a "steradian". Cones are involved. I'd never heard of this before; how does it fit in? I can see how it might be determined when calculating the usefulness of LED home lighting, but for a photo, I'm at a loss.  Some part of my (exploded, from the last paragraph) brain is trying to relate this to the difference between flash metering with TTL and with an incident meter. But how can the incident meter work without knowing the reflectance properties of the objects in the scene? Is this what the "C" in the  is all about? Is it just an average-this-probably-will-work value, or is there more to it than that? And if it is just an average, what knowledge is necessary for compensating for off-averages scenes? (As with the , where the photographer simply judges if the scene should be rendered brighter or darker than the average given by the meter.)  So yeah, so much confusion. In short:   What's the difference? Can one meaningfully convert between the two? When and how are illuminance / incident light measurements useful for photography?     Update: I appreciate Stan's answer, which covers the third point of when and how pretty well. And I think I've basically got the first point figured out, as described above. But I'd appreciate some answers covering the issue of conversion as well, both in the mathematical abstract and as the practical for photography. And I wouldn't mind more why and how, either. How to intuitively understand eigenvalue and eigenvector? How to add programs to the Unity Launcher or Ubuntu Dock? How can I add new programs to the launcher (or the dock in Ubuntu 17.10 and later) in Ubuntu? Is there a regular expression to detect a valid regular expression? Does mathematics become circular at the bottom? What is at the bottom of mathematics? I am trying to understand what mathematics is really built up of. I thought mathematical logic was the foundation of everything. But from reading a book in mathematical logic, they use "="(equals-sign), functions and relations.  Now is the "=" taken as undefined? I have seen it been defined in terms of the identity relation.  But in order to talk about functions and relations you need set theory.  However,  seems to be a part of mathematical logic.  Does this mean that (naive) set theory comes before sentential and predicate logic? Is (naive)set-theory at the absolute bottom, where we can define relations and functions and the eqality relation. And then comes sentential logic, and then predicate logic?  I am a little confused because when I took an introductory course, we had a little logic before set-theory. But now I see in another book on introduction to proofs that set-theory is in a chapter before logic. So what is at the bottom/start of mathematics, logic or set theory?, or is it circular at the bottom?  Can this be how it is at the bottom?  naive set-theory $\rightarrow$ sentential logic $\rightarrow $ predicate logic $\rightarrow$ axiomatic set-theory(ZFC) $\rightarrow$ mathematics  (But the problem with this explanation is that it seems that some naive-set theory proofs use logic...)  (The arrows are of course not "logical" arrows.)  simple explanation of the problem:  a book on logic uses at the start: functions, relations, sets, ordered pairs, "="  a book on set theory uses at the start: logical deductions like this: "$B \subseteq A$", means every element in B is in A, so if $C \subseteq B, B \subseteq A$, a proof can be "since every element in C is in B, and every element in B is in A, every element of C is in A: $C \subseteq A$". But this is first order logic? ($(c \rightarrow b \wedge b \rightarrow a)\rightarrow (c\rightarrow a)$).  Hence, both started from each other? My computer does not store the history of the entries entered in RUN (WIN+R).   Thus, how to enable Windows to store the history? Should a toggle button show its current state or the state to which it will change? Why don't C++ compilers define operator== and operator!=? Comparing currency values as floats does not work How to escape text for regular expression in Java Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter "$5", I'd like to match that exactly rather than a "5" after the end of input. Solve for $f(x)$ if $f(f(x))=6x-f(x)$ Compression API on the iPhone I started a Roth IRA a little while ago, contributing ~$5,000, and I'd like some guidelines on how I should diversify my investments.  Should I invest in stocks or bonds or mutual funds or ETF? What percent should I contribute to these investments?  Additionally, I'm 30 years old, how might my age factor into diversification?  I understand that this is a very subjective question but any suggestions are greatly appreciated. How do i enter my numeric password in iPhone 4 in VoiceOver mode? My iPhone 4 is in VoiceOver mode. It`s currently locked and not accepting my passcode which is absolutely correct. And now it's saying iPhone is disabled.  Any solution?