POV-Ray : Newsgroups : povray.general : Function: Making negative numbers positive Server Time
26 Jun 2024 13:39:48 EDT (-0400)
  Function: Making negative numbers positive (Message 21 to 30 of 33)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>
From: Thomas de Groot
Subject: Re: Function: Making negative numbers positive
Date: 28 Nov 2015 02:58:00
Message: <56595e88@news.povray.org>
On 27-11-2015 22:12, Stephen wrote:
> On 11/27/2015 7:24 PM, Alain wrote:
>> Le 15-11-27 05:52, clipka a écrit :
>>> Am 27.11.2015 um 05:12 schrieb Alain:
>>>
>>>> You can also use the sellect() function:
>>>> #declare Abs = sellect(A, -A, A);
>>>
>>> The keyword is actually "select".
>>>
>> Oups
>
> Or Oops, in English. :-P
>
> PS I know that I have a cheek correcting anyone's spelling but I could
> not resist it.
>

Carry on Stephen, carry on! ;-)

-- 
Thomas


Post a reply to this message

From: Stephen
Subject: Re: Function: Making negative numbers positive
Date: 28 Nov 2015 03:25:02
Message: <565964de$1@news.povray.org>
On 11/28/2015 7:57 AM, Thomas de Groot wrote:
> On 27-11-2015 22:12, Stephen wrote:
>> On 11/27/2015 7:24 PM, Alain wrote:
>>> Le 15-11-27 05:52, clipka a écrit :
>>>> Am 27.11.2015 um 05:12 schrieb Alain:
>>>>
>>>>> You can also use the sellect() function:
>>>>> #declare Abs = sellect(A, -A, A);
>>>>
>>>> The keyword is actually "select".
>>>>
>>> Oups
>>
>> Or Oops, in English. :-P
>>
>> PS I know that I have a cheek correcting anyone's spelling but I could
>> not resist it.
>>
>
> Carry on Stephen, carry on! ;-)
>

They will only stop me when they box me. :-)

-- 

Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: Function: Making negative numbers positive
Date: 28 Nov 2015 03:59:50
Message: <56596d06$1@news.povray.org>
On 28-11-2015 9:24, Stephen wrote:
> On 11/28/2015 7:57 AM, Thomas de Groot wrote:
>> On 27-11-2015 22:12, Stephen wrote:
>>> On 11/27/2015 7:24 PM, Alain wrote:
>>>> Le 15-11-27 05:52, clipka a écrit :
>>>>> Am 27.11.2015 um 05:12 schrieb Alain:
>>>>>
>>>>>> You can also use the sellect() function:
>>>>>> #declare Abs = sellect(A, -A, A);
>>>>>
>>>>> The keyword is actually "select".
>>>>>
>>>> Oups
>>>
>>> Or Oops, in English. :-P
>>>
>>> PS I know that I have a cheek correcting anyone's spelling but I could
>>> not resist it.
>>>
>>
>> Carry on Stephen, carry on! ;-)
>>
>
> They will only stop me when they box me. :-)
>

That's the spirit!

-- 
Thomas


Post a reply to this message

From: Kenneth
Subject: Re: Function: Making negative numbers positive
Date: 29 Nov 2015 03:50:01
Message: <web.565abbd57aaf16cc33c457550@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
>
> ...As a matter of fact, in its most
> basic form the multiplication operation isn't even /defined/ for
> negative numbers; defining whether the product of two negative values
> should itself be negative or positive is actually a choice -- it doesn't
> follow from first principles (although the choice that such a product
> should be positive turns out to be helpful).
>
This particular example-- multiplying two negative numbers and getting a
positive answer-- has always given me pause, philosophically. That might sound
strange, coming from someone who considers himself (reasonably) math-literate;
but I have always had a kind of built-in stumbling-block regarding it's
'philosophical basis', and why or how this 'convention' came about, in the
history of mathematics. ('Convention' may not be the correct way of putting it,
of course; there have no doubt been many great mathematicians who have struggled
with this concept in order to put it on a firm logical foundation. I hope!)

Put more simply: It seems perfectly 'obvious' that +3 X +2 = +6 (as any child
discovers, when making two sets of three toy blocks, for example.) Likewise, -2
X +3 should 'obviously' produce -6 ... although I can't think of a good
'child's' example to illustrate that ;-) But when it comes to -2 X -3, it just
doesn't seem 'intuitive' that it should produce a positive value. (Although,
what *else* it should produce is certainly a mystery!) HOWEVER... I'm not about
to question centuries (millennia??) of mathematical thought-- I'll just accept
it. ;-)


