Overview
Algorithms are the recipes of the digital world. They are step-by-step instructions for solving a problem. From Google Search to your GPS, algorithms run modern life.
Core Idea
The core idea is Efficiency. How do we solve a problem using the least amount of time and memory?
Formal Definition
A finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation.
Intuition
- The Recipe: To bake a cake, you follow steps: Mix flour, add eggs, bake at 350. That’s an algorithm.
- Sorting Cards: How do you sort a deck of cards?
- Bubble Sort: Compare two, swap if wrong. Repeat forever. (Slow).
- Merge Sort: Split deck in half, sort halves, merge. (Fast).
Examples
- PageRank: The algorithm that made Google. It ranks web pages by how many other pages link to them.
- Dijkstra’s Algorithm: Finding the shortest path on a map (GPS).
- RSA: The algorithm that secures the internet (Cryptography).
Common Misconceptions
- Misconception: Algorithms are unbiased.
- Correction: Algorithms are written by humans and trained on human data. They can inherit and amplify Bias (e.g., facial recognition working poorly on minorities).
- Misconception: It’s “magic.”
- Correction: It’s just math. Input -> Logic -> Output.
Related Concepts
- Data Structures: Algorithms manipulate data structures.
- Big O Notation: How we measure algorithm speed.
Applications
- Finance: High-frequency trading.
- Biology: DNA sequencing.
- Social Media: The “Feed” algorithm that decides what you see.
Criticism and Limitations
- Black Box: Deep Learning algorithms are often uninterpretable. We know that they work, but not how.
Further Reading
- Introduction to Algorithms by CLRS
- Algorithms to Live By by Brian Christian