1.10 Recursive Definition

Matching Parentheses

Which of the following are true about \(M\), the set of matched parentheses strings?

Exercise 1

For any string of length greater than \(0\), if it starts with a right parenthesis, it is immediately unmatched. The empty string also vacuously satisfies this statement.

The empty string is a counterexample.

There are a variety of ways to show \(M\) is infinite. For example, for any proposed longest string, simply append "()" to the end.

In order for a string to be matched, its length must be a multiple of 2, for pairs of left and right parentheses. Note that the empty string has length 0 which is also even.