For the past few months I have been grappling with the classic machine learning problem of classifying handwritten digits using their gray-scale pixel maps. The first thing I tried was to apply the k-nearest neighbors algorithm. Naively, I implemented the algorithm from scratch in C++ using only the Standard Template Library. Doing so meant that writing the implementation took me one week. When the program was executed, for each test digit, it calculated the square distance between it and each training digit. Then it sorted the training digits in order from nearest to furthest, took the first k and predicted that the test digit was the same as the most frequently occurring digit among those first k training digits. The total running time for the program was 24 hours. This post is not about machine learning it is about the following question: how much time would it have taken a human being to do the same work as the program?
We need to come up with a way to measure work done by the program and by a human being in order to compare them. We'll do that by measuring work done in terms of operations performed.
We can get a ballpark underestimate of how much work was done by the program as follows. There were 42,000 training digits. For each test digit, calculating the distance between it and one training digit required 2351 operations. Then, the training digits were sorted from nearest to furthest using the heap-sort algorithm which has a time complexity of $O(n*log(n))$. Putting this together we find that the program performed approximately $28000 * 42000 * 2351 * 42000 * log_{2}(42000) \approx 1.78 * 10^{18}$ operations.
Okay! So what about a human being? Assuming a person could do 60 operations per minute, every minute of every day, every day of every year, every year for 85 years, one person could do $2.68056 * 10^9$ operations in their life. This means it would take $\frac{1.78 * 10^{18}}{2.68056 * 10^9} \approx 6.65 * 10^{8}$ human lives to do the same number of operations.
How incredible is it that human beings have made it possible for one person to program a machine to do an amount of work in one day that would require the lives of hundreds of millions of human beings to do manually! What an incredible testament to the accomplishments of humanity!