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

  FALSE

  TRUE

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

  to the power of (exponent)

  variable duplicate

  ^ doesn't mean anything in computing

  lift up

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

  zero law

  binary only rule

  preferential treatment

  order of precedence (order in which calculations are done)

 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

  after

  neither - the order of addition and subtraction is the same

  before

  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

= ??? 

  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 Smarty is correct as addition and subtraction come last and the answer is 10

  Mr Smarty is correct - he must be smart!

  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

 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

  7 MOD 2 = 0

  8 MOD 5 = 0

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

  3

  2

  0

  1

 11. What is 33 MOD 10

  4

  1

  3

  2

 12. What is 3 MOD 10

  1

  3

  0

  Error

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

  99

  None of the above

  111111.0029

  99.29

 14. Which of the following is a real number?

  9

  All numbers are real numbers

  There is no such thing as a real number

  3.223

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

  14

  12

  10

  none of the above

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

  FALSE

  TRUE

 17. 5 / 2 evaluates to ….

  5

  3.5

  Error

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

  Just .25 because the integer part is ignored

  6.25

  5 because it rounds down to the next lowest integer

 20. 17 DIV 5 evalutes to?

  4

  1

  2

  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?

  /

  +

  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.

  4 MOD 4

  n MOD 4

  n MOD 1

  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

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

  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:

  2.5

  Error

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

  3

  0

  1

  -3