What is artificial intelligence?
Artificial intelligence (AI) means a computer system that can do jobs that usually need a human mind. For example: recognise a face, understand speech, translate a language, play chess or suggest a video.
What counts as intelligent behaviour? A system that can:
- perceive: take in pictures, sounds or numbers,
- reason: work out an answer or a plan,
- learn: get better with more examples,
- communicate: use human language.
Cognitive computing is AI that tries to copy parts of human thinking: it understands language, finds patterns in huge data, gives answers with a level of confidence and keeps learning from feedback.
Narrow AI and general AI
Every AI today is narrow AI: it is good at one kind of task (like spotting spam) but cannot do everything a person can. General AI, a machine as flexible as a human in every task, does not exist yet.
Intelligent agents: sense, think, act
An agent is anything that senses its surroundings and acts on them. A robot is an agent with a body: its sensors (camera, touch, distance) are its senses and its actuators (motors, wheels, arms) are its muscles. The program in the middle decides what to do.
A robot vacuum cleaner is a good example: it senses a wall, decides to turn, and turns. With the Internet of Things (IoT), many small sensors (in homes, farms and factories) send data to an AI that decides, for example, when to water a field.
The loop never stops: the action changes the world, and the agent senses the new situation again.
How AI works: rules, data and machine learning
There are two main ways to make a machine smart.
- Rule-based AI (expert systems): people write the rules. "IF temperature > 38 °C THEN fever." Easy to explain, but people cannot write rules for everything (try writing rules for "is this a cat?").
- Machine learning (ML): we give the computer many labelled examples (data) and it finds the rule itself. This finding is called training. Then it uses the rule on new cases: this is prediction.
Three kinds of machine learning
- Supervised learning: every example has the right answer (label). Example: photos marked "cat" or "dog".
- Unsupervised learning: no labels; the machine groups similar things. Example: grouping shoppers with similar habits.
- Reinforcement learning: the machine tries actions and gets rewards or penalties. Example: an AI learning to play a game.
How AI makes a judgement
A simple method is k-nearest neighbours: to label a new item, look at the k most similar known items and take a majority vote. The maths behind this is distance (how far apart two points are). Other AI uses probability (how likely each answer is), statistics (averages and patterns) and functions (a rule turning inputs into an output). An AI answer is usually a best guess with a confidence, not a certainty.
Neural networks and deep learning
A neural network is loosely inspired by the brain. It has an input layer (numbers such as pixel brightness), one or more hidden layers of simple units, and an output layer (the answer). Each link has a weight: a number saying how strongly one unit affects the next.
During training the network makes a guess, checks the error, and nudges every weight a little to reduce the error. Repeat this millions of times and the network becomes good at the task. Networks with many hidden layers are called deep learning. Large language models, which chat and write text, are very big neural networks trained on huge amounts of text.
A short history of AI
- 1950: Alan Turing asks "Can machines think?" and suggests the Turing test: can a machine chat so well that a person cannot tell it from a human?
- 1956: the term "artificial intelligence" is used at a meeting at Dartmouth College, USA. AI becomes a field of study.
- 1958: the perceptron, an early one-unit neural network.
- 1970s and late 1980s: "AI winters": promises were too big, money and interest fell.
- 1980s: expert systems (rule-based) used in business and medicine.
- 1997: the computer Deep Blue beats the world chess champion.
- 2010s: big data + fast graphics chips (GPUs) make deep learning work: speech and image recognition get very good.
- 2016: AlphaGo beats a top player at the board game Go.
- 2020s: generative AI and chatbots that write text and make pictures.
The maths grew alongside: logic (Boole, 1850s), probability (Bayes, 1700s), statistics, and calculus for adjusting weights.
Where AI is used
- Health: spotting disease in X-rays and eye scans.
- Farming: drones and phone apps detecting crop disease; smart irrigation.
- Transport: map routes, traffic prediction, driver-assist cars.
- Language: voice assistants, translation between Indian and world languages, captions.
- Shopping and media: recommendations ("you may also like").
- Banking: catching unusual payments (fraud).
- Games: a game-playing AI looks ahead at possible moves. In the minimax method it assumes the opponent plays their best, scores the future positions, and picks the move with the best worst case.
Ethics, bias and AI in society
- Bias: if training data is one-sided (for example, faces mostly of one skin tone), the AI works worse for others. Fix: varied, fair data and testing.
- Privacy: AI needs data; personal data must be collected with consent and kept safe.
- Transparency: people should be able to ask why an AI decided something.
- Jobs: AI changes work; some tasks disappear, new jobs appear. Learning new skills matters.
- Misinformation: AI can make fake photos, voices and videos (deepfakes). Check the source.
- Cybersecurity: AI helps catch attacks, but attackers use it too.
- Responsibility: a human must stay accountable for important decisions such as medical or legal ones.
Try it: be the machine
Take 10 fruits or pictures of fruits. Give each a score for softness (1–5) and colour (1–5), and write "ripe" or "unripe". Now take one new fruit, score it, and find the 3 known fruits whose scores are closest. Take a vote. You just did k-nearest neighbours by hand. In the 3D free-play step, do the same with the sliders and check your answer.
Key formulas and definitions
- AI agent: sense → think → act (→ sense again)
- Machine learning: data + labels → training → model (rule) → prediction on new data
- Supervised = with labels; unsupervised = no labels (grouping); reinforcement = rewards and penalties
- Distance between points (x₁, y₁) and (x₂, y₂) = √((x₂ − x₁)² + (y₂ − y₁)²), used by k-nearest neighbours
- Neural network: input layer → hidden layers → output layer; training adjusts weights
- Accuracy = correct predictions ÷ total predictions × 100%
Worked examples
1. A spam filter learns from 10,000 emails that people marked "spam" or "not spam". Which type of machine learning is this?
Supervised learning, because every training example comes with the correct label.
2. Known fruits (softness, colour): A(1, 1) unripe, B(2, 1) unripe, C(4, 4) ripe, D(5, 4) ripe, E(4, 5) ripe. Use 3-nearest neighbours to label a new fruit N(3, 3).
Distances from N: A = √(4+4) ≈ 2.83; B = √(1+4) ≈ 2.24; C = √(1+1) ≈ 1.41; D = √(4+1) ≈ 2.24; E = √(1+4) ≈ 2.24. Nearest is C (ripe), then a tie of B, D and E at 2.24. Taking C, D, E gives 3 ripe votes; taking C, B, D gives 2 ripe to 1 unripe. Either way the vote is ripe.
3. An AI tested on 200 X-rays gets 184 right. What is its accuracy?
Accuracy = 184 ÷ 200 × 100% = 92%.
4. A robot lawn-mower bumps into a flower bed, stops and turns left. Name its sensor, the "think" part and its actuator.
Sensor: bump or distance sensor. Think: the program decides "obstacle → turn". Actuator: the wheel motors that turn it.
Common mistakes
- Thinking AI "understands" like a person. Today's AI finds patterns in data; it can sound confident and still be wrong.
- Mixing up AI and machine learning. Machine learning is one way to build AI; rule-based systems are AI too.
- Believing more data always fixes everything. One-sided data, even lots of it, gives a biased model.
- Calling every automatic machine AI. A fixed timer that switches on a light does not sense, decide or learn.