Clearly, the first two answers give you the correct answer for how long it takes to reach 40 grams of your element. But I think it might be helpful to explain a little bit about why you should set your equations up the way they did.
If you think about it, what you are doing here is just like figuring the interest on an investment (only you are getting negative interest since your "investment" is decaying, not growing). When you try to figure that, you use the formula
A = P(1+r)^n
where A is the final value of your investment, P is the original principal, r is the rate of interest, and n is the number of times the interest is compounded.
In your problem, you start with 100g -- that's your original investment. It decays at 12% -- that's your interest rate (-.12). You want to end up with 40g -- that's your final value. You are asked to solve for n -- how many interest periods (in your case, hours).
So you start with
40 = 100 (1-.12)^n
From there, you do what the first two answers did and you get your result.
I hope this explanation is helpful.
When the material is decaying at the rate of p percent per hour the percentage of material left after n (Qn) hours is given by the formula:
Qn = 100*[(100-p)/100]^n
p = 12 and
Original quantity = 100 g
Final quantity = 40 grams
Therefore final quantity expressed as percentage of initial quantity = Qn = (40/100)*100 = 40
Substituting values of Qn and p in the above equation for Qn we get:
40 = 100*[(100 - 12)/100]^n = 100*0.88^n
Therefore: o.40 = 0.88^n
Solving this equation for value of n we get:
n = 7.167851 hours
40 g of the element will be after 7.167851 hours.
Since the element is decaying 12% per hour, the remaining of it is =(100-12)% = 88% =0.88 of the original mass.
Therefore the mass remaining after x hours = (0.88)^x = 40% =0.4 of the original mass. So, by taking logarithms on both sides, we get:
x*log(0.88) = log (0.4) or
x = log(0.4)/log(0.88) or
=7.167852346 hrs = 7hrs 10 minutes 4.2684456 secs