The speed of ocean waves depends on their wavelength λ (in meters) and the gravitational field strength g (in m/sˆ2) in this way:

V=Kλˆp Gˆq

Where K is a dimentionless constant. Find the value of the exponents p and q.

Consider the dimensions. Left side, m/s.

Right side (dimentionless)(m)^p * (m/s^2)^q

m/s = m^P * m^q * 1/s^(2q)
consider the exponents of m
1=p+q
consider the exponents of s
-1=-2q

You should be able to solve. Check my thinking and math.