  This article introduces a natural extension of colouring numbers of knots,
called colouring polynomials, and studies their relationship to Yang-Baxter
invariants and quandle 2-cocycle invariants.
  For a knot K in the 3-sphere let \pi_K be the fundamental group of the knot
complement, and let (m_K,l_K) be a meridian-longitude pair in \pi_K. Given a
finite group G and an element x in G, we consider the set of representations
\rho from \pi_K to G that map the meridian m_K to x, and define the colouring
polynomial P(K) as the sum over all longitude images \rho(l_K). The resulting
invariant maps knots to the group ring Z[G]. It is multiplicative with respect
to connected sum and equivariant with respect to symmetry operations of knots.
Examples are given to show that colouring polynomials distinguish knots for
which other invariants fail, in particular they can distinguish knots from
their mutants, obverses, inverses, or reverses.
  We prove that every quandle 2-cocycle state-sum invariant of knots is a
specialization of some knot colouring polynomial. This provides a complete
topological interpretation of these invariants in terms of the knot group and
its peripheral system. Furthermore, we show that P can be presented as a
Yang-Baxter invariant, i.e. as the trace of some linear braid group
representation. This entails in particular that Yang-Baxter invariants can
detect non-inversible and non-reversible knots.
