Part I: Foundations of Discovery AI
Chapter 2: Scientific Discovery and Knowledge Creation

Scientific Discovery and Knowledge Creation

"I have spent centuries watching hypotheses come and go. The ones that survive are never the cleverest; they are the ones that had the decency to be testable."

A Hypothesis That Refused to Be Falsified

Overview

Before we can build machines that discover, we need to understand what discovery means in practice. This chapter traces the logic of scientific inquiry from observation through theory revision, formalizes belief updating with Bayesian probability, confronts the reproducibility crisis that threatens modern science, and closes with a hands-on recipe for comparing competing hypotheses computationally. By the end you will have both the conceptual vocabulary and the working code to evaluate scientific claims the way a careful researcher would.

Chapter 1 introduced discovery as search through a space of possible explanations. This chapter sharpens that idea: scientific discovery is search guided by evidence, constrained by falsifiability, and quantified by probability. The scientific method is the oldest and most successful algorithm for navigating explanation space, and Bayesian inference is its mathematical backbone. Understanding both is essential before we formalize knowledge representation in Chapter 3 or build reasoning engines in Chapter 4.

Prerequisites

This chapter assumes comfort with basic probability (conditional probability, Bayes' rule at the formula level) and Python fluency (functions, NumPy arrays, matplotlib). If you need a refresher on probability notation, Appendix A has you covered. You should have read Chapter 1 for the "discovery as search" framing that this chapter builds on.

What You Will Learn

Sections

2.1 The Scientific Method Revisited

Observation, hypothesis, prediction, experiment, revision. Falsification and Popper. Why the scientific method is both humanity's greatest algorithm and frustratingly hard to automate.

2.2 Bayesian Science

Prior beliefs, evidence, posteriors. Posterior predictive checking. Model comparison via Bayes factors. Conjugate priors and the likelihood ratio test. Calibration and expected calibration error.

2.3 Reproducibility and Measurement

The replication crisis, measurement uncertainty, construct validity. Statistical power, p-hacking, and the garden of forking paths. Computational tools for reproducible science.

2.4 Building a Bayesian Hypothesis Tester

Recipe: a complete Bayesian hypothesis comparison notebook with PyMC, ArviZ, and Bayes factors. From data loading through model specification, sampling, diagnostics, and interpretation.

What's Next

With the scientific method and Bayesian reasoning in hand, Chapter 3: Knowledge Representation asks the next natural question: how do we encode the knowledge that scientific discovery produces? You will meet ontologies, knowledge graphs, embeddings, and the data structures that let machines reason about what science has found. The Bayesian updating machinery from Section 2.2 will reappear in Chapter 32 at full scale, and the reproducibility concerns from Section 2.3 will shape the experiment registries of Chapter 47.

Bibliography

Foundational Works

Popper, K. (1959). The Logic of Scientific Discovery. Routledge.

The classic statement of falsificationism. Popper argues that science progresses not by confirming theories but by attempting to refute them. Essential background for understanding why hypothesis testing is structured the way it is.

Kuhn, T. (1962). The Structure of Scientific Revolutions. University of Chicago Press.

Introduced "paradigm shifts" and challenged the idea of purely cumulative scientific progress. Section 2.1 draws on Kuhn's observation that normal science and revolutionary science require different computational strategies.

Jaynes, E. T. (2003). Probability Theory: The Logic of Science. Cambridge University Press.

The definitive argument for probability as an extension of logic. Chapters 1 through 4 provide the philosophical grounding for the Bayesian approach used throughout this book.

Bayesian Methods

Martin, O. A. (2024). Bayesian Analysis with Python, 3rd ed. Packt.

A practical guide to Bayesian modeling with PyMC. The code in Section 2.4 follows conventions from this text. Excellent companion for readers who want more depth on ArviZ diagnostics.

Salvatier, J., Wiecki, T. V., & Fonnesbeck, C. (2016). Probabilistic programming in Python using PyMC3. PeerJ Computer Science, 2, e55.

The foundational paper for PyMC. Describes the NUTS sampler and the model specification API that Section 2.4 uses directly.

Reproducibility

Open Science Collaboration. (2015). Estimating the reproducibility of psychological science. Science, 349(6251), aac4716.

The landmark study that attempted to replicate 100 psychology experiments and found that fewer than 40% replicated. Section 2.3 uses this as its central case study.

Camerer, C. F. et al. (2018). Evaluating the replicability of social science experiments in Nature and Science. Nature Human Behaviour, 2, 637-644.

Extended the replication crisis to high-profile social science, finding roughly 60% replication success. Useful for calibrating how severe the problem is.

Tools and Libraries

PyMC Development Team. (2024). PyMC: Bayesian Modeling and Probabilistic Programming in Python.

The primary tool used in the hands-on recipe. Modern PyMC (v5+) uses PyTensor as its backend and provides state-of-the-art MCMC and variational inference.

Kumar, R. et al. (2019). ArviZ: a unified library for exploratory analysis of Bayesian models. JOSS, 4(33), 1143.

The visualization and diagnostics library for Bayesian inference. ArviZ provides trace plots, posterior predictive checks, WAIC, LOO, and the comparison plots used in Section 2.4.

Gelman, A. et al. (2017). The prior can often only be understood in the context of the likelihood. Entropy, 19(10), 555.

Practical guidance on prior selection. Argues that priors should be evaluated by their implied predictions, which is exactly what posterior predictive checking does.