Skip to content

CutWord ​

A composition of n as the binary word of length n - 1 marking where it is cut.

CutWord(Composition)A composition of n as the binary word of length n - 1 marking where it is cut.
Typed signatures
TypePackageApplies
(composition) -> binary_wordcombinatoricsalways

Domain: Combinatorial maps

Details
  • Takes a Composition and returns a BinaryWord — a typed map, so a wrong carrier is a type error rather than a wrong answer.
  • Not order-preserving: IntegerCompositions lists compositions lex on their parts, while BinaryWords(n - 1) through Composition(word) gives them in their cut words' order.

Examples

Basic #

the composition 2+1+32 + 1 + 3

live ↗
InCutWord(Composition⁡([2,1,3]))\mathrm{CutWord}({\operatorname{Composition}}([2, 1, 3]))OutBinaryWord⁡([0,0,1,1,0]){\operatorname{BinaryWord}}([0, 0, 1, 1, 0])
About
Examples1