Numbers: Integers
Calculating with integers
When several operations must be performed one after another, the notation will have to represent this. For this purpose brackets are used: if a sub-expression is placed between brackets, then the part between the brackets has to be calculated first. For example \[ \begin{array}{rcl}3\times (6+9) &=& 3\times 15 = 45\\ &\text{ and }&\\ (3\times 6) + 9 &=& 18+9 = 27\tiny.\end {array}\]
Because too many brackets could complicate reading the expression, we leave them out if the rules of precedence allow us to do so without changing the meaning of the expression.
Order of operations with numbers
- With repeated addition and repeated multiplication the order does not matter.
- With repeated subtraction and repeated exponentiation the order does matter.
- If there are no brackets at the repetition of subtraction, we interpret the expression as if there are brackets from left to right.
- If there are no brackets at the repetition of exponentiation, we interpret the expression as if there are brackets from right to left.
With repeated addition the order of appearance does not matter. For example:
\[3+4+7=(3+4)+7=7+7=14= 3+11=3+(4+7)\tiny,\]
so different ways of putting brackets gives the same result.
Also with repeated multiplication the order of appearance does not matter. For example:
\[5\times 2\times 7 =(5\times 2)\times 7=10\times 7=70=5\times 14= 5\times (2\times 7) \tiny.\]
With repeated subtraction the order does matter:
\[ \begin{array}{rclcl}(3-2)-8&=&1-8&=&-7\\ 3- (2-8)&=&3-(-6)&=&9 \\ \end {array}\] With #3-2-8# being the first expression. Hence #3-2-8=3-(2+8)#. It does not matter if we first subtract #2# and then #8# from #3#, or first subtract #8# and then #2# from #3#:
\[ \begin{array}{rcl}3-2-8&=&-7\\ 3- 8-2&=&-7 \\ \end {array}\]
With exponentiation the order of appearance also matters:
\[ \begin{array}{rclcl}\left(2^3\right)^2&=&8^2&=&64\\ 2^{\displaystyle (3^2)}&=&2^9&=&512 \\ \end {array}\] with #{2^3}^3# we mean #2^{\left(3^3\right)}#.
Sum and product
An expression which consists of an addition of two or more sub-expressions is called a sum. The sub-expressions are called terms or summands.
An expression which is obtained from the multiplication of two or more sub-expressions is called a product. The sub-expressions are called factors.
The sum #2+4+6+8# is equal to #20#. Its summands are #2#, #4#, #6#, and #8#.
The product #2\times 4\times 6\times 8# equals #384#. Its factors are #2#, #4#, #6#, and #8#.
Dots are used to indicate a pattern:
\[ \begin{array}{rcl}2+4+6+\cdots +20 &=& 110\\ 2\times 4\times 6\times \cdots\times 20 &=&3715891200\end {array}\]
So #\cdots# in the above expressions stand for #8+10+12+14+16+18#, respectively, #8\times10\times12\times14\times16\times18#.
The order of operations is:
- calculate what is inside the brackets
- exponentiation (in case of more exponentiations in a row: from right to left)
- multiplication
- addition and subtraction (in case of more operations without brackets: from left to right)
Exponents also have to be interpreted as expressions within brackets. Hence, below we reduce #1+3# and #1+4# as part of Step 1.
\[ \begin{array}{rcl}\left(1+2\right)^{1+3}\times(3-2)-\left(1+3\right)^{1+4}\times3-2&=&\left(3\right)^{4}\times(1)-\left(4\right)^{5} \times3-2\\ &=&81\times(1)-1024\times3-2\\ &=&81-3072-2\\ &=&-2991-2\\ &=&-2993\\ \end {array}\]
In case many brackets come into play, it may be convenient to use grouping symbols like braces { }, or square brackets [ ], in addition to the usual parentheses ( ). For example:
\[\begin{array}{rcl}\left\{\left[(3+2)-4\right]-(6-5)\right\}-\left[8-(6+5)\right]&=&\left\{(5-4)-(-1)\right\}-\left[-3\right]\\ &=&2+3\\ &=&5\end{array}\]
In the input field, however, you are always supposed to enter expressions with the usual parentheses for brackets.
For,
\[-5\cdot 62 + 11=-310+11=-299\]
and
\[ -5\cdot (62 + 11) = -5\cdot 73 = -365 \]
Or visit omptest.org if jou are taking an OMPT exam.