Skip to main content



Pascal's Wager (Solved)

Created: 2024-Jan-22

Fair warining: this post pokes a bit of (reasonably inoffensive) religious fun. If your relationship to your religion doesn’t allow a bit of humor, feel free to skip this post.


An Agnostic Author

As with many people, my current relationship to religion has not been a straightforward path. Because of this, the multitude of ways in which atheists and agnostics interact with religious culture interests me. I have changed my own interactions with religion over the years, starting with a strict Orthodox Christian upbringing, predictably devolving with teen angst into rebellious atheism, and in adulthood mellowing out into various flavours of agnosticism.

I like to cheekily tell my parents that I would love to avoid thinking about religion at all, but their early religious indoctrination efforts mean that I can’t be rid of religion fully and can only hope to balance out the dogma of one religion by learning more about the others. While saying that is mostly a joke, the grain of truth is that these days I do give religion fair consideration, with most of it coming from a place of cultural curiosity. Even if God is empirically unprovable, organized religion has driven so much of history and is still such a large part of modern culture that it can only benefit individuals to understand it.

And, while I’m thinking about it, I might as well cheekily solve the vexxing questions with a little bit of code.

The Wager

The summary can be found on Wikipedia: Pascal’s Wager.

If you’re already familiar with it and interested, I found the original text (or at least an english translation of the original French), which is a selection within Pascal’s Pensées (search for “233” or “wager” and you should easily find the relevant selection).

As an aside, one thing that I find interesting when comparing these sources is that Wikipedia makes reference not only to the inifinite gain of heaven, but the infinite punishment of hell, whereas the original text makes no mention of hell. Since I’m reading a translation rather than the original text, I don’t feel confident enough to revise the Wikipedia page, but it seems likely that a secondary source is projecting onto the original its own concept of hell. Some would argue hell is implied by heaven in the original text, but my anecdotal experience is that Christians do not have a ubiquitous recognition and understanding of hell, especially when comparing different sects of Christianity. With this in mind, I think the most reasonable possibility is that the Wikipedia article’s mishandling of the source material is inadvertent, but I also find fascinating the possibility that some folks might be so invested in the thought of hell as negative reinforcement that they might choose to project hell onto sources that don’t discuss it on their own.

Anyways, I digress.

The Solution

class Person {
    private $isGodReal;

    public function __construct( Callable $isGodReal = null ) {
        if($isGodReal === null) {
            $isGodReal = function() {
                throw new DeferralException(
                    'Means of proof resolution missing. Defer.'

        $this->isGodReal = $isGodReal;

    public function hasBeliefInGod(): bool {
        return $this->isGodReal();

The Explanation

This little bit of code was inspired by my unit test mocks and dependency injection, and by functional programming concepts. What it achieves within the scope of Pascal’s Wager is that it directly ties belief in God to God’s existence. No matter how it resolves, nothing is risked, and using functional programming techniques, we conveniently encapsulate the proof of God as the responsibility of an external entity. We only provide a fallback, and we only do so in the case that there is no black box proof provided, but that part isn’t very important. The important part is that for something that’s unknowable and outside our control, we’ve represented its unknowability, and can operate no matter how it resolves.