Feedback

Study guide

Data Science & AI

Organized by the 8 areas on the 2026–27 test. Each topic matches an official objective.

Probability and Statistics Foundations

15 of 100 questions

Mean, median, mode, range

  • Mean: add the values and divide by how many there are (2, 4, 6, 8: 20 ÷ 4 = 5).
  • Median: the middle value when sorted; with an even count, average the two middle values (2, 4, 6, 8: (4 + 6) ÷ 2 = 5).
  • Mode: the value that appears most often; a set can have no mode or more than one.
  • Range: the largest value minus the smallest (8 − 2 = 6).
  • The median resists outliers; the mean is pulled toward them.

Check yourself: Find the median of 9, 3, 7, 5, 11, 1.

Show answer

6. Sorted: 1, 3, 5, 7, 9, 11; (5 + 7) ÷ 2 = 6.

Variance and standard deviation

  • Variance is the average of the squared distances from the mean.
  • Standard deviation is the square root of the variance, in the data's own units; a small one means values cluster near the mean.
  • Covariance shows whether two variables move together (positive) or in opposite directions (negative).
  • Correlation scales covariance to between −1 and 1.
  • A standard deviation of 0 means every value is the same.

Check yourself: A dataset has a variance of 25. What is its standard deviation?

Show answer

5 (the square root of 25).

Normal distribution

  • A normal (Gaussian) distribution is a symmetric bell-shaped curve.
  • Its mean, median, and mode are equal, at the center.
  • The 68–95–99.7 rule: about 68% of values fall within 1 standard deviation of the mean, 95% within 2, and 99.7% within 3.
  • Many real measurements (heights, test scores, errors) are roughly normal.
  • A z-score tells how many standard deviations a value is from the mean.
  • Many statistical and machine learning methods assume normal data.

Check yourself: Test scores are normal with a mean of 70 and a standard deviation of 10. About what percent fall between 50 and 90?

Show answer

About 95%, since 50 to 90 is within 2 standard deviations of the mean.

Expected value

  • Expected value is the long-run average result: multiply each outcome by its probability and add them up.
  • Example: win $10 with probability 0.2, else $0: 10 × 0.2 + 0 × 0.8 = $2.
  • A fair six-sided die's expected value is (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5.
  • The expected value doesn't have to be a possible outcome.
  • Probabilities of all outcomes must add up to 1.

Check yourself: A game pays $20 with probability 0.25 and $0 otherwise. What is its expected value?

Show answer

$5 (20 × 0.25 + 0 × 0.75).

Types of variables

  • Discrete variables are countable values, often whole numbers (number of students, goals scored).
  • Continuous variables can take any value in a range (height, time, temperature).
  • Categorical variables are groups or labels (color, state); ordinal ones have an order (small, medium, large).
  • Independent variables are inputs; dependent variables are the outcomes being predicted.
  • Variable type decides which charts and methods fit.

Check yourself: Is the number of cars in a parking lot discrete or continuous? What about the time it takes to park?

Show answer

The number of cars is discrete (a count); the time is continuous.

Data Analysis and Statistics for AI

15 of 100 questions

Choosing a chart

  • Line chart: change over time.
  • Bar chart: compare categories.
  • Pie chart: parts of a whole (few categories, adding to 100%).
  • Scatterplot: the relationship between two numeric variables.
  • Histogram: the distribution of one numeric variable; map: geographic data.
  • Keep charts simple, labeled, and honest (start bar axes at zero).

Check yourself: A store wants to show how its monthly sales changed over two years. Which chart fits best?

Show answer

A line chart, which shows change over time.

Boxplots, histograms, and scatterplots

  • A boxplot (box-and-whisker) shows the five-number summary: minimum, first quartile (Q1), median, third quartile (Q3), and maximum; outliers appear as dots.
  • The box covers the middle 50% of data (the interquartile range, Q3 − Q1).
  • A histogram groups numeric data into bins and shows how often values fall in each; the bars touch.
  • A scatterplot plots pairs of values as points to show correlation and clusters.
  • A heat map uses color to show values in a grid.

