I have these base values "$a_1,a_2,a_3,a_4,b_1,b_2,b_3,b_4,c_1,c_2,c_3,c_4$" and I have to find how many different ways I can arrange them. Rules are these, for example $a_2$, can't come before $a_1$, all a's have to be in order. same goes for b's and c's. But for example $b_1$ or $c_1$ can come before $a_2$ etc.
Here is incorrect line: $a_1,b_1$,$a_3$, $a_2$,$b_2,b_3,b_4,c_1,c_2,c_3,c_4,a_4$ // $a_3$ comes before $a_2$, so a's are not in correct order.
Here is correct line: $b_1,a_1,a_2,c_1,a_3,b_2,a_4,c_2,b_3,b_4,c_3,c_4$ // everything is fine.
I'd like to know is there any formulas that can solve this?