The AI Search Handbook
A complete, self-contained guide to generative engine optimisation: how AI search retrieves, chunks, evaluates and cites information, and how to become a source an AI answer names.
The same complete foundation in math & logic, with every idea bridged to Python
The complete Math & Logic Essentials foundation with a “From Concept to Code” Python section in every chapter and a final hands-on Python part, so each idea runs as real code the moment you understand it.
Free download. No payment, no sign-up. Anyone who wants the maths and logic behind programming, and to write Python while learning it.
Math & Logic Essentials for Programming is the same complete foundation as Math & Logic Essentials, from arithmetic and logic to calculus and number bases, with every idea bridged to Python.
Every chapter ends with a “From Concept to Code” section that writes the idea as Python you can run yourself, and a final part takes you from the REPL and print() through variables, conditionals, loops, functions and collections to small working programs.
From Chapter 1 · Order of Operations · From Concept to Code (Python)
Python obeys the exact same order of operations – it is built into the language as operator precedence. Type math straight into Python and it evaluates powers (**) first, then * / // %, then + -, left to right, with parentheses overriding everything.
print(3 + 4 * 2) # multiply first
print((3 + 4) * 2) # parentheses force the add first
print(5 + 2 ** 3 * (7 - 3))11
14
37Try it: (1) Predict, then run: print(20 / 4 * 2). Why is it 10.0 and not 2.5? (2) Use parentheses to make 2 + 3 * 4 equal 20 instead of 14.
Yes. The complete 698-page PDF is free to download. There is no payment, sign-up or email address required.
Anyone who wants the maths and logic behind programming, and to write Python while learning it.
The complete Math & Logic Essentials foundation with a “From Concept to Code” Python section in every chapter and a final hands-on Python part, so each idea runs as real code the moment you understand it.
One PDF of 698 pages (9.6 MB) with 73 chapters.
Luke McLaughlin, an AI marketing and search specialist in Munich with more than ten years in B2B marketing. His profile and CV are on the author page.
A complete, self-contained guide to generative engine optimisation: how AI search retrieves, chunks, evaluates and cites information, and how to become a source an AI answer names.
Sixteen chapters from NumPy and data preparation through classical machine learning, neural networks and PyTorch to NLP, embeddings, transformers, RAG and MLOps — every project with runnable code and its exact output.
A hands-on course in fourteen chapters. Each project is a small Python audit tool that crawls, parses and checks a site the way a search engine does — ending with GEO, AEO and an end-to-end technical audit.
An illustrated learning path for marketers who want to understand the instructions and build something useful: 52 chapters across ten parts, with a companion pack of runnable exercises and solutions.
Sixty-four chapters that build mathematics and logic from the ground up: arithmetic, algebra, truth tables and Boolean logic, trigonometry, geometry, calculus and number bases, each with worked examples, mental-math shortcuts, common mistakes and a quiz.