For a thin lens to form images of the same size at two different object positions, one image must be real and the other must be virtual. This situation occurs for a convex lens.
Let the object distance be $u$ and focal length be $f$. Using lens formula:
$$ \frac{1}{v} - \frac{1}{u} = \frac{1}{f} $$
$$ \Rightarrow \frac{1}{v} = \frac{u+f}{uf} $$
Magnification is given by:
$$ m = \frac{v}{u} $$
Substituting $v$:
$$ m = \frac{1}{u}\left(\frac{uf}{u+f}\right) = \frac{f}{u+f} $$
Since the sizes (magnitudes of magnification) of the images are equal but their nature is different:
$$ |m_1| = |m_2| \Rightarrow m_1 = -m_2 $$
Using sign convention:
$$ u_1 = -8\,cm,\quad u_2 = -24\,cm $$
$$ \frac{f}{f-8} = -\frac{f}{f-24} $$
Cancelling $f$:
$$ \frac{1}{f-8} = -\frac{1}{f-24} $$
$$ f - 24 = -(f - 8) $$
$$ f - 24 = -f + 8 $$
$$ 2f = 32 $$
$$ f = 16\,cm $$
Final Answer: $$ \boxed{16\text{ cm}} $$
Updated for JEE Main 2026: This PYQ is important for JEE Mains, JEE Advanced and other competitive exams. Practice more questions from this chapter.