How is the decaying of radioactive uranium into lead used to date rock?

The amount of radioactivity halves every so many years, so ifyou know how much should have been it, there is a simple equation to firgure it out.