Here is a small example. The aim is to draw a sequence of length N (even), which contains equally many 1s and 2s, and find the formula for the number of unique sequences. Here is the example for N=4:
1212, 2121, 1122, 2211, 2112, 1221
Six possibilities.
From a small numerical simulation, I also know there are 26 possibilities, if the length of the sequence is intended to be 10.
What is the exact mathematical logical formula for calculating this?