Skip to content

AlternatingComplement ​

Every second letter swapped for the other, starting with the second.

AlternatingComplement(BinaryWord)Every second letter swapped for the other, starting with the second.
Typed signatures
TypePackageApplies
(binary_word) -> binary_wordcombinatoricsalways

Domain: Combinatorial maps

Details
  • Takes a BinaryWord and returns a BinaryWord — a typed map, so a wrong carrier is a type error rather than a wrong answer.
  • FindStat's Mp00158, "alternating inverse", an involution.

Examples

Basic #

the binary word 0110001100

live ↗
InAlternatingComplement(BinaryWord⁡([0,1,1,0,0]))\mathrm{AlternatingComplement}({\operatorname{BinaryWord}}([0, 1, 1, 0, 0]))OutBinaryWord⁡([0,0,1,1,0]){\operatorname{BinaryWord}}([0, 0, 1, 1, 0])
About
Examples1
CrosswalkFindStat