In this book, we explore the probabilistic approach to cognitive science, which models learning and reasoning as inference in complex probabilistic models. In particular, we examine how a broad range of empirical phenomena in cognitive science (including intuitive physics, concept learning, causal reasoning, social cognition, and language understanding) can be modeled using a functional probabilistic programming language called Church.


  1. Index
  2. Introduction
  3. Generative models
  4. Conditioning
  5. Patterns of inference
  6. Models for sequences of observations
  7. Inference about inference
  8. Algorithms for inference
  9. Learning as conditional inference
  10. Hierarchical models
  11. Occam's Razor
  12. Mixture models
  13. Non-parametric models
  14. Appendix: Scheme basics
  15. Appendix: Models of language
  16. Appendix: Conjugate models and exponential families
  17. Church Reference


How to use

Best viewed in recent versions of Chrome or Safari on a laptop or desktop computer.

This book contains many exercises where you will write and run Church code directly in the browser. At the end of some chapters, we present extended exercises as homework problems; to save your progress on homework problems, you can register an account. Registering an account also helps us improve the book by tracking what kinds of programs users run and what kinds of errors they encounter.

How to cite

Please cite this book as: N. D. Goodman and J. B. Tenenbaum (electronic). Probabilistic Models of Cognition. Retrieved <Date> from

How to help

Send any errors to

This book is open source. We use Github to host the repositories for the book content, the accounts infrastructure, and the WebChurch engine, which supports running Church programs in the browser. We welcome issues and pull requests.


We are grateful to the following people, who contributed content or technical expertise: Timothy J. O’Donnell, Andreas Stuhlmuller, Tomer Ullman, John McCoy, Long Ouyang, Julius Cheng.

The construction and ongoing support of this tutorial are made possible by grants from the Office of Naval Research, the James S. McDonnell Foundation, the Stanford VPOL, and the Center for Brains, Minds, and Machines (funded by NSF STC award CCF-1231216).