Check yourself: On a boxplot, Q1 is 20 and Q3 is 35. What is the interquartile range?

Show answer

15 (35 − 20), the middle 50% of the data.

Multivariate methods

  • Multivariate data has several variables per observation.
  • Dependence methods predict one outcome from other variables: multiple linear regression (predicts a number) and logistic regression (predicts a category, such as yes/no).
  • Interdependence methods find structure without a target: cluster analysis and factor analysis or PCA (reducing many variables to a few).
  • Regression coefficients show how much the outcome changes per unit of each input.
  • Correlation isn't causation.

Check yourself: A model uses several variables to predict whether a customer will buy (yes or no). Which kind of regression fits?

Show answer

Logistic regression, which predicts a category.

Data cleaning

  • Data cleaning fixes or removes wrong, incomplete, or messy data before analysis.
  • Tasks: remove duplicates, handle missing values (fill or drop), fix typos and formats, and check outliers.
  • "Garbage in, garbage out": bad data gives bad results and bad models.
  • Cleaning often takes most of a data scientist's time.
  • Document every change so the work can be checked.

Check yourself: While cleaning data, an analyst finds a few very high values. Should they be deleted right away?

Show answer

No. Check them first; some outliers are real.

Data quality factors

  • Quality dimensions: accuracy, completeness, consistency, timeliness, and validity.
  • Problems: duplicates, missing values, outdated data, inconsistent formats (dates written different ways), and typing errors.
  • Low-quality sources may be biased or unverified.
  • Sampling bias: the data doesn't represent the whole population.
  • Small or incomplete datasets lead to unreliable conclusions.

Check yourself: A survey of 50,000 people reached only shoppers at one mall. What data quality problem does this show?

Show answer

Sampling bias: the data doesn't represent the whole population, however large it is.

Algorithms in practice

  • Linear regression predicts a number from a straight-line relationship (predicting house prices from size).
  • Decision trees make predictions through a series of yes/no questions (approving a loan).
  • K-means groups data into k clusters of similar points (customer segments); it's unsupervised.
  • Classification predicts categories (spam or not spam).
  • Choose the method by the question: a number, a category, or groups.

Check yourself: A bank decides whether to approve a loan through a series of yes/no questions. What kind of algorithm is that?

Show answer

A decision tree.

Tools for Data and AI

10 of 100 questions

SQL queries

  • SELECT chooses columns, FROM names the table, WHERE filters rows: SELECT name FROM students WHERE grade = 10;
  • ORDER BY sorts (ASC or DESC); GROUP BY groups rows for summaries.
  • Aggregate functions: COUNT, SUM, AVG, MIN, MAX; HAVING filters groups.
  • JOIN combines tables on a shared key (INNER JOIN keeps only matches).
  • INSERT, UPDATE, and DELETE change data.
  • SELECT * returns all columns.

Check yourself: After a GROUP BY, you want only groups whose COUNT is above 5. Do you use WHERE or HAVING?

Show answer

HAVING, which filters groups after GROUP BY.

Data and AI libraries

  • NumPy: fast arrays and math in Python.
  • Pandas: tables (DataFrames) for loading, cleaning, and analyzing data.
  • Matplotlib and Seaborn: charts.
  • scikit-learn: classic machine learning (regression, trees, clustering).
  • PyTorch and TensorFlow: deep learning and neural networks.
  • R's tidyverse (dplyr, ggplot2) does similar work in R.

Check yourself: Which Python library would you use to build a neural network, and which to clean a table of data?

Show answer

PyTorch (or TensorFlow) for neural networks; Pandas for tables.

Python for data wrangling

  • Python is the most popular data science language, mostly through Pandas.
  • Load data: pd.read_csv("file.csv").
  • Clean: dropna() removes missing values, fillna() fills them, drop_duplicates() removes repeats.
  • Transform: rename columns, change data types, filter rows, and merge tables.
  • Summarize with describe(), groupby(), and value_counts().
  • Jupyter notebooks mix code, results, and notes.

Check yourself: A DataFrame has missing values you want to replace with 0, not remove. Which Pandas function do you use?

Show answer

