Need help creating an equation

coder1

Senior member
Jul 29, 2000
433
0
0
ok, here is my basic code

Dim x As Decimal = 0
Dim y As Decimal = 0.016

Do Until y <= 0.00016
y = y * 0.869
x = x + 1
Loop

MessageBox.Show(x)

+
How in the world would I make this into a single line math equation.
Basically this is for a chemical extraction where each time an extraction occurs there is 86.9% less of the chemical. How many extractions would be required to reduce the chemical to 1% of it's original value (which is .016, so once the extraction reaches .00016 then we are done) Now If I throw this into code as I did above it's easy to find out that it would need 33 extractions. BUT!!! I want to create an equation that will show this by plugging in someplace the 1% How would I do this. If anyone gives me an acceptable equation (One that I think would be presentable, I will paypal them 15 dollars)
Remeber I know the answer and I can do this in code. But what I am looking for is a mathmatical equation that I can present to a meeting.

Thanks
 

Peter

Elite Member
Oct 15, 1999
9,640
1
0
If you'll have 86.9 percent LESS of the chemical, then you keep only 13.1 percent! What you've been calculating is the other way round, you have 86.9 percent REMAINING in the solution. Let's stay with that for now, you change to 0.131 below if it's the former.

You might have already figured out that it's an exponential thing, because you keep multiplying with the same factor.

X amount of chemical after N extraction procedures:

X=0.016*(0.869^n)

Put .00016 for X, then solve for N:

0.869^n = 0.01 (there's your one percent)

Here's where you need to get the math book out and look up how to make that an n=... equation, using logarithmics - because I don't remember.

PS: Isn't it hilarious how most basic programs begin with a series of "dim" statements?
 

jagec

Lifer
Apr 30, 2004
24,442
6
81
Originally posted by: Peter
If you'll have 86.9 percent LESS of the chemical, then you keep only 13.1 percent! What you've been calculating is the other way round, you have 86.9 percent REMAINING in the solution. Let's stay with that for now, you change to 0.131 below if it's the former.

You might have already figured out that it's an exponential thing, because you keep multiplying with the same factor.

X amount of chemical after N extraction procedures:

X=0.016*(0.869^n)

Put .00016 for X, then solve for N:

0.869^n = 0.01 (there's your one percent)

Here's where you need to get the math book out and look up how to make that an n=... equation, using logarithmics - because I don't remember.

PS: Isn't it hilarious how most basic programs begin with a series of "dim" statements?

Ti-89 is the easiest way, but besides that you just do this:

ln(0.869^n)=ln(.01)

n* ln(0.869)=ln(.01)

n=ln(.01)/ln(.869)

can I have my $15 now?
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |