Skip to content

PartitionsInBox ​

The integer partitions fitting in an a×ba \times b box: at most aa parts, each at most bb. Count (a+ba)\binom{a+b}{a}.

✓ checked against that system · ! checked, with disagreements (hover a chip)OEISA046899✓
PartitionsInBox(a, b)partitions with at most aa parts, each at most bb
Typed signatures
TypePackageApplies
(integer<0..>, integer<0..>) -> indexed_collection<integer_partition>combinatoricsalways

Domain: Collections

Definition

Epsil, as the implementation runs it.

count(_a, _b)

Binomial(_a + _b, _a)

unrank(_a, _b, _r)

Apply(
       (pb_digits: list<integer>) => Filter(
                                             Map(
                                                  Function(
                                                            _b - (pb_digits[m +
                                                                            1] +
                                                                  1) + m,
                                                            m,
                                                          ),
                                                  Range(1, _a, 1),
                                                ),
                                             Function(_t > 0, _t),
                                           ),
       Apply((pb_st_init: list<integer>) => Fold(
                                                  (pb_st: list<integer>, pb_i) => Apply(
                                                                                         (pb_st_next: list<integer>) => pb_st_next,
                                                                                         Apply((pb_left: integer) => Apply(
                                                                                                                            (pb_found: integer) => ReplaceAt(ReplaceAt(pb_st, 1, pb_left -
                                                                                                                                                                                 _tables[pb_found *
                                                                                                                                                                                         (_a + 1) + pb_i + 1]), pb_i + 1, pb_found),
                                                                                                                            Fold(
                                                                                                                                  Function(pb_c if _tables[pb_c *
                                                                                                                                                           (_a + 1) + pb_i + 1] <=
                                                                                                                                                   pb_left else pb_best, pb_best, pb_c),
                                                                                                                                  pb_i - 1,
                                                                                                                                  Range(
                                                                                                                                         pb_i - 1,
                                                                                                                                         (_a + _b if pb_i == _a else pb_st[pb_i + 2]) -
                                                                                                                                         1,
                                                                                                                                         1,
                                                                                                                                       ),
                                                                                                                                ),
                                                                                                                          ), pb_st[1]),
                                                                                       ),
                                                  pb_st_init,
                                                  Range(_a, 1, -1),
                                                ), Join(
                                                        [_r],
                                                        Map(
                                                             Function(0, pb_z),
                                                             Range(1, _a, 1),
                                                           ),
                                                      )),
     )

rank(_a, _b, _x)

Fold(Function(acc + _tables[(_b - (_x[j] if j <= Length(_x) else 0) + j - 1) *
                            (_a + 1) + j + 1], acc, j), 0, Range(1, _a, 1))

valid(_a, _b, _x)

Length(_x) <= _a && Fold(Function(okv && _x[jv] >= 1 &&
                                         _x[jv] <= _b &&
                                         (_x[jv] <= _x[jv - 1] if jv > 1 else True), okv, jv), True, Range(
                                                                  1,
                                                                  Length(_x),
                                                                  1,
                                                                ))

tables(_a, _b)

Fold(
      Function(
                Join(
                      pc_t,
                      Fold(
                            Function(
                                      ReplaceAt(
                                                 pc_row,
                                                 pc_c + 1,
                                                 1 if pc_c == 0 else pc_t[(pc_s -
                                                                           1) *
                                                                          (_a +
                                                                           1) +
                                                                          (pc_c -
                                                                           1) + 1] +
                                                                     pc_t[(pc_s -
                                                                           1) *
                                                                          (_a +
                                                                           1) +
                                                                          pc_c +
                                                                          1],
                                               ),
                                      pc_row,
                                      pc_c,
                                    ),
                            Map(Function(0, pc_z), Range(0, _a + 1 - 1, 1)),
                            Range(0, _a + 1 - 1, 1),
                          ),
                    ),
                pc_t,
                pc_s,
              ),
      Fold(
            Function(
                      ReplaceAt(pc_row, pc_c + 1, 1 if pc_c == 0 else 0),
                      pc_row,
                      pc_c,
                    ),
            Map(Function(0, pc_z), Range(0, _a + 1 - 1, 1)),
            Range(0, _a + 1 - 1, 1),
          ),
      Range(1, Max(_a + _b, 1) - 1, 1),
    )

Statistics

On IntegerPartition, called as CombinatorialStat(x, "Name").

Maps

Into and out of IntegerPartition, called as CombinatorialMap(x, "Name"). Properties are the laws we state and what FindStat records.

From IntegerPartition

  • BinaryWordIntegerPartition → BinaryWordInjectionMp00095The shape's boundary read from the first row down: 1 for a step down, 0 for a step left.
  • BulgarianSolitaireIntegerPartition → IntegerPartitionGraded mapMp00308A move of Bulgarian solitaire: the first column of the Ferrers diagram becomes a new row.
  • GlaisherFranklinIntegerPartition → IntegerPartitionbijectioninverseBijectionGraded mapMp00312The Glaisher-Franklin bijection: even part sizes halved become repeated parts, and repeated odd parts merge into their binary multiples.
  • InitialTableauIntegerPartition → StandardTableauInjectionGraded mapMp00042The standard tableau of the shape filled row by row with 1, 2, ..., n.
  • InverseGlaisherFranklinIntegerPartition → IntegerPartitionbijectioninverseBijectionGraded mapMp00313The inverse of GlaisherFranklin: repeated parts merge into doubled parts, and a leftover part splits into copies of its odd part.
  • MinimalDyckPathIntegerPartition → DyckPathInjectionMp00043The shortest Dyck path tracing the shape of the Ferrers diagram.
  • OddPartsWordIntegerPartition → BinaryWordSurjectionMp00317The binary word marking which parts are odd, the parts taken largest first.
  • ParallelogramPolyominoDyckPathIntegerPartition → DyckPathInjectionMp00230The Dyck path of the partition read as a parallelogram polyomino, one column per part.
  • ReadingTableauIntegerPartition → StandardTableauInjectionGraded mapMp00045The recording tableau of the row reading word of the shape filled row by row.
  • RemoveFirstPartIntegerPartition → IntegerPartitionSurjectionMp00202The partition without its largest part: its first row removed.
  • TransposePartitionIntegerPartition → IntegerPartitioninvolutionBijectionGraded mapInvolutionMp00044The conjugate partition: column i of the Ferrers diagram becomes row i.

