One-sentence summary
An AI is only as good as the data it learns from; if the data is wrong or biased, the results will be wrong and unfair too.
Why does it matter?
In earlier lessons we saw that an AI learns from examples, which means it learns from data. In this lesson we ask a simple but very important question: what if the data is bad?
Think of it this way. Even a cook who knows the best recipe cannot bake a good cake with rotten eggs and mouldy flour. If the ingredients are bad, the result is bad. It works the same way with AI. Computer scientists have a phrase for this: "garbage in, garbage out."
This matters because AI is now used in real decisions: which video gets recommended to you, how a sentence is translated, and in some places even how a job or loan application is reviewed. When the data is flawed or biased, these decisions can affect people unfairly. Learning to question data is the first step toward using technology in a safer and fairer way.
Flawed data: wrong or missing information
Flawed data is data that contains wrong, missing or broken information. A computer does not automatically know whether the information is correct; it learns whatever we give it.
Flawed data can appear in many ways:
- Wrong information: A weather table showing 250 instead of 25 degrees by mistake.
- Missing information: Some students having no height recorded at all.
- Duplicate or broken records: The same measurement entered twice with different values.
Everyday example: Class height average
Suppose you want to work out the average height of your class. You collect five friends' heights in centimetres, but you write one of them in metres by mistake.
# Heights should be in centimetres
heights = [150, 148, 152, 1, 149] # "1" is flawed: written as 1 metre
total = sum(heights)
average = total / len(heights)
print("Average height:", round(average, 1), "cm")
This program prints an average of about 120.0 cm. But the real average is around 150 cm. A single flawed number ruined the whole result. The computer did not make a mistake; the data we gave it was flawed.
Biased data: unbalanced or unfair data
Biased data is a different problem. Here the individual numbers may all be correct, but the data represents one side too much and another side too little. In other words, the data is not balanced.
An AI only generalises from the examples it has seen. If it never saw a certain group, it cannot make good decisions about that group. This is why biased data can lead an AI to treat some people unfairly.
Everyday example 1: A model that only knows apples
You teach a friend what "fruit" means by showing only photos of red apples. Then you show them a banana and ask, "is this a fruit?" Because they have never seen a banana, they might say "no." They are not being silly; they simply learned from incomplete data. In their world, fruit means red and round.
Everyday example 2: A prediction that only knows one team
Imagine an AI that predicts match results. But most of the matches it was given are ones that a single team won. The model learns "this team usually wins" and keeps making unfair predictions against other teams. Because the data is unbalanced, the prediction becomes biased.
Similar things have happened in real life. For example, some voice assistants had trouble understanding certain accents because most of the voices they were trained on used one accent. The problem was not in how people spoke, but in the imbalance of the data.
The unfairness biased data can cause
Biased data is closely tied to one question: does the data represent everyone fairly?
- If a face-recognition system is trained mostly on one type of face, it will confuse other people more often.
- If a translation tool always says "he" for one job and "she" for another, it may be repeating a prejudice that came from the data.
There is an important point here: the AI is not being mean. It simply copies the pattern in the data. If the prejudice is in the data, it comes out in the result.
Questioning data
Here is the good news: most of these problems can be spotted by asking the right questions. When you see a piece of data or an AI result, you can ask:
- Where did this data come from? Who collected it, and how?
- Are there missing or strange values? Do any numbers look far too big or too small?
- Is everyone represented? Is one group over-represented and another left out?
- Does the result make sense? Does the answer match the real world?
- Is it enough on its own for an important decision? Or should a person check it?
These questions are like a detective questioning the clues. The goal is not to fear AI, but to avoid trusting it blindly.
Mini practice
The simple program below writes a rule that flags clearly flawed values in a data list. We are not training a model; we are just setting a sensible threshold (limit).
# Class heights (cm). Some may be flawed.
heights = [150, 148, 152, 1, 149, 300, 151]
# We set a simple rule for a reasonable height range
low_limit = 120
high_limit = 210
clean = []
suspicious = []
for h in heights:
if low_limit <= h <= high_limit:
clean.append(h)
else:
suspicious.append(h)
print("Clean data:", clean)
print("Suspicious data:", suspicious)
print("Clean average:", round(sum(clean) / len(clean), 1), "cm")
This program separates 1 and 300 as suspicious and calculates the average using only reasonable values. This is an "error-catching rule," not a perfect truth: if we pick the wrong limits, we might throw away real data by mistake. That is why it matters to think about why we chose 120 and 210.
Your turn: Add your own data to the list. Then change the low and high limits and watch which values get flagged as suspicious. What happens if you make the range too narrow?
Common mistakes
Blaming the computer
When an AI gives a wrong result, many people say "the computer made a mistake." But usually the problem is in the data. The person who questions the data is the one who finds the fix.
Believing data is "neutral"
Numbers look objective, but people collect and choose the data. So the data can carry the blind spots of the people who gathered it.
Generalising from too little data
Looking at five examples and saying "they are all like this" is risky. Small, unbalanced data creates strong but wrong impressions.
Never checking the result
Accepting an AI's output as correct without ever questioning it. Especially for important decisions, a person should check the result.
Safety note
- Do not share personal information. Do not enter your name, address, phone number, school, or other people's details into online AI tools or datasets. Data that has been shared once cannot easily be taken back.
- Adult guidance. Use AI tools together with an adult and follow the platform's age rules.
- Humans are responsible. AI is a tool; it is not conscious, it is not magic, and it can be wrong. We are responsible for how we use it.
- Verify important results. If you plan to use an AI output for something important like homework, health, or money, check it against a reliable source or with an adult.
- Think about fairness. Asking whether a piece of data or a result affects a group unfairly is part of using technology in a fairer way.
Lesson summary
- Flawed data contains wrong, missing or broken information, and even a single error can ruin the result.
- Biased data is unbalanced; it represents some groups too much and others too little.
- "Garbage in, garbage out": an AI cannot be better than the data it learns from.
- AI is not being mean; it copies the pattern and the prejudice found in the data.
- Questioning data (where it came from, who it represents, whether the result makes sense) is the key to fairer and safer use.
Check questions
- What does the phrase "garbage in, garbage out" mean?
- What is the difference between flawed data and biased data?
- Why can a model trained only on red apple photos fail to recognise a banana?
- If an AI result affects a group unfairly, where is the problem most likely to be?
- Why is it important not to enter your personal information into an online AI tool?
Answers
- It means that if the data given to an AI is bad (wrong or biased), the result will be bad too. The output cannot be better than the input.
- In flawed data the information is wrong, missing or broken. In biased data the information may be correct, but the data is unbalanced; it represents one side too much and another too little.
- Because the model only learns from the examples it has seen. It never saw a banana, so it cannot recognise it; the training data is incomplete and unbalanced.
- The problem is most likely in the data: the data represented that group too little or in an unbalanced way. The AI copies the prejudice in the data.
- Because data that has been shared once may not be recoverable and could reach other people. That is why you should not share personal information without adult guidance.
Source and verification note
For “Flawed and Biased Data”, verification focuses on whether the relationship between Flawed data: wrong or missing information and Biased data: unbalanced or unfair data remains consistent across examples. Datasets in this module are small and educational; real personal data should not be used. An AI result should be evaluated not only for accuracy but also for data balance, error distribution and explainability.
Next lesson
Introduction to Image Recognition: We look at how a computer "sees" and recognises an object in a photo, and why this again depends on data.