POV-Ray : Newsgroups : povray.general : unexpected rotation result Server Time
8 Aug 2024 16:20:43 EDT (-0400)
  unexpected rotation result (Message 31 to 40 of 48)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 8 Messages >>>
From: Scott Hill
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 06:40:02
Message: <3a813412$1@news.povray.org>
"Marc-Hendrik Bremer" <Mar### [at] t-onlinede> wrote in message
news:3a805846@news.povray.org...
>
> Scott Hill schrieb in Nachricht <3a804217@news.povray.org>...
>
> >Does that make any sense ?
> >
>
>
> Yes, it does. But only if you use a hierarchic structure for the rules,
you
> use. From a strictly mathematical point of you (I think) there is no
> difference in the rule that multiplications are done before additions and
> the one that tells you, what brackets mean or what the digit "2" mean. Or
is
> this not right?
>

    Hmm. IMHO, no. But then I've just tried putting into words why they're
different and I can't. I'll have to ponder on this one for while....

> From a more general point of view you and Tom are absolutely right of
> course.
>

    Of course. I'm _always_ right! ;-)

--
Scott Hill.
NC Graphics (Cambridge) Ltd.
http://www.ncgraphics.co.uk


Post a reply to this message

From: Tom Melly
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 07:34:23
Message: <3a8140cf@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-95BA06.05341707022001@news.povray.org...

> > that the solution is: (a*x)^2 + (b*x) + c.
>
> You still followed the precedece of * over +, I think it's even uglier:
> ((((a * x) ^ 2) + b) * x) + c
> Unless you were only talking about individual terms.
>

I didn't really follow the precedence - I just reduced the equation to a
non-ambiguous form... Well, almost. I should have written ((a*x)^2)+(b*x)+c.
As I wrote it originally, I suppose it could mean (a*x)^(2+(b*x)+c).


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 09:32:37
Message: <3a815c85@news.povray.org>
In article <3a80db3a$1@news.povray.org> , "Mark Wagner" 
<mar### [at] gtenet> wrote:

> I just typed the expression 1+2*3-4 into my TI-1795 calculator, and, as
> expected, got the number 5.

Yes, because you did not calculate the above!  What you calculated* was :

1+2=3

3*3=9

9-4=5

Obviously this cannot be the same as 1+2*3-4.


     Thorsten


* Your calculator manual will of course explain this exactly the same way.
However, most newer caclulators (and many expensive older ones) support
calculations in mathematical order (or whatever this is called).

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Scott Hill
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 10:20:51
Message: <3a8167d3@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:3a815c85@news.povray.org...
> In article <3a80db3a$1@news.povray.org> , "Mark Wagner"
> <mar### [at] gtenet> wrote:
>
> > I just typed the expression 1+2*3-4 into my TI-1795 calculator, and, as
> > expected, got the number 5.
>
> Yes, because you did not calculate the above!  What you calculated* was :
>
> 1+2=3
>
> 3*3=9
>
> 9-4=5
>
> Obviously this cannot be the same as 1+2*3-4.
>
>


    Yeah, but the point is that 5 is just as valid a result as 3, for the
sum 1+2*3-4, if we ignore the 'accepted' operator precedence rules. We could
quite as easily have precedence rules that state that addition and
subtraction is done before multiplication and then everyone would be saying
"But it's not 3, it's -3!". Do you see ? All that makes 1+2*3-4 evaluate to
3, rather than -3, or 5, or -1 is an arbitrary rule about which order the
operations should be done in - change those rules and you change the
answer - but you don't change any fundamental aspect of mathematics.

    There are, unless I've missed some, 5 ways (if we ignore standard
operator order rules) to interpret '1+2*3-4' :

    (1+(2*(3-4))) = -1
    (1+((2*3)-4)) = 3
    ((1+(2*3))-4) = 3
    ((1+2)*(3-4)) = -3
    ((1+2)*3)-4) = 5

    These're all _mathematically_ correct statements, yet we only except one
to be the correct evaluation of '1+2*3-4'. This is not, as I've already
said, because any of the others are wrong, but merely because the statement
is ambiguous and we therefore need some way to de-ambiguate (choose) between
the possible interpretations.

--
Scott Hill.
NC Graphics (Cambridge) Ltd.
http://www.ncgraphics.co.uk

P.S. When will p.o-t be back ?


Post a reply to this message

From: Tom Melly
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 10:42:55
Message: <3a816cff$1@news.povray.org>
"Scott Hill" <sco### [at] ncgraphicsnet> wrote in message
news:3a8167d3@news.povray.org...
>
> P.S. When will p.o-t be back ?
>

It is! (follow ups to ot.)


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 10:50:09
Message: <3a816eb1@news.povray.org>
Scott Hill schrieb in Nachricht <3a8167d3@news.povray.org>...

>    (1+(2*(3-4))) = -1
>    (1+((2*3)-4)) = 3
>    ((1+(2*3))-4) = 3
>    ((1+2)*(3-4)) = -3
>    ((1+2)*3)-4) = 5
>
>    These're all _mathematically_ correct statements, yet we only except
one
>to be the correct evaluation of '1+2*3-4'. This is not, as I've already
>said, because any of the others are wrong, but merely because the statement
>is ambiguous and we therefore need some way to de-ambiguate (choose)
between
>the possible interpretations.


