Let the refractive index of the glass be n_g = 1.5. Let the refractive index of the liquid be n_l. The radius of curvature of the lens is R.
When the liquid layer is present, the distance of the needle from the lens is x. In this case, the image is formed at the needle itself, so the object and image distances are equal. Let's call this distance x. The effective focal length of the lens-liquid system (f') can be found using the lens formula:
1/f' = (n_g/n_l -1)(1/R1 - 1/R2)
Since it's a biconvex lens, R1 = R and R2 = -R. This simplifies to:
1/f' = (n_g/n_l - 1)(2/R)
The distance between the object and the image is 2x. Since the image is formed at the needle, the image distance is x. Thus, applying the lens formula:
1/f' = 1/x + 1/x = 2/x
Equating the two expressions for 1/f':
2/x = (n_g/n_l - 1)(2/R)
Simplifying:
x = R/(n_g/n_l - 1)
When the liquid is removed, the distance is y. In this case, the refractive index is simply that of air (approximately 1). So the focal length of the lens in air (f) is given by:
1/f = (n_g - 1)(2/R)
Again, applying the lens formula with the object and image distance equal to y:
1/f = 2/y
Equating the two expressions for 1/f:
2/y = (n_g - 1)(2/R)
y = R/(n_g - 1)
Now we have two equations:
x = R/(n_g/n_l - 1)
y = R/(n_g - 1)
We want to find n_l. We can solve for R in the second equation:
R = y(n_g - 1)
Substitute this into the first equation:
x = y(n_g - 1)/(n_g/n_l - 1)
x(n_g/n_l - 1) = y(n_g - 1)
xn_g/n_l - x = y(n_g - 1)
xn_g/n_l = x + y(n_g - 1)
n_l = xn_g/[x + y(n_g - 1)]
Substituting n_g = 1.5:
n_l = 1.5x/[x + y(1.5 - 1)]
n_l = 1.5x/(x + 0.5y)