# How to calculate the number of total permutations of a set excluding some results?

I have to calculate the number of total permutations that are possible to obtain from a set of objects (position of balls), excluding some results.

The problem The main 'object' is a set of 2 balls that are connected by a string (so it forms a single object), both balls are green (the color is not important for this exercise, but I comment it to help to visualize the scene easier). This first object is always constant. The balls are in the same position. So it doesn't change.

The second object is the same, but this second object changes. It's also composed of 2 balls, but different color (I repeat, the color is not important. I use colors to help to visualize better the problem). The change that happens is that blue or red ball varies its position respect the 2 green balls.

What I want to calculate I want to calculate all the possible permutations that are possible to obtain while varying the second object (blue/red balls pair) respect to the first object (green balls pair). But with some rules...

Mainly, I want to know HOW to solve this problem because in the future it will be harder. This is the easier example that I could imagine. An example of this problem resolved will be also very useful.

So, the first object (couple of green balls) is always static. Never changes. The second object changes, but the red ball has the same or higher value than the blue ball (the red ball never is lower than the blue ball).

The blue or red ball can adopt 5 different values as maximum. While red ball is at the same level or above the blue ball.

An example of some permutations that fulfill the requirements: Video showing some pictures to visualize the problem easier.

The problem is more easily solved by reversing it.

Imagine the red-blue combo fixed, and look at possible positions for green

$\quad\quad\color{red}{\;\bullet\quad\quad\quad} \color{blue}\bullet$
$\color{green}{(\bullet\bullet)\;\bullet\;(\bullet\;\bullet)\;\bullet\;\;(\bullet\bullet)}$

The two greens can occupy any two positions out of $5$ shown,
plus the three doubles in $(\; )$s,
thus $\binom52 +3 = 13$ possible arrangements

In a row numbered $1a,1b,2,3a,3b,4,5a,5b,$
place red at $2$, and blue at $4$, then ok positions for green are
$1a1b,\;12,\;13,\;14,\;15,\;23,\; 24,\;25,\; 3a3b,\;34,\;35,\;45,\;5a5b$