Statistical & Mathematical Methods for Data Science · Chapter 1

Introduction to Data Science, taught visually

Everything in PPT 1, rebuilt so you can see it: flip the definition cards, tap through both pyramids, work the case scenarios like exam questions, and run the calculations yourself. The professor tests in three formats — this guide is organised in exactly those three.

Definitions — word-for-word Case scenarios — spot the concept Calculations — grades, mean, data volume
01

Four fields, one family — don't mix them up

The single most likely definition question: "Distinguish data science, machine learning, data mining and statistics." Each field below has one essence line — memorise those four lines and you can reconstruct the rest.

Data Science

The goal: better decisions from big data.

Improves decision-making by basing decisions on insights extracted from large datasets. It pulls out actionable insights — principles, problem definitions, algorithms and processes that reveal nonobvious, useful patterns.

Exam trap: Data science is broader in scope than both machine learning and data mining — it contains them, it isn't a synonym for either.

Machine Learning

The algorithms that find the patterns.

Focuses on the design and evaluation of algorithms for extracting patterns from data. A pattern only counts if it passes two tests: it must be useful and nonobvious — otherwise it isn't worth the effort.

Exam trap: If a scenario says "designing / evaluating an algorithm," the answer is ML — even if the word "data" appears everywhere.

Data Mining

Patterns in structured, stored data.

Generally deals with the analysis of structured data, which usually lives in relational databases. It often carries an emphasis on commercial applications, powered by data warehouses and analytical databases.

Exam trap: "Structured data + relational database + business use" is the data-mining fingerprint.

Statistics

The oldest science of data.

The branch of science dealing with the collection and analysis of data. Its simplest form, descriptive (summary) statistics, uses measures of central tendency (e.g. the arithmetic mean) and measures of variation (e.g. the range).

Exam trap: Classic statistics asks why the data looks the way it does (the hidden model that generated it). ML/DS ask what predicts best. Scenario 9 in the practice set tests exactly this.

FieldCore question it answersWorks withOne-line identity
Data Science"What decision should we make?"Large datasets, any formBroadest scope — decisions from insights
Machine Learning"Which algorithm extracts the pattern best?"Data fed to algorithmsDesign + evaluation of algorithms
Data Mining"What patterns hide in our stored data?"Structured data in relational databasesCommercial focus, warehouse-powered
Statistics"How was this data generated, and what does it summarise to?"Collected samples & populationsCollection + analysis; mean & range at its simplest
02

Definition flip-cards

Read the term, say the definition out loud, then tap to check. The highlighted phrases on the back are the exact wording markers are scanning for.

03

The two pyramids — learn them bottom to top

Both pyramids say the same thing two ways: raw material at the bottom, value at the top, and most of the work (and most of the marks) is in knowing what each layer adds. Tap any layer to see what it means and an example.

DIKW Pyramid

How raw signals become wisdom. Each layer adds context and meaning.

Memory hook: every step up answers a bigger question — What? → So what? → How? → Why / what now?

Data Science Pyramid

How an organisation climbs from raw records to harvested value.

Exam favourite: a company that "only makes dashboards" is stuck at layer 2 — Charts. No predictions, no actions, no value harvested.

04

Big Data: the three V's & the data explosion

Big Data is defined by three properties. If a scenario mentions data that is huge, messy in format, or arriving too fast to store first — it's pointing at one of these.

V1

Volume

Data at a scale too large for ordinary tools — terabytes to exabytes and beyond.

Picture it: humanity now generates about 5 exabytes every 2 days.
V2

Variety

Many forms at once: neat tables (structured) plus text, images, audio and social posts (unstructured).

Why it hurts: analysts spend ~80% of their time just capturing, cleaning and transforming unstructured data.
V3

Velocity

Data arrives as a continuous, high-speed stream that must be processed as it flows, not later.

Picture it: live transaction feeds and sensor streams that never pause.

5,000 years of data — then everything changed

The slide's timeline, drawn out. Notice how the "type" of data shifts from one-off records to continuous generation.

~3200 BCE

Mesopotamia. A sale is recorded — transactional data: one record of one exchange.

~3000 BCE

Egypt. A census counts people for tax collection — non-transactional (demographic) data.

Writing → 2013

5 exabytes total created in roughly 5,000 years of recorded history.

2013 → today

5 exabytes every 2 days. The same amount now arrives before your weekend ends.

2.5 EB / day

5 exabytes ÷ 2 days — the current daily creation rate

75 EB

created in 30 days at that rate (2.5 × 30) — a likely exam calculation

~912 EB / year

2.5 × 365 — nearly a zettabyte of new data every year

05

3 V's case scenarios — name the V

