Stuck in real world Algebra problem

Adawi

New member
Joined
Nov 18, 2020
Messages
4
Hi

I am working in the software industry, and I am trying to reach a formula in order to use it in a piece of software. In the field of business solutions we do not usually face such an equation, and it is relatively difficult to me.

I have an excel sheet which led me to a deduce an equation: Current Percentage (CP) = Target Percentage (TP). At this point, the number of foreigners (F) will be maximum. I need to get F Given that

CP = 100 S / (S+F)
TP = A Log (S+F) + B

Thus: 100 S / (S+F) = A Log (S+F) + B

All my attempts failed because I always reach a point in which F is in both sides of the equation, and I need to get F = bla bla bla. Please check the below images.

Attempt
Math Problem 2.jpeg

Attempt (closer I think but still stuck)
Math Problem 1.jpeg
 
Last edited:
Hi Adawi.

We cannot solve for F algebraically because it appears both inside and outside a transcendental function (the logarithm). A computer algebra system would express solutions in terms of the LambertW function.

I noticed in your work that you'd swapped the base and exponent, when switching from logarithmic to exponential form. The following is correct.

Y = log10(X)

10Y = X

?
 
Thanks that was helpful, I managed to put it in the form of n Log(n), and now it is Lambert
 
Actually I did another mistake, and it is not yet in the form n log (n). I did some researches and figured out how to use Lambert W function to solve
nlog(n) = C.

But I am not sure how to solve:

n(Log(n) + c1) = c2 .......................... where c1 and c2 are constants
 
… not sure how to solve:

n (Log(n) + c1) = c2 … where c1 and c2 are constants
Hi Adawi. I used computer software, to find the solution in terms of the LambertW function. Each system I'd tried reported the solution in terms of the natural logarithm. In other words, the software first applies the change-of-base formula:

log10(n) = ln(n) / ln(10)

Given:

n [log10(n) + c1] = c2

n = [c2 ∙ ln(10)] / LambertW[10c1 ∙ c2 ∙ ln(10)]

n ≈ (2.30259 ∙ c2) / LambertW(2.30259 ∙ 10c1 ∙ c2)

?
 
Big Thanks. This is beautiful. I enjoy it, and I might use this equation, and I really admire of this kind of mathmatical skills. You have just encouraged me to study mathmatics! What is the software you used "Matlab"?

I found also another numerical method, and it works. You know, non-academic ( not super smart :) ) people like me stick to the first working solution they find unless it has performance issues. Remember that my target is to create a piece of software. Newton's method worked here but it took like 50000 iterations, so I come up with this:

Since TP-CP = 0 is a trustworthy fact.

CP = 100 S / (S+F)
TP = A Log (S+F) + B

Thus: 100 S / (S+F) = A Log (S+F) + B

Let Z = S + F.
Thus: 100 S / (Z) = A Log (Z) + B
finally Z =100 S / (A LOG (Z) + B)



Zn+1 = 100 S / (A LOG (Zn) + B)

Zn+1 will have its max value when find find the root of this equation TP - CP = 0, and I am intrested in this value in particular. This is by common sense because you will have the max number of foreigners F is when current the ercentage equals the target percenatge (TP - CP = 0).

The system gives me Z0, which is a fact based on the above equation TP - CP = 0, so eventually I will get the max of Zn+1, and my stop condition will be TP-CP = 0 or when Zn+1 = Zn (it means also TP-CP = 0)

The worst case scenario O(N) takes 12 iterations or something, so it takes few milliseconds (Good enough).
 
What is the software you used "Matlab"?
First, I tried a 20th-century version of Maple, but I didn't like the output (eg: powers of e in the exponent of a power of e). The solution that I'd posted came from wolframalpha.com

I'd misunderstood and thought you were programming an excel sheet. (I think Lambert W-function is an add-on for excel.)

Glad you found something faster than Newton's method.

?
 
Top