Suppose there's an urn containing $r$ red balls and $b$ blue balls. At each trial, I'm drawing a ball at random from the urn, without replacement. Let $R$ denote the event of drawing a red ball, and let $B$ denote the event of drawing a blue ball. I'm conducting $r+b$ trials of this experiment. So, there are a total of $r+b \choose r$ equally likely possibilities.
Each of the $r+b \choose r$ possibilities can be considered as a string of $R$s and $B$s. Each such string has $r+b-2$ substrings (strings formed from the original string from consecutive $R$s or $B$s) of length $3$.
For example, if $r = 7$ and $b = 3$, then $RRBBRRBRRR$ (which may be denoted by $R_2B_2R_2B_1R_3$) is one of the $10 \choose 3$ possibilities. It has $8$ substrings of length $3$, which are $RRB$, $RBB$, $BBR$, $BRR$, $RRB$, $RBR$, $BRR$ and $RRR$.
Now, given the premise of $r$ red balls and $b$ blue balls, after conducting $r+b$ trials, I'm interested in finding the probability distribution of the substrings of length $3$ in the resulting string. How do I approach this problem?
Motivation:- The motivation behind this problem directly arises from a reaction problem in polymer chemistry involving two types of molecules ($R$ and $B$), where the aim is to find the probability of an $R$ (or alternately, a $B$) being flanked on both sides by $R$s or $B$s.