Exercise · Volume 1 · 2.2.1-11
Exercise 2.2.1-11
not stated yet in Lean solution written
| Rating | M40 |
|---|---|
| Markers | M (mathematical) |
| Kind | K3, find a value: compute a number, a set or a closed form from the written solution |
| Section | Section 2.2.1 of Volume 1 |
The task
By Exercises 2.2.1-9 and 2.2.1-10, is the number of admissible sequences with letters X. Find a closed form for the generating function .
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
Use the fact, found in the remarks of Exercise 2.2.1-10, that an X which empties the deque is the last letter. So the deque stays non-empty from the first letter to the last X.
Hint 2
Count each insert with weight when the choice between S and Q is free, and with weight when it is forced.
Solution
Show the solution
Plan. Turn the admissible sequences into weighted Dyck words. Split a Dyck word at its first return, as for the Catalan numbers. Solve a quadratic equation.
Write U for an insert (S or Q) and D for X. An admissible sequence with starts with an insert. By rule 3 of Exercise 2.2.1-10 that insert is Q. After it, the deque is not empty until the last letter, which is X. So the sequence has the form U D, where is a Dyck word of length , that is, a word with the same number of U and D and no prefix with more D than U.
The number of ways to choose the letters from S, Q for a given word is a product over the inserts. The first insert is Q, one way. Any other insert comes with a non-empty deque, so rule 3 does not bind it. If it follows an X, rule 4 forces S, one way. If it follows another insert, both S and Q are free, two ways. So the weight of U D is , where is the number of factors UU in the word U .
Let count the factors UU of a word . Define
where runs over all Dyck words and is the number of U in . Then
since is the sum of over the Dyck words with letters U, for , and .
Every non-empty Dyck word has one form with Dyck words and . The letter D breaks every factor, so
The in the second formula is the factor made of the first two letters. These formulas give
Put . The first equation is . Multiply the second by : . Clear the denominator: , so The root with is because . Therefore
A recurrence. Put in the form . The coefficient of gives for . Differentiating the closed form gives also
Check
The series of the closed form is . The first values agree with the counts of the admissible sequences found by search in Exercise 2.2.1-10. I checked the weighted sum over Dyck words for , with results . The coefficient recurrence and the three-term recurrence both gave up to , with equal values.
Remarks
The numbers for are the large Schröder numbers . They count Dyck-type paths with a second kind of step, so the appearance of a quadratic equation is natural. The book's answer finds the same function from a double generating function.
This solution is drafted, and a person has not reviewed it yet. The source.
In Lean
not stated yet The exercise is not stated in Lean yet.
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.