What is the number of balanced strings of 5 left and 5 right brackets whichend with RR?
The answer is 42-14 = 28 ...
I know 42 is the number of ways we can arrange 5 balacned strings of brackets... but why did we pick the number 14 which is the number of ways to arrange 4 balanced strings of brackets...
can some one clear this one for me thanks
Thanks for not answering my question, this question was in our exam just for your information.
If you didn't understand the question, here is what i started with...
The aim of that question is to find all POSSIBLE balacned strings that end with RR or ))
here is an example ...
()()()(()) .. there are 13 more...
my question was.. why do C(5)-C(4) ???
I will use ( and ) as the brackets and write C(n) for the nth Catalan number.
I assume that by "balanced string" you mean the same as a string of correctly matched parentheses.
A balanced string of length 10 must end in ). There are C(5) = 42 such strings.
The preceding character can be either ( or ). If the preceding character is ) then we have a string ending in )), which is what we are trying to count. If the preceding string is a (, so the last two characters are (), then the first 8 characters must form a balanced string of length 8; there are C(4) = 14 of these. So...