fillna(). dropna() would remove them instead.

R for data science

  • R is a programming language built for statistics and data visualization.
  • It's popular in research, academia, and statistics.
  • RStudio is a common editor; packages come from CRAN.
  • The tidyverse includes ggplot2 (charts) and dplyr (data wrangling).
  • R stores tables in data frames.
  • Python is more general-purpose; R is strongest in statistical analysis.

Check yourself: ggplot2 is a charting package for which programming language?

Show answer

R, as part of the tidyverse.

Relational databases

  • Data is stored in tables of rows (records) and columns (fields).
  • A primary key uniquely identifies each row; a foreign key links to another table's primary key.
  • Tables are linked by relationships (one-to-one, one-to-many, many-to-many).
  • SQL is used to query them; examples: MySQL, PostgreSQL, SQL Server.
  • Normalization reduces repeated data.
  • NoSQL databases store data in other forms (documents, key-value) for unstructured data.

Check yourself: An Orders table has a CustomerID column that points to the Customers table's primary key. What is CustomerID in the Orders table?

Show answer

A foreign key.

AI Basics

10 of 100 questions

Generative AI

  • Generative AI creates new content (text, images, audio, video, code) based on patterns learned from training data.
  • It's trained on huge datasets and produces output in response to a prompt.
  • Text tools use large language models; image tools often use diffusion models.
  • It predicts likely output; it doesn't look up facts the way a database does.
  • Other AI is discriminative: it classifies or predicts rather than creating.

Check yourself: One AI tool writes a new product description; another sorts emails into spam or not spam. Which one is generative?

Show answer

The one writing the description; the spam sorter is discriminative.

Generative AI limits

  • Capabilities: drafting and summarizing text, translating, writing code, brainstorming, and creating images.
  • It can hallucinate: state false information confidently.
  • Knowledge stops at a training cutoff unless it can search.
  • It may reflect biases in its training data.
  • It raises copyright and privacy questions and needs human review.
  • Output quality depends on the prompt.

Check yourself: What is the term for an AI confidently stating false information?

Show answer

A hallucination.

Uses of generative AI

  • Healthcare: drafting notes, summarizing records, and helping discover drugs.
  • Research: summarizing papers and analyzing data.
  • Digital art and media: creating images, music, and video.
  • Business: customer service chatbots, marketing copy, and reports.
  • Software: writing and explaining code.
  • Education: tutoring and practice questions.

Check yourself: A hospital uses generative AI with patient records. What is one task it might do?

Show answer

Draft notes or summarize records (it can also help discover drugs).

AI subfields

  • Computer vision: understanding images and video (face recognition, medical scans).
  • Natural language processing (NLP): understanding and producing human language (translation, chatbots).
  • Robotics: machines that sense and act in the physical world.
  • Human-computer interaction: how people and AI systems work together.
  • Speech recognition, expert systems, and machine learning are other areas.

Check yourself: A phone unlocks by recognizing its owner's face. Which AI subfield is that?

Show answer

Computer vision.

Large language models

  • A large language model (LLM) is an AI model trained on huge amounts of text to understand and generate language.
  • It works by predicting the next token (a word or part of a word).
  • Most use the transformer architecture.
  • "Large" refers to billions of parameters and huge training data.
  • They're often fine-tuned with human feedback to follow instructions.
  • Examples include the models behind ChatGPT, Gemini, and Claude.

Check yourself: What does a large language model predict, one step at a time, to produce text?

Show answer

The next token, a word or part of a word.

LLM capabilities

  • LLMs can answer questions, summarize, translate, write, and explain.
  • They can write and debug code.
  • They can follow instructions and examples given in a prompt (few-shot learning).
  • Some can use tools (search, calculators) or handle images (multimodal).
  • A context window limits how much text they can consider at once.
  • They still make mistakes, so important output needs checking.

Check yourself: A user pastes in a very long document, and the LLM can't take all of it into account. What limit is likely the cause?

Show answer

The context window, which limits how much text it can consider at once.

Machine Learning

10 of 100 questions

