Skip to content

LatticePaths ​

The monotone lattice paths from (0,0)(0,0) to (a,b)(a,b) using unit north/east steps, each written as a 0/10/1 step sequence (11 = north). Count (a+ba)\binom{a+b}{a}.

✓ checked against that system · ! checked, with disagreements (hover a chip)OEISA046899✓
LatticePaths(a, b)the monotone north/east lattice paths in an a×ba \times b grid
Typed signatures
TypePackageApplies
(integer<0..>, integer<0..>) -> indexed_collection<list<integer>>combinatoricsalways

Domain: Collections

Examples

Basic #

(53)=10\binom{5}{3} = 10

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

11 = north

live ↗
InTake(LatticePaths(2,2),6)\mathrm{Take}(\mathrm{LatticePaths}(2, 2), 6)Out[[1,1,0,0],[1,0,1,0],[0,1,1,0],[1,0,0,1],[0,1,0,1],[0,0,1,1]]\bigl\lbrack\bigl\lbrack1, 1, 0, 0\bigr\rbrack, \bigl\lbrack1, 0, 1, 0\bigr\rbrack, \bigl\lbrack0, 1, 1, 0\bigr\rbrack, \bigl\lbrack1, 0, 0, 1\bigr\rbrack, \bigl\lbrack0, 1, 0, 1\bigr\rbrack, \bigl\lbrack0, 0, 1, 1\bigr\rbrack\bigr\rbrack
About
Examples2
CrosswalkOEIS

See also: PartitionsInBox