Maths to data science and AI: a practical learning route
Start with a question you can measure, then build the mathematical tools needed to explain a model. These seven stages connect existing Library chapters with original introductory exercises and public further reading. You do not need to begin with a neural network.
Starting knowledge: fractions, percentages and basic arithmetic. Learn algebra before calculus; use vectors, derivatives and probability before optimisation and neural models. Python is optional for the paper exercises; the Python Foundations pack supports later coding practice.
What this route provides: a prerequisite sequence, seven original worked practice checkpoints and links to deeper teaching. It is not a complete mathematics degree, machine-learning course, credential or claim of mastery. Each checkpoint can take about 20–40 minutes after the relevant reading; the linked subjects require substantially more study. All numbers and scenarios below are invented.
1. Model, observe and describe
Goal: turn a real question into quantities, units, assumptions and a checkable relationship. A model leaves things out deliberately; its usefulness depends on what question it is meant to answer. Record one row per defined observation, keep missing values distinct from zero and label chart axes and denominators.
Use algebra to express relationships and functions to map inputs to outputs. A straight-line cost model can separate a fixed setup cost from cost per item. Trigonometry relates angles and lengths: for a right triangle, sine, cosine and tangent connect side ratios to an angle. These are preparation for geometry and periodic models, not a reason to fit a cycle to every time series.
Reuse Library teaching: statistics and measurement, exploratory data analysis and visualisation and BI. These chapters already develop observation units and interpretation; this route adds a bridge to mathematical modelling.
Practice 1: a bounded cost model
A hypothetical workshop costs 120 units to prepare and 8 units per participant. Write C(n), calculate the cost for 10 participants and the average cost per participant, then find the largest whole-number attendance within a 300-unit budget. State two assumptions. Separately, for a right triangle with legs 3 and 4, find the hypotenuse and the sine of the angle opposite the side of length 3.
Worked answer and feedback
C(n) = 120 + 8n. At n = 10, total cost is 200 and average cost is 20. The budget gives n ≤ (300 − 120)/8 = 22.5, so at most 22 whole participants: C(22) = 296, while C(23) = 304. This assumes the fixed cost and per-participant rate stay constant; it says nothing about room capacity or staffing. For the triangle, the hypotenuse is √(3² + 4²) = 5 and the requested sine is 3/5. A plausible-looking number without units or a capacity caveat is not a complete decision.
Next reading: OpenStax Algebra and Trigonometry 2e. Work through functions and trigonometry before advanced stages.
Optional practice: When does a cache pay for itself?
A fictional study-guide site serves 1,000 page requests. Without a cache each request takes 120 milliseconds (ms) and costs ₹0.05 at the server that holds the original page. Of these requests, 800 are for stable public pages that can use the cache. A cache hit costs nothing at the origin and takes 20 ms. An eligible miss still costs ₹0.05 at the origin and takes 140 ms, including the cache check. The remaining 200 requests bypass the cache and keep their original 120 ms and ₹0.05 cost. The cache service adds ₹20 for these 1,000 requests. Treat these as fixed example inputs, not provider prices.
- With 600 hits, find the hit rate among eligible requests, the mean time across all requests, and the total cost.
- How many hits are needed to break even on cost? With only 320 hits, is it still faster on average, and does it still save money?
- If a timetable changes that morning, should its notice stay eligible under a policy meant for stable pages?
Show the worked cache answer
600 hits: The eligible hit rate is 600 ÷ 800 = 75%. The weighted mean is (600 × 20 + 200 × 140 + 200 × 120) ÷ 1,000 = 64 ms, down from 120 ms. Cost is ₹20 + 400 × ₹0.05 = ₹40, down from ₹50 without caching.
Cost break-even: Each hit avoids ₹0.05 of origin cost. The ₹20 cache fee needs 20 ÷ 0.05 = 400 hits, or 50% of eligible requests. At 320 hits, the mean is (320 × 20 + 480 × 140 + 200 × 120) ÷ 1,000 = 97.6 ms, but cost is ₹20 + 680 × ₹0.05 = ₹54. It is faster and ₹4 more expensive.
Freshness: Under a policy for stable pages, keep frequently corrected notices out unless there is a verified way to serve the latest update when needed. Neither the average response time nor total cost tells you whether readers saw the newest timetable or how long the slowest requests took.
2. Functions, change and accumulation
Prerequisite: stage 1 algebra and functions. Goal: distinguish a value, a rate of change and an accumulated quantity. A limit describes behaviour as an input approaches a point. A derivative gives local change per unit of input; a definite integral accumulates signed contributions over an interval. A differential equation relates a changing quantity to its rate of change and needs suitable initial or boundary information.
For s(t) = t², the difference quotient at t is ((t + h)² − t²)/h = 2t + h for h ≠ 0. Its limit as h approaches zero is 2t. This connects algebra to the derivative rather than presenting a rule to memorise. Elementary linear systems also belong here; stage 4 develops them further.
Practice 2: distinguish rate, total and state
Let s(t) = t² metres for t seconds. Find its instantaneous rate at t = 3. A separate process adds material at r(t) = 2t kilograms per hour for 0 ≤ t ≤ 3 hours: find the accumulated mass. Finally, check whether y(t) = 5e−t satisfies dy/dt = −y and y(0) = 5. Time for this last model is dimensionless.
Worked answer and feedback
The derivative s′(t) = 2t gives 6 metres per second at t = 3. The integral of 2t from 0 to 3 is [t²]₀³ = 9 kilograms. These are different quantities with different units. For the last model, y′(t) = −5e−t = −y(t), and y(0) = 5, so both the equation and the initial condition hold. This verifies one proposed solution; it does not teach every differential-equation method or establish a model for a real process.
Next reading: OpenStax Calculus Volume 1 for functions, limits, derivatives and integration; Volume 2: differential equations for a subsequent course of study. The current Library subject map is a discovery aid, not a substitute for these foundations.
3. Discrete structures and reasoning
Prerequisite: algebra and clear definitions; calculus is not required to start this branch. Goal: reason about objects, rules and finite possibilities. Study sets and relations, logical implication, counting and proof before using graphs to represent connections. Number theory studies properties of integers. A group is a set with an associative operation, an identity and an inverse for each element, closed under that operation; the word does not merely mean a collection of items.
Reuse Library teaching: sets, logic, counting and proof, algorithmic thinking and data structures and graphs. Groups and deeper number theory remain further study, not completed coverage because they appear in this route.
Practice 3: a relation and a modular check
Task A must finish before B and C, and both B and C must finish before D. Draw the directed graph and list its valid task orders when each task is performed once. Then use addition modulo 5 to find the inverse of 3 and explain why the integers 0 through 4 are closed under this operation.
Worked answer and feedback
The edges are A→B, A→C, B→D and C→D. The two valid orders are A, B, C, D and A, C, B, D. The graph describes precedence, not durations or resource capacity. Modulo 5, 3 + 2 ≡ 0, so 2 is the additive inverse of 3. Every integer sum has a remainder in {0,1,2,3,4}, establishing closure. Zero is the identity, and associativity is inherited from integer addition modulo 5. Finding one inverse alone is not a proof of all group axioms; verify the inverse for each element.
Next reading: MIT OCW Mathematics for Computer Science; MIT OCW Modern Algebra for later proof-based algebra. That course lists multivariable calculus as a prerequisite; do not treat it as an immediate beginner continuation.
4. Linear algebra and optimisation for data science
Prerequisite: linear equations and functions; derivatives for the optimisation exercise. Goal: connect data representations to systems, geometry and loss functions. A vector records ordered components; a matrix represents a linear transformation or a collection of observations. A vector space has addition and scalar multiplication satisfying specific rules. Solving Ax = b is different from choosing an approximate solution when an exact one is unavailable.
A nonzero eigenvector is mapped to a scalar multiple of itself; the scalar is its eigenvalue. A negative eigenvalue reverses direction, while zero maps the vector to zero. Matrix decompositions expose useful structure: QR separates orthogonal directions and triangular coefficients; singular value decomposition writes A = UΣVT for a real matrix. Eigenvalues and singular values are not interchangeable in general. Optimisation chooses parameters according to a stated objective and constraints; a small training loss does not establish useful predictions.
Practice 4: solve, transform, then improve a loss
Solve x + y = 7 and 2x + y = 10. For A = diag(2,1), apply A to v = (1,0) and identify the corresponding eigenvalue. For L(w) = (w − 3)², start at w = 0 and take one gradient step with learning rate 0.1. Compare the old and new loss.
Worked answer and feedback
Subtracting the equations gives x = 3, then y = 4; substitution checks both equations. Av = (2,0) = 2v, so this nonzero vector has eigenvalue 2. The gradient is L′(w) = 2(w − 3); at zero it is −6. The update is w = 0 − 0.1(−6) = 0.6. Loss falls from 9 to (0.6 − 3)² = 5.76. One successful step on a convex one-variable example does not establish convergence for an arbitrary objective. Try learning rate 1.1: the next w is 6.6 and loss is 12.96, showing why step size matters.
Next reading: MIT OCW Linear Algebra and the linear algebra, eigendecomposition and optimisation chapters in Dive into Deep Learning. These are deeper resources; this checkpoint is not a full decomposition or optimisation course.
Optional companion reading: Public lesson: gradient descent and neural-network foundations. For loss (w − 2)², take one gradient step from w = 0 with learning rate 0.1. Compare the old and new losses. Hosted notebooks may have separate access limits; this exercise needs none.
5. Probability and statistics for data science
Prerequisite: proportions, functions and stage 1 observation rules. Goal: separate variation in observations from uncertainty in an estimate. Study probability rules, random variables and distributions, then sampling distributions and estimation. EDA helps reveal missingness, unusual observations and structure before a test is chosen. A significance test assesses evidence under a specified model; it does not report the probability that a hypothesis is true or replace effect size and study design.
Reuse Library teaching: probability and Bayes, descriptive and inferential statistics, EDA and regression and study design.
Practice 5: variability is not bias
Under an invented model of four independent trials, each with success probability 1/2, calculate the probability of exactly three successes. In a separate mean-estimation problem, assume independent observations from a population with standard deviation 6. Compare the standard error for samples of 9 and 36. Can the larger sample repair a systematically excluded customer group?
Worked answer and feedback
There are C(4,3) = 4 equally likely success-position patterns; each has probability (1/2)⁴ = 1/16. The requested probability is 1/4. The mean's standard error is σ/√n under the stated model: 6/3 = 2 for n = 9 and 6/6 = 1 for n = 36. Quadrupling sample size halves this standard error, but does not remove selection bias. The independence and fixed-probability assumptions are essential, not conclusions drawn from the calculation.
Next reading: OpenStax Introductory Statistics 2e. Use its probability, sampling and inference chapters alongside the Library's worked interpretations.
6. From features to evaluated machine-learning models
Prerequisite: stages 1, 4 and 5; comfortable data handling before implementation. Goal: state the prediction problem, build a defensible baseline and compare models without leaking future information. Learn feature engineering, linear methods, kernel methods, trees and unsupervised methods as different tools, not a leaderboard of sophistication. A valid kernel supplies a similarity corresponding to an inner product in a feature space; it does not remove the need for validation. Clustering has no supplied class labels and its groups need interpretation.
For historical context, compare how linear models, trees, representation learning and available computing changed what could be attempted. The linked readings provide context; this page does not claim a complete historical timeline. Reuse problem framing, splits and metrics and ML evaluation before adding model complexity.
Practice 6: baseline and information timing
A held-out set contains 20 positives and 80 negatives. An always-negative classifier gets how many answers right, and what positive-class recall? A second classifier has TP = 12, FP = 8, FN = 8 and TN = 72. Calculate its accuracy, precision and recall. Could a “refund approved next week” field be used to predict which request will need a refund today?
Worked answer and feedback
The baseline is correct on 80 of 100 cases: 80% accuracy, but recall is 0/20 = 0. The second model has 84% accuracy, precision 12/(12 + 8) = 60% and recall 12/(12 + 8) = 60%. These invented counts do not establish a statistically reliable improvement or acceptable real-world costs. A future approval field is unavailable at today's prediction time and would leak information. Fit preprocessing only on training data, preserve a time-appropriate evaluation split and inspect errors before recommending a model.
Next reading: the authors' Introduction to Statistical Learning site offers book downloads and covers regression, classification, trees, support vector machines and unsupervised learning. Its labs are further practice, not code executed by this page.
7. Neural representations and next questions
Prerequisite: matrix operations, derivatives, probability and sound ML evaluation. Goal: trace a simple neural computation and choose a task-specific evaluation plan. Neural layers combine weighted inputs and nonlinear transformations; training adjusts parameters using a loss and gradients. Depth alone is neither a guarantee of quality nor a reason to deploy a model.
Explore neural-network history and representation learning, then vision, text and speech as different data and evaluation problems. Recommenders require attention to what was exposed and what feedback was observed. Deep reinforcement learning concerns sequential actions, rewards and an environment; ordinary held-out classification accuracy is not its entire evaluation. These specialisms remain advanced follow-on study, not completed labs here. Start with Library's deep-learning bridge, AI foundations and evaluation.
Practice 7: trace a neuron before discussing a network
Take x = (2,1), weights w = (0.5,−1) and bias b = 0.5. Compute z = w·x + b and ReLU(z) = max(0,z). Repeat after changing only the second input to 3. Then choose one evaluation risk for a vision model, a speech system or a recommender.
Worked answer and feedback
Initially z = 0.5×2 − 1×1 + 0.5 = 0.5, so ReLU(z) = 0.5. After the change, z = 1 − 3 + 0.5 = −1.5 and ReLU(z) = 0. This is a forward calculation with fixed weights, not a trained deep network. Relevant risks include performance under different lighting for vision, accents or background noise for speech, and exposure bias for recommendation. State a target population, meaningful error measure and a test set that can expose the chosen risk; a plausible example alone does not establish safety or fairness.
Next reading: Dive into Deep Learning provides public chapters on neural models, optimisation, vision, sequences, attention and recommendation. Use its chapter list to choose a bounded next topic; software versions, installation and compute requirements need separate checks before running examples.
For deep reinforcement learning, the Hugging Face course introduction is public reading. It reports low maintenance, a non-functional AI-vs-AI feature and an inactive leaderboard. Hands-on work can require accounts and external compute; this route neither starts those services nor verifies present certificate fulfilment.
Make the route your own
Keep a notebook with the question, assumptions, calculation, alternative explanation and next check for each stage. Explain one answer without looking, then change a number or assumption and predict what will happen. Return to the relevant foundation when a later calculation becomes opaque. This is the same continuous learning, recursive iteration and continuous improvement approach used on the landing page.
No answers are collected or automatically graded here. No code, external model, paid service or account connection is required for the authored exercises. Use fictional data and keep private records out of external tools.
Sources and scope
Public reading pages were checked on 29 October 2026. Links are to the publishers, course owners or authors; access to the linked reading does not imply enrolment, tutoring, assessment, a certificate or affiliation. Examples and explanations on this route are original Library teaching. No lecture slide, branding, source illustration, problem set or answer key is reproduced.
The route adds introductory practice where a discovery label alone was insufficient. It deliberately reuses existing statistics, probability, discrete-maths and evaluation chapters. Completing seven checkpoints is evidence of those checks only, not coverage of every listed specialist topic.
Explore the subject map · Practise programming separately · Find another Library reading