Published Updated
An algorithm is a set of steps you can follow to solve a problem or get a result. A computer can follow those steps, but so can you. Think of finding the largest number in a pile of cards without having to put every card in order.
Suppose your cards read 4, 9, 6 and you can look at only one at a time. Start by remembering the first number, 4. Look at the next card. If it is larger than the number you remember, remember the new one instead. Keep doing that until you reach the end. The number you remember is the answer.
“The largest card is 9” is the result. Here is how you got it. When you saw 9, you replaced 4 with 9. When you saw 6, you kept 9. Those same steps work on 8, 3, 8. The last card ties the first, so there is no need to change the answer. This particular method assumes you have at least one card.
“Find me the largest number” states the goal. It leaves you to work out how. The comparison rule above is an algorithm because it tells you what to do at each step and when to stop. A program could put that rule into words a particular computer understands. Two people could write different programs that follow the same algorithm.
At school, the written steps for long division are another example. On a maps app, an algorithm might compare routes to find one with a short estimated travel time. A route with the fewest miles could still take longer. The answer depends on the goal the rules were written to meet. The U.S. National Institute of Standards and Technology describes an algorithm in computing in terms of getting a desired result.
“My feed keeps showing me gardening videos. The algorithm must think I like tomatoes.” The speaker means the system choosing or ordering posts. An app might rank a video higher after you watch similar clips. That is one possible signal. The sentence alone cannot tell you exactly how that app ranks its posts.
Say AL-guh-rith-um. The th sounds like the one in this. The noun is an algorithm, plural algorithms. Algorithmic is the adjective, as in algorithmic recommendations. In spelling, the middle is ri, even though the ending sounds a little like rhythm.
The name traces back to the mathematician al-Khwarizmi, whose writings helped spread methods of arithmetic. The older word algorism is a real word in its own right. The word history of algorithm connects the two spellings.
Choose an answer to see why it fits or what clue to look for. You can change your answer.
The cards are 7, 2 and 5. Keep the largest seen so far. Which number is left?
Which instruction gives enough detail to find the lowest price on a nonempty list?
A child follows the card rule with paper cards. Did the child use an algorithm?
