1
$\begingroup$

I would like to solve this equation:

$n \cdot 2^n = 15000$

And according to WolframAlpha

$n=\frac{W(15000\log(2))}{\log(2)}, \text{ where }\log\text{ is ln}$

Which shows that I need to use the product log function $W$ which I tried looking up on wikipedia. I don't need the complex numbers, just real numbers.

Additionally, are there ways of solving the original equation without the $W$ functions?

Can someone explain the rules and how to do this please?

I would eventually like to implement a way to find $n$ programmaticly (if possible-in python).

  • 1
    @Dacto just out of curiosity: why do you want to solve it w/o W()? I mean the solution _is_ the Lambert$W$function (plus a log) -- you won't find another solution. Its like saying I want to find a solution of y = exp(x) but without the logarithm -- not gonna happen ;)2016-11-12

1 Answers 1

2

You can use Newton's method for finding the root of $f(n) = n 2^n - 15000 = 0$: $ n_{i+1} = n_i - \frac{f(n_i)}{f'(n_i)} = n_i - \frac{n_i 2^{n_i} - 15000}{2^{n_i} (1+n_i \log(2))} $ and start with a suitable guess (look up the Wikipedia page on that). Here $n_0 = 1$ should do.You keep repeating the process for $i \ge 1$ until you reach a proper accuracy, i.e., you terminate at iteration $t$ when $n_{t} - n_{t-1} < \epsilon$ for some tiny $\epsilon$ you define.

Questions on exact implementation are more suitable question for SO; also scicomp.SE in case you're interested in details on appropriate numerical methods, and robust libraries.

  • 1
    http://code.active$s$tate.com/recipes/577729-lambert-w-function/2012-03-12