What is artificial intelligence?
Tell AI from ordinary software, see how AI, machine learning and deep learning nest, and meet the field’s ups and downs.
- Explain the difference between programs that follow rules and programs that learn
- Tell narrow AI from general AI
- Place AI, machine learning and deep learning inside each other
You probably used AI several times today without noticing: your phone unlocking at a glance, a map rerouting around traffic, a streaming app guessing what you’ll watch next, a chatbot drafting an email.
Artificial intelligence (AI) is the field of building computer systems that do tasks we’d normally say need human intelligence: recognizing faces, understanding language, making decisions, spotting patterns.
The big shift is how these systems get their skills. A normal program follows rules a programmer wrote by hand. Most modern AI learns its rules from examples. Nobody wrote “a cat has pointy ears and whiskers” into a photo app; it saw millions of labeled photos and worked out the patterns itself.
Try it
AI or not?
Sort each system. Narrow AI learned a skill from data; fixed rules is ordinary software doing exactly what it was told; general AI is the science-fiction kind that can learn anything a person can.
“A photo app that finds every picture of your dog”
“A calculator app”
“A voice assistant turning speech into text”
“A robot that can learn to cook, do taxes and write novels as well as any person”
“A thermostat that turns on heat below 19 °C”
“A chess engine that taught itself by playing millions of games”
“A bank flagging card payments that look like fraud”
AI, machine learning and deep learning
You’ll hear three terms used almost interchangeably. They’re actually nested, like Russian dolls:
- Artificial intelligence - the whole field, including old-school hand-written rule systems.
- Machine learning (ML) - the part of AI where systems learn patterns from data instead of being told.
- Deep learning (DL) - the part of ML that uses large neural networks with many layers. It powers today’s image recognition, voice assistants and chatbots.
Rules versus learning, in code
Here is a spam filter written the old way, with hand-picked words. Run it, then notice the problem: every new trick spammers invent needs a programmer to add another rule. A learning system would read thousands of labeled emails and work out which words matter, and by how much.
1SPAM_WORDS = {"free", "winner", "prize", "urgent"}
2
3def is_spam(message):
4 words = message.lower().split()
5 hits = sum(word in SPAM_WORDS for word in words)
6 return hits >= 2
7
8for message in ["You are a WINNER claim your free prize", "Lunch at noon tomorrow?", "Fr3e pr1ze for the w1nner"]:
9 print(is_spam(message), "-", message)True - You are a WINNER claim your free prize False - Lunch at noon tomorrow? False - Fr3e pr1ze for the w1nner
A short history, with a few winters
AI is older than most people think. The term was coined in 1956, and the field has swung between excitement and disappointment ever since. The cold spells, when funding dried up because promises outran results, are called AI winters. Today’s boom is driven by three things arriving together: huge datasets, fast graphics chips (GPUs), and better neural-network techniques.
Key takeaways
AI systems do tasks that seem to need intelligence; most modern AI learns rules from examples instead of having them written by hand.
Everything that exists today is narrow AI: great at one task. General AI remains a research goal.
Deep learning ⊂ machine learning ⊂ artificial intelligence.
AI has had boom-and-bust cycles; data, GPUs and better networks drive the current boom.
Lesson quiz
6 questions · pass with 5 correct · up to 50 XP
Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.
Practice: write Python
Write Python in the editor and run it against sample inputs. Python runs locally in your browser using a WebAssembly runtime.
Write a rule-based filter
Each input line is a message. Print SPAM if it contains at least two of the words free, winner, prize, urgent, click (ignoring upper/lower case), otherwise OK. Words are separated by spaces.
- Mixed inbox
Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.
Let the data pick the words
Instead of choosing spam words yourself, learn them. Each line is spam: message or ham: message (ham means “not spam”).
Count how many times each lowercase word appears in spam and in ham messages. Print every word that appears at least twice in spam and never in ham, in alphabetical order, one per line.
- Small inbox
Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.
Questions about this lesson
Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.
Loading posts…