Find the inverse of p under the binary operation * defined by p*q = p…