18. 1764
18. We consider two cases.
Case 1: No green ball and blue ball are adjacent to each other
In this case the red balls must either occupy the 1 st, 3 rd, 5 th, $\ldots, 19$ th positions, or the 2 nd, 4 th, 6 th, $\ldots, 20$ th positions. In each case there are $C_{5}^{10}=252$ ways to arrange the green and blue balls. Hence there are altogether $252 \times 2=504$ ways in this case.
Case 2: A green ball and a blue ball are adjacent to each other
We place the 'green-blue pair' first. Since half of the total number of balls are red, and that no two red balls may be adjacent, the number of empty spaces before and after this pair must both be odd. Hence there are 9 choices of positions of this pair (2nd and 3rd, 4th and 5th, ...., 18th and 19th). Of course there are 2 ways to arrange the two balls among the pair. After this pair is placed, the positions of the red balls are fixed (e.g. if the pair is placed in the 6 th and 7 th positions, then the red balls must be placed at the 1 st, 3rd, 5th, 8th, 10th, ..., 18th and 20th positions), and there are $C_{4}^{8}=70$ ways to arrange the remaining 4 green balls and 4 blue balls. Hence there are altogether $9 \times 2 \times 70=1260$ ways in this case.
Combining the two cases, the answer is $504+1260=1764$.
18. How many ways are there to arrange 10 identical red balls, 5 identical green balls and 5 identical blue balls in a row so that no two adjacent balls are of the same colour?
有多少種方法把 10 個相同的紅球、 5 個相同的綠球和 5 個相同的藍球排成一行，使得沒有兩個相鄰的球的顏色相同？