# 08 - Computing related Maths (e.g. Bodmas)

1. Computing is a fundamental intellectual tool in computing. Many famous computer scientists like Charles Babbage were also mathematicians.
`Note: The computing and mathematical scribbles of Bababge`

TRUE

FALSE

2. There are symbols in maths that are obvious such as + = addition, but what is ^ ?

to the power of (exponent)

lift up

variable duplicate

^ doesn't mean anything in computing

3. Just like in Maths there is the ________________________ for performing calculations, otherwise known as BODMAS/BIDMAS

zero law

order of precedence (order in which calculations are done)

binary only rule

preferential treatment

4. What does the B in BODMAS mean?

Anything inside the brackets must be subtracted from everything else

The brackets must be ignored

Anything inside the brackets must be done first

The brackets must be done last

5. Does 'Addition' come before or after 'Subtraction'?
`B - O - D - M  - A - S`

neither - the order of addition and subtraction is the same

before

after

none of the above

6. What is 2 + 3 x 4?
```Which one is correct
=====================
What is 2 + 3 x 4?

If we calculate the '2 + 3' part first, we get:

2 + 3 x 4 = 5 x 4

= 20

If we calculate the '3 x 4' part first, we get:

2 + 3 x 4 = 2 + 12

= 14

These are obviously two different answers -
but which one is correct?```

17

14

none of the above

20

7. Calculate: 3 x (7 - 3)
```Worked Example
=====================
Calculate: 3 x (7 - 3)

Solution

In this question, we have a bracket, a subtraction
and a multiplication.

BIDMAS tells us that brackets come first, so we calculate:

3 x (7 - 3) = 3 x 4

= ??? ```

12

11

19

10

8. Mr Pinch says that 2 x 3 â€“ 2 x 5 = -4. Mr Smarty says the answer is 10. Who is right, and why?

Mr Smarty is correct as addition and subtraction come last and the answer is 10

Mr Smarty is correct because Multiplication comes before addition but not before subtraction

Mr Pinch is correct: Multiplication comes before addition and subtraction, so: 2 x 3 â€“ 2 x 5 = 6 - 10 = -4

Mr Smarty is correct - he must be smart!

9. If you can watch the video to see this bright young chap employ modulo arithemtic to get the answer right What is an example of MOD?

3 MOD 1 = 31

8 MOD 5 = 0

7 MOD 2 = 0

8 MOD 4 = 0

10. MOD in python is %. What is 10 MOD 5?

2

3

0

1

11. What is 33 MOD 10

4

3

1

2

12. What is 3 MOD 10

1

Error

0

3

13. An integer can be described as a whole number. Which of the following is an integer?

None of the above

99.29

111111.0029

99

14. Which of the following is a real number?

9

All numbers are real numbers

3.223

There is no such thing as a real number

15. (3 + 4) * (4 â€“ 2) clearly evaluates to

none of the above

10

14

12

16. For division the / symbol is used instead of the Ã· symbol as the latter is not on a standard keyboard.

TRUE

FALSE

17. 5 / 2 evaluates to â€¦.

Error

5

2.5

3.5

18. 25 / 4 evaluates to 6.25. There are two different types of division used in programming

FALSE

TRUE

19. DIV or // is integer division which amounts to rounding down. In this case 25 DIV 4 would give youâ€¦.

Just .25 because the integer part is ignored

Just 6 (as it doesn't count the decimal places)

5 because it rounds down to the next lowest integer

6.25

20. 17 DIV 5 evalutes to?

4

3

2

1

21. Suppose you wanted to write a program to find out if a number input was ODD or EVEN? What operator would be useful?

MOD

DIV

/

+

22. Read the following excerpt and see if you can fill in the blanks
```Using MOD to solve problems
===========================
Suppose your teacher needed help putting people into groups.
Assume every student in a class is given a number (n)
between 1 and 30

The teacher needs them all to be in four groups.

To solve the problem, you could ask them all to evaluate
the following:

______________

The result would be that they would each have the
value 0, 1, 2 or 3.```

n MOD 2

n MOD 1

n MOD 4

4 MOD 4

23. What is 2 ^ 4 = 16 (2 * 2 * 2 * 2 = 16, or 24) an example of?

Integer division: Used to find the quotient (integer number before the decimal point) after division. Python uses // for this.

Modulus: The remainder that is left over when a number is divided by another.

none of the above

Exponentiation: When one number increases exponentially to another. The repeated multiplication of a number by itself.

24. In Python the operator for DIV is //. If that is the case, what will the following evaluate to? 5//2:

Error

2.5

2

1.5

25. This is a more difficult question - you may want to look up the reason: What does the following evaluate to: 5//-2

-3

0

1

3