Home · Academy · Robotics & Coding · Introduction to Data and AI · Flawed and Biased Data

Flawed and Biased Data

Learn how flawed and biased data spoils results, and how to question data.

LESSON COMPASS

What will you use this page for?

Core idea

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.

Evidence to produce

Complete the page task with your own input, test conditions and reasoning.

Control trap

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…

Next connection

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.

Module sources: Python Tutorial · Arduino Learn

LevelBeginner
Age10–16
Duration30–45 min
PrerequisiteTraining Data and Test Data
ContentStandard lesson · 1,657 words
Last updated

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:

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?

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:

  1. Where did this data come from? Who collected it, and how?
  2. Are there missing or strange values? Do any numbers look far too big or too small?
  3. Is everyone represented? Is one group over-represented and another left out?
  4. Does the result make sense? Does the answer match the real world?
  5. 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

Lesson summary

Check questions

  1. What does the phrase "garbage in, garbage out" mean?
  2. What is the difference between flawed data and biased data?
  3. Why can a model trained only on red apple photos fail to recognise a banana?
  4. If an AI result affects a group unfairly, where is the problem most likely to be?
  5. Why is it important not to enter your personal information into an online AI tool?

Answers

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Start QuizBack to Introduction to Data and AI
QUESTION POOL

Reinforce this lesson with 10 questions

This lesson has a pool of 20 questions. Each attempt selects 10 and reshuffles the choices.