TITLE: Proof for coloring combinations problem. (color vertices of pentagon)
QUESTION [5 upvotes]: While studying, I found a problem in my book that read: "Each vertex of convex pentagon ABCDE is to be colored with one of seven colors. Each end of every diagonal must have different colors. Find the number of different colorings possible."
The answer key showed the answer as 7770. The answer key also explained that you needed to find the number of ways to color the pentagon with 3, 4, and 5 colors, then add the numbers up. But other than this, no explanation was given. Could someone please give me an explanation to reaching this answer of 7770?

REPLY [4 votes]: There are $7$ ways to color vertex $A$, split in two cases:
Case $1$: $D$ and $C$ have the same color, there are $6$ ways to pick that color, after this, vertices $E$ and $B$ must be distinct and must not have the color of $D$ and $C$, there are $6\cdot 5$ ways to do this, $7\cdot6\cdot6\cdot5=1260$ total.
Case $2$: $D$ and $C$ have different colors, there are $6\cdot 5$ ways to pick these colors, if $E$ and $D$ have the same color there are $6$ options for $B$ , if $E$ and $D$ have distinct colors there $5$ options for $E$ and then $5$ options for $B$ (so $6+25=31$ total). Hence there are $7\cdot6\cdot5\cdot31=6510$
Hence there are $1260+6510=7770$ total.