The binary operation * is defined on the set of integers p and q by…