Skip to content

CodeComposition ​

The composition whose code is the word with a 1 put in front: each 1 opens a part, of 1 plus the zeros after it.

CodeComposition(BinaryWord)The composition whose code is the word with a 1 put in front: each 1 opens a part, of 1 plus the zeros after it.
Typed signatures
TypePackageApplies
(binary_word) -> compositioncombinatoricsalways

Domain: Combinatorial maps

Details
  • Takes a BinaryWord and returns a IntegerComposition — a typed map, so a wrong carrier is a type error rather than a wrong answer.
  • FindStat's Mp00178, Sage's from_code. An injection one size up (the empty composition has no preimage); the inverse of CodeWord on the words that start with 1. Not IntegerComposition, whose word marks the cuts.

Examples

Basic #

the binary word 0110001100

live ↗
InCodeComposition(BinaryWord⁡([0,1,1,0,0]))\mathrm{CodeComposition}({\operatorname{BinaryWord}}([0, 1, 1, 0, 0]))OutIntegerComposition⁡([2,1,3]){\operatorname{IntegerComposition}}([2, 1, 3])
About
Examples1
CrosswalkFindStat