Decimals and other numbers
alister
alister.nospam.ware at ntlworld.com
Sat Jan 10 05:41:56 EST 2015
On Fri, 09 Jan 2015 19:57:20 -0800, Devin Jeanpierre wrote:
> On Fri, Jan 9, 2015 at 7:05 PM, Gregory Ewing
> <greg.ewing at canterbury.ac.nz> wrote:
>> It's far from clear what *anything* multiplied by itself zero times
>> should be.
>>
>> A better way of thinking about what x**n for integer n means is this:
>> Start with 1, and multiply it by x n times. The result of this is
>> clearly 1 when n is 0, regardless of the value of x.
>>
>>> 5**4 = 5*5*5*5 = 625
>>
>> No:
>>
>> 5**4 = 1*5*5*5*5 5**3 = 1*5*5*5 5**2 = 1*5*5 5**1 = 1*5 5**0 = 1
>
> I never liked that, it seemed too arbitrary. How about this explanation:
>
> Assume that we know how to multiply a nonempty list numbers. so
> product([a]) == a, product([a, b]) = a * b, and so on.
>
> def product(nums):
> if len(nums) == 0:
> return ???
> return reduce(operator.mul, nums)
>
> It should be the case that given a list of factors A and B,
> product(A + B) == product(A) * product(B) (associativity).
> We should let this rule apply even if A or B is the empty list,
> otherwise our rules are kind of stupid.
>
> Therefore, product([] + X) == product([]) * product(X)
> But since [] + X == X, product([] + X) == product(X)
>
> There's only one number like that: product([]) == 1
>
> (Of course if you choose not to have the full associativity rule for
> empty products, then anything is possible.)
>
> -- Devin
The general theory behind logarithms explains why it is excepted that any
number raised to the power of 0 =1
take X^3 * x^ 4 = X^7 achieved simply by adding the indices
if you wanted to do X *1 using the same method what would you need to add
to the index of X (X^1 ) to get X (X^1) - Answer 0 therefore X^0 = 1
This theoretically works regardless of the value of x you choose for the
base , of course in practice it is not possible to work in a number base
of 0 which is where things get into the indeterminate as it contradicts
the other provable fact that ) * anything is 0.
These edge case contradictions can easily cause my brain into an in
finite recursive loop.
it is as confusing as the concept that there are different values of
infinity (some larger than others!)
--
Ya'll hear about the geometer who went to the beach to catch some
rays and became a tangent ?
More information about the Python-list
mailing list