UlamDistance
The entries to remove to leave an increasing sequence: n less the length of a longest increasing subsequence.
✓ checked against that system · ! checked, with disagreements (hover a chip)FindStat
St000829via Permutation✓UlamDistance(p)The entries to remove to leave an increasing sequence: n less the length of a longest increasing subsequence.Typed signatures
| Type | Package | Applies |
|---|---|---|
(list<integer> | permutation) -> number | combinatorics | always |
Details
- Defined over
Permutationas an expression in_x, evaluated by compute-engine — the definition IS the implementation. - Takes a
Permutation, and also a bare list of integers: this reading compares entries with each other rather than with their positions, so it stands on any sequence. - FindStat takes the longest increasing subsequence of the inverse, which has the same length.
Definition
Epsil, as the implementation runs it.
on Permutation, over _x
0 if Length(_x) < 1 else Length(_x) - Count(Fold(Function(Apply(
Function(
Join(a, [b]) if k > Count(a) else ReplaceAt(a, k, b),
k,
),
Count(Filter(
a,
Function(t < b, t),
)) +
1,
), a, b), [], _x))Examples
Basic #
Properties #
About
| Examples | 6 |
|---|---|
| Crosswalk | FindStat |