Skip to content

Instantly share code, notes, and snippets.

@oshea00
Last active September 3, 2023 17:56
Show Gist options
  • Save oshea00/383ccdd172e09e4888aff4cdaa51bef1 to your computer and use it in GitHub Desktop.
Save oshea00/383ccdd172e09e4888aff4cdaa51bef1 to your computer and use it in GitHub Desktop.
Parity of 0123 permutations:
- 4! = 24 sequences
Rules:
- a shift left changes parity
- sequence reversal is the same parity
- single swap changes parity
0123 even 3210 even
1230 odd 0321 odd
2301 even 1032 even
3012 odd 2103 odd
- swap 01 rotate left to start next block
0231 even 1320 even
2310 odd 0132 odd
3102 even 2013 even
1023 odd 3201 odd
- swap 03 rotate left to start next block
1203 even 3021 even
2031 odd 1302 odd
0312 even 2130 even
3120 odd 0213 odd
@oshea00
Copy link
Author

oshea00 commented Sep 3, 2023

  1. There are really only 6 even and odd sequences - the others are mirrors.
  2. Another way to start the next blocks from 0123:
  • pin 0 and rotate left 123 -> 0231
  • pin 3 and rotate left 012 -> 1203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment