Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isPatternAvoiding sometimes incorrect #3291

Closed
anna-brosowsky opened this issue Jun 7, 2024 · 2 comments
Closed

isPatternAvoiding sometimes incorrect #3291

anna-brosowsky opened this issue Jun 7, 2024 · 2 comments

Comments

@anna-brosowsky
Copy link

The function isPatternAvoiding (and the related avoidsAllPatterns) from the MatrixSchubert package sometimes gives the incorrect output. For example:

i1 : needsPackage("MatrixSchubert");
i2 : isPatternAvoiding({3,1,2,4},{3,1,2})
o2 = true
i3 : isPatternAvoiding({3,1,2,4},{3,1,2,4})
o3 = true

Of course, sometimes it is also correct!

i4 : isPatternAvoiding({3,1,2,4},{2,1})
o4 = false
i5 : isPatternAvoiding({1,2,3,4}, {1,2,3,4})
o5 = false
@anna-brosowsky
Copy link
Author

A follow-up: this may be an issue of different definitions? When I said "incorrect output" above, the definition I was using is that a permutation avoids a pattern if, in matrix notation, the permutation matrix doesn't contain the pattern's permutation matrix as a submatrix (or equivalently, that the "relative order" of the pattern never appears in the permutation).

But upon more experimenting, it seems that this code is checking for what I would think of as avoiding the inverse of the pattern? If that's intentional, then I'd like to just change my request to be a documentation clarification---the current sample pattern to avoid is it's own inverse! Could an additional sample be added where this difference in definition will be more immediately noticeable? E.g., that by this definition, 312-avoiding means that we never have i < j < k with w_k < w_i < w_j (instead of the "relative order" definition where it would mean never having w_j < w_k < w_i)

@mahrud
Copy link
Member

mahrud commented Jul 21, 2024

Thanks Anna! Joe (@jmcdonough98) fixed this in #3353 for the next release! (It's in the development branch now)

@mahrud mahrud closed this as completed Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants