Well, p = k * q^3 for some k. So, for a particular q, we have 24 = k * q^3, from where k = 24 / q^3. What is k * (q / 2)^3 = (24 / q^3) * (q / 2)^3?
Yes. Now, q^3 cancels out and 24 / 8 can be simplified. Note that 8 is 2^3.
This situation happens when q is linear size and p is volume or mass, which are proportional to size cubed. The idea is that if linear size is reduced 2 times, the volume is reduce 2^3 = 8 times. For example, Eiffel tower, whose height is 324 m, weighs 7,300 tonnes. What would an exact replica weigh if its height is 32.4 cm? The replica linear size is 1000 = 10^3 times smaller, so the mass is (10^3)^3 = 10^9 times smaller. 7,300 tonnes = 7.3 * 10^3 tonnes = 7.3 * 10^6 kg = 7.3 * 10^9 g, so the replica's mass is 7.3 g. Hmm, seems a little small, bit that's what the math says.