Processing math: 100%
Ask Your Question
2

Constructing all NE-lattice paths from (0,0) to (m,n)

asked 6 years ago

joakim_uhlin gravatar image

updated 6 years ago

If I consider only Dyck Paths, I can do write something like this:

DWS=DyckWords(3).list()
for D in DWS:
    print(D.height())

to obtain the height of all Dyck paths of length 3. However, I would like to do the same thing but using NE-lattice paths from (0,0) to (m,n). Is there an easy way to do this in Sage?

Preview: (hide)

Comments

1

You could try using a bijection with something that is in Sage, e.g. see Ferrers diagram of a partition.

rburing gravatar imagerburing ( 6 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 6 years ago

joakim_uhlin gravatar image

I fixed this myself but in case anyone is interested I will leave this as an answer.

I decided to use the kbits from this thread to generate all binary strings of length n with m ones. Such strings are in a natural bijection with NE-lattice paths from (0,0) to (n,m). After that, I can get the heights of all the paths by writing

Paths = WordPaths('01', steps=[(1,-1),(1,1)])

for b in kbits(m+n,m):
    print(Paths(b).ymax())

Note: Sage has a "height" function on words, but this is not what I am looking for. In the definition of height that I am using, the height of an NE-path is geometrically the biggest distance that the path is away from the main diagonal.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 479 times

Last updated: Apr 11 '19