The possible outcomes is 3*3! . The answer of the second question is 4*4!.
In general, suppose the no. of matches is n ,then the possible outcomes would be n*n!
A function is a combination of different kinds of equations. Whereas an equation is a combination of different variables and different symbols. A function can have multiple values according to the changing of variable values.