ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 07 Jan 2021 18:26:01 +0100Counting lattice path with Sagehttps://ask.sagemath.org/question/55175/counting-lattice-path-with-sage/ Quite newbie with Sage but I try to count very standard lattice path with steps (1,0) and (0,1) on a grin (0,0) to (m,n) for positive integers n and m. I want also put constraints like for example "not touching the main. diagonal".
I can program it but maybe there are Sage libraries that can help me?
Thanks for any suggestions
GianfrancoThu, 07 Jan 2021 18:21:18 +0100https://ask.sagemath.org/question/55175/counting-lattice-path-with-sage/Answer by slelievre for <p>Quite newbie with Sage but I try to count very standard lattice path with steps (1,0) and (0,1) on a grin (0,0) to (m,n) for positive integers n and m. I want also put constraints like for example "not touching the main. diagonal". </p>
<p>I can program it but maybe there are Sage libraries that can help me?</p>
<p>Thanks for any suggestions
Gianfranco</p>
https://ask.sagemath.org/question/55175/counting-lattice-path-with-sage/?answer=55176#post-id-55176Sage has rich functionality in combinatorics.
In particular Dyck words are implemented and can be plotted
using N and E steps, or NE and SE steps.
See
- [SageMath documentation: Dyck words](https://doc.sagemath.org/html/en/reference/combinat/sage/combinat/dyck_word.html)Thu, 07 Jan 2021 18:26:01 +0100https://ask.sagemath.org/question/55175/counting-lattice-path-with-sage/?answer=55176#post-id-55176