Nature of machine learning

  • Machine learning (ML) lets computers learn patterns from data instead of being programmed with every rule.
  • A model is trained on examples, then makes predictions on new data.
  • Features are the inputs; the label (target) is what's predicted.
  • More and better data usually improves results.
  • ML is a subset of AI; deep learning is a subset of ML.

Check yourself: A model predicts house prices from size and location. What are the features, and what is the label?

Show answer

Size and location are the features; the price is the label.

Training, validation, and test sets

  • The training set teaches the model (often about 70–80% of the data).
  • The validation set tunes settings and compares models during development.
  • The test set is held back until the end to measure performance on unseen data.
  • Overfitting: the model memorizes training data and does poorly on new data.
  • Underfitting: the model is too simple to capture the pattern.
  • Never train on the test set.

Check yourself: A model scores 99% on its training data but 60% on the test set. What problem does this show?

Show answer

Overfitting: it memorized the training data and does poorly on new data.

How ML algorithms behave

  • A neural network has layers of connected nodes (neurons); each connection has a weight that's adjusted during training.
  • Training reduces a loss (cost) function, which measures error, often with gradient descent.
  • An activation function decides each neuron's output.
  • A decision tree splits data by questions at each node and gives a prediction at each leaf; it's easy to explain.
  • Models learn a function that maps inputs to outputs.

Check yourself: What does training a neural network adjust in order to lower the loss function?

Show answer

The weights on the connections between nodes.

Supervised, unsupervised, reinforcement

  • Supervised learning uses labeled data (inputs with known answers): classification and regression.
  • Unsupervised learning uses unlabeled data to find patterns: clustering (k-means) and dimensionality reduction.
  • Reinforcement learning has an agent learn by trial and error, earning rewards or penalties from an environment.
  • Examples: spam detection (supervised), customer segments (unsupervised), game-playing AI and robots (reinforcement).
  • Semi-supervised learning uses a little labeled data and a lot of unlabeled data.

Check yourself: A robot learns to walk by trial and error, earning rewards for each step forward. What type of learning is this?

Show answer

Reinforcement learning.

Choosing an ML approach

  • Have labeled examples and want to predict a category? Use supervised classification.
  • Predicting a number (price, temperature)? Use supervised regression.
  • Want to find groups in unlabeled data? Use unsupervised clustering.
  • An agent must make a sequence of decisions for rewards (games, robots)? Use reinforcement learning.
  • Start simple and compare models on a test set.

Check yourself: You want to predict tomorrow's temperature from labeled past weather data. Which machine learning approach fits?

Show answer

Supervised regression, because it predicts a number.

Deep learning

  • Deep learning uses neural networks with many layers (hence "deep").
  • Each layer learns more complex features: edges, then shapes, then objects in an image.
  • It needs large datasets and powerful hardware (GPUs).
  • It powers image recognition, speech recognition, and LLMs.
  • Types: convolutional networks (CNNs) for images, transformers for language.
  • It's harder to explain than simpler models (a "black box").

Check yourself: Put AI, machine learning, and deep learning in order from broadest to narrowest.

Show answer

AI, then machine learning, then deep learning.

Perception, Representation, and Reasoning

10 of 100 questions

Predicate logic in AI

  • Predicate logic (first-order logic) represents facts and rules with predicates, variables, and quantifiers.
  • A predicate describes a property or relation: Human(Socrates) means Socrates is human.
  • Quantifiers: for all (∀) and there exists (∃).
  • AI systems use rules to infer new facts (if Human(x) then Mortal(x)).
  • It's used in expert systems, knowledge bases, and logic programming (such as Prolog).
  • It's more expressive than propositional logic, which has only true/false statements.

Check yourself: What does predicate logic add that propositional logic lacks?

Show answer

Predicates with variables and quantifiers (for all, there exists); propositional logic has only true/false statements.

Predicate logic examples

  • "All students study": ∀x (Student(x) → Studies(x)).
  • "Some birds can't fly": ∃x (Bird(x) ∧ ¬Flies(x)).
  • "Ana is Ben's parent": Parent(Ana, Ben).
  • Symbols: ∧ (and), ∨ (or), ¬ (not), → (implies).
  • From ∀x (Human(x) → Mortal(x)) and Human(Socrates), infer Mortal(Socrates).
  • "No dogs are cats": ∀x (Dog(x) → ¬Cat(x)).

