Preview

08 - Computing related Maths

 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
computingmaths_q1.jpg

  TRUE

  FALSE

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

  to the power of (exponent)

  variable duplicate

  lift up

  ^ doesn't mean anything in computing

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

  order of precedence (order in which calculations are done)

  binary only rule

  zero law

  preferential treatment

 4. What does the B in BODMAS mean?

  The brackets must be ignored

  Anything inside the brackets must be subtracted from everything else

  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

  before

  neither - the order of addition and subtraction is the same

  none of the above

  after

 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?

  20

  14

  none of the above

  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

= ??? 

  10

  11

  12

  19

 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 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 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?

  7 MOD 2 = 0

  8 MOD 5 = 0

  8 MOD 4 = 0

  3 MOD 1 = 31

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

  0

  3

  1

  2

 11. What is 33 MOD 10

  3

  1

  4

  2

 12. What is 3 MOD 10

  1

  3

  Error

  0

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

  99.29

  99

  111111.0029

  None of the above

 14. Which of the following is a real number?

  All numbers are real numbers

  There is no such thing as a real number

  9

  3.223

 15. (3 + 4) * (4 – 2) clearly evaluates to

  14

  10

  none of the above

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

  3.5

  5

  2.5

  Error

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

  5 because it rounds down to the next lowest integer

  6.25

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

  Just .25 because the integer part is ignored

 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?

  +

  /

  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

  n MOD 2

  n MOD 4

  4 MOD 4

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

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

  none of the above

  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.

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

  1.5

  Error

  2.5

  2

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

  0

  1

  -3

  3