we define a new measure ,called GoldIndex(G,C).it takes two arguments as input namely a graph G and set of colors C respectively . the subroutine outputs an integer denoting the number of ways assigning colors to vertices in G such that at least two vertices in G have the same color.Let $k_n$ denote the complete graph having n vertices respectively and C={red,green,blue ,yellow}.then the GoldIndex ($k_3,C$) will be equal to_
my attempt –
the number of ways assigning colors to vertices in G such that at least two vertices in G have the same color= two vertices have same colors + three vertices have same colors (because $K_3$)
two vertices have same colors=$\binom{4}{2}$*3 // first choosing two colors out of four and then assigning these two colors on three vertices
three vertices have same colors (because $K_3$)=$\binom{4}{3}$*1 // first choosing three colors out of four and then assigning these three colors on three vertices so only one way
so total no. of ways =18+4 =22
i don’t know where m i going wrong ,please help me-
i know their solution is correct but i want to verify my approach-