Finding resistance of a resistor connected to ground

You have the right idea. As mike posted while I was writing you need a voltage divider. In your first setup where you have 5V->10K-> Variable Resistor -> GND the voltage between the 10K and your resistor will change depending on the resistance of your variable resistor. To find the resistance we use the formula for a voltage divider.

Vout=Vin(R2/(R1+R2))

Where:
Vout is the voltage going to the analog input
Vin is your 5V supply
R2 is your variable resistor
R1 is the 10K resistor

In your case this mean that you can find the resistance via the formula R2=-(10,000*Vin)/(Vin-5)