Post a reply to this message

From: Jérôme M. Berger
Subject: Re: Function: Making negative numbers positive
Date: 29 Nov 2015 07:13:20
Message: <565aebe0$1@news.povray.org>
On 11/29/2015 09:48 AM, Kenneth wrote:
> Put more simply: It seems perfectly 'obvious' that +3 X +2 = +6 (as a
ny child
> discovers, when making two sets of three toy blocks, for example.) Like
wise, -2
> X +3 should 'obviously' produce -6 ... although I can't think of a good

> 'child's' example to illustrate that ;-) But when it comes to -2 X -3, 
it just
> doesn't seem 'intuitive' that it should produce a positive value. (Alth
ough,
> what *else* it should produce is certainly a mystery!) HOWEVER... I'm n
ot about
> to question centuries (millennia??) of mathematical thought-- I'll just
 accept
> it. ;-)
> 
    Here's a logical explanation: it also seems 'obvious' that:
(a + b) × c = (a × c) + (b × c) and it is pretty easy to
 validate with
numbers: (1 + 2) × 2 = (3) × 2 = 6 = 2 + 4 = (1 × 
2) + (2 × 2). From a
theoretical standpoint, this is actually one of the ground rules that
define the multiplication (called distributivity). Now, apply this rule
with a = -b and c < 0, for example with your numbers: a = +2, b = -
2 and
c = -3. You get:

(+2 + -2) × -3 = (+2 × -3) + (-2 × -3)

which transforms into:

0 × -3 = (+2 × -3) + (-2 × -3)        by definition of -
2
0 = -6 + (-2 × -3)                    you said yourself it was 'ob
vious'
6 = (-2 × -3)                         by definition of -6

    Note: the 'ovbious' second step derives from the same ground rule by
taking c > 0: 0 = (+2 + -2) × +3 = (+2 × +3) + (-2 × +
3).

        Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

From: Stephen
Subject: Re: Function: Making negative numbers positive
Date: 29 Nov 2015 09:52:47
Message: <565b113f$1@news.povray.org>
On 11/29/2015 8:48 AM, Kenneth wrote:
> This particular example-- multiplying two negative numbers and getting a
> positive answer-- has always given me pause, philosophically. That might sound
> strange, coming from someone who considers himself (reasonably) math-literate;

Hmm! I tried to explain it using adding the number of times you want to 
multiply it. When I tried to multiply two negative numbers I am out by a 
factor of one. Now I am confused. :-(

Curse you Moriarty! ;-)
-- 

Regards
     Stephen


Post a reply to this message

From: clipka
Subject: Re: Function: Making negative numbers positive
Date: 29 Nov 2015 11:18:22
Message: <565b254e$1@news.povray.org>
Am 29.11.2015 um 09:48 schrieb Kenneth:

> Put more simply: It seems perfectly 'obvious' that +3 X +2 = +6 (as any child
> discovers, when making two sets of three toy blocks, for example.) Likewise, -2
> X +3 should 'obviously' produce -6 ... although I can't think of a good
> 'child's' example to illustrate that ;-) But when it comes to -2 X -3, it just
> doesn't seem 'intuitive' that it should produce a positive value. (Although,
> what *else* it should produce is certainly a mystery!)

Here's my attempt:


Suppose you have some salts dissolved in water, i.e. the water contains
ions of arbitrary elements; depending on the type of element, each ion
is either negatively or positively charged, and the magnitude of its
charge may be 1, 2, 3 or maybe even 4. The whole solution is in
electrostatic equilibrium, i.e. its net charge is 0.

Now suppose you do an experiment in which you know that this solution
exchanges ions of a single element type with the outside world, and you
want to figure out the resulting total charge. You don't know the
element type, nor the direction of the exchange; however, you have a
measurement device that will give you the change in the number of ions
in the solution (a positive value indicating a gain, a negative
indicating a loss), and another measurement device that will give you
the charge of the individual ions.

Now you measure that the gain was -100 (i.e. you actually lost ions),
and the individual ions' charge was -2 (i.e. each ion was doubly
negatively charged).

Obviously the solution's charge now has a magnitude of 100*2 = 200. But
how about the sign?

You lost some negatively charged ions, so your positively charged ions
now have the upper hand: The solution is now positively charged.

Thus, it would make sense in this context if the operation of
multiplying two negative numbers would give a positive result.


