The Universe of Programming
Algorithm Properties
To consider a series of actions as an algorithm, three fundamental conditions are required:
finiteness,
generality, and
clarity.
FINITENESS
The algorithm must
terminate after a finite number of steps, no matter how many. If it had an infinite
number of steps, our robot might go to get bread until its battery runs out. A stopping condition could be when
the battery level is below 15%, or more logically, when we already have bread, right?
GENERALITY
The algorithm must
solve a whole category of problems, not just a specific one. Referring back to
the bread-buying algorithm, it can also be successfully applied to other products:
CLARITY
The algorithm must
describe the steps precisely and without ambiguity to solve the problem.
If we want to tell the robot to buy us
a colorful T-shirt that we like, it wouldn't have a clue!
We're talking about
Artificial Intelligence and
Machine Learning now. The robot must know which
patterns we like, our preferred colors, shops, etc., from prior experience, applying complex computational and analytical algorithms.
Additionally, algorithms must be
EFFICIENT. If we're in Madrid and decide to go to Barcelona,
our route wouldn't include Malaga unless we need to pick up a relative from there. 😜 Can you imagine the
fantastic algorithms developed for Google Maps or Waze to display the optimal route in real-time?
The number of steps performed by an algorithm should be as few as possible to be considered
OPTIMAL. There is
also a
theory of algorithm complexity that deals with this aspect.
Proceed to the next page ...