Artificial Intelligence Examples in CS Thinking

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Artificial Intelligence.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in CS Thinking.

Concept Recap

Artificial intelligence is the field of building systems that perform tasks that normally require human-like perception, pattern detection, prediction, or decision making. Many AI systems learn patterns from large sets of data rather than following only hand-written rules.

AI systems learn patterns from examples so they can make useful predictions or decisions on new inputs.

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: AI depends on data, models, and evaluation, not just on bigger computers.

Common stuck point: AI is not magic or general human intelligence. Most school-level AI systems are specialized tools trained for a narrow task.

Sense of Study hint: When evaluating an AI system, ask what data it learned from, what task it is optimized for, how success is measured, and who could be harmed if it makes mistakes.

Worked Examples

Example 1

medium
A medical-image classifier gets 80% accuracy. Of 100 patients with disease it correctly flags 60. What is its recall on the disease class?

Answer

0.6ย (60%)0.6\ (60\%)

First step

1
Recall on the positive class = true positives / actual positives.

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Unlock answer keys One Family plan โ€” every worked solution, all subjects

Example 2

medium
A model labels 100 emails. 70 are correctly labeled, 30 wrong. Of the 30 wrong, 20 were spam wrongly marked safe. Compute overall accuracy and the spam recall if there were 50 real spam emails total.

Example 3

medium
Identify input, process, output for an AI that predicts tomorrow's weather: 'Yesterday's temperature, humidity, wind โ†’ trained neural network โ†’ predicted high temperature.' Then name the stakeholder most affected.

Example 4

hard
Model A has precision 0.9, recall 0.5. Model B has precision 0.6, recall 0.85. For a tumor-screening tool where missing a tumor is far worse than a false alarm, which model is preferable and why?

Example 5

hard
A bank's AI denies loans to applicants from one zip code at twice the rate of similar applicants elsewhere. Walk through the input-process-output-evidence-stakeholder checklist for this system.

Example 6

challenge
A recommender shows users content similar to what they previously clicked. Over months, the diversity of recommendations narrows. Explain the feedback loop in terms of y^=fฮธ(x)\hat{y} = f_\theta(x) and propose two countermeasures.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
A model is trained on emails LABELED 'spam' or 'not spam'. What type of machine learning is this?

Example 2

easy
A model groups customers into clusters with NO labels provided. What type of learning is this?

Example 3

easy
What does training data do for a machine learning model?

Example 4

easy
True or false: AI outputs are always correct and unbiased.

Example 5

easy
In y^=fฮธ(x)\hat{y} = f_\theta(x), what does xx represent?

Example 6

easy
A face-recognition system works poorly on groups underrepresented in its training data. What is the root cause?

Example 7

easy
Is AI a single technology or many different methods?

Example 8

easy
Why might a bigger computer alone NOT make an AI model better?

Example 9

medium
You want to predict house prices from features (size, location) using past sales with known prices. Supervised or unsupervised, and why?

Example 10

medium
A model gets 99% accuracy detecting a disease that occurs in only 1% of patients, by always predicting 'healthy'. Why is accuracy misleading here?

Example 11

medium
Classify each as supervised or unsupervised: (a) sorting photos into groups without labels, (b) predicting tomorrow's temperature from labeled historical data.

Example 12

medium
A model memorizes its training data and scores perfectly on it but fails on new data. Name this problem and one remedy.

Example 13

medium
Why is it important to test an AI model on data it has NOT seen during training?

Example 14

medium
A hiring AI trained on a company's past hires recommends mostly candidates resembling current staff. Name the issue and its source.

Example 15

medium
In y^=fฮธ(x)\hat{y} = f_\theta(x), training adjusts which symbol, and toward what goal?

Example 16

medium
A spam classifier flags 90 of 100 real spam emails (and misses 10). What is its recall on spam?

Example 17

medium
A recommendation model is retrained only on what users already clicked, so it keeps suggesting similar items and narrows over time. Name this dynamic.

Example 18

challenge
A model has 95% training accuracy but 70% test accuracy. A second model has 80% training and 78% test. Which is likely better for real use, and what does the gap indicate?

Example 19

challenge
An AI predicts loan defaults and is very accurate overall but denies a protected group at much higher rates than justified. Explain why 'high accuracy' does not make it fair, and one mitigation.

Example 20

challenge
A team has only 200 labeled examples but millions of unlabeled ones. Describe an approach that uses both, and why pure supervised learning alone may struggle.

Example 21

easy
Name the three pillars that AI systems depend on, beyond just raw compute.

Example 22

easy
A model is shown movies grouped by genre tags ('comedy', 'drama'). Is this supervised or unsupervised learning?

Example 23

easy
True or false: An AI trained only on adult speech will usually understand kids' voices just as well.

Example 24

easy
Name one stakeholder group that should be considered when deploying an AI hiring tool.

Example 25

easy
True or false: 'AI' refers to a single algorithm.

Example 26

easy
Pick the better label: an AI that finds natural groupings of news articles WITHOUT being told the topics is doing (a) supervised learning (b) unsupervised learning.

Example 27

medium
A spam filter flags 80 emails as spam; 60 truly are spam. Compute precision.

Example 28

medium
You have 1000 cat photos and 10 dog photos and train a classifier. Name the data problem and one concrete fix.

Example 29

medium
Why is a held-out test set kept SEPARATE from the training set?

Example 30

medium
Your model gets 92% training accuracy and 91% test accuracy. Is it more likely overfitting or underfitting?

Example 31

medium
A self-driving system uses both labeled images of stop signs AND many unlabeled driving videos. What learning paradigm fits?

Example 32

medium
A reinforcement-learning agent plays chess and improves by winning more games. What feedback signal is it using?

Example 33

medium
Why should an AI grading system keep a sample of work reviewed by humans, even after deployment?

Example 34

medium
A chatbot is fine-tuned to refuse to give medical advice. Is the safeguard primarily in the data, the model, or the deployment policy?

Example 35

medium
Out of 200 predictions, 150 are correct. What is the model's accuracy as a decimal?

Example 36

hard
A confusion matrix shows TP=40, FP=10, FN=20, TN=130. Compute precision and recall.

Example 37

hard
An AI image generator was trained on art scraped from the web without artist consent. Name two harms and one safeguard.

Example 38

hard
An AI tutor is more accurate for English speakers than Spanish speakers. Name two distinct fixes โ€” one at the data layer, one at the evaluation layer.

Example 39

hard
A language model is asked a question it has no information about and produces a confident, false answer. Name the phenomenon and one mitigation.

Example 40

challenge
A school is choosing between AI-graded essays (fast, cheaper, opaque) and human-graded (slow, expensive, transparent). Frame the decision using stakeholders, benefits, harms, data use, and safeguards.

Background Knowledge

These ideas may be useful before you work through the harder examples.

pattern recognitiondata representation