Concept:
Acceleration due to gravity at a height \(h\) above the earth's surface is given by
\[
g_h=g\left(\frac{R}{R+h}\right)^2
\]
where \(R\) is the radius of the earth.
Step 1: Determine the height of point A.
Given,
\[
\frac{g}{4}=g\left(\frac{R}{R+h_A}\right)^2
\]
Cancelling \(g\),
\[
\left(\frac{R}{R+h_A}\right)^2=\frac14
\]
\[
\frac{R}{R+h_A}=\frac12
\]
\[
R+h_A=2R
\]
\[
h_A=R
\]
Step 2: Determine the height of point B.
Given,
\[
\frac{g}{9}=g\left(\frac{R}{R+h_B}\right)^2
\]
\[
\left(\frac{R}{R+h_B}\right)^2=\frac19
\]
\[
R+h_B=3R
\]
\[
h_B=2R
\]
Step 3: Calculate the distance between A and B.
\[
AB=h_B-h_A
\]
\[
AB=2R-R
\]
\[
AB=R
\]
Hence,
\[
\boxed{AB=R}
\]