The enigma machine permuted the words by using a plugboard, three rotors, and a reverting drum.
View the image by clicking as I don't have permission to upload image
The plugboard, the three rotors, and the reverting drum performed permutations on the incoming key.
View the image by clicking as I don't have permission to upload image
The permutation can be given by
$$SNMLRL^{-1}M^{-1}N^{-1}S^{-1}$$
Now, when the operator of the enigma pressed the key, the right-most rotor is rotated once.
View the image by clicking as I don't have permission to upload image
So, to accommodate this change in our permutation, we added a permutation P that takes an alphabet and spits out the next alphabet.
$$P = (a\ b\ c\ d\ e\ f\ g\ h\ i\ j\ k\ l\ m\ n\ o\ p\ q\ r\ s\ t\ u\ v\ w\ x\ y\ z)$$
So, now the net permutation becomes,
$$SPNP^{-1}MLRL^{-1}M^{-1}PN^{-1}P^{-1}S^{-1}$$
I got till this, but this is a special case when all the rotors are lined up initially i.e. "a" of the right rotor matched with "a" of the plugboard and "a" of the middle rotor, similarly for the others.
But what if the rotors are not lined up i.e. "a" of the right rotor matched with say "p" of the plugboard. Or in other words, there is an initial offset in all the rotors.
Will the above permutation work in the general case when the rotors have some offsets?
The images are taken from: Marian Rejewski. "An application of the theory of permutations in breaking the Enigma cipher." Applicationes Mathematicae 16.4 (1980): 543-559. http://eudml.org/doc/264403