# 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

FALSE

TRUE

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

to the power of (exponent)

^ doesn't mean anything in computing

variable duplicate

lift up

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

binary only rule

preferential treatment

order of precedence (order in which calculations are done)

zero law

4. What does the B in BODMAS mean?

Anything inside the brackets must be done first

The brackets must be done last

The brackets must be ignored

Anything inside the brackets must be subtracted from everything else

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

*Note there is discussion about whether, in reality,
addition and subtraction are treated the same and
still other discussions about how it should
really be BODMSA.

have a look at:

https://math.stackexchange.com/questions/888907/should-bodmas-not-be-bodmsa

For the purposes of this question, we are
just referring to the BODMAS convention.

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?

none of the above

20

14

17

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

10

19

11

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 Pinch is correct: Multiplication comes before addition and subtraction, so: 2 x 3 â€“ 2 x 5 = 6 - 10 = -4

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

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

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?

8 MOD 4 = 0

3 MOD 1 = 31

8 MOD 5 = 0

7 MOD 2 = 0

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

3

0

1

2

11. What is 33 MOD 10

1

3

4

2

12. What is 3 MOD 10

Error

1

0

3

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

99

99.29

None of the above

111111.0029

14. Which of the following is a real number?

3.223

9

There is no such thing as a real number

All numbers are real numbers

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

none of the above

10

12

14

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

2.5

5

3.5

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

TRUE

FALSE

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

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

5 because it rounds down to the next lowest integer

Just .25 because the integer part is ignored

6.25

20. 17 DIV 5 evalutes to?

1

2

4

3

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

DIV

/

MOD

+

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 1

4 MOD 4

n MOD 4

n MOD 2

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

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.

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

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

2

Error

1.5

2.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

-3

1

0