Tournaments
A name from the enumeratio catalogue with no kernel of its own yet; this page carries its crosswalk only.
Orientations of the complete graph on [n].
Tournaments(...)Orientations of the complete graph on [n].Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer<0..>) -> indexed_collection<tournament> | combinatorics | always |
Definition
Epsil, as the implementation runs it.
count(_n)
2 ^ (Binomial(_n, 2) if 0 <= 2 && 2 <= _n else 0)unrank(_n, _r)
Map(
Function(Apply((tu_k: integer) => Apply(
(tu_u: integer) => Apply(
(tu_v: integer) => [tu_v, tu_u] if (_r -
_r %
2 ^
((Binomial(_n, 2) if 0 <= 2 &&
2 <= _n else 0) -
tk)) /
2 ^
((Binomial(_n, 2) if 0 <= 2 &&
2 <= _n else 0) -
tk) %
2 ==
1 else [tu_u, tu_v],
tu_k -
((Binomial(_n, 2) if 0 <= 2 &&
2 <= _n else 0) -
(Binomial(_n - tu_u +
1, 2) if 0 <= 2 &&
2 <=
_n - tu_u +
1 else 0)) + tu_u,
),
_tables[tu_k],
), tk), tk),
Range(1, Binomial(_n, 2) if 0 <= 2 && 2 <= _n else 0, 1),
)rank(_n, _x)
Fold(Function(
ra + (2 ^ ((Binomial(_n, 2) if 0 <= 2 && 2 <= _n else 0) -
((Binomial(_n, 2) if 0 <= 2 && 2 <= _n else 0) -
(Binomial(_n - Min(_x[rj][1], _x[rj][2]) + 1, 2) if 0 <=
2 &&
2 <=
_n -
Min(_x[rj][1], _x[rj][2]) +
1 else 0) + (Max(_x[rj][1], _x[rj][2]) - Min(
_x[rj][1],
_x[rj][2],
)))) if _x[rj][2] < _x[rj][1] else 0),
ra,
rj,
), 0, Range(1, Length(_x), 1))valid(_n, _x)
Fold(Function(ok_wb && 1 <= _x[wb][1] && _x[wb][1] <= _n && 1 <= _x[wb][2] &&
_x[wb][2] <= _n && _x[wb][1] != _x[wb][2], ok_wb, wb), True, Range(1, Length(_x), 1)) && Fold(
Function(ok_wj &&
Fold(
Function(ok_wi &&
(Binomial(_n, 2) if 0 <= 2 &&
2 <= _n else 0) -
(Binomial(_n -
Min(_x[wi][1], _x[wi][2]) +
1, 2) if 0 <= 2 &&
2 <=
_n -
Min(_x[wi][1], _x[wi][2]) +
1 else 0) +
(Max(_x[wi][1], _x[wi][2]) -
Min(_x[wi][1], _x[wi][2])) !=
(Binomial(_n, 2) if 0 <= 2 &&
2 <= _n else 0) -
(Binomial(_n -
Min(_x[wj][1], _x[wj][2]) +
1, 2) if 0 <= 2 &&
2 <=
_n -
Min(_x[wj][1], _x[wj][2]) +
1 else 0) +
(Max(_x[wj][1], _x[wj][2]) -
Min(_x[wj][1], _x[wj][2])), ok_wi, wi),
True,
Range(1, wj - 1, 1),
), ok_wj, wj),
True,
Range(1, Length(_x), 1),
) if Length(_x) ==
(Binomial(_n, 2) if 0 <= 2 &&
2 <= _n else 0) &&
Fold(
Function(ok_wp &&
Length(_x[wp]) == 2, ok_wp, wp),
True,
Range(1, Length(_x), 1),
) else Falsetables(_n)
Fold(
Function(Join(et, Map(Function(eu, ez), Range(1, _n - eu, 1))), et, eu),
[],
Range(1, _n - 1, 1),
)Enumeration
Examples
About
| Examples | 2 |
|---|