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.

How to use

Best viewed in Chrome/Safari on a laptop/desktop (smartphone/tablet not recommended).

This book contains exercises where you write and run Church code directly in the browser. To save your progress on these exercises, you can register an account. Registering also helps us improve the book by tracking what kinds of programs users run and what kinds of errors they encounter.

How to cite

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. See Github for the book content, the accounts infrastructure, and the webchurch engine, which runs Church code 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).