Logarithmic Functions: Half-Lives
00:12 Before we jump in, let’s recall what the exponential function is. When the base is e, Euler’s number, that’s usually called the exponential function, and we’ve seen that exponential functions have inverses.
The inverse of the exponential function is called the logarithm function. Sometimes it’s called the natural logarithm. Now, as an aside, in a lot of math circles, instead of writing log base e, the notation is used ln, so ln for the natural logarithm. In Python, to access to logarithm function, you use the
log() function with only one argument, so the second parameter to the
log() function is optional and when you don’t pass it, then you’re computing the natural logarithm.
01:13 Okay, so going back to our example of studying the decay of a radioactive substance, the amount of the substance—say, N of t at any given time t—is computed using this formula, which involves the exponential function with this exponent.
01:30 N sub-zero is the initial amount of the substance at time t = 0, capital T is the half-life, and little t is the time that you want to use to determine the amount of the substance at that given time. Now, in a previous lesson, we use this formula to compute the amount at any given time.
01:49 In this case, what we want to do is: Suppose we have some unknown radioactive substance that, say, was found 5 years ago. And 5 years ago when you found it, you measured it to be 88.45 milligrams, and today it weighs 23.865 milligrams.
02:09 What you want to know is, what is the substance? You know it’s a radioactive substance, but you don’t know which one. What you do have is these two measurements of the amount of the substance at two different times, and so one way to identify the substance is to know what its half-life is so then you can look it up in some table of known radioactive substances and their half-lives. Now, in this formula, what you can do is you can invert it and isolate for the half-life. If you do that, this is the expression that you get for the half-life, and the natural logarithm function is used to do the inversion, and so you end up with this expression.
02:50 So you can use this expression to determine the half-life of an unknown substance if you know all of these pieces of information. You need to know the initial amount when you first started measuring, and then the time—the current time, and so here we’ll plug in N(t), and so N(t) is just the value at the current time—and then the t is going to be the time from when you started measuring.
03:14 So in our case, we would plug in 5 for t. For N(t), we would plug in 23.865, and then for N sub-zero, 88.45. Do this computation, and it would give us the half-life. So let’s try this out in the console.
Make sure you’ve imported
math, and then let’s just work with the logarithm function, and then we’ll work on this decay problem. If you use the logarithm without a argument for the base, it defaults to the natural logarithm.
57 modulo some rounding. Let’s compare this real quick. If we were to use the logarithm function—again, with
57—but this time let’s pass in an argument, and we’ll use Euler’s number as the base, just to compare the difference with if we were to just use the
log() without a value. So if we type in here
e, we see that we’re pretty close.
It’s going to take two values for the two different amounts, so this will be the initial amount, N sub-zero, and so we’ll write it like this, and then we’ve got N sub-t, and then we need to specify the time that this second value corresponds to, and so we’ll denote that by
t. And what we’re returning from the formula,
-0.693 and then times the time
t, and then we need to divide all of that by the natural logarithm of the amount at time
t divided by the amount at time zero. All right, so go ahead and define that, and let’s try this out with the example that we did before.
Let’s get the half-life of a substance that had an initial amount of
88.45 milligrams, and then the amount of the substance after five years,
23.865, and then those two differences of amount from
23.865 occurred during a span of
You get 2.6449. If you round that to three digits after the decimal, you get
2.645. And so the scenario here is that you would look up in some known table of radioactive substances, you would see which one has a half-life of about 2.645, and then you would know that you’re dealing with Californium-252.
All right, so you made it! That wraps up all of the functions that have to do with powers and exponentials and logarithms. In the next lesson, we’ll take a look at some other useful functions in the
Become a Member to join the conversation.