Considering that the blue cup has to be on one end, we consider the number of arrangements possible with the other 4 cups, then multiply by 2(considering the blue on each end).
------------------------
Considering green and yellow before red and purple, there are outcomes(G-Y-R-P, G-Y-P-R, Y-G-R-P and Y-G-P-R).
Another two possible outcomes are yellow-purple and green-red, or vice-versa, thus 4 + 2 = 6 outcomes.
To account for the blue on the end, multiplying by 2.