# What is e in this equation, and how do I solve it?

Apologies for the rudimentary question. I haven't studied math and can't find an answer to this online.

Is the '$e$' in this equation for logistic regression Euler's number? If so, it doesn't matter how I calculate this; I can't get the same result. Could someone walk me through it? If I try to calculate this with a scientific calculator, I get all sorts of wrong answers — possibly because I am not using brackets in the right way. Really, I have done no maths at all!

$$\frac{e^{\color{red}{-2.91}+\color{blue}{6.26}*\color{green}{0.1}}}{1+e^{\color{red}{-2.91}+\color{blue}{6.26}*\color{green}{0.1}}} = 0.0924$$

• Yes, it is Euler's number. Jun 6, 2017 at 19:07
• Do you get a different value? I just computed it, using the standard definition of $e$ of course, and got $0.092456771$.
– lulu
Jun 6, 2017 at 19:09
• Worth noting that this not technically an "equation", since it doesn't contain a variable. Jun 6, 2017 at 21:19
• @imallett: I see no reason to exclude the trivial case of no variables from the term equation, when any other natural number would be allowed. Jun 7, 2017 at 0:47
• @wnoise Not that wikipedia is in any way authorative on the field, but the first sentence of their page on equations reads "In mathematics, an equation is a statement of an equality containing one or more variables." That meing said, $2x = x+x$ is certainly an equation, and if you reduce it to $0 = 0$, I don't think it should stop being an equation just because all the variables happened to cancel out. Jun 7, 2017 at 7:46

If you're having a hard time getting the same numeric result for that expression, it might be because you're not entering it correctly on a calculator. To get the correct value, you need to use parentheses in the right places.

Using a computer, or a TI graphing calculator, you would enter the expression this way:

e^(-2.91+6.26*0.1)/(1+e^(-2.91+6.26*0.1))

If you do that, you should get the right numeric value.

• You can also just paste that expression into the Google search bar. Jun 7, 2017 at 14:04

This is the Euler's constant. It is approximately $2.718281828459$... You can read more on it here:

https://en.wikipedia.org/wiki/E_(mathematical_constant)

• To me, the term "Euler's constant" refers to another constant, $\gamma = 0.57721566\ldots$. I know some people have a different terminology. What we are talking about here, $e=2.7182818\ldots$, is often just called "the number $e$", or the base of the natural exponential (or natural logarithm) function. After learning more about it, one can clarify by writing $e=\exp(1)$ (but this will not help someone who does not know $e$ in advance). Jun 6, 2017 at 21:57

Here $e$ is Euler's number, ($e \approx 2.718$) and that is the correct answer to the equation, so you might need to double check your work. If you don't use enough digits of $e$ (i.e. $e \approx 2.7$ evaluates to $0.09375\dots$), then your answer will be off.

$$\frac{e^{-2.91 + 6.26\cdot 0.1}}{1 + e^{-2.91 + 6.26\cdot 0.1}} = 0.0924568$$

Though the accepted answer certainly gives a good explanation of getting near the equation's stated "result", I think it's worth noting some points on rounding and errors here.

First, as this is a site for mathematicians, let's take their point of view; typically, mathematicians use arbitrary* precision in the constants and intermediate values in their equation - think calculator value. This is good because it avoids rounding errors. Irrational answers like the answer to this equation can then be given to a reasonable number of significant figures, in this case, that's 3 (answer is of the form 0.0###). So what does happen when we evaluate the equation with high precision and round the answer to 3s.f? $$\frac{e^{-2.91 + 6.26\cdot 0.1}}{1 + e^{-2.91 + 6.26\cdot 0.1}} \approx 0.0924568 = 0.0925 (3s.f.)$$ Note this is not the original 0.0924 from OP's equation.

Now what's probably happened is that the person writing the question has used a calculator value for e and ended up with this: 0.0924568... to which they've done this: 0.0924568... and that's given the (IMO wrong) "answer" to OP's equation.

But there are a few other approaches to errors and uncertainty that I'd like to highlight before writing the equation off as just plain wrong

*When I say "arbitrary precision", what I really mean is enough sig figs so that changing any of the later values will not affect the rounded calculation result. In this example, that happens with e to 6s.f., and so for e = 2.71828... it makes no difference whether that ... is a 9 or a 0 or anything else, the result will be the same when rounded.

### Method 1: the Engineer

Nothing is perfect in engineering, the equation as stated may be using a rounded value for e. All numbers in the equation are given to 3s.f. (at least, 1 and 0.1 aren't, but let's pretend they are). So logically a 3s.f. value for e of 2.72 should be used. This gives us the answer 0.0923357... = 0.0923 (3s.f.), also not in agreement.

### Method 2: the Physicist

A Physicist is an Engineer applying the rules more rigorously. In fact, as a Physicist, you tend to take all numbers in the equation to no more than 1s.f. greater accuracy than your answer. And the answer should have no greater accuracy than the least accurate number in your equation - which for us is 1s.f. for either 1 or 0.1. Therefore, the greatest accuracy of any of the numbers in our equation should be no more than 2s.f. in order to get a 1s.f. answer. With that in mind, our equation should have looked like: $$\frac{e^{-2.9 + 6.3\cdot 0.1}}{1 + e^{-2.9 + 6.3\cdot 0.1}} = (0.0924 \ rounded \ to \ 1s.f.) = 0.09$$ and e can be either 3 or 2.7. Testing both of those $$f(e=3) = 0.08(1s.f.)$$ $$f(e=2.7) = 0.09(1s.f.)$$

The 1s.f. version of the 0.0924 in the original question is 0.09, so the physicist taking values to 2s.f. would be fine seeing OP's equation if it was written as $$\frac{e^{-2.9 + 6.3\cdot 0.10}}{1.0 + e^{-2.9 + 6.3\cdot 0.1}} = 0.09$$

### Method 3:the Biologist

Finally, biologists like decimal places, and similar to what physicists say about sig figs, a biologist would expect an answer with the same number of dps as the least accurate bit of data in the equation. Well if 1 was measured to 0 dps, then actually, the equation the biologist is looking to confirm is whether $$\frac{e^{-3 + 6\cdot 0}}{1 + e^{-3 + 6\cdot 0}} = (0.0924 \ to \ 0d.p.) = 0$$ Which is true for e to 0 d.p, or to any precision

Now I'll admit that most of that was a bit silly, that's clearly not what was meant in the question the OP posed, but I do think it's important to have an appreciation of precision in answers and to see that depending on how you construct the equation you can get many different answers. Also as a caveat, I'm not claiming to speak for all Biologists, Engineers or Physicists, I just put those labels to help illustrate the point.

NB, this word document is a good resource for info on uncertainties and errors in physics