(a) -17 cm
Magnification equation:

where
is the size of the image
is the size of the object
is the distance of the image from the mirror
is the distance of the object from the mirror
In this problem, we have:
p = 51 cm (the object is 51 cm in front of the mirror)

So, we can find q, the image distance:

and the negative sign means the image is virtual.
(b) -25.5 cm
Mirror equation:

where
p = 51 cm
q = -17 cm
Substituting and re-arranging the equation, we find the focal length of the mirror:

and the negative sign is due to the fact it is a convex mirror.