1

In this post, for matched arrangements, they say the number of left parentheses should be greater than or equal to the number of right parentheses.

But shouldn't the number be just same for matched arrangements? If there are more left parentheses then wouldn't it be unmatched arrangement?

Also, for unmatched arrangement, they are just taking $n+1$ and $n-1$ right and left parentheses. But can't it be $n+2$ and $n-2$?

In another post, they are talking about flipping the parentheses. I don't understand why.

In yet another post, they are talking about two separate terms: legal and balanced. I don't know how they are different.

aarbee
  • 10,749
  • 2
    A chain with parenthesis can't be valid if total number of left parenthesis and right parenthesis is not the same, ok. But the text is : for any intermediate substring starting from the start, number of left parenthesis is always greater than or equal to the number of right parenthesis. When both constraints are ok, a chain of parenthesis is valid. ))(( is not valid, even if we have same number of left and right parenthesis. – Lourrran Dec 22 '23 at 11:04
  • In the post you link to you omitted recounting the qualification "in any length of the chain from start." Perhaps you thought this was just a meaningless detail, but it seems to create the context for distinguishing between counts of left vs. right parentheses overall and such counts up to an intermediate position in the expression. – hardmath Dec 24 '23 at 06:16

1 Answers1

1

But shouldn't the number be just same for matched arrangements? If there are more left parentheses then wouldn't it be unmatched arrangement?

They say "number of left parentheses are always greater than or equal to number of right parentheses in any length of the chain from start".

(Of course, the total number of left parenthesis and the total number of right parenthesis has to be the same.)

Also, for unmatched arrangement, they are just taking $n+1$ and $n−1$ right and left parentheses. But can't it be $n+2$ and $n−2$?

In another post, they are talking about flipping the parentheses. I don't understand why.

In joriki's answer, $\uparrow$ represents a left parenthesis, and $\rightarrow$ represents a right parenthesis.

The answer says "You want to go from $(0,0)$ to $(n,n)$ on a grid in $n$ steps up and $n$ steps to the right without ever going below the diagonal, that is, without touching the line $L$ given by $y=x−1$".

The reason why we take the line $y=x-1$ is that we touch the line $y=x-1$ if and only if the sequence is not legal.

For example, $\uparrow\uparrow\rightarrow\rightarrow\rightarrow\uparrow\uparrow\uparrow\rightarrow\rightarrow$ represents $(()))((())$ which is not legal. It touches the line $y=x-1$ at $(x,y)=(3,2)$.

Next, Callus - Reinstate Monica's answer says

"Suppose a sequence $L$ is not legal. Then there is a least $k$ where there is a right parenthesis at position $k$ and equally many left and right parentheses before $k$ ( necessarily $\frac{k-1}{2}$ ). Now swap all left parentheses for right and all right for left in the first $k$ positions of $L$. This gives us a collection of $n+1$ left parentheses and $n-1$ right parentheses".

To understand these sentences, it might be helpful to consider an example. Take $(())\color{red})((())$ as an example of illegal $L$ where $n=5$. Then, $k$ is equal to $5$. Then, swapping all left parentheses for right and all right for left in the first $k=5$ positions of $L$ gives $\color{red}{))(((}((())$ where there are $5+1$ left parentheses and $5-1$ right parentheses.

In yet another post, they are talking about two separate terms: legal and balanced. I don't know how they are different.

As this question says, a legal sequence of parentheses is one in which the parentheses can be properly matched (each opening parenthesis should be matched to a closing one that lies further to its right).

As this question says, a sequence of length $2n$ that contains only $1,−1$ is said to be balanced if all the $2n$ partial sums are non-negative, and the total sum is $0$.

mathlove
  • 151,597