Bayes' rule: Proportional form

[summary:  Suppose that Professor Plum and Miss Scarlet are two suspects in a murder, and that we start out thinking that Professor Plum is twice as likely to have committed the murder as Miss Scarlet.  We then discover that the victim was poisoned.  We think that Professor Plum is around one-fourth as likely to use poison as Miss Scarlet.  Then after observing the victim was poisoned, we should think Plum is around half as likely to have committed the murder as Scarlet: $2 	imes \dfrac{1}{4} = \dfrac{1}{2}.$  This reasoning is valid by [1lz Bayes' rule].]

If $H_i$ and $H_j$ are hypotheses and $e$ is a piece of evidence, [1lz Bayes' rule] states:

$$\dfrac{\mathbb P(H_i)}{\mathbb P(H_j)} 	imes  \dfrac{\mathbb P(e\mid H_i)}{\mathbb P(e\mid H_j)} = \dfrac{\mathbb P(H_i\mid e)}{\mathbb P(H_j\mid e)}$$

%%if-after([55z]):
In the [22s Diseasitis problem], we use this form of Bayes' rule to justify calculating the posterior odds of sickness via the calculation $(1 : 4) 	imes (3 : 1) = (3 : 4).$
%%

%%!if-after([55z]):
In the [22s Diseasitis problem], 20% of the patients in a screening population have Diseasitis, 90% of sick patients will turn a chemical strip black, and 30% of healthy patients will turn a chemical strip black.  We can use the form of Bayes' rule above to justify solving this problem via the calculation $(1 : 4) 	imes (3 : 1) = (3 : 4).$
%%

If instead of treating the ratios as odds, we actually calculate out the numbers for each term of the equation, we instead get the calculation $rac{1}{4} 	imes rac{3}{1} = rac{3}{4},$ or $0.25 	imes 3 = 0.75.$

If we try to directly interpret this, it says: "If a patient starts out 0.25 times as likely to be sick as healthy, and we see a test result that is 3 times as likely to occur if the patient is sick as if the patient is healthy, we conclude the patient is 0.75 times as likely to be sick as healthy."

This is valid reasoning, and we call it the *proportional* form of Bayes' rule.  To get the probability back out, we reason that if there's 0.75 sick patients to every 1 healthy patient in a bag, the bag comprises 0.75/(0.75 + 1) = 3/7 = 43% sick patients.

# Spotlight visualization

One way of looking at this result is that, since odds ratios are equivalent under multiplication by a positive constant, we can fix the right side of the odds ratio as equaling 1 and ask about what's on the left side.  This is what we do when seeing the calculation as $(0.25 : 1) \cdot (3 : 1) = (0.75 : 1),$ the form suggested by the theorem proved above.

We could visualize Bayes' rule as a pair of spotlights with different starting intensities, that go through lenses that amplify or reduce each incoming unit of light by a fixed multiplier.  In the [22s Diseasitis] case, if we fix the right-side blue beam as having a starting intensity of 1 and a multiplying lens of 1, and we fix the left-side beam of having a starting intensity of 0.25 and a multiplying lens of 3x, then the result gives us a visualization of the calculation prescribed by Bayes' rule:

![bayes lights](https://i.imgur.com/BIgoE87.png?0)

Note the similarity to a [1wy waterfall diagram].  The main thing the spotlight visualization adds is that we can imagine varying the absolute intensities of the lights and lenses, while preserving their relative intensities, in such a way as to make the right-side beams and lenses equal 1.

[fixme: draw the pre-proportional, odds form of the spotlight visualization.]

%todo: add example problem in proportional/spotlight form%

# Usefulness in informal argument

The proportional form of Bayes' rule is perhaps the fastest way of describing Bayesian reasoning that sounds like it ought to be true.  If you were having a fictional character suddenly give a Bayesian argument in the middle of a story being read by many people who'd never heard of Bayes' rule, you might have them [say](http://hpmor.com/chapter/86):

> "Suppose the Dark Mark is certain to continue while the Dark Lord's sentience lives on, but a priori we'd only have guessed a twenty percent chance of the Dark Mark continuing to exist after the Dark Lord dies. Then the observation, "The Dark Mark has not faded" is five times as likely to occur in worlds where the Dark Lord is alive as in worlds where the Dark Lord is dead. Is that really commensurate with the prior improbability of immortality? Let's say the prior odds were a hundred-to-one against the Dark Lord surviving. If a hypothesis is a hundred times as likely to be false versus true, and then you see evidence five times more likely if the hypothesis is true versus false, you should update to believing the hypothesis is twenty times as likely to be false as true."

Similarly, if you were a doctor trying to explain the meaning of a positive test result to a patient, you might say:  "If we haven't seen any test results, patients like you are a thousand times as likely to be healthy as sick.  This test is only a hundred times as likely to be positive for sick as for healthy patients.  So now we think you're ten times as likely to be healthy as sick, which is still a pretty good chance!"

[1wy Visual diagrams] and special notation for [1x5 odds] and [1rq relative likelihoods] might make Bayes' rule more intuitive, but the proportional form is probably the most valid-*sounding* thing that *is* quantitatively correct that you can say in three sentences.

[fixme: write a from-scratch Standalone Intro of the proportional form of Bayes' rule in particular, using the Diseasitis example and going from frequency diagram to waterfall to spotlight, with no proofs, just to justify the proportional form.  add to Main a statement that if you can phrase things in proportional form, there exists a Standalone Intro that justifies it quickly.]


Bayes' rule: Guide

Bayes' rule or Bayes' theorem is the law of probability governing *the strength of evidence* - the rule saying *how much* to revise our probabilities (change our minds) when we learn a new fact or observe new evidence.

You may want to learn about Bayes' rule if you are:

- A professional who uses statistics, such as a scientist or doctor;
- A computer programmer working in machine learning;
- A human being.

As Philip Tetlock found when studying "superforecasters", people who were especially good at predicting future events:

> The superforecasters are a numerate bunch: many know about Bayes' theorem and could deploy it if they felt it was worth the trouble. But they rarely crunch the numbers so explicitly. What matters far more to the superforecasters than Bayes' theorem is Bayes' core insight of gradually getting closer to the truth by constantly updating in proportion to the weight of the evidence.

— Philip Tetlock and Dan Gardner, [https://en.wikipedia.org/wiki/Superforecasting _Superforecasting_]

## Learning Bayes' rule

This guide to Bayes' rule uses Arbital's technology to allow for multiple flavors of introduction. They vary by technical level, speed, and topics covered. After you pick your path, remember that you can still switch between pages, in particular by using the "Say what?" and "Go faster" buttons.

[multiple-choice(q_wants_angles): Which case fits you best?
a: I want to have a basic theoretical and practical understanding of the Bayes' rule.
-wants: [62d],[62f]
b: I can easily read algebra and don't mind the explanation moving at a fast pace. Just give me the basics, quick!
wants: [62d]
-wants: [62f]
c: I want the basics, but I'm also interested in reading more about the theoretical implications and the reasons why Bayes' rule is considered so important.
wants: [62f]
-wants: [62d]
d: I'd like to read everything! I want to have a *deep* theoretical and practical understanding of the Bayes' rule.
wants: [62d],[62f]
]

%%%wants-requisite([62d]):
%%wants-requisite([62f]):
%box:
*Your path will go over all forms of Baye's Rule, along with developing deep appreciation for its scientific usefulness. Your path will contain 12 pages:*

 * *Frequency diagrams: A first look at Bayes*
 * *Waterfall diagrams and relative odds*
 * *Introduction to Bayes' rule: Odds form*
 * *Bayes' rule: Proportional form*
 * *Extraordinary claims require extraordinary evidence*
 * *Ordinary claims require ordinary evidence*
 * *Bayes' rule: Log-odds form*
 * *Shift towards the hypothesis of least surprise*
 * *Bayes' rule: Vector form*
 * *Belief revision as probability elimination*
 * *Bayes' rule: Probability form*
 * *Bayesian view of scientific virtues*
%

%start-path([61b])%
%%
%%!wants-requisite([62f]):
%box:
No time to waste! Let's plunge directly into [693 a single-page abbreviated introduction to Bayes' rule].
%
%%
%%%

%%%!wants-requisite([62d]):
%%wants-requisite([62f]):
%box:
*Your path will teach you the basic odds form of Bayes' rule at a reasonable pace and then delve into the deep mysteries of the Bayes' Rule! Your path will contain 8 pages:*

* *Frequency diagrams: A first look at Bayes*
* *Waterfall diagrams and relative odds*
* *Introduction to Bayes' rule: Odds form*
* *Belief revision as probability elimination*
* *Extraordinary claims require extraordinary evidence*
* *Ordinary claims require ordinary evidence*
* *Shift towards the hypothesis of least surprise*
* *Bayesian view of scientific virtues*
%

%start-path([62f])%
%%

%%!wants-requisite([62f]):
%box:
*Your path will teach you the basic odds form of Bayes' rule at a reasonable pace. It will contain 3 pages:*

* *Frequency diagrams: A first look at Bayes*
* *Waterfall diagrams and relative odds*
* *Introduction to Bayes' rule: Odds form*
%

%start-path([62c])%
%%
%%%


Path: Multiple angles on Bayes's Rule

[summary:  A page with all the details of Bayes' rule as requisites, to help autogenerate a sequence that includes all the requisites.]

[todo: Remove req on proof of Bayes' rule, it's a hack b/c the pathfinding system is currently not working super well.]

Congratulations!  You've now learned multiple angles and approaches to Bayes' rule.  Please continue on to the next step of this path!


Ignorance prior

An ignorance prior is a a [1rm prior] [1zj probability function] on some problem of interest, usually with the intended properties of being simple to describe and facilitating good learning from the evidence.  A classic example would be the [21b inductive prior] for [21c Laplace's Rule of Succession].


Inductive prior

An "inductive prior" is a state of belief, before seeing any evidence, which is conducive to learning when the evidence finally appears.  A classic example would be observing a coin come up heads or tails many times.  If the coin is biased to come up heads 1/4 of the time, the inductive prior from [21c Laplace's Rule of Succession] will start predicting future flips to come up tails with 3/4 probability.  The [ maximum entropy prior] for the coin, which says that every coinflip has a 50% chance of coming up heads and that all sequences of heads and tails are equally probable, will never start to predict that the next flip will be heads, even after observing the coin come up heads thirty times in a row.

The prior in [11w] is another example of an inductive prior - far more powerful, far more complicated, and [1mk entirely unimplementable on physically possible hardware].


Laplace's Rule of Succession

[summary:  Suppose you roll an initial billiards ball on a billiards table, letting it bounce off the left and right sides until it comes to a halt.  You mark down where the billiard ball halted.  You then roll additional billiards, and [1ly observe] that M come to rest to the left of the original billiard, and N halt to the right of the original billiard.  If this is all someone knows, what probability should they assign that the next billiard comes to halt on the left, or the right?  Laplace's Rule of succession says that the [1rb odds] are (M + 1) : (N + 1) for left vs. right.  If we flip a coin with an unknown bias and observe 2 heads and 7 tails, our probability of getting heads next time is (2 + 1)/(2 + 7 + 2) = 3/11.  On the very first flip, it's 1 : 1 or 1/2.]

# Theorem and proof

Suppose a sequence $X_1, \dots, X_n$ of binary values (0 or 1), e.g., a potentially non-fair coin which comes up heads or tails on each flip.

Laplace's Rule of succession says that if:

- 1.  We think each coinflip $X_i$ has an independent, unknown likelihood $f$ of coming up heads, and
- 2.  We think that all values of $f$ between 0 and 1 have equal probability density *a priori*...

Then, after observing $M$ heads and $N$ tails, the expected probability of heads on the next coinflip is:

$\dfrac{M + 1}{M + N + 2}$

Proof:

For a hypothetical value of $f$, each coinflip observed has a [1rq likelihood] of $f$ if heads or $1 - f$ if tails.

The [1rm prior] is uniform between 0 and 1, so a prior density of 1 everywhere.

By [1zj Bayes's Rule], after seeing M heads and N tails, the [1rp posterior] probability density over $f$ is *proportional* to $1 \cdot f^M(1 - f)^N.$

Then the [1rk normalizing constant] is:  $\int_0^1 f^M(1 - f)^N \operatorname{d}\!f = rac{M!N!}{(M + N + 1)!}.$

So the posterior probability density function is $f^M(1 - f)^N rac{(M + N + 1)!}{M!N!}.$

Integrating this function, times $f,$ from 0 to 1, will yield the marginal probability of getting heads on the next flip.

The answer is thus:

$\dfrac{(M+1)!N!}{(M + N + 2)!} \cdot \dfrac{(M + N + 1)!}{M!N!} = \dfrac{M + 1}{M + N + 2}.$

# Simpler proof by combinatorics

Although Laplace's Rule of Succession was originally proved (by Thomas Bayes) by finding the posterior probability density and integrating, and the proof of Laplace's Rule illustrates the core idea of an [21b inductive prior] in Bayesianism, a simpler intuition for the proof also exists.

Consider the problem originally posed by Thomas Bayes:  An initial billiard is rolled back and forth between the left and right edges of an ideal billiards table until friction brings it to a halt.  We then roll M + N additional billiard balls, and observe that M halt to the left of the initial billiard, and N halt to the right of it.  If this is all we know, what is the probability the next ball halts on the left, or right?

Suppose that we rolled a total of 5 additional billiards, and 2 halted to the left of the original, and 3 halted to the right.  Then, using **|** to symbolize the initial billiard, the billiards would have come to rest in the order:

- **LL|RRR**

Suppose we now roll a new billiard, symbolized by **+**, until it comes to a halt.  It's equally likely to appear at:

- **+LL|RRR**
- **L+L|RRR**
- **LL+|RRR**
- **LL|+RRR**
- **LL|R+RR**
- **LL|RR+R**
- **LL|RRR+**

This means there are 3 ways the ball could be ordered on the left of the **|**, and 4 ways it could be ordered on the right.  Since all left-to-right orderings of 7 randomly rolled billiard balls are equally likely a priori, we assign 3/7 probability that the ball comes to a rest on the left of the original ball's position.

See also the [Wikipedia page](https://en.wikipedia.org/wiki/Rule_of_succession).

# Use and abuse

Laplace's Rule of Succession assumes that all prior values of the frequency $f$ are undistinguished *a priori* in our subjective knowledge.

For example, Laplace used the rule to estimate a probability of the sun rising tomorrow, given that it had risen every day for the past 5000 years, and arrived at odds of around <PHONE>:1.  But today when we have physical knowledge of the Sun's operation, not every possible 'rate at which the Sun rises each day' is undistinguished.  Furthermore, even in Laplace's time, he should have perhaps thought it especially likely a priori that "the Sun always rises" and "the Sun never rises" were distinguished as unusually likely frequencies of the Sun rising, a priori.

The Rule of Succession follows from assuming approximate ignorance about prior frequencies.  It does not, of itself, justify this assumption. Variations of the rule of succession are obtainable by taking different priors, corresponding to different views of what should count as uninformative. See discussion on the Wikipedia page on [non-informative priors](https://www.wikipedia.com/en/Prior_probability#/Uninformative_priors). For example if starting with the Jeffreys' prior, then after observing $M$ heads and $N$ tails, the expected probability of heads on the next coinflip is:

$\dfrac{M + \dfrac{1}{2}}{M + N + 1}$

# Nomenclature

Laplace's Rule of Succession was the famous problem proved by Thomas Bayes in "An Essay towards solving a Problem in the Doctrine of Chances", read to the Royal Society in 1763, after Bayes's death.  Pierre-Simon Laplace, the first systematizer of what we now know as Bayesian reasoning, was so impressed by this theorem that he named the central theorem of his new discipline after Thomas Bayes.  The original theorem proven by Bayes was popularized by Laplace in arguments about the problem of induction, and so became known as Laplace's Rule of Succession.


Extraordinary claims require extraordinary evidence

[1lz Bayes' rule] tells us how strong a piece of evidence has to be in order to support a given hypothesis.  This lets us see whether a piece of evidence is sufficient, or insufficient, to drive the probability of a hypothesis to over 50%.

For example, consider the [559 sparking widgets] problem:

> 10% of widgets are bad and 90% are good. 4% of good widgets emit sparks, and 12% of bad widgets emit sparks. Can you calculate in your head what percentage of sparking widgets are bad?

The prior odds are 1 : 9 for bad widgets vs. good widgets.

12% of bad widgets and 4% of good widgets emit sparks, so that's a likelihood ratio of 3 : 1 for sparking (bad widgets are three times as likely to emit sparks).

$(1 : 9 ) 	imes (3 : 1)  \ = \ (3 : 9) \ \cong \ (1 : 3)$ posterior odds for bad vs. good sparking widgets.  So 1/4 of sparking widgets are bad.

Bad widgets started out relatively rare:  1 in 10.  We applied a test — looking for sparks — that was only 3 times more likely to identify bad widgets as opposed to good ones. *The evidence was weaker than the prior improbability of the claim.*

This doesn't mean we toss out the evidence and ignore it.  It does mean that, after updating on the observation of sparkiness, we only gave 25% posterior probability to the widget being bad — the probability didn't go over 50%.

What would need to change to drive the probability of widget badness to over 50%?  We would need evidence with a more extreme likelihood ratio, more extreme than the (9 : 1) prior odds.  For example, if instead bad widgets were 50% likely to spark and good widgets were 5% likely to spark, the posterior odds would go to (10 : 9) or 53%.

In other words:  For a previously implausible proposition $X$ to end up with a high posterior probability, the likelihood ratio for the new evidence favoring $X$ over its alternatives, needs to be *more extreme* than the prior odds against $X.$

This is the quantitative argument behind the qualitative statement that "extraordinary claims require extraordinary evidence" (a claim popularized by Carl Sagan, which dates back to at least Pierre-Simon Laplace).

That is: an "[26y extraordinary claim]" is one with a low [1rm prior probability] in advance of considering the evidence, and "extraordinary evidence" is evidence with an extreme [1rq likelihood ratio] favoring the claim over its alternatives.

# What makes evidence extraordinary?

The likelihood ratio is defined as:

$$	ext{Likelihood ratio} = \dfrac{	ext{Probability of seeing the evidence, assuming the claim is true}}{	ext{Probability of seeing the evidence, assuming the claim is false}}$$

To obtain an extreme likelihood ratio, the bottom of the fraction has to be very low.  The top of the fraction being very high doesn't help much.  If the top of the fraction is 99% and the bottom is 70%, that's still not a very extreme ratio, and it doesn't help much if the top is 99.9999% instead.

So to get extremely strong evidence, we need to see an observation which is very _improbable,_ given "business as usual," but fairly likely according to the extraordinary claim. This observation would be deserving of the title, "extraordinary evidence".

# Example of an extraordinary claim and ordinary evidence: Bookcase aliens.

Consider the following hypothesis:  What if there are Bookcase Aliens who teleport into our houses at night and drop off bookcases?

Bob offers the following evidence for this claim:  "Last week, I visited my friend's house, and there was a new bookcase there. If there were no bookcase aliens, I wouldn't have expected that my friend would get a new bookcase. But if there are Bookcase Aliens, then the probability of my finding a new bookcase there was much higher. Therefore, my observation, 'There is a new bookcase in my friend's house,' is strong evidence supporting the existence of Bookcase Aliens."

In an intuitive sense, we have a notion that Bob's evidence "There is a new bookcase in my friend's house" is not as extraordinary as the claim "There are bookcase aliens" - that the evidence fails to lift the claim.  Bayes's Rule makes this statement precise.

Bob is, in fact, correct that his observation, "There's a new bookcase in my friend's house", is indeed evidence favoring the Bookcase Aliens.  Depending on how long it's been since Bob last visited that house, there might ceteris paribus be, say, a 1% chance that there would be a new bookcase there.  On the other hand, the Bookcase Aliens hypothesis might assign, say, 50% probability that the Bookcase Aliens would target this particular house among others.  If so, that's a [1rq likelihood ratio] of 50:1 favoring the Bookcase Aliens hypothesis.

However, a reasonable prior on Bookcase Aliens would assign this a very *low* [1rm prior probability] given our other, previous observations of the world.  Let's be conservative and assign odds of just 1 : 1,000,000,000 against Bookcase Aliens.  Then to raise our [1rp posterior belief] in Bookcase Aliens to somewhere in the "pragmatically noticeable" range of 1 : 100, we'd need to see evidence with a cumulative likelihood ratio of 10,000,000 : 1 favoring the Bookcase Aliens.  50 : 1 won't cut it.

What would need to change for the observation "There's a new bookcase in my friend's house" to be convincing evidence of Bookcase Aliens, compared to the alternative hypothesis of "business as usual"?

As suggested by the Bayesian interpretation of [22x strength of evidence], what we need to see is an observation which is nigh-impossible if there are *not* bookcase aliens.  We would have to believe that, [1rj conditional] on "business as usual" being true, the [1rq likelihood] of seeing a bookcase was on the order of 0.<PHONE>%.  That would then take the [1rq likelihood ratio], aka strength of evidence, into the rough vicinity of a billion to one favoring Bookcase Aliens over "business as usual".

We would still need to consider whether there might be *other* alternative hypotheses besides Bookcase Aliens and "business as usual", such as a human-operated Bookcase Conspiracy.  But at least we wouldn't be dealing with an observation that was so unsurprising (conditional on business as usual) as to be unable to support *any* kind of extraordinary claim.

However, if instead we suppose that Bookcase Aliens are allegedly 99.999999% probable to add a bookcase to Bob's friend's house, very little changes - the likelihood ratio is 99.99999% : 1% or 100 : 1 instead of 50 : 1.  To obtain an extreme likelihood ratio, we mainly need a tiny denominator rather than a big numerator.  In other words, "extraordinary evidence".

# What makes claims extraordinary?

An obvious next question is what makes a claim 'extraordinary' or 'ordinary'.  This is a [26y deep separate topic], but as an example, consider the claim that the Earth is becoming warmer due to carbon dioxide being added to its atmosphere.

To evaluate the ordinariness or extraordinariness of this claim:

- We _don't_ ask whether the future consequences of this claim seem extreme or important.
- We _don't_ ask whether the policies that would be required to address the claim are very costly.
- We ask whether "carbon dioxide warms the atmosphere" or "carbon dioxide fails to warm the atmosphere" seems to conform better to the *deep, causal* generalizations we already have about carbon dioxide and heat.
- *If* we've already considered the deep causal generalizations like those, we don't ask about generalizations *causally downstream* of the deep causal ones we've already considered.  (E.g., we don't say, "But on every observed day for the last 200 years, the global temperature has stayed inside the following range; it would be 'extraordinary' to leave that range.")

These tests suggest that "Large amounts of added carbon dioxide will incrementally warm Earth's atmosphere" would have been an 'ordinary' claim in advance of trying to find any evidence for or against it - it's just how you would expect a greenhouse gas to work, more or less.  Thus, one is not entitled to demand a prediction made by this hypothesis that is wildly unlikely under any other hypothesis before believing it.

# Incremental updating

A key feature of the Bookcase Aliens example is that the followers of Bayes' rule acknowledges the observation of a new bookcase as being, locally, a single piece of evidence with a 50 : 1 likelihood ratio favoring Bookcase Aliens.  The Bayesian doesn't toss the observation out the window because it's *insufficient* evidence; it just gets accumulated into the pool.  If you visit house after house, and see new bookcase after new bookcase, the Bayesian slowly, incrementally, begins to wonder if something strange is going on, rather than dismissing each observation as 'insufficient evidence' and then forgetting it.

This stands in contrast to the instinctive way humans often behave, where, having concluded that they should not believe in Bookcase Aliens on the basis of the evidence in front of them, they discard that evidence entirely, denounce it, and say that it was never any evidence at all. (This is "[https://wiki.lesswrong.com/wiki/Arguments_as_soldiers treating arguments like soldiers]" and acting like any evidence in favor of a proposition has to be "defeated.")

The Bayesian just says "yes, that is evidence in favor of the claim, but it's not quantitatively enough evidence." This idiom also stands in contrast to the practice of treating any concession an opponent makes as a victory.  If true claims are supposed to have all their arguments upheld and false claims are supposed to have all their enemy arguments defeated, then a single undefeated claim of *support* stands as a proof of victory, no matter how strong or weak the evidence that it provides. Not so with Bayesians — a Bayesian considers the bookcase observation to be locally a piece of evidence favoring Bookcase Aliens, just massively insufficient evidence.

# Overriding evidence

If you think that a proposition has prior odds of 1 to a $10^{100}$, and then somebody presents evidence with a likelihood ratio of $10^{94}$ to one favoring the proposition, you shouldn't say, "Oh, I guess the posterior odds are 1 to a million." You should instead question whether either (a) you were wrong about the prior odds or (b) the evidence isn't as strong as you assessed.

It's not that hard to end up believing a hypothesis that had very low prior odds. For example, whenever you look at the exact pattern of 10 digits generated by a random number generator, you're coming to believe a hypothesis that had prior odds on the order of ten billion to 1 against it.

But this should only happen with _true_ hypotheses. It's much rarer to find strong support for false hypotheses. Indeed, "strong evidence" is precisely "that sort of evidence we almost *never* see, when the proposition turns out to be false".

Imagine tossing a fair coin at most 300 times, and asking how often the sequence of heads and tails that it generates along the way, ever supports the false hypothesis "this coin comes up heads 3/4ths of the time" strongly over the true hypothesis "this coin is fair". As you can verify using [https://gist.github.com/Soares/941bdb13233fd0838f1882d148c9ac14 this code], the sequence of coinflips will at some point support the false hypothesis at the 10 : 1 level on about 8% of runs; it will at some point support the false hypothesis at the 100 : 1 level on about 0.8% of runs, and it will at some point support the false hypothesis at the 1000 : 1 level on about 0.08% of runs. (Note that we are less and less likely to be more and more deceived.)

Seeing evidence with a strength of $(10^{94} : 1)$ / 94 orders of magnitude / 312 [1zh bits of evidence] supporting a false hypothesis should only happen to you, on average, once every IT DIDN'T HAPPEN.

Witnessing an observation that truly has a $10^{-94}$ probability of occurring if the hypothesis is false, in a case where the hypothesis *is in fact false,* is something that will not happen to anyone even once over the expected lifetime of this universe.

So if you think that the prior odds for a coin being unfair are $(1 : 10^{100})$ against, and then you see the coin flipped 312 times and coming up heads each time... you do not say, "Well, my new posterior odds are $(1 : 10^6)$ against the coin being unfair."  You say, "I guess I was wrong about the prior odds being that low."


Bayesian view of scientific virtues

[summary:  The classic scientific virtues of falsifiability (saying what we should *not* expect to see if a hypothesis is true), making bold experimental predictions (that aren't predicted by other theories), and precision (making narrow predictions about quantitative measurements) can be seen in the light of [1lz Bayes' rule] as properties which allow theories to gain stronger evidence (greater [1rq likelihood ratios]) in their favor when their predictions are correct.  We can also interpret traditional ideas like falsificationism - acceptance being provisional, and rejection being more forceful - as features that arise from the probability theory of Bayes' rule.]

A number of scientific virtues are explained intuitively by Bayes' rule, including:

- __Falsifiability:__ A good scientist should say what they do *not* expect to see if a theory is true.
- __Boldness:__ A good theory makes bold experimental predictions (that we wouldn't otherwise expect)
- __Precision:__ A good theory makes precise experimental predictions (that turn out correct)
- __Falsificationism:__ Acceptance of a scientific theory is always provisional; rejection of a scientific theory is pretty permanent.
- __Experimentation:__ You find better theories by making observations, and then updating your beliefs.

# Falsifiability

"Falsifiability" means saying which events and observations should definitely *not* happen if your theory is true.

This was first popularized as a scientific virtue by Karl Popper, who wrote, in a famous critique of Freudian psychoanalysis:

> Neither Freud nor Adler excludes any particular person's acting in any particular way, whatever the outward circumstances. Whether a man sacrificed his life to rescue a drowning child (a case of sublimation) or whether he murdered the child by drowning him (a case of repression) could not possibly be predicted or excluded by Freud's theory; *the theory was compatible with everything that could happen.*

In a Bayesian sense, we can see a hypothesis's falsifiability as a requirement for obtaining strong [1rq likelihood ratios] in favor of the hypothesis, compared to, e.g., the alternative hypothesis "I don't know."

Suppose you're a very early researcher on gravitation, named Grek.  Your friend Thag is holding a rock in one hand, about to let it go.  You need to predict whether the rock will move downward to the ground, fly upward into the sky, or do something else.  That is, you must say how your theory $Grek$ assigns its probabilities over $up, down,$ and $other.$

As it happens, your friend Thag has his own theory $Thag$ which says "Rocks do what they want to do."  If Thag sees the rock go down, he'll explain this by saying the rock wanted to go down.  If Thag sees the rock go up, he'll say the rock wanted to go up.  Thag thinks that the Thag Theory of Gravitation is a very good one because it can explain any possible thing the rock is observed to do.  This makes it superior compared to a theory that could *only* explain, say, the rock falling down.

As a Bayesian, however, you realize that since $up, down,$ and $other$ are [1rd mutually exclusive and exhaustive] possibilities, and *something* must happen when Thag lets go of the rock, the [1rj conditional probabilities] $\mathbb P(\cdot\mid Thag)$ must sum to $\mathbb P(up\mid Thag) + \mathbb P(down\mid Thag) + \mathbb P(other\mid Thag) = 1.$

If Thag is "equally good at explaining" all three outcomes - if Thag's theory is equally compatible with all three events and produces equally clever explanations for each of them - then we might as well call this $1/3$ probability for each of $\mathbb P(up\mid Thag), \mathbb P(down\mid Thag),$ and $\mathbb P(other\mid Thag)$.  Note that Thag theory's is isomorphic, in a probabilistic sense, to saying "I don't know."

But now suppose Grek make falsifiable prediction!  Grek say, "Most things fall down!"

Then Grek not have all probability mass distributed equally!  Grek put 95% of probability mass in $\mathbb P(down\mid Grek)!$  Only leave 5% probability divided equally over $\mathbb P(up\mid Grek)$ and $\mathbb P(other\mid Grek)$ in case rock behave like bird.

Thag say this bad idea.  If rock go up, Grek Theory of Gravitation disconfirmed by false prediction!  Compared to Thag Theory that predicts 1/3 chance of $up,$ will be likelihood ratio of 2.5% : 33% ~ 1 : 13 against Grek Theory!  Grek embarrassed!

Grek say, she is confident rock *does* go down.  Things like bird are rare.  So Grek willing to stick out neck and face potential embarrassment.  Besides, is more important to learn about if Grek Theory is true than to save face.

Thag let go of rock.  Rock fall down.

This evidence with likelihood ratio of 0.95 : 0.33 ~ 3 : 1 favoring Grek Theory over Thag Theory.

"How you get such big likelihood ratio?" Thag demand.  "Thag never get big likelihood ratio!"

Grek explain is possible to obtain big likelihood ratio because Grek Theory stick out neck and take probability mass *away* from outcomes $up$ and $other,$ risking disconfirmation if that happen.  This free up lots of probability mass that Grek can put in outcome $down$ to make big likelihood ratio if $down$ happen.

Grek Theory win because falsifiable and make correct prediction!  If falsifiable and make wrong prediction, Grek Theory lose, but this okay because Grek Theory not Grek.

# Advance prediction

On the next experiment, Thag lets go of the rock, watches it fall down, and then says, "Thag Theory assign 100% probability to $\mathbb P(down\mid Thag)$."

Grek replies, "Grek think if Thag see rock fly up instead, Thag would've said $\mathbb P(up\mid Thag) = 1.$  Thag engage in [hindsight bias](https://en.wikipedia.org/wiki/Hindsight_bias)."

"Grek can't prove Thag biased," says Thag.  "Grek make ad hominem argument."

"New rule," says Grek.  "Everyone say probability assignment *before* thing happens.  That way, no need to argue afterwards."

Thag thinks.  "Thag say $\mathbb P(up\mid Thag) = 1$ and $\mathbb P(down\mid Thag) = 1$."

"Thag violate [probability axioms](https://en.wikipedia.org/wiki/Probability_axioms)," says Grek.  "Probability of all [1rd mutually exclusive] outcomes must sum to $1$ or less.  But good thing Thag say in advance so Grek can see problem."

"That not fair!" objects Thag.  "Should be allowed to say afterwards so nobody can tell!"

## Formality

The rule of advance prediction is much more pragmatically important for informal theories than formal ones; and for these purposes, a theory is 'formal' when the theory's predictions are produced in a sufficiently mechanical and determined way that anyone can plug the theory into a computer and get the same answer for what probability the theory assigns.

When Newton's Theory of Gravitation was proposed, it was considered not-yet-fully-proven because retrodictions such as the tides, elliptical planetary orbits, and Kepler's Laws, had all been observed *before* Newton proposed the theory.  Even so, a pragmatic Bayesian would have given Newton's theory a lot of credit for these retrodictions, because unlike, say, a psychological theory of human behavior, it was possible for *anyone* - not just Newton - to sit down with a pencil and derive exactly the same predictions from Newton's Laws.  This wouldn't completely eliminate the possibility that Newton's Theory had in some sense been overfitted to Kepler's Laws and the tides, and would then be incapable of further correct new predictions.  But it did mean that, as a formal theory, there could be less pragmatic worry that Thagton was just saying, "Oh, well, of course my theory of 'Planets go where they want' would predict elliptical orbits; elliptical orbits look nice."

## Asking a theory's adherents what the theory says.

Thag picks up another rock.  "I say in advance that Grek Theory assign 0% probability to rock going down."  Thag drops the rock.  "Thag disprove Grek Theory!"

Grek shakes her head.  "Should ask advocates of Grek Theory what Grek Theory predicts."  Grek picks up another rock.  "I say Grek Theory assign $\mathbb P(down\mid Grek) = 0.95$."

"I say Grek Theory assign $\mathbb P(down\mid Grek) = 0$," counters Thag.

"That not how science work," replies Grek.  "Thag should say what Thag's Theory says."

Thag thinks for a moment.  "Thag Theory says rock has 95% probability of going down."

"What?" says Grek.  "Thag just copying Grek Theory!  Also, Thag not say that *before* seeing rocks go down!"

Thag smiles smugly.  "Only Thag get to say what Thag Theory predict, right?"

Again for pragmatic reasons, we should *first* ask the adherents of an informal theory to say what the theory predicts (a formal theory can simply be operated by anyone, and if this is not true, we will not call the theory 'formal').

Furthermore, since you can find a fool following any cause, you should ask the smartest or most technically adept advocates of the theory.  If there's any dispute about who those are, ask separate representatives from the leading groups.  Fame is definitely not the key qualifier; you should ask Murray Gell-Mann and not Deepak Chopra about quantum mechanics, even if more people have heard of Deepak Chopra's beliefs about quantum mechanics than have heard about Murray Gell-Mann.  If you really can't tell the difference, ask them both, don't ask only Chopra and then claim that Chopra gets to be *the* representative because he is most famous.

These types of courtesy rules would not be necessary if we were dealing with a sufficiently advanced Artificial Intelligence or ideal rational agent, but it makes sense for human science where people may be motivated to falsely construe another theory's probability assignments.

This informal rule has its limits, and there may be cases where it seems really obvious that a hypothesis's predictions ought not to be what the hypothesis's adherents claim, or that the theory's adherents are just stealing the predictions of a more successful theory.  But there ought to be a *large* (if defeasible) bias in favor of letting a theory's adherents say what that theory predicts.

# Boldness

A few minutes later, Grek is picking up another rock.  "$\mathbb P(down\mid Grek) = 0.95$," says Grek.

"$\mathbb P(down\mid Thag) = 0.95$," says Thag.  "See, Thag assign high probability to outcomes observed.  Thag win yet?"

"No," says Grek.  "[1rq Likelihood ratios] 1 : 1 all time now, even if we believe Thag.  Thag's theory not pick up advantage.  Thag need to make *bold* prediction other theories not make."

Thag frowns.  "Thag say... rock will turn blue when you let go this time?  $\mathbb P(blue\mid Thag) = 0.90$."

"That very bold," Grek says.  "Grek Theory not say that (nor any other obvious 'common sense' or 'business as usual' theories).  Grek think that $\mathbb P(blue\mid
eg Thag) < 0.01$ so Thag prediction definitely has virtue of boldness.  Will be big deal if Thag prediction come true."

$\dfrac{\mathbb P(Thag\mid blue)}{\mathbb P(
eg Thag\mid blue)} > 90 \cdot \dfrac{\mathbb P(Thag)}{\mathbb P(
eg Thag)}$

"Thag win now?" Thag says.

Grek lets go of the rock.  It falls down to the ground.  It does not turn blue.

"Bold prediction not correct," Grek says.  "Thag's prediction virtuous, but not win.  Now Thag lose by 1 : 10 likelihood ratio instead.  Very science, much falsification."

"Grek lure Thag into trap!" yells Thag.

"Look," says Grek, "whole point is to set up science rules so *correct* theories can win.  If wrong theorists lose quickly by trying to be scientifically virtuous, is feature rather than bug.  But if Thag try to be good and loses, we shake hands and everyone still think well of Thag.  Is normative social ideal, anyway."

# Precision

At a somewhat later stage in the development of gravitational theory, the Aristotelian synthesis of Grek and Thag's theories, "Most things have a final destination of being at the center of the Earth, and try to approach that final destination" comes up against Galileo Galilei's "Most unsupported objects accelerate downwards, and each second of passing time the object gains another 9.8 meters per second of downward speed; don't ask me why, I'm just observing it."

"You're not just predicting that rocks are observed to move downward when dropped, are you?" says Aristotle.  "Because I'm already predicting that."

"What we're going to do next," says Galileo, "is predict *how long* it will take a bowling ball to fall from the Leaning Tower of Pisa."  Galileo takes out a pocket stopwatch.  "When my friend lets go of the ball, you hit the 'start' button, and as soon as the ball hits the ground, you hit the 'stop' button.  We're going to observe exactly what number appears on the watch."

After some further calibration to determine that Aristotle has a pretty consistent reaction time for pressing the stopwatch button if Galileo snaps his fingers, Aristotle looks up at the bowling ball being held from the Leaning Tower of Pisa.

"I think it'll take anywhere between 0 and 5 seconds inclusive," Aristotle says.  "Not sure beyond that."

"Okay," says Galileo.  "I measured this tower to be 45 meters tall.  Now, if air resistance is 0, after 3 seconds the ball should be moving downward at a speed of 9.8 * 3 = 29.4 meters per second.  That speed increases continuously over the 3 seconds, so the ball's *average* speed will have been 29.4 / 2 = 14.7 meters per second.  And if the ball moves at an average speed of 14.7 meters per second, for 3 seconds, it will travel downward 44.1 meters.  So the ball should take just a little more than 3 seconds to fall 45 meters.  Like, an additional 1/29th of a second or so."

![tower cartoon](https://i.imgur.com/kUeMG6w.png?0)

"Hm," says Aristotle.  "This pocketwatch only measures whole seconds, so your theory puts all its probability mass on 3, right?"

"Not literally *all* its probability mass," Galileo says.  "It takes you some time to press the stopwatch button once you see the ball start to fall, but it also takes you some time to press the button after you see the ball hit the ground.  Those two sources of measurement error should *mostly* cancel out, but maybe they'll happen not to on this particular occasion.  We don't have all *that* precise or well-tested an experimental setup here.  Like, if the stopwatch breaks and we observe a 0, then that will be a *defeat* for Galilean gravity, but it wouldn't imply a *final* refutation - we could get another watch and make better predictions and make up for the defeat."

"Okay, so what probabilities do you assign?" says Aristotle.  "I think my own theory is about equally good at explaining any falling time between 0 and 5 seconds."

![aristotle probability](https://i.imgur.com/LQNDTki.png?0)

Galileo ponders.  "Since we haven't tested this setup yet... I think I'll put something like 90% of my probability mass on a falling time between 3 and 4 seconds, which corresponds to an observable result of the watch showing '3'.  Maybe I'll put another 5% probability on air resistance having a bigger effect than I think it should over this distance, so between 4 and 5 seconds or an observable of '4'.  Another 4% probability on this watch being slower than I thought, so 4% for a *measured* time between 2 and 3 and an observation of '2'.  0.99% probability on the stopwatch picking this time to break and show '1' (or '0', but that we both agree shouldn't happen), and 0.01% probability on an observation of '2' which basically shouldn't happen for any reason I can think of."

![galileo probability](https://i.imgur.com/4CoLkuW.png?0)

"Well," says Aristotle, "your theory certainly has the scientific virtue of *precision,* in that, by concentrating most of its probability density on a narrow region of possible precise observations, it will gain a great likelihood advantage over *vaguer* theories like mine, which roughly say that 'things fall down' and have made 'successful predictions' each time things fall down, but which don't predict exactly how long they should take to fall.  If your prediction of '3' comes true, that'll be a 0.9 : 0.2 or 4.5 : 1 likelihood ratio favoring Galilean over Aristotelian gravity."

"Yes," says Galileo.  "Of course, it's not enough for the prediction to be precise, it also has to be correct.  If the watch shows '4' instead, that'll be a likelihood ratio of 0.05 : 0.20 or 1 : 4 against my theory.  It's better to be vague and right than to be precise and wrong."

Aristotle nods.  "Well, let's test it, then."

The bowling ball is dropped.

The stopwatch shows 3 seconds.

"So do you believe my theory yet?" says Galileo.

"Well, I believe it somewhere in the range of four and a half times as much as I did previously," says Aristotle.  "But that part where you're plugging in numbers like 9.8 and calculations like the *square* of the time strike me as kinda complicated.  Like, if I'm allowed to plug in numbers that precise, and do things like square them, there must be hundreds of different theories I could make which would be that complicated.  By the [11w quantitative form of Occam's Razor], we need to [ penalize the prior probability] of your theory for its [5v algorithmic complexity].  One observation with a likelihood ratio of 4.5 : 1 isn't enough to support all that complexity.  I'm not going to believe something that complicated because I see a stopwatch showing '3' just that one time!  I need to see more objects dropped from various different heights and verify that the times are what you say they should be.  If I say the prior complexity of your theory is, say, [1zh 20 bits], then 9 more observations like this would do it.  Of course, I expect you've already made more observations than that in private, but it only becomes part of the public knowledge of humankind after someone replicates it."

"But of course," says Galileo.  "I'd like to check your experimental setup and especially your calculations the first few times you try it, to make sure you're not measuring in feet instead of meters, or forgetting to halve the final speed to get the average speed, and so on.  It's a formal theory, but in practice I want to check to make sure you're not making a mistake in calculating it."

"Naturally," says Aristotle.  "Wow, it sure is a good thing that we're both Bayesians and we both know the governing laws of probability theory and how they motivate the informal social procedures we're following, huh?""

"Yes indeed," says Galileo.  "Otherwise we might have gotten into a heated argument that could have lasted for hours."

# Falsificationism

One of the reasons why Karl Popper was so enamored of "falsification" was the observation that falsification, in science, is more definite and final than confirmation.  A classic parable along these lines is Newtonian gravitation versus General Relativity (Einsteinian gravitation) - despite the tons and tons of experimental evidence for Newton's theory that had accumulated up to the 19th century, there was no sense in which Newtonian gravity had been *finally* verified, and in the end it was finally discarded in favor of Einsteinian gravity.  Now that Newton's gravity has been tossed on the trash-heap, though, there's no realistic probability of it *ever* coming back; the discard, unlike the adoption, is final.

Working in the days before Bayes became widely known, Popper put a *logical* interpretation on this setup.  Suppose $H
ightarrow E,$ hypothesis H logically implies that evidence E will be observed.  If instead we observe $
eg E$ we can conclude $
eg H$ by the law of the contrapositive.  On the other hand, if we observe $E,$ we can't logically conclude $H.$  So we can logically falsify a theory, but not logically verify it.

Pragmatically, this often isn't how science works.

In the nineteenth century, observed anomalies were accumulating in the observation of Uranus's orbit.  After taking into account all known influences from all other planets, Uranus still was not *exactly* where Newton's theory said it should be.  On the logical-falsification view, since Newtonian gravitation said that Uranus ought to be in a certain precise place and Uranus was not there, we ought to have become [ infinitely certain] that Newton's theory was false.  Several theorists did suggest that Newton's theory might have a small error term, and so be false in its original form.

The actual outcome was that Urbain Le Verrier and John Couch Adams independently suspected that the anomaly in Uranus's orbit could be accounted for by a previously unobserved eighth planet.  And, rather than *vaguely* say that this was their hypothesis, in a way that would just spread around the probability mass for Uranus's location and cause Newtonian mechanics to be not *too* falsified, Verrier and Adams independently went on to calculate where the eighth planet ought to be.  In 1846, Johann Galle observed Neptune, based on Le Verrier's observations - a tremendous triumph for Newtonian mechanics.

In 1859, Urbain Le Verrier recognized another problem: Mercury was not exactly where it should be.  While Newtonian gravity did predict that Mercury's orbit should precess (the point of closest approach to the Sun should itself slowly rotate around the Sun), Mercury was precessing by 38 arc-seconds per century more than it ought to be (later revised to 43).  This anomaly was harder to explain; Le Verrier thought there was [a tiny planetoid orbiting the Sun inside the orbit of Mercury](https://en.wikipedia.org/wiki/Vulcan_(hypothetical_planet)).

A bit more than half a century later, Einstein, working on the equations for General Relativity, realized that Mercury's anomalous precession was exactly explained by the equations in their simplest and most elegant form.

And that was the end of Newtonian gravitation, permanently.

If we try to take Popper's logical view of things, there's no obvious difference between the anomaly with Uranus and the anomaly with Mercury.  In both cases, the straightforward Newtonian prediction seemed to be falsified.  If Newtonian gravitation could bounce back from one logical disconfirmation, why not the other?

From a Bayesian standpoint, we can see the difference as follows:

In the case of Uranus, there was no attractive alternative to Newtonian mechanics that was making better predictions.  The current theory seemed to be [227 strictly confused] about Uranus, in the sense that the current Newtonian model was making confident predictions about Uranus that were much wronger than the theory expected to be on average.  This meant that there ought to be *some* better alternative.  It didn't say that the alternative had to be a non-Newtonian one.  The low $\mathbb P(UranusLocation\mid currentNewton)$ created a potential for some modification of the current model to make a better prediction with higher $\mathbb P(UranusLocation\mid newModel)$, but it didn't say what had to change in the new model.

Even after Neptune was observed, though, this wasn't a *final* confirmation of Newtonian mechanics.  While the new model assigned very high $\mathbb P(UranusLocation\mid Neptune \wedge Newton),$ there could, for all anyone knew, be some unknown Other theory that would assign equally high $\mathbb P(UranusLocation\mid Neptune \wedge Other).$  In this case, Newton's theory would have no likelihood advantage versus this unknown Other, so we could not say that Newton's theory of gravity had been confirmed over *every other possible* theory.

In the case of Mercury, when Einstein's formal theory came along and assigned much higher $\mathbb P(MercuryLocation\mid Einstein)$ compared to $\mathbb P(MercuryLocation\mid Newton),$ this created a huge likelihood ratio for Einstein over Newton and drove the probability of Newton's theory very low.  Even if someday some other theory turns out to be better than Einstein, to do equally well at $\mathbb P(MercuryLocation\mid Other)$ and also get even better $\mathbb P(newObservation\mid Other),$ the fact that Einstein's theory did do much better than Newton on Mercury tells us that it's *possible* for simple theories to do much better on Mercury, in a simple way, that's definitely not Newtonian.  So whatever Other theory comes along will also do better on Mercury than $\mathbb P(MercuryLocation\mid Newton)$ in a non-Newtonian fashion, and Newton will just be at a new, huge likelihood disadvantage against this Other theory.

So - from a Bayesian standpoint - after explaining Mercury's orbital precession, we can't be sure Einstein's gravitation is correct, but we *can* be sure that Newton's gravitation is wrong.

But this doesn't reflect a logical difference between falsification and verification - everything takes place inside a world of probabilities.

## Possibility of permanent confirmation

It's worth noting that although Newton's theory of gravitation was false, something *very much like it* was true.  So while the belief "Planets move *exactly* like Newton says" could only be provisionally accepted and was eventually overturned, the belief, "All the kind of planets we've seen so far, in the kind of situations we've seen so far, move *pretty much* like Newtonian gravity says" was much more strongly confirmed.

This implies that, contra Popper's rejection of the very notion of confirmation, *some* theories can be finally confirmed, beyond all reasonable doubt.  E.g., the DNA theory of biological reproduction.  No matter what we wonder about quarks, there's no plausible way we could be wrong about the existence of molecules, or about there being a double helix molecule that encodes genetic information.  It's reasonable to say that the theory of DNA has been forever confirmed beyond a reasonable doubt, and will never go on the trash-heap of science no matter what new observations may come.

This is possible because DNA is a non-fundamental theory, given in terms like "molecules" and "atoms" rather than quarks.  Even if quarks aren't exactly what we think, there will be something enough *like* quarks to underlie the objects we call protons and neutrons and the existence of atoms and molecules above that, which means the objects we call DNA will still be there in the new theory.  In other words, the biological theory of DNA has a "something *sort of like this* must be true" theory *underneath* it.  The hypothesis that what Joseph Black called 'fixed air' and we call 'carbon dioxide', is in fact made up of one carbon atom and two oxygen atoms, has been permanently confirmed in a way that Newtonian gravity was not permanently confirmed.

There's some amount of observation which would convince us that all science was a lie and there were fairies in the garden, but short of that, carbon dioxide is here to stay.

Nonetheless, in ordinary science when we're trying to figure out controversies, working to Bayes' rule implies that a virtuous scientist should think like Karl Popper suggested:

- Treat disconfirmation as stronger than confirmation;
- Only provisionally accept hypotheses that have a lot of favorable-seeming evidence;
- Have some amount of disconfirming evidence and prediction-failures that makes you permanently put a hypothesis on the trash-heap and give up hope on its resurrection;
- Require a qualitatively *more* powerful kind of evidence than that, with direct observation of the phenomenon's parts and processes in detail, before you start thinking of a theory as 'confirmed'.

# Experimentation

Whatever the likelihood for $\mathbb P(observation\mid hypothesis)$, it doesn't change your beliefs unless you actually execute the experiment, learn whether $observation$ or $
eg observation$ is true, and [1y6 condition your beliefs in order to update your probabilities].

In this sense, Bayes' rule can also be said to motivate the experimental method.  Though you don't necessarily need a lot of math to realize that drawing an accurate map of a city requires looking at the city.  Still, since the experimental method wasn't quite obvious for a lot of human history, it could maybe use all the support it can get - including the central Bayesian idea of "Make observations to update your beliefs."


Strictly confused

[summary:  A hypothesis is "strictly confused" by the data if the hypothesis does much worse at predicting the data than it expected to do.  If, on average, you expect to assign around 1% likelihood to the exact observation you see, and you actually see something to which you assigned 0.000001% likelihood, you are strictly confused.]

A hypothesis is "strictly confused" by the data if the hypothesis does much worse at predicting the data than it expected to do.  If, on average, you expect to assign around 1% likelihood to the exact observation you see, and you actually see something to which you assigned 0.000001% likelihood, you are strictly confused.

%%knows-requisite([1r6]):
I.e., letting $H$ be a hypothesis and $e_0$ be the data observed from some set $E$ of possible observations, we say that $H$ is "strictly confused" when

$$ \log \mathbb P(e_0 \mid H) \ll \sum_{e \in E} \mathbb P(e \mid H) \cdot \log \mathbb P(e \mid H)$$

%%

# Motivation and examples

In Bayesian reasoning, the main reason to reject a hypothesis is when we find a better hypothesis.  Suppose we think a coin is fair, and we flip it 100 times, and we see that the coin comes up "HHHHHHH..." or all heads.  After doing this 100 times, the hypothesis "This is a double-headed coin" has a likelihood ratio of $2^{100} : 1$ favoring it over the "fair coin" hypothesis, and the "double-headed coin" hypothesis isn't *more* improbable than $2^{-100}$ a priori.

But this relies on the insight that there's a simple / a priori plausible *alternative* hypothesis that does better.  What if the coin is producing TTHHTTHHTTHH and we just never happen to think of 'alternating pairs of tails and heads' as a hypothesis?  It's possible to do better by thinking of a better hypothesis, but so far as the 'fair coin' hypothesis sees the world, TTHHTTHH... is no more or less likely than any other possible sequence it could encounter; the first eight coinflips have a probability of $2^{-8}$ and this would have been true no matter which eight coinflips were observed.  After observing 100 coinflips, the fair coin hypothesis will assign them a collective probability of $2^{-100},$ and in this sense, no sequence of 100 coinflips is any more 'surprising' or 'confusing' than any other from *within* the perspective of the fair coin hypothesis.

We can't say that we're 'confused' or 'surprised' on seeing a long sequence of coinflips to which we assigned some very low probability on the order of $2^{-100} pprox 10^{-30},$ because we expected to assign a probability that low.

On the other hand, suppose we think that a coin is biased to produce 90% heads and 10% tails, and we flip it 100 times and get some fair-looking sequence like  "THHTTTHTTTTHTHTHHH..." (courtesy of random.org).  Then we *expected* to assign the observed sequence a probability in the range of $0.9^{90} \cdot 0.1^{10} pprox 7\cdot 10^{-15},$ but we *actually* saw a sequence we assigned probability around $0.9^{50} \cdot 0.1^{50} pprox 5 \cdot 10^{-53}.$  We don't need to consider any other hypotheses to realize that we are very confused.  We don't need to have *invented* the concept of a 'fair coin', or know that the 'fair coin' hypothesis would have assigned a much higher likelihood in the region of $7 \cdot 10^{-31},$ to realize that there's something wrong with the current hypothesis.

In the case of the supposed fair coin that produces HHHHHHH, we only do poorly relative to a better hypothesis 'all heads' that makes a superior prediction.  In the case of the supposed 90%-heads coin that produces a random-looking sequence, we do poorly than we expected to do from inside the 90%-heads hypothesis, so we are doing poorly in an absolute, non-relative sense.

Being strictly confused is a sign that tells us to look for *some* alternative hypothesis in advance of our having any idea whatsoever what that alternative hypothesis might be.

# Distinction from frequentist p-values

The classical frequentist test for rejecting the null hypothesis involves considering the probability assigned to particular 'obvious'-seeming partitions of the data, and asking if we ended up inside a low-probability partition.

Suppose you think some coin is fair, and you flip the coin 100 times and see a random-looking sequence "THHTTTHTT..."

Someone comes along and says, "You know, this result is very surprising, given your 'fair coin' theory.  You really didn't expect that to happen."

"How so?" you reply.

They say, "Well, among all sequences of 1000 coins, only 1 in 16 such sequences start with a string like THHT TTHTT, a palindromic quartet followed by a palindromic quintet.  You confidently predicted that had a 15/16 chance of *not* happening, and then you were surprised."

"Okay, look," you reply, "if you'd written down that *particular* prediction in advance and not a lot of others, I might be interested.  Like, if I'd already thought that way of partitioning the data — namely, 'palindrome quartet followed by palindrome quintet' vs. '*not* palindrome quartet followed by palindrome quintet' — was a specially interesting and distinguished one, I might notice that I'd assigned the second partition 15/16 probability and then it failed to actually happen.  As it is, it seems like you're really reaching."

We can think of the frequentist tests for rejecting the fair-coin hypothesis as a *small* set of 'interesting partitions' that were written down in advance, which are supposed to have low probability given the fair coin.  For example, if a coin produces HHHHH HTHHH HHTHH, a frequentist says, "*Partitioning by number of heads*, the fair coin hypothesis says that on 15 flips we should get between 12 and 3 heads, inclusive, with a probability of 98.6%.  You are therefore surprised because this event you assigned 98.6% probability failed to happen.  And yes, we're just checking the number of heads and a few other obvious things, not for palindromic quartets followed by palindromic quintets."

Part of the point of being a Bayesian, however, is that we try to only reason on the data we actually observed, and not put that data into particular partitions and reason about those partitions.  The partitioning process introduces potential subjectivity, especially in an academic setting fraught with powerful incentives to produce 'statistically significant' data - the equivalent of somebody insisting that palindromic quartets and quintets are special, or that counting heads isn't special.

E.g., if we flip a coin six times and get HHHHHT, this is "statistically significant p < 0.05" if the researcher decided to flip coins until they got at least one T and then stop, in which case a fair coin has only a 1/32 probability of requiring six or more steps to produce a T.  If on the other hand the researcher decided to flip the coin six times and then count the number of tails, the probability of getting 1 or fewer T in six flips is 7/64 which is not 'statistically significant'.

The Bayesian says, "If I use [21c the Rule of Succession] to denote the hypothesis that the coin has an unknown bias between 0 and 1, then the sequence HHHHHT is assigned 1/30 probability by the Rule of Succession  and 1/64 probability by 'fair coin', so this is evidence with a likelihood ratio of ~ 2 : 1 favoring the hypothesis that the coin is biased - not enough to [ overcome] any significant [ prior improbability]."

The Bayesian arrives at this judgment by only considering the particular, exact data that was observed, and not any larger partitions of data.  To compute the probability flow between two hypotheses $H_1$ and $H_2$ we only need to know the likelihoods of our *exact* observation given those two hypotheses, not the likelihoods the hypotheses assign to any partitions into which that observation can be put, etcetera.

Similarly, the Bayesian looks at the sequence HHHHH HTHHH HHTHH and says: this specific, exact data that we observed gives us a likelihood ratio of (1/1680 : 1/32768) ~ (19.5 : 1) favoring "[21c The coin has an unknown bias] between 0 and 1" over "The coin is fair".  With that already said, the Bayesian doesn't see any need to talk about the total probability of the fair coin hypothesis producing data inside a partition of similar results that could have been observed but weren't.

But even though Bayesians usually try avoid thinking in terms of rejecting a null hypothesis using partitions, saying "I'm strictly confused!" gives a Bayesian a way of saying "Well, I know *something's* wrong..." that doesn't require already having the insight to propose a better alternative, or even the insight to realize that some particular partitioning of the data is worth special attention.


Diseasitis

[summary:  A nurse is screening a set of patients for an illness, Diseasitis, using a tongue depressor that tends to turn black in the presence of the disease.

- On average, around 20% of the patients in a population like this one will actually have Diseasitis.  (20% prior prevalence.)
- Among the patients with Diseasitis, 90% turn the tongue depressor black.  (90% true positives.)
- 30% of patients without Diseasitis also turn the tongue depressor black.  (30% false positives.)

The probability that a patient with a blackened tongue depressor has Diseasitis can be found using [693 Bayes' rule].]

A nurse is screening a student population for a certain illness, Diseasitis (lit. "inflammation of the disease").

- Based on prior epidemiological studies, you expect that around 20% of the students in a screening population like this one will actually have Diseasitis.

You are testing for the presence of the disease using a color-changing tongue depressor with a sensitive chemical strip.

- Among students with Diseasitis, 90% turn the tongue depressor black.
- 30% of the students without Diseasitis will also turn the tongue depressor black.

One of your students comes into the office, takes your test, and turns the tongue depressor black.

Given only that information, what is the probability that they have Diseasitis?

This problem is used as a central example in several introductions to Bayes's Rule, including all paths in the [1zq Arbital Guide to Bayes' Rule] and the [693 High-Speed Intro to Bayes' Rule].  A simple, unnecessarily difficult calculation of the answer can be found in [55z].


Just a requisite

A tag which indicates that a page is mainly meant to serve as an anonymous requisite inside Arbital's requisite system.


Introductory Bayesian problems

Introductory problems:

1. [22s]
2. [55b]
3. [559]
4. [54v]

(Hover or click to read them.)


Strength of Bayesian evidence

From a Bayesian standpoint, the strength of evidence can be identified with its [1rq relative likelihood].  See the [1zh log odds form of Bayes' rule] for a representation which makes this unusually clear.


Path: Insights from Bayesian updating

[summary:  A small page that collects the currently explained list of Bayesian insights as requisites, to help Arbital auto-generate a learning path that includes all those requisites.]

You've finished reading our current collection of Bayesian insights!  There aren't many here yet, but there might be more later.  Please continue on to the next part of this path!


Finishing your Bayesian path on Arbital

[todo: This is currently marking "Bayes' rule: proof" as a requisite. It shouldn't. It should just mark "technical understanding of Bayes' rule" as a requisite, and arbital should figure out that it needs to work a proof in there.]

You've now reached the end of whatever you asked the [1zq Bayes' rule guide] to explain to you!

If you'd like to join in and help create more math content like this, we'd [4d6 love to have you]!

%%!knows-requisite([25y]): If you'd like to keep reading about Bayesian reasoning here on Arbital, there's a couple of less polished pages on real-world insights derived from Bayes' rule — [https://arbital.com/learn/?path=bayes_update_details,bayes_guide_end click here to start on a path to learn them].%%

You might also be interested in reading [58p this explanation of Arbital's goals.]

Thank you!


Extraordinary claims

[summary:  To determine whether something is an 'extraordinary claim', for purposes of deciding whether it [21v requires extraordinary evidence], we consider / don't consider these factors:

- Do consider:  Whether the claim requires lots of complexity that isn't already implied by other evidence.
- Don't consider:  Whether the claim has future consequences that are extreme or important-sounding.
- Don't consider:  Whether the claim's truth would imply that we ought to do costly or painful things.
- Do consider:  Whether the claim violates low-level or causal generalizations.
- Don't consider:  Whether the claim, if locally true, would imply downstream effects that violate high-level or surface generalizations.

We don't automatically *believe* claims that pass such tests; we just consider them as ordinary claims which we'd believe on obtaining ordinary evidence.]

# Summary

What makes something count as an 'extraordinary claim' for the purposes of determining whether it [21v requires extraordinary evidence]?

Broadly speaking:

- Not-yet-supported complexity or precise details; by [occams_razor Occam's Razor], this requires added support from the evidence.
- Violation of (deep, causal) generalizations; behaving in a way that's out of character for (the lowest level of) the universe.

Some properties that do *not* make a claim inherently 'extraordinary' in the above sense:

- Having future consequences that are important, or extreme-sounding, or that would imply we need to take costly policies.
- Whether few or many people already believe it.
- Whether there might be bad reasons to believe it.

The ultimate grounding for the notion of 'extraordinary claim' would come from [11w Solomonoff induction], or some generalization of Solomonoff induction to handle more [-naturalistic] reasoning about the world.  Since this page is a [4v Work In Progress], it currently only lists out the derived heuristics, rather than trying to explain in any great detail how those heuristics might follow from Solomonoff-style reasoning.

# Example 1: Anthropogenic global warming

Consider the idea of [anthropogenic global warming](https://en.wikipedia.org/wiki/Global_warming) as it might have been analyzed in *advance* of observing the actual temperature record.  Would the claim, "Adding lots of carbon dioxide to the atmosphere will result in increased global temperatures and climate change", be an 'extraordinary' claim requiring extraordinary evidence to verify, or an ordinary claim not requiring particularly strong evidence?  We assume in this case you can do all the physics reasoning or ecological reasoning you want, but you can't actually look at the temperature record yet.

The core argument (in *advance* of looking at the temperature record) will be:  "Carbon dioxide is a greenhouse gas, so adding sufficient amounts of it to the atmosphere ought to trap more heat, which ought to raise the equilibrium temperature of the Earth."

To evaluate the ordinariness or extraordinariness of this claim:

We *don't* ask whether the future consequences of the claim are extreme or important.  Suppose that adding carbon dioxide actually did trap more heat; would the Standard Model of physics think to itself, "Uh oh, that has some extreme consequences" and decide to let the heat radiate away anyway?  Obviously not; the laws of physics have no privileged tendency to avoid consequences that are, on a human scale, very important in a positive or negative direction.

We *don't* ask whether the policies required to address the claim are very costly - this isn't something that would prevent the causal mechanisms behind the claim from operating, and more generally, reality doesn't try to avoid inconveniencing us, so it doesn't affect the prior probability we assign to a claim in advance of seeing any evidence.

We *don't* ask whether someone has a motive to lie to us about the claim, or if they might be inclined to believe it for crazy reasons.  If someone has a motive to lie to us about the evidence, this affects the strength of evidence, rather than lowering the [1rm prior probability].  Suppose somebody said, "Hey, I own an apartment in New York, and I'll rent it to you for $2000/month."  They might be lying and trying to trick you out of the money, but this doesn't mean "I own an apartment in New York" is an extraordinary claim.  Lots of people own apartments in New York.  It happens all the time, even.  The monetary stake means that the person might have a motive to lie to you, but this affects the likelihood ratio, not the prior odds.  If we're just considering their unsupported word, the probability that they'll say "I own an apartment in New York", given that they *don't* own an apartment in New York, might be unusually high because they could be trying to run a rent scam.  But this doesn't mean we have to call in physicists to check out whether the apartment is really there - we just need stronger, but ordinary, evidence.  Similarly, even if there was someone tempted to lie about global warming, we'd consider this as a potential weakness of the evidence they offer us, but not a weakness in the prior probability of the proposition "Adding carbon dioxide to the atmosphere heats it up."

(Similarly, wanting strong evidence about a subject doesn't always coincide with the underlying claim being improbable.  Maybe you're considering *buying* a house in San Francisco, and *millions* of dollars are at stake.  This implies a high [value_of_information value of information] and you might want to invest in extra-strong evidence like having a third party check the title to the house.  But this isn't because it's a Lovecraftian anomaly for anyone to own a house in San Francisco.  The money at stake just means that we're willing to pay more to eliminate small residues of improbability from this very ordinary claim.)

We *do* ask whether "adding carbon dioxide warms the atmosphere" or "carbon dioxide doesn't warm the atmosphere" seems more consonant with the previously observed behavior of carbon dioxide.

After we finish figuring out how carbon dioxide molecules and infrared photons usually behave, we *don't* give priority to generalizations like, "For as long as we've observed it, the average summer temperature in Freedonia has never gone over 30C."  It's true that the predicted consequences of carbon dioxide behaving like it usually does, are violating another generalization about how Freedonia usually behaves.  But we generally give priority to *deeper* generalizations continuing, i.e., generalizations that are *lower-level* or *closer to the start of causal chains.*

- The behavior of carbon dioxide is lower-level - it's generalizing over a class of molecules that we can observe in very great detail and make very precise generalizations about.  The weight of a carbon dioxide molecule (with the standard isotopes in both cases), or the amount of infrared light the corresponding gas allows to pass, is something that varies much less than the summer temperature in Freedonia - it's a very precise, very strong generalization.
- The behavior of carbon dioxide is closer to the start of the chain of cause and effect.  The summer temperature in Freedonia is something that's caused by, or happens as a result of, a particular level of carbon dioxide in Freedonia's atmosphere.  We'd expect changes that happened toward the start of the causal chain to produce changes in the effects at the end of the causal chain.  Conversely, it would be very surprising if the Freedonia-surface-temperature generalization can reach back and force carbon dioxide to have a different permeability to infrared.

We *don't* consider whether lots of prestigious scientists believe in global warming.  If you expect that lots of prestigious scientists usually won't believe in a proposition like global warming in worlds where global warming is false, then observing an apparent scientific consensus might be moderately strong *evidence* favoring the claim.  But that isn't part of the *prior probability* before seeing any evidence.  For that, we want to ask about how complicated the claim is, and whether it violates or obeys generalizations we already know about.

Another way of looking at a test of extraordinariness is to ask whether the claim's truth or falsity would imply learning more about the universe that we didn't already know.  If you'd never observed the temperature record, and had only guessed *a priori* that adding carbon dioxide would warm the atmosphere, you wouldn't be too surprised to go look at the temperature record and find that nothing seemed to be happening.  In this case, rather than imagining that you were wrong about the behavior of infrared light, you might suspect, for example, that plants were growing more and absorbing the carbon dioxide, keeping the total atmospheric level in equilibrium.  But in this case you would have learned *a new fact not already known to you (or science)* which explained why global temperatures were not rising.  So to expect that outcome in *advance* would be a more extraordinary claim than to not expect it.  If we can imagine some not-too-implausible ways that a claim could be wrong, but they'd all require us to postulate new facts we don't solidly know, then this doesn't make the original claim 'extraordinary'.  It's still a very ordinary claim that we'd start believing in after seeing an ordinary amount of evidence.


Prior

Our (potentially rich or complex) state of knowledge and *propensity to learn,* before seeing the evidence, expressed as a [1zj probability function].  This is a deeper and more general concept than '[-1rm]'.  A prior probability is like guessing the chance that it will be cloudy outside, in advance of looking out a window.  The more general notion of a Bayesian prior would include probability distributions that answered the question, "*Suppose* I saw the Sun rising on 999 successive days; would I afterwards think the probability of the Sun rising on the next day was more like 1000/1001, 1/2, or 1 - 10^-6?"  In a sense, a baby can be said to have a 'prior' before it opens its eyes, and then to develop a model of the world by updating on the evidence it sees after that point.  The baby's 'prior' expresses not just its current ignorance, but the different kinds of worlds the baby would end up believing in, depending on what sensory evidence they saw over the rest of their lives.  Key subconcepts include [219 ignorance priors] and [21b inductive priors], and key examples are [21c Laplace's Rule of Succession] and [11w Solomonoff induction].


Kevin Clancy

[summary: Nothing here yet.]

Automatically generated page for "Kevin Clancy" user.
If you are the owner, click [here to edit](https://arbital.com/edit/299).


Travis Rivera

[summary: Machine Learning and statistics expert.]


Uncountability

Sizes of infinity fall into two broad classes: *countable* infinities, and *uncountable* infinities.

A set $S$ is *uncountable* if it is not [6f8 countable].


Uncountability: Intro (Math 1)

[summary: [3jz Collections of things] which are the same [4w5 size] as or smaller than the collection of all [-45h natural numbers] are called *countable*, while larger collections (like the set of all [-4bc real numbers]) are called *uncountable*.

All uncountable collections (and some countable collections) are [infinity infinite]. There is a meaningful and [5ss well-defined] way to compare the sizes of different infinite collections of things, and some infinite collections are larger than others.]

[3jz Collections of things] which are the same [4w5 size] as or smaller than the collection of all [-45h natural numbers] are called *countable*, while larger collections (like the set of all [-4bc real numbers]) are called *uncountable*.

All uncountable collections (and some countable collections) are [infinity infinite]. There is a meaningful and [5ss well-defined] way to compare the sizes of different infinite collections of things %%note: Specifically, mathematical systems which use the [69b], see the [4zp technical] page for details.%%. To demonstrate this, we'll use a 2d grid.

[toc:]

## Real and Rational numbers

[4bc Real numbers] are numbers with a [4sl decimal expansion], for example 1, 2, 3.5, $\pi$ = 3.<PHONE>...  Every real number has an infinite decimal expansion, for example 1 = <PHONE>..., 2 = 2.<PHONE>..., 3.5 = 3.<PHONE>...  Recall that the rational numbers are [fraction fractions] of [48l integers], for example $1 = rac11$, $rac32$, $rac{100}{101}$, $rac{22}{7}$.  The positive integers are the integers greater than zero (i.e. 1, 2, 3, 4, ..).

There is a [-theorem] in math that states that the rational numbers are *countable* %%note: You can see the theorem [511 here].%%, that is, that the set of rational numbers is the same size as the set of positive integers, and another theorem which states that the real numbers are *uncountable*, that is, that the set of real numbers is strictly bigger.  By "same size" and "strictly bigger", we mean that it is possible to match every rational number with some positive integer in a way so that there are no rational numbers, nor positive integers, left unmatched, but that any matching you make between real numbers and positive integers leaves some real numbers not matched with anything.

## Rational grid

If you imagine laying the rational numbers out on a two-dimensional grid, so that the number $p / q$ falls at $(p, q)$, then we may match the positive integers with the rational numbers by walking in a spiral pattern out from zero, skipping over numbers that we have already counted (or that are undefined, such as zero divided by any number).  The beginning of this sequence is $rac01$, $rac11$, $rac12$, $rac{-1}{2}$, $rac{-1}{1}$, ...  Graphically, this is:

![A counting of the rational numbers](//i.imgur.com/OS5hr4U.png?1)

This shows that the rational numbers are countable.

## Reals are uncountable

The real numbers, however, cannot be matched with the positive integers.  I show this by [46z contradiction]. %%note:That is to say, I show that if there is such a matching, then we can conclude nonsensical statements (and if making a new assumption allows us to conclude nonsense, then the assumption itself must be nonsense.%%

Suppose we have such a matching.  We can construct a new real number that differs in its $n^	ext{th}$ decimal digit from the real number matched with $n$.

For example, if we were given a matching that matched 1 with 1.8, 2 with 1.26, 3 with 5.758, 4 with 1, and 5 with $\pi$, then our new number could be 0.11111, which differs from 1.8 in the first decimal place (the 0.1 place), 1.26 in the second decimal place (the 0.01 place), and so on.  It is clear that this number cannot be matched with any number under the matching we are given, because, if it were matched with $n$, then it would differ from itself in the $n^	ext{th}$ decimal digit, which is nonsense.  Thus, there is no matching between the real numbers and the positive integers.

## See also

If you enjoyed this explanation, consider exploring some of [3d Arbital's] other [6gg featured content]!

Arbital is made by people like you, if you think you can explain a mathematical concept then consider [-4d6]!


Uncountability: Intuitive Intro

[summary: [3jz Collections of things] which are the same [4w5 size] as or smaller than the collection of all [-45h natural numbers] are called *countable*, while larger collections (like the set of all [-4bc real numbers]) are called *uncountable*.

All uncountable collections (and some countable collections) are [infinity infinite]. There is a meaningful and [5ss well-defined] way to compare the sizes of different infinite collections of things, and some infinite collections are larger than others.]

[3jz Collections ] which have less than or the same [4w5 number of items] than the collection of all [-45h natural numbers] are called *countable*, while larger collections (like the set of all [-4bc real numbers]) are called *uncountable*.

All uncountable collections (and some countable collections) are [infinity infinite] and some infinite collections are larger than others %%note: At least, within mathematical systems which include the [69b], see the [4zp technical] page for details.%%. To demonstrate this, we'll explore a graphical demonstration with tiles and paths.

[toc:]

## Tiles and paths

![A colored sidewalk, the top row red, the bottom row blue](//i.imgur.com/8HDHt19.png)

Consider, as shown above, a sidewalk that goes on forever in one direction, which is made up of equal-sized square tiles.  The sidewalk is two squares across.  Consider a person who walks forever on it, obeying the following rule: Each step the person takes must be to one of the two tiles immediately in front of that person; no going backwards, no skipping tiles, no going sideways, no standing in place forever. The following is the beginning of one possible path:
![A zig-zagging path that begins on blue.](//i.imgur.com/1oO6YeD.png)

Now let's ask two questions:

 1. How many tiles are there?
 2. How many possible paths are there?

In both cases, you could just say that there are infinitely many, and that would be correct. But now let's consider a third question:

 3. Is the number of tiles the same as the number of possible paths?

It turns out that there is a meaningful and [5ss well-defined] way to compare the sizes of different infinite [3jz collections of things], and some infinite collections are larger than others. In particular, some infinite collections are *countable* (like the [3jz set] of all [-45h]s), while others are *uncountable* (like the set of all [-4bc]s). As we will see, it can be shown that the number of tiles on our infinite sidewalk is countable, but that the number of possible paths one could take, following the rules above, is uncountable. So there are in fact *more* possible paths than there are tiles.

Let's dig into exactly what this means and why it's true.

## Pairing off

We say that two collections of things are the "same size" if you can match the items together completely: you can pair each of the things in the first collection with exactly one of the things in the second collection, in such a way that there is nothing left unpaired. For example, given two sets of three things each, we may pair them.  Here is an example of such a pairing:

![Example pairing showing that 3 = 3: Three things on each side, all matched up: a cow (http://www.faqs.org/photo-dict/phrase/348/cow.html) matched to a racecar (http://www.zcars.com.au/wrc/), an airplane (http://www.penziononyx.cz/) matched to a watermelon (http://www.free-extras.com/tags/1/watermelon.htm),the earth (http://www.treehugger.com/2010/04/18-week/) matched to a computer (http://www.sb.fsu.edu/~xray/Xrf/anaconda.html)](//i.imgur.com/JphY27q.png)

You might think it obvious, then, that the number of paths our person can walk is bigger than the number of tiles.  We can match each tile with the path that starts on a tile the same color as it, and changes to the other color after it hits this tile.  For example, we would match the third red tile with the path
![An example of a path](//i.imgur.com/s7yjGBX.png)

It is important to note, however, that it is not sufficient that we find some matching that leaves things left over.  We must show that *every* matching leaves things left over.  For example, an infinite sidewalk that is one tile across has just as many tiles as an infinite sidewalk that is two tiles across, as we can see from the picture below by matching the 1R on top with the 1R on bottom, the 1B on top with the 1B on bottom, the 2R on top with the 2R on bottom, and so on.

![A two-tile-wide sidewalk, with each column having a B tile and an R tile](//i.imgur.com/4YecTkO.png)
![A one-tile-wide sidewalk, alternating B and R tiles](//i.imgur.com/DDGBX7G.png)

In fact, if we were only to require that *some* matching leave extra tiles, then the number of tiles in a sidewalk that is one tile wide would not be equal to itself, for we could match the first tile with 1B (in the bottom picture above), the second tile with 2B, and so on, and we would leave over half the tiles!

In fact, even if we had a *field* of tiles that is infinite in every direction, we would still have no more tiles than if we had only a sidewalk that is one tile across.  The following matching shows this:

![A one-tile-wide sidewalk, with each tile numbered starting at 1](//i.imgur.com/P4b0CPc.png)
![A field of tiles](//i.imgur.com/glPTsSG.png)

## An unpairable path

You might wonder, given that there are so many different ways to match up infinitely many things, how we can know that there is no matching that catches everything.  I will now prove that, no matter how you try to match paths (ways of walking) and tiles, you will miss some paths.  Since we have already seen that the number of tiles in a sidewalk two tiles wide is the same as the number of tiles in a sidewalk one tile wide, I will show that any matching between paths and tiles in a sidewalk one tile wide misses some paths.  I will do this by creating a path that does not match the path we have chosen for any tile %%note: This type of proof is known as a [-46z].%%.

Suppose we are given a matching between tiles and paths.  Since we have numbered the tiles in a sidewalk one tile wide ($\fbox{1}\fbox{2}\fbox{3}\fbox{4}\fbox{5}\fbox{6}\fbox{7}\fbox{8}\overline{\underline{\vphantom{<PHONE>}\cdots}}$), we also have a numbering of the paths in our matching.  Consider a new path that differs from the [nth $n^\text{th}$] path in our matching on the $n^\text{th}$ tile, that is, the $n^\text{th}$ step that you take.  For example, if our first eight paths are

![8 paths: 1: BRBRBRBR, 2: BBBBBBBB, 3: RRRRRRRR, 4: BRRRRRBB, 5: RBBRBRRB, 6: RBRRBBRR, 7: BRRRRRRB, 8: BRRBBBBB](//i.imgur.com/0Snexa1.png)

then our new path is

![The path RRBBRRBR](//i.imgur.com/s7yjGBX.png)

Clearly, this path is not any of the ones in the matching, because it differs from every single path at some point (in particular, it differs from the $n^\text{th}$ path on the $n^\text{th}$ tile, the $n^\text{th}$ step you take, which is highlighted in yellow).

Because we can repeat this exercise no matter what matching we're given, that means *any* possible matching will always leave out at least one path.  Thus, the number of paths a person can take must be strictly larger than the number of tiles in the sidewalk.

## See also

If you enjoyed this explanation, consider exploring some of [3d Arbital's] other [6gg featured content]!

Arbital is made by people like you, if you think you can explain a mathematical concept then consider [-4d6]!


Gödel encoding and self-reference

A Gödel encoding is a way of using the formal machinery of proving theorems in arithmetic to discuss that very machinery. [Kurt Gödel](https://en.wikipedia.org/wiki/Kurt_G%C3%B6del) rocked the world of mathematics in 1931 by showing that this was possible, and that it had surprising consequences for the sort of things that could ever be formally proven in a given system.

The original formulation of this self-referential framework was really messy (involving prime factorizations of huge numbers), but we can think about it more easily now by thinking about computer programs. In order to get mathematical statements that refer to themselves, we can first show that we can talk interchangeably about mathematical proofs and computer programs, and then show how to write computer programs that refer to themselves.

To be specific about the machinery of proving theorems, we'll use the formal system of [3ft Peano Arithmetic].

What kind of self-reference do we want for our computer program? We would like to be able to write a program that takes its own source code and performs computations on it. But it doesn't count for the program to access its own location in memory; we'd like something we could write directly into an interpreter, with no other framework, and get the same result.

This kind of program is known as a [322 quine].

Gödel encoding is equivalent to an encoding of a computer program as a binary string.

If we think about any conjecture in mathematics that can be stated in terms of arithmetic, you can write a program that loops over all possible strings, checks whether any of them is a valid proof of the conjecture, and halts if and only if it finds one. In the other direction, we can imagine proving a theorem about whether a particular computer program ever halts.


Nate Soares

Automatically generated page for "Nate Soares" user. Click [here to edit](https://arbital.com/edit/32).


Quine

A quine is a computer program that 'knows' its own entire source code via indirect self-reference, rather than by getting it as input. The classic exercise in this domain is writing a (non-empty) program that takes no input and which outputs its own entire source code. But the same trick can be used to do more than that; for any program that takes a string as input and performs some operations on it, we can write a quining program that takes no input and performs the same operations on the program's own source code.

The trick to write a quining program is to take a recipe for substituting a string into various places in a program, and then to apply this recipe to itself.  If you've not encountered this idea before, but you know a programming language, it is a nice exercise to try and write a quine which prints its own source code.

An example of a quine in Python (due to [32]) which prints its own source code:

	template = 'template = {hole}
print(template.format(hole=repr(template)))'
	print(template.format(hole=repr(template)))

Wikipedia has a [list of examples of quining programs](https://en.wikipedia.org/wiki/Quine_(computing)#Examples) in various languages.

Named after the logician [W.V.O. Quine](https://en.wikipedia.org/wiki/Willard_Van_Orman_Quine), as coined by [Douglas Hofstadter](https://en.wikipedia.org/wiki/Douglas_Hofstadter) in [Gödel, Escher, Bach](https://en.wikipedia.org/wiki/G%C3%B6del,_Escher,_Bach), in the informal context of English phrases like

> "Yields falsehood when preceded by its quotation" yields falsehood
> when preceded by its quotation.

Quining has been used for practical purposes and even seen in the wild, most famously in [Ken Thompson's illustration of a C compiler Trojan backdoor](http://en.wikipedia.org/wiki/Backdoor_(computing)#Compiler_backdoors).


Math playpen

$$\mathcal{P}e^{i \oint_C A_\mu dx^\mu} 	o g(x) \mathcal{P}e^{i \oint_C A_\mu dx^\mu} g^{-1}(x)\,$$

Numbers, woo!

Can I bork the page? Trying to bork the page… 3

asdf