|
 |
I also found this interesting from a parser perspective:
https://en.wikipedia.org/wiki/Catalan_number
"Re-interpreting the symbol X as an open parenthesis and Y as a close
parenthesis, Cn counts the number of expressions containing n pairs of
parentheses which are correctly matched:
((())) (()()) (())() ()(()) ()()()
Cn is the number of different ways n + 1 factors can be completely parenthesized
(or the number of ways of associating n applications of a binary operator, as in
the matrix chain multiplication problem). For n = 3, for example, we have the
following five different parenthesizations of four factors:
((ab)c)d (a(bc))d (ab)(cd) a((bc)d) a(b(cd))"
(plus lots more interesting stuff in that entry)
- BE
Post a reply to this message
|
 |