To IntegerPartition

  • BlockSizePartitionSetPartition → IntegerPartitionsurjectionSurjectionGraded mapMp00079The partition of n a set partition's block sizes form, largest first.
  • ConjugateAfterCycleTypePermutation → IntegerPartitionThe conjugate partition of the cycle type.
  • CutOutPartitionDyckPath → IntegerPartitionInjectionMp00027The partition cut out of the staircase by the path: part i is the number of downs before the (n + 1 - i)-th up step.
  • CycleTypePermutation → IntegerPartitionsurjectionSurjectionGraded mapMp00108The multiset of cycle lengths, as a partition.
  • NegativeCycleTypeSignedPermutation → IntegerPartitionSurjectionMp00169The lengths of the negative cycles, largest first: those of the underlying permutation with an odd number of negative entries.
  • PositiveCycleTypeSignedPermutation → IntegerPartitionSurjectionMp00166The lengths of the positive cycles, largest first: those of the underlying permutation with an even number of negative entries.
  • RskShapePermutation → IntegerPartitionsurjectionSurjectionGraded mapMp00060The common shape of the RSK tableaux: the row lengths, as a partition of n.
  • SortedPartitionIntegerComposition → IntegerPartitionsurjectionSurjectionGraded mapMp00040The partition a composition's parts form, sorted largest first.
  • TableauShapeStandardTableau → IntegerPartitionsurjectionSurjectionGraded mapMp00083The shape of a standard tableau: its row lengths.
21 more in FindStat, not implemented here
  • Mp00021CorePartition → IntegerPartitionGraded mapBijectionto bounded partition
  • Mp00022CorePartition → IntegerPartitionSurjectionto partition
  • Mp00037LabeledGraph → IntegerPartitionSurjectionGraded mapto partition of connected components
  • Mp00077SemistandardTableau → IntegerPartitionSurjectionGraded mapshape
  • Mp00110Posets → IntegerPartitionSurjectionGraded mapGreene-Kleitman invariant
  • Mp00179IntegerPartition → SkewPartitionInjectionGraded mapto skew partition
  • Mp00182SkewPartition → IntegerPartitionSurjectionouter shape
  • Mp00183SkewPartition → IntegerPartitionSurjectioninner shape
  • Mp00186SkewPartition → IntegerPartitionSurjectionGraded mapdominating partition
  • Mp00204Permutation → IntegerPartitionSurjectionGraded mapLLPS
  • Mp00225SemistandardTableau → IntegerPartitionSurjectionweight
  • Mp00251LabeledGraph → IntegerPartitionclique sizes
  • Mp00275LabeledGraph → IntegerPartitionSurjectionto edge-partition of connected components
  • Mp00276LabeledGraph → IntegerPartitionto edge-partition of biconnected components
  • Mp00306Posets → IntegerPartitionrowmotion cycle type
  • Mp00307Posets → IntegerPartitionpromotion cycle type
  • Mp00311PlanePartition → IntegerPartitionGraded mapto partition
  • Mp00321IntegerPartition → IntegerPartitionBijectionGraded mapInvolution2-conjugate
  • Mp00322IntegerPartition → IntegerPartitionBijectionGraded mapLoehr-Warrington
  • Mp00323IntegerPartition → IntegerPartitionBijectionGraded mapLoehr-Warrington inverse
  • Mp00332Posets → IntegerPartitionSurjectionGraded mapJordan block partition

Examples

Basic #

(52)=10\binom{5}{2} = 10

live ↗
InCount(PartitionsInBox(2,3))\mathrm{Count}(\mathrm{PartitionsInBox}(2, 3))Out1010

At most 2 parts, each at most 2

live ↗
InTake(PartitionsInBox(2,2),6)\mathrm{Take}(\mathrm{PartitionsInBox}(2, 2), 6)Out[IntegerPartition⁡([2,2]),IntegerPartition⁡([2,1]),IntegerPartition⁡([1,1]),IntegerPartition⁡([2]),IntegerPartition⁡([1]),IntegerPartition⁡([])]\bigl\lbrack{\operatorname{IntegerPartition}}([2, 2]), {\operatorname{IntegerPartition}}([2, 1]), {\operatorname{IntegerPartition}}([1, 1]), {\operatorname{IntegerPartition}}([2]), {\operatorname{IntegerPartition}}([1]), {\operatorname{IntegerPartition}}([])\bigr\rbrack
About
Examples2
CrosswalkOEIS

See also: IntegerPartitions, PartitionsMaxPart, PartitionsIntoKParts