They are not mathematically correct, because an improtant part of the
mathematical system are the precedence rules. They are in no way more
arbitrary than any other mathematical rule, 'cause mathematics is no science
but just a set of rules which have at first nothing to do with any real
thing in the world (although they prove to be of much help to understand
some things in real world). If you just cancel one of the rules you can as
easily give up the whole system - or at least you have to say what you are
doing. The mathematical system in whole is not ambiguos at all - cause there
are rules to tell you how everything interacts which each other.

>P.S. When will p.o-t be back ?
>

Well, it is back for more than a week now.


Marc-Hendrik


Post a reply to this message

From: Tom Melly
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 11:14:51
Message: <3a81747b$1@news.povray.org>
"Marc-Hendrik Bremer" <Mar### [at] t-onlinede> wrote in message
news:3a816eb1@news.povray.org...
>
>
> They are not mathematically correct, because an improtant part of the
> mathematical system are the precedence rules. They are in no way more
> arbitrary than any other mathematical rule, 'cause mathematics is no
science

I disagree - for example I am not offended/shocked/suprised/whatever that
entering 2+3*5 in a calculator gives me 25 but gives me 17 in POV. However,
if a calculator or program ever told me that 3*5 was anything but 15, I
would ask for a refund.

IMHO you're missing the point. Precedence rules exist (once more with
feeling) because common-sense cannot resolve the issue.

Another English example - "rape" is both an act and a plant. If I say "there
is a lot of rape in Sussex" you have no way of knowing whether I mean the
plant or the act. The doubt can only be resolved by some extra words. For
example "there are many rape-plants in Sussex".

This is the linguistic equivalent of brackets in a function. For you to
argue that the meaning of * or + is just as arbitary as precedence is the
equivalent of me saying that "there is a lot of rape in Sussex" is as
ambivalent as "there is a lot of crime in Sussex" because, in some private
language of my own, "crime" also means "oxygen".

Yes, maths is arbitary, but so is English. Nevertheless "rape" is ambivalent
in a way that "crime" is not.


Post a reply to this message

From: Warp
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 12:23:25
Message: <3a81848c@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
: I disagree - for example I am not offended/shocked/suprised/whatever that
: entering 2+3*5 in a calculator gives me 25

  If I enter that in my calculator it gives me 17.
  Why?

  There are two (main) types of calculators.
  Usually calculators only calculate one operation at a time. They do not
have memory for long expressions (some of these have indeed parentheses,
but still they work in the same way when parentheses are not used) and they
calculate every sub-expression right after it has been entered.
  What happens when you type "2+3*" (yes, I left the '5' intentionally out)
is the following: The calculator gets a '2', then a '+', then a '3'. Now
it expects either a number or another key (such as '=' or another operator).
When it gets something that is not numerical input it immediately calculates
the result of the current operation (as if '=' had been pressed) before
continuing.
  In fact, pressing any operator is like pressing '=' and that operator
(some very cheap calculators don't even have a '=' at all, but you have to
press some operator in order to get the result, such as '+'). Pressing the
operator is more like a shortcut for '=' and the operator itself.
  This is most probably done for simplicity. Usually these kind of calculators
are used for very simple tasks, like adding the prices of some products
together and so on. Modifying the behaviour of the operator keys to work
in another way would most probably just confuse people.
  When you type "2+4*5" you are, in fact, typing "2=+3=*5", although it's
kind of hidden.

  Now, the most advanced calculators (mainly graphical ones, like mine) allow
you to actually write long expressions (the whole expression is shown on
the screen of the calculator) and the result is calculated only when you
press '=' (or usually 'enter' in those calculators).
  These calculators also usually allow you to navigate through the expression
with cursor keys and make modifications to it.
  (The most advanced allow you to enter more complex mathematical operations
such as summation, derivative and integrals. Mine does; it even shows them
in the same way as I would write them on paper.)
  Since in these calculators you are actually calculating the result of the
whole expression, not just a sub-expression at a time, the result is the
mathematically expected one.

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Peter Popov
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 14:41:13
Message: <ae738t4t1vm66jo1sup9dgpbkvkim23ec3@4ax.com>
>E.g, what does 1+2*3-4 evaluate to ?

11123-4
12222223-4

and so on

Basically one or more 1's followed by zero or more 2's followed by
'3-4'

It basically depends on the input string you are matching against.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Tom Melly
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 14:58:30
Message: <3a81a8e6@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3a81848c@news.povray.org...
> Tom Melly <tom### [at] tomandlucouk> wrote:
> : I disagree - for example I am not offended/shocked/suprised/whatever
that
> : entering 2+3*5 in a calculator gives me 25
>
>   If I enter that in my calculator it gives me 17.
>   Why?
>

<SNIP>

Exactly - there is no wrong answer in the two answer, they are just using
two different conventions. However, to calculate the result on the basis
that "+" meant "/" would be silly.


Post a reply to this message

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

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