The professor's favourite format for Big Data: a short story, and you must say whether the core problem is Volume, Variety or Velocity — or all three at once. Watch for the traps: a problem can be tiny in size and still be Big Data, and a huge dataset can be a problem of only one V.

0 of 6 V scenarios revealed
For each one: commit to a V before you reveal.
06

Transactional vs non-transactional data

The chapter's timeline quietly introduces the two oldest kinds of data there are. Transactional data records events — things that happened between parties. Non-transactional data describes entities — what people and things are like. Almost every database you will ever meet holds both, and exam scenarios ask you to tell them apart.

Transactional data

Records of events — things that happened.

Captured at the moment an exchange or activity occurs. Each record is one event and carries the same anatomy: who was involved, what happened, when (a timestamp), and usually how much. It is generated continuously and grows fast.

Examples: a sale receipt, an ATM withdrawal, a flight booking, a card payment, a hospital admission, a click on a website.

Chapter anchor: Mesopotamia, ~3200 BCE — a merchant recording a sale. The first data in history was transactional.

Non-transactional data

Descriptions of entities — what things are.

Data about people, products and places that records no exchange: attributes and characteristics. It changes slowly (an address, a birth date, a product's category) and exists to give transactional data its context — it is the reference, or master, data of a system.

Examples: census demographics, a customer profile (name, address, occupation), a product catalogue, a student record, a price list.

Chapter anchor: Egypt, ~3000 BCE — a census counting people for tax collection. Demographic data, not exchanges.

TransactionalNon-transactional
RecordsAn event / exchange between partiesFacts and attributes of an entity
Always hasA timestamp — it happened at a momentNo moment — it simply is
How it changesConstantly appended, record by recordRarely updated, field by field
Volume behaviourHuge and growing every secondComparatively small and stable
Main jobRun operations; reveal behaviour over timeProvide context — who/what the events involve
Ancient exampleMesopotamian sale record (~3200 BCE)Egyptian census (~3000 BCE)
The classic trap: one system usually holds both. A loyalty program stores a member's name and phone number (non-transactional) and logs every purchase she makes (transactional). The strongest analysis joins the two — purchases (events) grouped by age or city (attributes) is exactly how customer segmentation is built.
0 of 5 data-type scenarios revealed
Ask of each: is it an event, or a description?
07

Types of data patterns — what mining actually finds

When the chapter says ML and data mining "extract patterns", these six are the shapes those patterns take. Learn each by its picture and its trigger words — the scenario cards in the next section are all one of these six in disguise. And remember the chapter's quality test: a pattern only counts if it is useful and nonobvious.

Association
Things that show up together

Items or events that co-occur more often than chance. The market-basket pattern: customers who buy nappies on Friday evenings also buy snacks — so the store shelves them together.

Triggers: "frequently bought together", "who buy X also buy Y", "found together in…"
Classification
Rules that sort into known categories

Patterns learned from labelled examples become rules that assign new items to categories decided in advance: this email is spam, that transaction is fraud, this tumour is benign.

Triggers: "assign to a category", "labelled as", "flagged as", "sorted into spam / not spam"
Clustering
Groups nobody defined in advance

Natural groupings that emerge from similarity alone — no labels are given beforehand. The algorithm discovers that customers fall into usage tiers; naming the groups is the human's job afterwards.

Triggers: "groups", "segments", "clusters of similar…", "types of customers emerged"
Anomaly
The one that doesn't fit

A rare case that deviates sharply from the normal pattern — valuable precisely because it is rare: the $50,000 transfer from a $200 account, the sensor reading ten times its usual value.

Triggers: "unusual", "sudden spike", "doesn't match the pattern", "outlier", "fraud"
Sequence & trend
What happens next, in order

Patterns where order and time carry the meaning: browse → add to cart → buy; demand rising every winter; a patient's readings drifting steadily worse. The same events shuffled would say nothing.

Triggers: "after X, customers then…", "over time", "trend", "seasonal", "leads to"
Correlation
Variables that move together

As one variable rises, another reliably rises (or falls) with it: temperature with ice-cream sales, study hours with marks. The workhorse pattern behind charts and reports — and behind most bad conclusions.

Triggers: "increases with", "related to", "linked", "the higher the X, the higher the Y" · Trap: correlation is not causation
08

Case scenarios — think first, then reveal

The professor's scenarios hide the concept inside a story. The highlighted phrases are the trigger words that give the answer away — train your eye to spot them before you reveal.

0 of 10 scenarios revealed
Work through them all before the exam.
09

Storage-constraint scenarios — when data outgrows the disk

A storage constraint means the data you have — or keep generating — no longer fits the storage you own, or costs more to keep than it is worth. Chapter 1 sets this up directly: data is now created at 2.5 exabytes a day, but disks, servers and budgets are finite. Every scenario below is that collision wearing a different costume.

Why the collision is guaranteed

Storage capacity grows in steps — you buy a disk, it fills, you buy another. Data creation grows continuously. Sooner or later the curves cross, and someone has to decide what gets kept, summarised, sampled or thrown away.

Storage you own (fixed) Data created — 2.5 EB/day and climbing The curves cross — the constraint bites time →

Past the crossing point, "keep everything forever" stops being a plan. The six moves below are what replace it — and each practice scenario that follows is solved by one of them.

The six standard escapes — know these cold

Almost every storage-constraint answer is one of these six moves. Learn the menu first, then spot which one each scenario is asking for.

Sample it
Statistics' answer

A representative sample carries the population's patterns at a fraction of the size — you rarely need all the data to learn from it.

Summarise it
Descriptive stats as compression

Replace raw rows with means, totals and hourly aggregates. A summary keeps the meaning and drops the bulk.

Compress & archive it
Tiered storage

Squeeze files and move cold data to cheaper, slower tiers; keep only hot, recent data on fast storage.

Process the stream
Decide at arrival

With high Velocity you can't store first and think later — analyse as data flows, keep events and exceptions, not everything.

Scale out
Warehouses & distributed storage

Spread data across many machines that grow by adding more — the data-warehouse infrastructure data mining is built on.

Delete deliberately
Retention policy

Data nobody uses is a cost, not an asset. Set a retention policy and delete on schedule — GIGO's cousin: junk kept is junk paid for.

0 of 6 storage scenarios revealed
For each one: name the constraint, then the escape.
10

"95% accurate — so why is the user still unhappy?"

A classic exam discussion question, and the answer is hiding in this chapter's own definitions: a pattern only counts if it is useful and nonobvious, and the goal of data science is better decisions — not a bigger percentage. Run the demo first; the six reasons underneath will then feel obvious.

The 95% trap — one inbox, 1,000 emails, 50 of them spam

Each square stands for 10 emails. Blue is legitimate mail, red is spam. Run two different spam filters over the same inbox and compare how the user feels — not just the score.

Legit mail, handled right Spam Spam that got through Spam caught Good mail wrongly junked
95.0%

headline accuracy

0 / 50

spam actually caught

0

good emails lost to junk

The six reasons accuracy ≠ happiness

Any two or three of these, well explained, earn full marks on this question. Learn all six and pick the ones that fit the scenario you're given.

1 · The imbalance trick

95% can mean doing literally nothing.

Accuracy counts every case equally. When 95% of the data belongs to one class (not-spam, no-fraud, healthy), a model that always predicts that class scores 95% while learning nothing at all — exactly what Filter A did above.

Exam phrasing: accuracy is misleading on imbalanced data. Always ask: "95% of what — and what is the base rate?"

2 · The errors aren't equal

The wrong 5% can be the only 5% that matters.

The model is perfect on the easy, harmless majority and wrong on the rare cases the user actually cares about: the fraud that slipped through, the cancer that was missed, the spam still flooding the inbox. One expensive miss outweighs hundreds of cheap correct calls.

Exam phrasing: judge a model by the cost of its errors, not just the count of them.

3 · Accurate but obvious

It breaks the chapter's own rule for patterns.

A pattern counts only if it is useful AND nonobvious. A model that learns "most emails aren't spam" or "umbrella sales rise when it rains" can be highly accurate while telling the user nothing they didn't already know — no insight, no value. Hamming: insight, not numbers.

Exam phrasing: high accuracy on a trivial or already-known pattern is not a data-science success.

4 · No decision changed

A score is not an outcome.

The goal of data science is improved decision-making. If the model's output never reaches the Actions layer of the pyramid — no process changes, no one acts differently — the user receives a number, not a benefit, however accurate it is.

Exam phrasing: value is only harvested at the Actions layer; accuracy stops at Predictions.

5 · Test data ≠ the real world

The 95% was measured in the lab.

The score usually comes from clean, historical test data. Live data is messier — missing values, new behaviour, shifting patterns — so real-world accuracy drops, sometimes sharply. The user judges the model on the live version, not the lab report. That's GIGO working in reverse.

Exam phrasing: accuracy on test data overstates performance on unseen, real data.

6 · The average hides people

95% overall can be 60% for someone.

One headline number averages over everyone. The model might be near-perfect for most users and terrible for one group — a region, a language, a customer type. That group's users experience a broken product, and their unhappiness is correct, not irrational.

Exam phrasing: always check accuracy per group, not only in aggregate.

How to answer this in the exam — a model answer

"Accuracy alone does not measure value. First, if the data is imbalanced — say 95% of cases in one class — a model can reach 95% by always predicting that class, learning nothing useful or nonobvious. Second, errors are not equal: the missed 5% are usually the costly cases (fraud, disease, spam), so the user's actual problem remains unsolved. Third, the goal of data science is improved decision-making — a model creates value only when it changes an action. Finally, the 95% is measured on test data; on messy real-world data, performance is lower. A model should therefore be judged by the value of what it gets right and the cost of what it gets wrong, not by accuracy alone."

11

Calculation lab — practise with live tools

Don't just read the formulas — move the sliders and type your own numbers until the method is automatic. These are the three calculation types this chapter can produce.

Weighted course grade

Assignments & quizzes 40% · Midterm 30% · Final 30%. Drag each score and watch the weighted total build up segment by segment.

Grade = 0.40 × A + 0.30 × M + 0.30 × F
85
70
90
Assignments × 0.40 Midterm × 0.30 Final × 0.30
82.0weighted final grade

Mean & range

The two descriptive statistics named in this chapter. Type any list of numbers, separated by commas.

Mean = Σx ÷ n   ·   Range = max − min
⚠ Slide typo alert: the grading slide prints the weights as "40, 30%, 40%" — that adds up to 110%, which can't be right. The sensible split (and the one used above) is 40 / 30 / 30. If a calculation question uses odd weights, follow whatever the professor stated verbally in class.

Worked example — data volume (the third calculation type)

Rate: 5 EB per 2 days→ per day: 5 ÷ 2 = 2.5 EB→ 30 days: 2.5 × 30= 75 exabytes

Method: always convert to a per-day rate first, then multiply by the period asked. The same pattern answers "per week" (×7 = 17.5 EB) or "per year" (×365 ≈ 912 EB).

12

The Python toolbox — which library, when?

Scenario questions love this set: they describe a job ("draw a histogram in two lines of code") and you name the library. Learn each one by its job, not its name.

NumPy
High-performance arrays

The numerical foundation — fast multi-dimensional arrays that almost everything else is built on.

SciPy
Scientific computing

Builds on top of NumPy — optimisation, integration, and scientific algorithms.

Pandas
Dataframes

Advanced 2D data structures (rows × columns) for cleaning and wrangling tabular data.

Matplotlib
Highly customisable plots

The original plotting library — full control over every pixel of a chart.

Seaborn
Minimal-code charts

Attractive statistical plots — e.g. a histogram in minimal code, built on Matplotlib.

StatsModels
Statistical model estimation

Fitting and testing statistical models — regression, hypothesis tests, formal inference.

13

Rapid fire — quotes, stages & course rules

The short-answer material that doesn't fit anywhere else: two quotable lines, the five stages where humans stay in charge, and the lab rules that could appear as easy-mark questions.

"The purpose of computing is insight, not numbers."

— Richard Hamming, 1962 · Why we analyse at all: charts and totals are means, insight is the end.

"A data scientist is a statistician who works at a startup — who knows more statistics than a computer scientist and more computer science than a statistician."

— The classic job description · The role sits exactly between the two disciplines.

Machines dig, humans frame — the 5 oversight stages

Algorithms do the heavy lifting, but a human stays responsible at every one of these checkpoints:

STAGE 1

Frame the problem

Decide what question is actually worth answering.

STAGE 2

Design & prepare data

Choose, gather and clean the data the model will learn from.

STAGE 3

Select algorithms

Pick the method that fits the problem and the data.

STAGE 4

Interpret results

Critically judge whether the output makes sense.

STAGE 5

Plan actions

Turn findings into decisions — the top of both pyramids.

Last-check questions

What is KDD?
Knowledge Discovery in Databases — the overall process of extracting useful knowledge from data, of which data mining is the pattern-extraction step.
What does GIGO warn about?
Garbage In, Garbage Out — flawed input data produces flawed output, no matter how good the algorithm is. It's the argument for spending time on data preparation (Stage 2 above).
Classification vs prediction — what's the actual difference?
Classification is the set of rules that assigns items to categories (an email containing "make money easily" → spam). Prediction is the act of identifying those rules. And the trap: "prediction" here does not mean forecasting the future — it means predicting a missing attribute value (the spam flag is simply on or off).
What are the lab / team rules for this course?
You work with one lab partner as a single team — both members receive the same score, partners cannot be changed, and each person still submits a 1-page individual postmortem report on the work.
Why does data science spend so much effort on "unstructured" data?
Because most real-world data (text, images, posts, audio) doesn't arrive in neat database tables. Capturing, cleaning and transforming it is where analysts spend roughly 80% of their time — before any actual analysis begins.