• Advertisement

Archived

This topic is now archived and is closed to further replies.

e

This topic is 5037 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Everything you''ve always wanted to know about e but were afraid to ask: http://mathworld.wolfram.com/e.html

Share this post


Link to post
Share on other sites
e = 1/0! + 1/1! + 1/2! + 1/3! + 1/4! + 1/5! + 1/6! ... ... ...

When I was in 8th grade, I didn''t know what x! meant, so incase you''re like me...

x! = x*(x-1)(x-2)(1)

So 5! = 5*4*3*2*1
8! = 8*7*6*5*4*3*2*1

Hope that helps explain.

Share this post


Link to post
Share on other sites
quote:
Original post by Skybin
If the ... means it continues on forever, how do you get a single definite irrational number?



What do you mean by definite irrational number? Irrational numbers are approximations. As carry the series representing the value out to greater iterations, you get better approximations. Just like sin, cos, tan, pi, etc..

Share this post


Link to post
Share on other sites
By it''s very definition, you cannot express an irrational number as a decimal. Any decimal representation is therefore an approximation.

e, pi, sqrt(2), are all irrational numbers. The formulas you will find for them will only ever give approximations if you try to evaluate them.

- Xavier

Share this post


Link to post
Share on other sites
I think he''s looking for an equation like the famous PI equation that gives you a hexadecimal digit of pi for each n you plug in.

However, as an 8th grader myself, I don''t know it.

<-- that''s still a link if you didn''t notice
"Gay marriage will encourage people to be gay, in the same way that hanging around tall people will make you tall." - Grizwald

Share this post


Link to post
Share on other sites
The infinite series is an ok way to approximate e. Using 6 terms gives you 3 digits of accuracy.

The equation you mentioned, (1 + 1/x)x x->∞ is one of the definitions of e. In other words, that is an equation that leads you to the exact value of e. On Mathworld there are several other formulas that are identities of e but they generally involve some trigonometric function or hyperbolic functions.


Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud

Share this post


Link to post
Share on other sites
The definition I like best is d/dx(e^x) = e^x, i.e. y=e^x has a gradient of e^x.
Using that you can obtain the series Kranar gave with a little bit of brain work.

[edited by - furby100 on May 7, 2004 4:40:54 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by furby100
The definition I like best is d/dx(e^x) = e^x, i.e. y=e^x has a gradient of e^x.
Using that you can obtain the series Kranar gave with a little bit of brain work.

<SPAN CLASS=editedby>[edited by - furby100 on May 7, 2004 4:40:54 PM]</SPAN>


Obtaining the series involves calculus, not quite for an 8th grader. However it is possible, using basic calculus and a bit of analysis facts (such as logarithms) to derive the series directly from the definition of e, lim n->inf (1+1/n)^n, if you know the general formula for taylor/maclaurin series

The series is converges somewhat fast, the 7 terms Kranar posted will give you 3 decimal places of accuracy - 2.718

Share this post


Link to post
Share on other sites
Not exactly sure if this helps but since this is on a programming forum, you don''t need to calculate it past a float or a double''s accuracy because your just going to lose it anyways. e is irrational and calculating it is slow. I would just make a double equal to as much of e as it could hold and use that.

If you want a good equation to calculate it to a specific accuracy while hiding all the calculus it is:
e = (1 + 1/x)^x
The higher x is the closer you get to a value for e.

You''re going to have to cut off the accuracy at some point anyways, unless your doing something really advanced which I''m assuming your not since you don''t know calculus yet ; )

Good luck!

Share this post


Link to post
Share on other sites
quote:
Original post by Cibressus
well if you recur to infinity would'nt e be infinity?


no because you're adding smaller and smaller numbers:

i.e.

0.9 + 0.09 + 0.009 + 0.0009 + you get the pattern

at infinity will be 1, not inifinity.

-me

[edited by - Palidine on May 10, 2004 11:53:44 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by InTheSackMan
Not exactly sure if this helps but since this is on a programming forum, you don't need to calculate it past a float or a double's accuracy because your just going to lose it anyways. e is irrational and calculating it is slow. I would just make a double equal to as much of e as it could hold and use that.

If you want a good equation to calculate it to a specific accuracy while hiding all the calculus it is:
e = (1 + 1/x)^x
The higher x is the closer you get to a value for e.

You're going to have to cut off the accuracy at some point anyways, unless your doing something really advanced which I'm assuming your not since you don't know calculus yet ; )

Good luck!


Either this or the taylor series is useful to calculate e if you want. With the taylor series it's simple to determine if you've achieved the number of decimal places you want though.

If you want to be really picky, you can state that e come from this process:
define &int 1->inf dx/x = ln x,
then e is the value for which ln x = 1
all other "definitions" are really results of the true definition
but that's really too picky for game development

in reality, use const double E = 2.718281828 and be done with it
if you need to find e^x in a game(first ask why), then use the taylor series. it's the easiest way to do the power.

EDIT: Not that I prefer or even like this picky definiton at all...see 2 posts down

[edited by - etothex on May 11, 2004 4:49:46 AM]

[edited by - etothex on May 11, 2004 5:27:26 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by etothex
all other "definitions" are really results of the true definition



(Off Topic) What makes you believe this is the true definition? Was it because this is the way you learned it? Was it because this is the first historical definition? We both agree on the fact that this a correct definition. But why should it be the true one?

My preferred definition is e = exp( 1 ). This is a result of your definition as much as your definition is a result of mine.

EDIT : now that I think of it, if you use your definition you must first prove (although it is trivial) that there exists only one real x for which ln x = 1.

Victor Nicollet, INT13 game programmer



[edited by - ToohrVyk on May 11, 2004 5:07:30 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by ToohrVyk
quote:
Original post by etothex
all other "definitions" are really results of the true definition



(Off Topic) What makes you believe this is the true definition? Was it because this is the way you learned it? Was it because this is the first historical definition? We both agree on the fact that this a correct definition. But why should it be the true one?

My preferred definition is e = exp( 1 ). This is a result of your definition as much as your definition is a result of mine.



I didn''t mean it was my choice definition or even that I didn''t wish to rip that definition out of textbooks. I was trying to show how people get crotchety about definitions. Maybe I wasn''t clear enough, sorry(should''ve put true in quotes too), but since we essentially agree, maybe we should get back on topic.

BTW, one of my favorite definitions is the taylor series where x=1, because it is easiest to explain and also easy to derive other definitions from it.

BTW#2-I believe the integral of 1/x definition comes from the fact that there''s no simple way to calculate that integral without knowing the derivative of ln x, and some people don''t like that, so they make a "definition" and wrap it up in a clean package. Could be mistaken, though, haven''t gone too far in math.

Share this post


Link to post
Share on other sites

  • Advertisement