Surjections
A name from the enumeratio catalogue with no kernel of its own yet; this page carries its crosswalk only.
Catalogued in the enumeratio database, with crosswalk rows in oeis, sage; not yet written up here.
✓ checked against that system · ! checked, with disagreements (hover a chip)OEIS
A000670A019538A131689✓SageMathOrderedSetPartitions(n)Surjections(...)Catalogued in the enumeratio database, with crosswalk rows in oeis, sage; not yet written up here.Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer<0..>, integer<0..>) -> indexed_collection<surjection> | combinatorics | always |
Definition
Epsil, as the implementation runs it.
count(_n, _k)
_tables[_n * (_k + 1) + _k + 1]unrank(_n, _k, _r)
Drop(Fold(Function(Apply(
(sw: list<integer>) => Apply((sm: integer) => Apply((sl: integer) => Apply(
(sc: list<integer>) => Join([sc[1], sc[3]], sw, [sc[2]]),
Fold(
Function(sf if 0 < sf[2] else Apply(
(sn: integer) => [sf[1], c, sm if Contains(sw, c) else sm - 1] if sf[1] < sn else [sf[1] - sn, 0, sm],
_tables[sl *
(_k + 1) + sm + 1] if Contains(sw, c) else _tables[sl *
(_k + 1) +
(sm - 1) +
1] if 0 < sm else 0,
), sf, c),
[su[1], 0, sm],
Range(1, _k, 1),
),
), _n - si), su[2]),
Drop(su, 2),
), su, si), [_r, _k], Range(1, _n, 1)), 2)rank(_n, _k, _x)
Fold(Function(Apply(
(sp: list<integer>) => Apply((sm: integer) => Apply((sl: integer) => [
sr[1] +
Fold(
Function(sb +
(_tables[sl *
(_k + 1) + sm + 1] if Contains(sp, c) else _tables[sl *
(_k + 1) +
(sm - 1) +
1] if 0 < sm else 0), sb, c),
0,
Range(1, sx - 1, 1),
),
sm if Contains(sp, sx) else sm - 1,
sr[3] + 1,
], _n - sr[3]), sr[2]),
Take(_x, sr[3] - 1),
), sr, sx), [0, _k, 1], _x)[1]valid(_n, _k, _x)
Length(_x) == _n &&
Fold(Function(ok_x && 1 <= x && x <= _k, ok_x, x), True, _x) && Fold(
Function(ok_c &&
Contains(_x, c), ok_c, c),
True,
Range(
1,
_k,
1,
),
)tables(_n, _k)
Fold(
Function(Join(
j_t,
Fold(
Function(ReplaceAt(
j_row,
j_c + 1,
(j_c * j_t[(j_s - 1) * (_k + 1) +
(j_c - 1) + 1] if 0 < j_c else 0) +
(_k - j_c) * j_t[(j_s - 1) * (_k +
1) +
j_c + 1],
), j_row, j_c),
Map(Function(0, j_z), Range(0, _k + 1 - 1, 1)),
Range(0, _k + 1 - 1, 1),
),
), j_t, j_s),
Fold(
Function(
ReplaceAt(j_row, j_c + 1, 1 if j_c == 0 else 0),
j_row,
j_c,
),
Map(Function(0, j_z), Range(0, _k + 1 - 1, 1)),
Range(0, _k + 1 - 1, 1),
),
Range(1, _n + 1 - 1, 1),
)Maps
Into and out of Surjection, called as CombinatorialMap(x, "Name"). Properties are the laws we state and what FindStat records.
From Surjection
- SetCompositionSurjection → SetCompositioninverseThe set composition a surjection labels: block j holds the positions labelled j.
To Surjection
- SurjectionSetComposition → SurjectioninverseA set composition as a surjection: each position labelled with its block's index, from 1.