A recipe for a computer
A recipe takes ingredients, follows steps in order and gives a dish. An algorithm takes inputs, follows steps and gives an output. The steps must be precise enough that the same input always gives the same result.
A small example
- Take a list of numbers.
- Compare the first two and keep the larger.
- Compare that with the next number, and keep the larger again.
- Continue to the end. The number you hold is the largest in the list.
Everyday uses
- Sorting a list by price or name.
- Finding the quickest route between two places.
- Deciding which results to show first in a search.
- Compressing a photo so it uses less space.
Algorithms that learn
Some algorithms are not written step by step. Instead they are trained on many examples and adjust internal settings until they match the examples well. This is how many speech, image and recommendation systems work. They can then make predictions on new data.
Good questions to ask
- What is the input, and is it good data?
- How does the algorithm handle cases it has not seen?
- Who checks the output, and how are mistakes fixed?
- Does it work fairly for everyone who uses it?