What is in the frontier after A* expands its third node? Which branches does alpha-beta prune, and why? How far does each centroid move in the second round of k-means? What happens to every weight of a neural network after the first epoch of backpropagation? Artificial Intelligence, Iteration by Iteration answers these questions with real numbers. Every algorithm in this 800-page guide is demonstrated step by step for several iterations, on inputs small enough to follow with a pencil, before the book zooms out to show how it behaves at scale and how to use it with today's libraries.
Inside you will find:
41 chapters in 10 parts, from the foundations of AI and the mathematics behind it to search, dynamic programming, divide-and-conquer, alpha-beta pruning, constraint satisfaction, propositional and first-order logic, Bayesian networks, genetic programming and particle swarm optimization.
The complete classical machine-learning toolkit: linear, ridge, lasso, ElasticNet, kernel ridge, isotonic and Gaussian-process regression; logistic regression and SGD; naive Bayes; support vector machines; nearest neighbors; clustering and PCA; decision trees, random forests, extra trees, isolation forests, AdaBoost, GBDT, XGBoost, LightGBM, CatBoost, histogram boosting and stacking.
Deep learning from the ground up: perceptrons, backpropagation with every number shown, optimizers such as Adam traced step by step, CNNs, RNNs, LSTMs and GRUs, attention and transformers computed by hand, large language models, VAEs, GANs, diffusion models and reinforcement learning.
The library ecosystem: scikit-learn, SciPy, TensorFlow, Keras, PyTorch, NLTK, FANN, OpenNN and Shogun.
Real-world AI: computer vision, natural language processing, financial trading, recommendation systems, and responsible AI, fairness, explainability and regulation.
519 figures, including diagrams, Graphviz trees and three-dimensional WebGL renderings; 432 tables of computed traces; and 146 code listings, every one executed so that the output you read is the output you will see.
Current to October 2026, with summaries and exercises at the end of every chapter.
Written for students, developers, data scientists, engineers and curious professionals who can read basic Python, this book develops all the mathematics it needs with worked examples rather than abstract proofs.
Don't just learn what AI algorithms do. Watch them think.
Chong Lip Phang is a seasoned web and mobile app developer who has been writing computing books since 2013.