Poll

48÷2(9+3) = ?

2
20 (25.3%)
288
38 (48.1%)
meth not even once
21 (26.6%)

Total Members Voted: 79

Author Topic: the math apocalypse: 48÷2(9+3) = ?  (Read 16345 times)

I find it amazing that there are over 220 replies and 15 pages of people arguing over one math problem.
i'll laugh if it gets to 288 replies :cookieMonster:

poll vote on your favorite answer. winner is winner forever

wait you guys are right it IS 288

288 is and will forever be the right answer, because x/y(z) literally means (x÷y)*z because of the good ol' left to right rule.
This kind of topic is what we get for having a forum full of stubborn teenagers/kids.
« Last Edit: September 20, 2014, 03:58:57 PM by BlockoCrafter »

288 is and will forever be the right answer, because x/y(z) literally means (x÷y)*z because of the good ol' left to right rule.
This kind of topic is what we get for having a forum full of stubborn teenagters/kids.

QFT

/thread

i find it hard to believe that people actually had trouble with this exercise

Yeah. I'm saying that there is a left-to-right rule for multiplication and division. He claims that there isn't.
There isn't though. Googling "left-to-right addition" returns thousands of extremely useful tutorials and informational pages. Googling "left-to-right multiplication" results in a few obscure teaching plans and online tutorials, and in the top 10 results is the Berkeley publication I quoted. While you may have been taught that you multiply left-to-right in school, there's literally no official way to do it. It's entirely ambiguous because the problem stems from the persons failure to clarify what they wanted when they asked you that question. It's not incorrect to write "five over the quantity 2b" as 5/2b, and it's not incorrect to write "five halves times b" as 5/2b.

It's not incorrect to write "five over the quantity 2b" as 5/2b, and it's not incorrect to write "five halves times b" as 5/2b.

yes

There isn't though. Googling "left-to-right addition" returns thousands of extremely useful tutorials and informational pages. Googling "left-to-right multiplication" results in a few obscure teaching plans and online tutorials, and in the top 10 results is the Berkeley publication I quoted. While you may have been taught that you multiply left-to-right in school, there's literally no official way to do it. It's entirely ambiguous because the problem stems from the persons failure to clarify what they wanted when they asked you that question. It's not incorrect to write "five over the quantity 2b" as 5/2b, and it's not incorrect to write "five halves times b" as 5/2b.
There doesn't need to be a tutorial, you just do it left to right. "No official way to do it" is ridiculous. Just because the mathematicians of the world haven't got together and decided something doesn't mean that there isn't already a widely used convention. Left-to-right is probably the most intuitive thing to do, as well as the way any computer will tell you to do it. I mean, the convention is easy to learn anyway, and all of our machines already do it, so why people are arguing against it is beyond me.

Also, 5/2b is not a correct way to write "5 over the quantity 2b."

Our "machines" do it because that's how a parser works. Here's the code for evaluating an expression out of my own coding language. Please excuse the messiness of the code; it's not yet in production so obviously it's not 100% optimized and pretty.

Code: [Select]
    AST::ExprAST *ParseBinOpRHS(int ExprPrec, Lexer::Token token, Lexer::Token binop) {
        AST::ExprAST *LHS;
        LHS = ParsePrimary(token);
        while(1) {
            int tokPrec = GetTokPrecedence(binop);
            if(tokPrec < ExprPrec)
                return LHS;
       
            Lexer::Token nextToken = Lexer::getToken();
            AST::ExprAST *RHS = ParsePrimary(nextToken);
            if(RHS == 0) {
                return error("Syntax Error! Expected value.");
            }
           
            if(GetTokPrecedence(nextToken) > tokPrec) {
                RHS = ParseBinOpRHS(tokPrec+1, nextToken, binop);
            }
           
            LHS = (AST::ExprAST *)new AST::BinaryExprAST(binop.strVal.c_str()[0], LHS, RHS);
            binop = nextToken;
        }
    }

For those of you who don't speak code, it evaluates the left half of the expression (in 5+6+2 this would be '5'), determines the right half of the expression (in 5+6+2 this would be 6), solves, then uses the solution as the left side of the expression (making the new expression 11+2).

Our "machines" do it because that's how a parser works.
Yeah, I know how they work. Replace "all of our machines" with "most dedicated math solving software/hardware."
« Last Edit: September 20, 2014, 04:44:52 PM by Doomonkey »

Yeah, I know how they work.
Then you should know that they're not programmed that way because of convention, they're programmed that way because right-to-left parsing of equations requires much more computational power.

Then you should know that they're not programmed that way because of convention, they're programmed that way because right-to-left parsing of equations requires much more computational power.
Yeah, and as a result there is now a convention of left-to-right.

I find it amazing that there are over 220 replies and 15 pages of people arguing over one math problem.
people like to defend their intelligence

Then you should know that they're not programmed that way because of convention, they're programmed that way because right-to-left parsing of equations requires much more computational power.
I think what he's saying is there's no gain to doing it any other way. This way is easy, simple, and it's already widely used. Why would you not use it?