CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual use to large groups and classes! Also, H100 GPUs starting at $2/hour.
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual use to large groups and classes! Also, H100 GPUs starting at $2/hour.
| Download
Project: Combinatorics classes 2024
Views: 8Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu2204New Posets from Old and Lattices
Math 737 - Lab 2
We can use Sage to construct new posets from old
Copy your code for our examples posets P,Q,R,S,T,N from Lab 1 into the block below.
Exercise 1: (If you did not complete this in the prior lab) Using our example posets P,Q,R,S,T,N, construct new posets as examples of the disjoint sum, ordinal sum, and direct (cartesian) product. Plot the new posets you create.
[0, 1, 1, 2, 1, 2, 2, 3]
x^3 + 3*x^2 + 3*x + 1
Sage includes many common combinatorial objects. Let's use Sage to make natural posets on combinatorial objects.
Until now, we have defined posets by inputting elements and covering relations. Now let's define a poset by specifying a set of combinatorial objects and the partial order as a function which returns 'True' if x < y and 'False' otherwise.
Exercise 2: Evaluate the blocks and follow the directions below to define the poset on Dyck paths for with partial order of containment.
Dyck words with 3 opening parentheses and 3 closing parentheses
()()()
[2, 1]
------------------------------------------------------------------------------------------
()(())
[1, 1]
------------------------------------------------------------------------------------------
(())()
[2]
------------------------------------------------------------------------------------------
(()())
[1]
------------------------------------------------------------------------------------------
((()))
[]
------------------------------------------------------------------------------------------
Below we define a function for the partial order by diagram containment.
Note how functions are structured in Python.
A function starts with 'def' and then has the name of the function followed by the inputs inside ( ) and a colon : at the end of the first line.
Then the next lines are indented and contain commands for the function to do. The last line includes 'return' to indicate what the function returns.
Evaluate the block below to see the Dyck path poset for n=3.
Copy the above commands to plot the Dyck path posets for n=4 and n=5. Give each poset a new name.
Exercise 3: Evaluate the blocks and follow the directions below to explore lattice properties of the Dyck path poset.
We can ask Sage if the Dyck path poset is a lattice
True