"inverse variation" means that "x times y" is a constant: xy= k. If we let y be the magnetic force at x= 12 inches. Then 12y= k. If we let z be the distance the nail needs to be in order to have twice the force, 2y, then we must have z(2y)= k. Since they are both equal to k, 12y= 2zy. Dividing both sides by 2y, z= 6. In other words, because this is "inverse variation", you double the force by halving the distance.