Integer arithmetic and order of operations
Perform calculations with integers and apply the order of operations correctly.
Practise in Mattegrafen ↗ · Taluppfattning och tals användningEveryday explanation
Computers perform calculations constantly. This is the foundation of all data processing. The four basic operations are addition (+), subtraction (−), multiplication (·), and division (/).
Order of operations: Multiplication and division are performed before addition and subtraction. Example: 2 + 3 · 4 = 2 + 12 = 14, not 20. If you want the addition to happen first, use parentheses: (2 + 3) · 4 = 20.
The computer always follows this logic. To get the correct result in code or spreadsheets, you must follow the same rules.
Interactive
Calculate the result before verifying:
10 − 2 · 3 → 4 (multiplication first)
(10 − 2) · 3 → 24 (parentheses first)
12 / 4 + 1 → 4
12 / (4 + 1) → 2.4
Construct your own expression where parentheses change the result. Construct an expression where they do not.
Mastery means
- Confidently performs addition, subtraction, multiplication, and division with integers
- Applies the order of operations: multiplication and division before addition and subtraction
Sign in to do the exercises and build your mastery up.
Sources
- Swedish Wikipedia — Order of operations (CC BY-SA 4.0) — CC BY-SA 4.0
Leads to
Part of the goals (20)
- Foundations of computer science
- The maths AI is built on — ages 10–12
- Systems knowledge for AI engineers
- The language of mathematics in AI texts
- Computers that see and hear
- Image classification with convolutional networks
- Seeing and hearing with AI
- Training neural networks for real
- Statistics for experiments
- Classical machine learning in practice
- Build a voice interface
- The mathematics behind the models
- Language models in practice
- Interpreting a language model
- Fine-tune and run your own models
- Understand how generative AI works
- Multimodal systems
- Generative models in depth
- Classical ML for real
- Run models more cheaply: quantisation