A mathematical explanation of carbon dating and half life