Check yourself: Given ∀x (Human(x) → Mortal(x)) and Human(Socrates), what can you infer?

Show answer

Mortal(Socrates): Socrates is mortal.

Logic vs. probability reasoning

  • Logic-based reasoning uses fixed rules and gives certain true/false conclusions.
  • Probability-based reasoning handles uncertainty and gives degrees of belief (a 70% chance).
  • Logic works well with clear rules; probability works with noisy, incomplete real-world data.
  • Bayes' theorem updates probabilities when new evidence arrives.
  • Modern AI often combines both.

Check yourself: A system says there's a 70% chance a patient has the flu. Is that logic-based or probability-based reasoning?

Show answer

Probability-based; it gives a degree of belief, not a certain answer.

Bayesian networks

  • A Bayesian network models how variables affect each other's probabilities.
  • Nodes are variables (such as Rain or Wet Grass).
  • Directed edges (arrows) show dependence: the parent influences the child.
  • It's a directed acyclic graph (DAG): arrows have direction and never form a loop.
  • Each node has a conditional probability table given its parents.
  • Used for diagnosis, spam filtering, and risk prediction.

Check yourself: In a Bayesian network, what do the nodes stand for, and what do the arrows show?

Show answer

Nodes are variables; arrows show that a parent influences a child.

Knowledge representation

  • Knowledge representation stores facts about the world so an AI can reason with them.
  • Methods: rules (if-then), logic, semantic networks, frames, and ontologies.
  • A knowledge graph links entities (nodes) by relationships (edges).
  • Reasoning draws new conclusions from stored knowledge (inference).
  • Expert systems use a knowledge base plus an inference engine.
  • Good representation makes reasoning faster and clearer.

Check yourself: In an expert system, which part applies rules to the knowledge base to reach conclusions?

Show answer

The inference engine.

Privacy and Ethics

10 of 100 questions

AI dilemmas

  • Self-driving cars: who's responsible in a crash, and how should a car act when harm can't be avoided?
  • Generative AI: deepfakes, misinformation, copyright, and cheating.
  • Surveillance: facial recognition can track people without consent and threatens privacy.
  • Jobs: automation may replace some work.
  • Accountability and transparency: who's responsible when AI makes a harmful decision, and can it be explained?
  • Keep a human in the loop for high-stakes decisions.

Check yourself: What is the term for keeping a person able to check and approve high-stakes AI decisions?

Show answer

Keeping a human in the loop.

Algorithmic bias

  • AI learns from data, so biased training data produces biased results.
  • Data that underrepresents groups leads to worse accuracy for them (face recognition errors).
  • Historical bias: past unfair decisions (such as in hiring) get repeated.
  • Developers' choices of features and goals can add bias.
  • Reduce it with diverse data, fairness testing, audits, and human review.
  • Algorithmic bias means a system's outputs are systematically unfair to some groups.

Check yourself: A hiring AI learns from years of past hiring decisions that unfairly favored one group. What kind of bias is this?

Show answer

Historical bias: past unfair decisions get repeated.

LLM privacy and security

  • What users type may be stored or used for training; don't enter personal or confidential data.
  • Prompt injection: hidden instructions in text trick a model into ignoring its rules.
  • Data leakage: models may reveal sensitive information from training data or other inputs.
  • Attackers use LLMs to write convincing phishing and malware.
  • Companies set AI use policies and use enterprise tools with data protections.
  • Jailbreaking tries to get around a model's safety limits.

Check yourself: A web page contains hidden text telling an AI model to ignore its rules. What is this attack called?

Show answer

Prompt injection.

LLM credibility

  • Hallucinations: LLMs can make up facts, quotes, or sources that sound real.
  • They can spread misinformation and outdated information (training cutoff).
  • Their confident tone can mislead users.
  • Verify important claims with reliable sources and check citations.
  • Use LLMs for drafts and ideas, with human review for facts.

