BinaryStrings
The binary strings of length , in standard binary counting order.
✓ checked against that system · ! checked, with disagreements (hover a chip)OEIS
A000079✓A320487✓A011782✓A131577✓A034008✓A166444✓BinaryStrings(n)the binary strings of length Combinatorica
Map[Function[s, Table[Boole[MemberQ[s, i]], {i, n}]], BinarySubsets[Range[n]]]Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer<0..>) -> indexed_collection<list<integer>> | combinatorics | always |
Definition
Epsil, as the implementation runs it.
count(_n)
1 if _n == 0 else 2 ^ _nunrank(_n, _r)
Map(
Function((_r - _r % 2 ^ (_n - j)) / 2 ^ (_n - j) % 2 + 0, j),
Range(1, _n, 1),
)rank(_n, _x)
Fold(Function(acc * 2 + (_x[j] - 0), acc, j), 0, Range(1, _n, 1))valid(_n, _x)
Length(_x) == _n && Fold(Function(
ok_j && 0 <= _x[j] && _x[j] <= 2 + 0 - 1,
ok_j,
j,
), True, Range(1, Length(_x), 1))Examples
About
| Examples | 2 |
|---|---|
| Checked against | Combinatorica 2 agree |
| Crosswalk | OEIS ×6Combinatorica |
Implementation
mapped
combinatoricapackages/oracle/src/mappings.tsCombinatorica lists binary counting as subsets; the word of a subset has a 1 at each element.
See also: BinaryWords