I have 4 objects in group A and 4 objects in group B.
One by one I need to add the 8 objects from the two different groups in a line.
But the condition is that as the line is being created, the amount of "A" objects is always >= the amount of "B" objects.
What I have 4 objects in group A and 4 objects in group B.
One by one I need to add the 8 objects from the two different groups in a line.
But the condition is that as the line is being created, the amount of "A" objects is always >= the amount of "B" objects.
I need to count the total number of possible arrangements
What theorem or concept should I use? or concept should I use?
This can also be posed as counting the number of unilateral walks of type $n$; that is, strings of $n$ '$+1$'s and $n$ '$-1$'s whose partial sum is never negative. Let $w(n)$ be the number of such walks. Furthermore, let $2k$ be the number of steps at which the walk first returns to the starting point. Such a walk looks like $$ \left<+1\right>\left<\text{walk of type $k-1$}\right>\left<-1\right>\left<\text{walk of type $n-k$}\right> $$ Thus, we get the recurrence $$ w(n)=\sum_{k=1}^nw(k-1)w(n-k) $$ In the answer cited, Generating Functions are used to compute $$ w(n)=\frac1{n+1}\binom{2n}{n} $$ which is the $n^\text{th}$ Catalan number.