So is "6÷2(1+2)" equivalent to "6/(2*(1+2))" or "(6/2)*(1+2)"?
Waiting for an answer from Tom and only Tom because you're unclear as mud in the first post.
The thing about making witty signature lines is that it first needs to actually be witty.I really don't see what's hard to understand about «it's hard to understand, so rewrite it».
[1] This facsimile operated in part by synAC.You might be putting entirely too much faith in the company that gave us "biliseconds".
Okay.
See, we're far enough from the original argument that I can concede a point and still have the original argument remain intact. And I don't really care what Microsoft's position on this is either way.
I'm convinced that our modern day analogues to ancient scholars are comedians. -0dd1Does Excel even use the division symbol?
[1] This facsimile operated in part by synAC.I don't know! And I don't care!
I'm convinced that our modern day analogues to ancient scholars are comedians. -0dd1Yes, and it was quite unfunny on top of that.
The thing about making witty signature lines is that it first needs to actually be witty.Everyone, without exception, understands that. We all figure if we encounter such a problem in Real Life, we'll pass it off as ambiguous and either abandon it or ask for clarifications. Everyone but you has moved on to much more interesting problem of which answer it should be.
Hmm...clearly the answer is to get outside more.
Is using "Julian Assange is a Hillary butt plug" an acceptable signature quote?
You can't decide which answer it "should be" until you agree what the question "should be", though. Anway, apparently this thread has gone past that, into bickering over programming notation.
That was implied (though maybe not as much as I thought). If we figure out how to resolve the ambiguity (answering what the question should be) then the answer is unambiguous
At first I thought the answer was one, but after reading the question I realized it was actually nine, because there are no explicit parentheses around "2(1+2)".
And my TI-89 agrees with me◊.
"And as long as a sack of shit is not a good thing to be, chivalry will never die."Just another example of why Polish notation is superior. No ambiguity!
Though you can overdo it. I think I remember a book - by Prior, perhaps - which dealt with a family of fairly interesting temporal logics using (non-reverse) Polish notation, using capital letters for logical operators and using small letters for variables. There was no ambiguity in operation order, but the formulas looked like random keyboard mashes...
edited 1st May '11 3:20:54 AM by Carciofus
But they seem to know where they are going, the ones who walk away from Omelas.I'm sticking with 42.
And also, RPN FTW!!!
6 2 / 1 2 + *
6 2 1 2 + * /
edited 1st May '11 3:43:11 AM by vijeno
Ok.
6÷2(1+2) = 6/(2*1+2*2) = 6/6 = 1, this is one answer.
The other way of doing this is to write it as (6/2)*(1+2). 3*1+3*2=9.
I would say the first method is correct, because the second method requires that one splits up the equation.
^^ Eh, I find direct Polish notation more readable - I mean, you can just read the expression aloud and make sense of it, without needing to build stacks of inputs and keep track of their order.
In PN, * / 6 2 + 1 2 is read as "multiply the division of 6 by 2 and the sum of 1 and 2" and / 6 * 2 + 1 2 is read as"divide 6 by the product of two and of the sum of 1 and 2": this quite simpler than the equivalent RPN expressions, I think...
edited 1st May '11 6:04:42 AM by Carciofus
But they seem to know where they are going, the ones who walk away from Omelas.But RPN is easier for your Friend, the Computer to read. Besides, stacks aren't that bad...
edited 1st May '11 6:10:23 AM by Yej
Da Rules excuse all the inaccuracy in the world. Listen to them, not me.My Friend The Computer has 2 GB of RAM and can make I-forgot-how-many-gazillions integer operations per second. I don't.
Plus, keeping track of stacks of numbers gets confusing pretty quickly - I mean, in 6 2 1 2 + * /, could you tell at a glance what subexpressions the * operator is applied to?
edited 1st May '11 6:19:25 AM by Carciofus
But they seem to know where they are going, the ones who walk away from Omelas.PN does require a stack, doesn't it? Or maybe even two stacks... Okay, I'll admit I'm automatically trying to create a parser for it in my head, and RPN is just a bit easier to parse...
/ -> push to op stack
- 6 -> push to value stack, check whether top of op stack is unary op
- 2 -> push to value stack, check whether top of op stack is unary op
- check whether top of op stack is binary op -> yes, pop 2 values from values stack, pop 1 op from op stack, push to values stack
compared to RPN:
- 6 -> push
- 2 -> push
- / -> perform op, i.e. pop pop div push
eeeeewwwwwwwwwww...
Okay. We're soooo OT now... sorry.
Well, and let me add that I'm not serious about promoting stack-based languages. I love them for their geekiness and obscurity, and it might be beneficial to teach their fundamentals in schools so people realize the arbitrary nature of mathematical notation; but I wouldn't dream of actually wanting them in the mainstream.
edited 1st May '11 6:26:24 AM by vijeno
Yeah, I can't work out how to parse PN without discrete tokens, stacks and recursion, which makes me think I'm doing something wrong. At least RPN is simple to write a parser for. (whereas proper mathematics is nicer when you have an sense of the geometry of the page.)
Anywho, the original question isn't well-formed. We might as well be arguing, "Do curious green ideas sleep furiously?"
edited 1st May '11 6:33:13 AM by Yej
Da Rules excuse all the inaccuracy in the world. Listen to them, not me.^^ Yeah, it does - instead of having a stack of numbers, you have a stack of operations (where things such as "multiply 6 by the next number", or "* 6", count as operations).
Mostly, it seems to me that it is easier to individuate subexpressions in PN than in RPN.
Perhaps this has some linguistic basis? My native language has SVO order, but it elides the subject often enough - definitely more so than English - and therefore constructions of the form
I wonder if people whose first languages have SOV orders perceive this otherwise... Question for German or Japanese native speakers: what is easier to understand, PN or RPN?
Since Polish is also a pro-drop language, the fact that PN was developed before RPN would make sense under this hypothesis...
edited 1st May '11 6:48:28 AM by Carciofus
But they seem to know where they are going, the ones who walk away from Omelas.I'm austrian (ie german-speaking, SVO-but-not-in-relative-clauses), and to me it's definitely RPN. But I've worked on a few forth interpreters for fun, so I prolly can't speak for the general public...
Oh, right, I forgot that German is SOV only in relative clauses, sorry :(
But they seem to know where they are going, the ones who walk away from Omelas.
Yeah, I only bother with pow if I'm entering a complex expression or an ugly pile of dereferences I don't want to type twice