Check yourself: An LLM gives you a source to back up a claim. What should you do before using it?

Show answer

Check that the source really exists and says that; LLMs can make up sources.

Data Literacy and Foundations

20 of 100 questions

Nature of data science

  • Data science uses statistics, programming, and subject knowledge to get insights from data.
  • It combines math and statistics, computer science, and domain expertise.
  • Data scientists collect, clean, analyze, model, and communicate data.
  • Uses: business decisions, medicine, sports, and recommendations.
  • Big data is often described by volume, velocity, and variety.
  • Data analysts mostly describe and report on past data; data scientists more often build predictive models, though the roles overlap.

Check yourself: Which role focuses on describing data, and which also builds predictive models?

Show answer

A data analyst mostly describes data; a data scientist more often builds predictive models.

Structured vs. unstructured data

  • Structured data fits rows and columns with a set format (spreadsheets, relational databases).
  • Unstructured data has no set format: emails, documents, images, video, and social media posts.
  • Semi-structured data has tags but no fixed table (JSON, XML).
  • Most of the world's data is unstructured.
  • Structured data is queried with SQL; unstructured data often needs AI (NLP, computer vision).

Check yourself: A JSON file has tags but no fixed table. What kind of data is it?

Show answer

Semi-structured data.

Numeric vs. categorical data

  • Numeric (quantitative) data are measured or counted numbers: age, price, temperature.
  • Categorical (qualitative) data are labels or groups: color, city, yes/no.
  • Ordinal categories have an order (ratings from poor to excellent); nominal ones don't (eye color).
  • Numbers used as labels (ZIP codes, jersey numbers) are categorical.
  • Categorical data is shown with bar or pie charts; numeric with histograms and scatterplots.

Check yourself: A dataset has a column of ZIP codes. Is it numeric or categorical data?

Show answer

Categorical; the digits are labels, not amounts.

Binary, hex, and decimal

  • Binary (base 2) uses 0 and 1; place values are 1, 2, 4, 8, 16, 32, 64, 128.
  • Binary 1011 = 8 + 0 + 2 + 1 = 11 in decimal.
  • Hexadecimal (base 16) uses 0–9 and A–F (A = 10, F = 15); each hex digit is 4 bits.
  • Hex 1F = 1 × 16 + 15 = 31; FF = 255.
  • Decimal to binary: divide by 2 repeatedly and read the remainders from bottom to top (13 = 1101).
  • Eight bits (one byte) hold values 0–255.

Check yourself: Convert hexadecimal 2A to decimal.

Show answer

42 (2 × 16 + 10, since A = 10).

Data sources

  • Surveys and forms give opinions and demographics.
  • Sensors and IoT devices give measurements (temperature, location).
  • Transactions give sales and purchase records.
  • Web and social media give clicks, posts, and reviews; APIs let programs request data from services.
  • Public datasets from governments (census) and research.
  • Primary data is collected yourself; secondary data was collected by others.

Check yourself: A business downloads government census data for its research. Is that primary or secondary data?

Show answer

Secondary data, because someone else collected it.

Data wrangling

  • Data wrangling (munging) turns raw data into a clean, usable format.
  • Common steps include gathering, cleaning, structuring, combining (joining), and validating; sources name and order them differently.
  • Transformation changes data: converting types, normalizing or scaling values, creating new features, and reshaping tables.
  • It makes data consistent so models and analyses work.
  • ETL (extract, transform, load) moves data into a database or warehouse.

Check yourself: Scaling all values in a column to a range of 0 to 1 is part of which data wrangling step?

Show answer

Transformation (normalizing or scaling values).

Data science process

  • 1. Define the problem or question.
  • 2. Collect data.
  • 3. Clean and prepare the data.
  • 4. Explore it (exploratory data analysis, EDA) with summaries and charts.
  • 5. Model and analyze; 6. evaluate the results.
  • 7. Communicate findings and deploy or act on them; the process often repeats.

Check yourself: Does exploratory data analysis come before or after building models?

Show answer

Before. Explore the cleaned data with summaries and charts, then model.