# Proof of Equality [duplicate]

Possible Duplicate:
What is 48÷2(9+3)?

I was having a heated debate with my colleague and we can't agree on the answer to this question: Does 6÷2(2+1) equal 9 or does it equal 1?

-

## marked as duplicate by Henry T. Horton, Pedro Tamaroff♦, Cameron Buie, Brian M. Scott, lhfSep 18 '12 at 22:25

The textbook answer is that operations of equal precedence are performed from left to right in the absence of parentheses, so the result is $9$. The real answer is that the expression equals the writer is incompetent: in the real world it’s ambiguous, and the ambiguity is sufficiently obvious that failure to avoid it is inexcusable sloppiness. – Brian M. Scott Sep 18 '12 at 21:50
Depends on whether $6 \div 2 \times (2+1)$ means $(6 \div 2) \times (2+1)$ or $6 \div (2 \times (2+1))$. The former yields $9$, the latter $1$. In a programming language like Haskell, the ambiguity would be resolved by specifying what the priority of each operator is, and whether such operator is left- or right-associative.