There are 3 types of balls black, white and green. Find the number of ways of arranging $n$ such balls such that
- black, white adjacent pairs occur $a$ times,
- black, green adjacent pairs occur $b$ times,
- green, black adjacent pairs occur $c$ times,
- green, white adjacent pairs occur $d$ times,
- white, green adjacent pairs occur $e$ times,
- white, black adjacent pairs occur $f$ times,
- $0\le a,b,c,d,e,f\le 10$, and
- $n \le 100000$.
Is there a better approach to this problem than what I have already done?
My approach:
Suppose $n = 10$; I am going for $1$ condition at a time.
All are zero, so we left with $3$ permutations i.e. $BBB\dotso$ $n$ times, $WWW\dotso$ $n$, and $GGG\dotso$ $n$.
All are $1$. Then we can have $6(n-1)$ permutations, e.g. if there are only black ($B$) and white ($W$) balls, then permutations will be like $BBBBBWWWWW$ or $BWWWWW$, or something like $\dotso BW\dotso$, so $(n-1)$.
Some of my observations are that there will not be any permutations which contain (ONLY) any of these following pairs: $BW$ and $BG$ not possible because $BW\dotso BG$ should also contain some other pairs to coexist like $WB$ or $BWWWBG$. So in this way only 2 pairs available are: $$ BW\dotso WG \\ BG\dotso GW \\ GW\dotso WG \\ GB\dotso BG \\ WB\dotso BW \\ WG\dotso GB \\ $$ for a total of $6$ pairs and they can only exist only $1$ time. So this type of permutations will be $x(n-1)$ where $x$ is the number of pairs that can be formed, since there are different values for each of them.
In this way I trying to figure out all other possibilities. I need a better solution which gives me permutations when $a,b,c,d,e,f$ are given.