Page 3 of 5

Posted: Wed May 11, 2005 10:14 pm
by thefool
so you think purebasic is handling this the right way..

but again you are probaly right at the 0^0 is indefinate, but after understanding that i still think purebasic puts out the right answer.

Posted: Wed May 11, 2005 10:18 pm
by MrMat
Psychophanta wrote:...and MrMat, never forget that conveniences are always human interests :wink:
Of course :) And if it's taken 100's of years of arguments between far cleverer people than us to agree on what the answer is then what chance do we have? :wink:

Posted: Wed May 11, 2005 10:20 pm
by Froggerprogger
Another explanation:

The power is short writing for
x^n = x*x*x*x...,
similar to n*x for x+x+x+x...,
similar to UNION {k from 1 to n} M_k = M_1 union M_2 union M_3 ... union M_k
similar to SECTION {k from 1 to n} M_k = M_1 section M_2 ... section M_k,

What I mean is:
All of them are defined for NONE elements (e.g. the sum from 1 to 0 of elements, or a product of no elements, etc.) to the NEUTRAL element of the according operation.
So the sum from 1 to 0 gives 0 per definition, the UNION from 1 to 0 gives the empty set, the SECTION gives the whole set's universe instead. And so gives x^0 the same as 0^0 = 1 (the neutral element of multiplication), the same for faculty: 0! = 1

This is the explanation for this stuff I heard at university, but I like MrMats explanation, too!
btw PI=3 :)

Posted: Wed May 11, 2005 10:23 pm
by thefool
PI = 3
:lol:

okay so from your post i see that you agree that pb should act the way it does.

okay, i belive you stop calling me a donkey!!
and psycopanta: you have more important things to do: viewtopic.php?p=88505#88505
:twisted:

Posted: Wed May 11, 2005 10:31 pm
by MrMat
Froggerprogger wrote:x^n = x*x*x*x...,

What I mean is:
All of them are defined for NONE elements (e.g. the sum from 1 to 0 of elements, or a product of no elements, etc.) to the NEUTRAL element of the according operation.
So the sum from 1 to 0 gives 0 per definition, the UNION from 1 to 0 gives the empty set, the SECTION gives the whole set's universe instead. And so gives x^0 the same as 0^0 = 1 (the neutral element of multiplication), the same for faculty: 0! = 1
It's also defined for a zero value x with finite n, in which case 0^n = 0*0*0*0... = 0, which leads us back to the same problem!
thefool wrote:so you think purebasic is handling this the right way..

but again you are probaly right at the 0^0 is indefinate, but after understanding that i still think purebasic puts out the right answer.
I agree it is giving the 'right' (the useful!) answer. If anyone was ever doing limits in PureBasic then they'd have to think carefully about what is going on, but if they were doing limits they'd probably be using a computer algebra package like Mathematica in the first place... So i think we can agree Fred got it right! :lol:

Posted: Wed May 11, 2005 11:27 pm
by traumatic
Go out, watch TV, meet friends, code something... :twisted:

Posted: Thu May 12, 2005 12:07 am
by jack
if 0^0=1 is an error then exp(0)=1 should be an error also. :shock:

Posted: Thu May 12, 2005 7:44 am
by Psychophanta
thefool wrote:okay, i belive you stop calling me a donkey!!
and psycopanta: you have more important things to do: viewtopic.php?p=88505#88505
:twisted:
:lol: Weeelll, okay, i am in a doubt with you, you can insult me once, but please with logical arguments, ehhh!?


jack wrote:if 0^0=1 is an error then exp(0)=1 should be an error also. :shock:
I say 0^0=1 is an error because it is a CONVENIENCE, so it is not a valid math equation, but a concrete interest for a concrete situation. If maths are convenience interests, then science would be idealism. :o

exp(0) ? Whats that?

The best explanation given here is not lim x^0 as x->0+ , neither lim 0^x as x->0+ , but lim x^x as x->0+ that's the more correct and humble answer :!: :D

Posted: Thu May 12, 2005 9:07 am
by DoubleDutch
Its the fact that the answer (to most people who will see 0^0) is expected to be 1.

Most modern calculators will display 1.

Most textbooks will say, "unknown state, but take the result to be 1" or "can be replaced by 1".

If your so convinced that its incorrect, then check for it beforehand and make the appropriate changes to your code. It is a programming language after all, not a simple calculator - it should be an easy check you you to make. It will make you happy and contented. ;)

I personally check for division by zero (another equation that can have 2 possible answers, neither of them being possible to be represented by PureBasics REAL number system, that itself is inherited from the x86). I'd rather not really on the processor interpreting the result and presenting the user with an error condition because the processor just crashed.

I'd also suggest writing a petition to all the major calculator and processor manufacturers, telling them they much introduce another error condition into their systems if your really that bothered as to continue this thread to 3-4 pages. :twisted:

Posted: Thu May 12, 2005 10:54 am
by dagcrack
Putting apart the whole subject, do you guys realize this is a binary discussion? (0s and 1s :lol: ).

Posted: Thu May 12, 2005 12:41 pm
by GedB
A good way to understand why x^0 should always be one is to plot a graph of the following:

Code: Select all

i = 2

For e = -5 To 5 
  Debug Pow(i,e)
Next e
Trying changing i. For whatever value you have the following is true:

i to the power of a positive number will give you a value greater than 1.
i to the power of a negative number will give you a value between 0 and 1.

If you make i to the power of 0, 0, then your graph will not be continuous. It will approach 1, leap to 0, and the leap back up to close to 1.

Like in the following:

Code: Select all

Debug Pow(10, 0.0001)
Debug 0
Debug Pow(10, -0.0001)
Making Pow(i, 0) always 1 will give a continuous graph.

Posted: Thu May 12, 2005 1:27 pm
by Psychophanta
All of you are making me to repeat it, because it looks like you didn't see.
The best explanation given here is not lim x^0 as x->0+ , neither lim 0^x as x->0+ , but lim x^x as x->0+ that's the more correct and humble answer
i^0 or 0^i are expressions where there is in advance supossed i<>0, and is just here where the confusion (or convention) lies.

Posted: Thu May 12, 2005 2:06 pm
by thefool
Psychophanta wrote:
thefool wrote:okay, i belive you stop calling me a donkey!!
and psycopanta: you have more important things to do: viewtopic.php?p=88505#88505
:twisted:
:lol: Weeelll, okay, i am in a doubt with you, you can insult me once, but please with logical arguments, ehhh!?
i can insult you WITHOUT logical arguements if you want :twisted:

okay i belive that x^0 is only 1 if x>0 .
but i also belive the answer should be 1 in this case.. :)

okay enough discussion,..!

Posted: Thu May 12, 2005 2:51 pm
by Psychophanta
thefool wrote:i can insult you WITHOUT logical arguements if you want :twisted:
Yes, but don't forget that in that cases the receptor acts as a mirror :P

Posted: Thu May 12, 2005 3:09 pm
by GedB
lim x^x as x->0+
What on earth does that actually mean?

If nobody understands it is better to reiterate rather than repeat.