We wish to show that combinatorially . Let's take for simplicity. The general case follows. Let's first write down strings which enumerate :
000001010011100101110111To make use of , we're going to treat our strings as necklaces . So,
for example, the string 011 looks like:
*-→ 0 -*| || ↓1 ←--- 1So we have three possible rotations of the string 011:
011110101- Each of these rotations are unique, since they can be totally ordered using lexicographic ordering. Indeed, for any string other than
000,111, all of its rotations are unique.
- So we can count the above 7 strings with equivalence class representatives. These representatives are those strings that are the lex smallest in their cyclic shifts. (Why are cyclic shifts so important ?)
Cyclic subshifts of strings:---------------------------000, 000, 000001, 010, 100011, 110, 101111, 111, 111- We've written the strings along with their cyclic subshifts, with the representative of the equivalence class as the first element. So the representatitives are
000, 001, 011, 111. Note that two of these (000, 111) are equal to their cyclic subshifts. All of the others are distinct, and generate 3 elements.
- So we can count the above strings as:
all strings = {shifts of 001, 011}U{000, 111}|all strings| = |{shifts of 001, 011}|+|{000, 111}|no. of shifts = 3*(no. of representatives)2^3 = 3 * (no. of representatives) + 22^3 = 3 * (no. of representatives) + 22^3 % 3 = 2In general, for x^p % p, we will get x strings that contain the same letter.
These will not have elements in their cyclic shift equivalence classes. The
other strings will be generated as the smallest cyclic subshift of some
string.
§ Why does this not work when p is not prime?
Let p = 4. In this case, I can pick the string s = 0101. It has shifts:
0101 <-10100101 <-1010so two of its shifts overlap, hence we will double-count the string 0101
if I counted its equivalence class as having size 4.
§ Relationship to group theory?
- How does this relate to group theory? Well, what we are doing is providing an action of the group
Z/pZinto the set of stringsX^pwhereXis some set. Our group action for a numbern ∈ Z/pZtakes a strings ∈ X^pto its cyclic shift byncharacters.
- We are then using the fact that the orbits of an action when
pis prime has size either1orp, since the size of the orbit divides the size of the groupZ/pZ, which isp, a prime. The divisors ofpare only1andp. Therefore, the size of the orbit is either1orp.
- Only necklaces that have identical elements like
000and111have orbits of size1. We have|X|such necklaces.
- All other necklaces have size
p.
- The rest of the proof follows similarly as before.