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

  variable duplicate

  to the power of (exponent)

  ^ 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

  preferential treatment

  binary only rule

  order of precedence (order in which calculations are done)

 4. What does the B in BODMAS mean?

  The brackets must be done last

  Anything inside the brackets must be subtracted from everything else

  Anything inside the brackets must be done first

  The brackets must be ignored

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

  neither - the order of addition and subtraction is the same

  after

  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?

  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

  19

  11

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

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

 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

  8 MOD 4 = 0

  7 MOD 2 = 0

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

  0

  2

  1

  3

 11. What is 33 MOD 10

  1

  4

  2

  3

 12. What is 3 MOD 10

  0

  3

  Error

  1

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

  None of the above

  111111.0029

  99

  99.29

 14. Which of the following is a real number?

  There is no such thing as a real number

  All numbers are real numbers

  3.223

  9

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

  none of the above

  12

  14

  10

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

  2.5

  5

  Error

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

  6.25

  5 because it rounds down to the next lowest integer

  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

  2

  3

  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

  4 MOD 4

  n MOD 2

  n MOD 4

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

  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.

  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:

  2

  1.5

  2.5

  Error

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

  1

  0

  -3

  3