Note how this example uses a "magnitude-and-direction" style definition
of a signed number. I guess /any/ "natural" example for multiplication
of two negative values needs to be based on this style of definition.
(After all, how would a signed number fit in a magnitude-only numerical
system anyway?)


Post a reply to this message

From: Cousin Ricky
Subject: Re: Function: Making negative numbers positive
Date: 30 Nov 2015 07:46:44
Message: <565c4534$1@news.povray.org>
On 2015-11-27 03:37 PM (-4), clipka wrote:
> Am 27.11.2015 um 20:26 schrieb Alain:
>> It's always safer to assume that the value in question *may* be negative
>> as well as positive.
>> You want the result to be *always* positive indepentently if it's
>> original sign.
>
> Actually we can't tell whether that's what the OP wants, as he never
> told us the intended result for this case. (Though I'd agree it's a good
> guess that he would have known about the negation or multiplication by
> -1 if that had been the behaviour he was after.)

It would be helpful if the OP would write back and explain what he 
wants.  By now, the confusion caused by his ambiguity should be clear to 
any reader.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Function: Making negative numbers positive
Date: 30 Nov 2015 07:55:06
Message: <565c472a$1@news.povray.org>
On 2015-11-29 04:48 AM (-4), Kenneth wrote:
> This particular example-- multiplying two negative numbers and getting a
> positive answer-- has always given me pause, philosophically. That might sound
> strange, coming from someone who considers himself (reasonably) math-literate;
> but I have always had a kind of built-in stumbling-block regarding it's
> 'philosophical basis', and why or how this 'convention' came about, in the
> history of mathematics. ('Convention' may not be the correct way of putting it,
> of course; there have no doubt been many great mathematicians who have struggled
> with this concept in order to put it on a firm logical foundation. I hope!)
>
> Put more simply: It seems perfectly 'obvious' that +3 X +2 = +6 (as any child
> discovers, when making two sets of three toy blocks, for example.) Likewise, -2
> X +3 should 'obviously' produce -6 ... although I can't think of a good
> 'child's' example to illustrate that ;-) But when it comes to -2 X -3, it just
> doesn't seem 'intuitive' that it should produce a positive value. (Although,
> what *else* it should produce is certainly a mystery!) HOWEVER... I'm not about
> to question centuries (millennia??) of mathematical thought-- I'll just accept
> it. ;-)

-2 x  3 = -6
-2 x  2 = -4
-2 x  1 = -2
-2 x  0 =  0
-2 x -1 =  2
-2 x -2 =  4
-2 x -3 =  6

Seems intuitive enough.  I figured this out on my own as a kid, although 
I was suspicious of my own reasoning until it was confirmed in math class.


Post a reply to this message

From: Alain
Subject: Re: Function: Making negative numbers positive
Date: 30 Nov 2015 16:28:18
Message: <565cbf72$1@news.povray.org>

> On 2015-11-29 04:48 AM (-4), Kenneth wrote:
>> This particular example-- multiplying two negative numbers and getting a
>> positive answer-- has always given me pause, philosophically. That
>> might sound
>> strange, coming from someone who considers himself (reasonably)
>> math-literate;
>> but I have always had a kind of built-in stumbling-block regarding it's
>> 'philosophical basis', and why or how this 'convention' came about, in
>> the
>> history of mathematics. ('Convention' may not be the correct way of
>> putting it,
>> of course; there have no doubt been many great mathematicians who have
>> struggled
>> with this concept in order to put it on a firm logical foundation. I
>> hope!)
>>
>> Put more simply: It seems perfectly 'obvious' that +3 X +2 = +6 (as
>> any child
>> discovers, when making two sets of three toy blocks, for example.)
>> Likewise, -2
>> X +3 should 'obviously' produce -6 ... although I can't think of a good
>> 'child's' example to illustrate that ;-) But when it comes to -2 X -3,
>> it just
>> doesn't seem 'intuitive' that it should produce a positive value.
>> (Although,
>> what *else* it should produce is certainly a mystery!) HOWEVER... I'm
>> not about
>> to question centuries (millennia??) of mathematical thought-- I'll
>> just accept
>> it. ;-)
>
> -2 x  3 = -6
> -2 x  2 = -4
> -2 x  1 = -2
> -2 x  0 =  0
> -2 x -1 =  2
> -2 x -2 =  4
> -2 x -3 =  6
>
> Seems intuitive enough.  I figured this out on my own as a kid, although
> I was suspicious of my own reasoning until it was confirmed in math class.
>

I had that same reasoning around 3rd or 4th grade. For the additions, it 
was in second grade.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.