Mathematics I / Vectorised Computation and Libraries
Practice question · Numerical answer

An interpreted loop processes 2 million elements per second while the vectorised version processes 500 million per second. How many seconds does the loop need for 100 million elements?

Hints
  1. Divide the number of elements by the rate.
  2. 100 million divided by 2 million per second.
Show the answer

50

Why

100/2 = 50 seconds, against 0.2 seconds for the vectorised version. A minute versus a fifth of a second on identical arithmetic is what 'orders of magnitude slower' actually means in practice.

Read the lesson: Vectorised Computation and Libraries →

Practise Vectorised Computation and Libraries

The app has 5 more questions on this lesson, and keeps your place in the course. Mathematics I is free to start.

More questions on Vectorised Computation and Libraries