Skip to content

LongestIncreasingSubsequenceCount ​

The number of longest increasing subsequences of p.

✓ checked against that system · ! checked, with disagreements (hover a chip)FindStatSt000883via Permutation✓
LongestIncreasingSubsequenceCount(p)The number of longest increasing subsequences of p.
Typed signatures
TypePackageApplies
(list<integer> | permutation) -> numbercombinatoricsalways

Domain: Permutation statistics

Details
  • Defined over Permutation as 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.

Definition

Epsil, as the implementation runs it.

on Permutation, over _x

1 if Length(_x) < 1 else Apply(
                                (r: list<integer>) => Sum(Map(
                                                               Function(r[Length(_x) +
                                                                          i] if r[i] ==
                                                                               Max(Map(
                                                                                        Function(r[j], j),
                                                                                        Range(1, Length(_x)),
                                                                                      )) else 0, i),
                                                               Range(
                                                                      1,
                                                                      Length(_x),
                                                                    ),
                                                             )),
                                Fold(Function(Apply(
                                                     Function(
                                                               Apply(
                                                                      Function(ReplaceAt(
                                                                                          ReplaceAt(a, b, L),
                                                                                          Length(_x) + b,
                                                                                          c,
                                                                                        ), c),
                                                                      1 if L ==
                                                                           1 else Sum(Map(
                                                                                          Function(a[Length(_x) + j], j),
                                                                                          Filter(
                                                                                                  Range(1, Length(_x)),
                                                                                                  Function(j < b &&
                                                                                                           _x[j] < _x[b] &&
                                                                                                           a[j] ==
                                                                                                           L - 1, j),
                                                                                                ),
                                                                                        )),
                                                                    ),
                                                               L,
                                                             ),
                                                     1 + Max(Join(
                                                                   [0],
                                                                   Map(
                                                                        Function(a[j], j),
                                                                        Filter(
                                                                                Range(1, Length(_x)),
                                                                                Function(j < b &&
                                                                                         _x[j] < _x[b], j),
                                                                              ),
                                                                      ),
                                                                 )),
                                                   ), a, b), Map(
                                                                 Function(0, w),
                                                                 Range(
                                                                        1,
                                                                        2 *
                                                                        Length(_x),
                                                                      ),
                                                               ), Range(
                                                                        1,
                                                                        Length(_x),
                                                                      )),
                              )

Examples

Basic #

the one-line word 312312

live ↗
InLongestIncreasingSubsequenceCount(Permutation⁡([3,1,2]))\mathrm{LongestIncreasingSubsequenceCount}({\operatorname{Permutation}}([3, 1, 2]))Out11

the one-line word 312312, as a plain list

live ↗
InLongestIncreasingSubsequenceCount([3,1,2])\mathrm{LongestIncreasingSubsequenceCount}(\bigl\lbrack3, 1, 2\bigr\rbrack)Out11

the one-line word 24132413

live ↗
InLongestIncreasingSubsequenceCount(Permutation⁡([2,4,1,3]))\mathrm{LongestIncreasingSubsequenceCount}({\operatorname{Permutation}}([2, 4, 1, 3]))Out33
Properties #

FindStat's value for [1]

live ↗
InCombinatorialStat(Permutation⁡([1]),LongestIncreasingSubsequenceCount)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1]), \text{LongestIncreasingSubsequenceCount})Out11

Known value · FindStat St000883

FindStat's value for [1,2]

live ↗
InCombinatorialStat(Permutation⁡([1,2]),LongestIncreasingSubsequenceCount)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1, 2]), \text{LongestIncreasingSubsequenceCount})Out11

Known value · FindStat St000883

FindStat's value for [2,1]

live ↗
InCombinatorialStat(Permutation⁡([2,1]),LongestIncreasingSubsequenceCount)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([2, 1]), \text{LongestIncreasingSubsequenceCount})Out22

Known value · FindStat St000883

About
Examples6
CrosswalkFindStat