¿What is computation?

Euler Sánchez Gómez
2 min readJul 2, 2021
Photo by Christian Wiediger on Unsplash

Basically a computer can do a lot of calculations per second, but, ¿What kinds of calculations? Well, calculations that are built-in to the language, and the ones that you define as the programmer. Just keep in mind that computers only know what you tell them.

If you look into Wikipedia and search for Computation, you will see that “Computation is any type of calculation that includes both arithmetical and non-arithmetical steps and which follows a well-defined model (e.g. an algorithm).”

So, ¿How can we tell these steps to the computer? well, the answer is with “Imperative knowledge”, imperative knowledge in resume is a recipe or “how-to”, and of course, computers knows how to follow a recipe. For example:

Merge Sort Steps

  1. Divide by finding the number q of the position midway between p and r. Do this step the same way we found the midpoint in binary search: add p and r, divide by 2, and round down.
  2. Conquer by recursively sorting the subarrays in each of the two subproblems created by the divide step. That is, recursively sort the subarray array[p..q] and recursively sort the subarray array[q+1..r].
  3. Combine by merging the two sorted subarrays back into the single sorted subarray array[p..r].

So, this recipe is there for an algorithm and we want to load these sequence of instructions inside a computer.

How to create recipes

  • Choose any programming language, when you define that, the programming language provides a set of primitive operations.
  • Expressions are complex but legal combinations of primitives (atomic operations) in a programming language.
  • Expression and computations have values and meanings in a programming language.

With that in mind, we can write a program in some language (programming language). The basic definition of a program is that a program is a sequence of steps (definitions and commands) for resolve an algorithm, for instance, if we want to write a program that implements Merge Sort algorithm, we need to write all the steps (recipe) and then verify that we do the rigth job when the result is what we expected.

If you want to know more detail about the topic you should watch the next video on which I base to do this short summary:

https://www.youtube.com/watch?v=nykOeWgQcHM&list=PLUl4u3cNGP63WbdFxL8giv4yhgdMGaZNA

--

--