This problem involves permutation since we are dealing with different ways that the colors of the 7 balls can be arranged distinctly. The equation of permutation is described as
[tex]P=\frac{n!}{(n-r)!}[/tex]There are 7 balls in this problem, hence, n = 7. Also, 7 colors are selected at each process of arranging them by color, hence, r = 7. Substitute it on the equation above and compute, we get
[tex]P=\frac{7!}{(7-7)!}[/tex]The expression above can be simplified as
[tex]\begin{gathered} P=\frac{7!}{0!} \\ P=\frac{1\times2\times3\times4\times5\times6\times7}{1} \\ P=5040 \end{gathered}[/tex]Answer: E. 5040