0 ^ 0 = 1

This is a discussion on 0 ^ 0 = 1 within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I read that zero to the power of zero is suppose to be 1... Does anyone know why this is ...

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,678

    0 ^ 0 = 1

    I read that zero to the power of zero is suppose to be 1...
    Does anyone know why this is the case? It seems silly to me. Wouldn't the logical answer be zero? To my understanding, exponentation is simply recursive multiplication, 3 ^ 4 is 3 * 3 * 3 * 3, 8 ^ 2 is 8 * 8. This would make zero to the power of x nothing. The way I see it, this should give zero, or, at the very least, an 'undefined' result. (much like dividing by zero).
    ?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  2. #2
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    Exponentiation - Wikipedia, the free encyclopedia


    also

    Computer programming languages that evaluate 0^0 to 1[16] include bc, Haskell, J, Java, LISP,MATLAB, ML, Perl, PHP, Python, R, Ruby, Scheme, and SQL. In the .NET Framework, the method System.Math.Pow treats 0^0 to be 1.

    Among spreadsheet applications, Microsoft Excel issues an error when it evaluates 0^0, while OpenOffice.org 3 returns 1.

    Microsoft Windows' Calculator and the calculator in Google search[17] evaluate 0^0 to 1.

    Maple simplifies a^0 to 1 and 0^a to 0, even if no constraints are placed on a, and evaluates 0^0 to 1.

    Mathematica simplifies a^0 to 1, even if no constraints are placed on a. It does not simplify 0^a, and it takes 0^0 to be an indeterminate form.

    The TI-84 returns a Domain Error when given 0^0 to solve, but the TI-89 returns 1. The TI-89 Titanium returns undef.
    Last edited by ಠ_ಠ; 05-09-2009 at 11:22 PM.
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    Division can be done by subtracting powers.

    Any number can be written as some base, raised by some exponent (floating point does this all the time)
    x = n ^ a
    y = n ^ b

    so
    x / y == n ^ ( a - b )

    Dividing a number by itself gives 1, which in the above identity would mean a and b are the same, that is a-b is 0
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,159
    Based on the same reasoning that n^0 is 1 for some n not equal to 0 (which is what Salem just outlined), I reason that 0^0 = 0/0, and hence it is indeterminate. However, I have never asked a professional mathematician for his opinion.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    0^0=1 is true simply for convenience, yet it is not something that is universally agreed upon. Read this for more information.

  6. #6
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    >> I reason that 0^0 = 0/0, and hence it is indeterminate.
    0^0 is perfectly defined.

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,159
    Quote Originally Posted by twomers
    0^0 is perfectly defined.
    Please elaborate.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Whoops. Though I wrote it as 0^0 I meant x^0.

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,159
    Quote Originally Posted by twomers
    Though I wrote it as 0^0 I meant x^0.
    Right, in which case you completely missed or ignored the "based on the same reasoning that n^0 is 1 for some n not equal to 0" part of my sentence. (Though in retrospect it should be any n rather than some n, but whatever.)
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Thanks, laserlight. I'd love an omelette.

  11. #11
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    to calculate 0^0 one can take lim(x^y) when x,y -> 0

    Depending on the relative speed of approximation to zero the result will be different
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  12. #12
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312
    The recursive definition of the product is:

    prod() = 1
    prod(x,y,z, ...) = x * prod(y,z, ...)

    Thus, prod(5,3) = 5*prod(3) = 5*3*prod() = 5*3*1 = 15.

    1 has been chosen because it is the neutral element of multiplication. Hence, a^0, 0^0, 0! are all equal to 1.

    Check your favorite math book for "empty product", "empty sum", "empty function"...

    EDIT: and it makes sense, too: how many functions are there from X->Y? Exactly |Y|^|X| functions. What if X=Y=<empty set>? Then |Y|^|X| = 0^0 = 1, and there's exactly one function from the empty set to the empty set: the empty function.

    Greets,
    Philip
    Last edited by Snafuist; 05-11-2009 at 03:41 AM.
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  13. #13
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    x^0 (where x -> 0) = 1
    0^x (where x -> 0) = 0

    So 0^0 will get different values depending on how you approach it. The actual value is thus undefined.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  14. #14
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,159
    Quote Originally Posted by Magos
    So 0^0 will get different values depending on how you approach it. The actual value is thus undefined.
    You can always define it out of convenience (and possibly elegance), which is what the cited Wikipedia article notes, as do bithub and Snafuist. If that Wikipedia article is to be believed, mathematicians do concur with my analysis as well, to some extent.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  15. #15
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,678
    I've looked around more (already seen Wiki's say on it), it seems that most agree that the value is (in reality) undefined.
    Glad that's cleared up. My mind often has a mind of it's own and goes off pondering things that I really don't care about.

    >> Thanks, laserlight. I'd love an omelette.
    Forgive me for not understanding this, but... what?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21