Skip to content

CodeWord ​

The word that writes each part i as a one followed by i - 1 zeros.

CodeWord(IntegerComposition)The word that writes each part i as a one followed by i - 1 zeros.
Typed signatures
TypePackageApplies
(composition) -> binary_wordcombinatoricsalways

Domain: Combinatorial maps

Details
  • Takes a IntegerComposition and returns a BinaryWord — a typed map, so a wrong carrier is a type error rather than a wrong answer.
  • FindStat's Mp00094, Sage's to_code. An injection; its image is the words that start with a 1. Not CutWord, which marks the cuts and is one letter shorter than the size.

Examples

Basic #

the composition 2+1+32 + 1 + 3

live ↗
InCodeWord(IntegerComposition⁡([2,1,3]))\mathrm{CodeWord}({\operatorname{IntegerComposition}}([2, 1, 3]))OutBinaryWord⁡([1,0,1,1,0,0]){\operatorname{BinaryWord}}([1, 0, 1, 1, 0, 0])
About
Examples1
CrosswalkFindStat