Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/check-bibliography-dois.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
# mackay2003information: the book has no DOI.
# iec80000132008: the standard has no DOI.
# grinstead1997introduction: the book has no DOI.
# hamblin1973questions: the journal article has no DOI (JSTOR only).
# groenendijk1984studies: the thesis has no DOI.
# shannon1948mathematical: the publisher answers the checker with HTTP
# 202, which the check reads as an error, though the DOI resolves.
exclude-keys: >-
Expand All @@ -33,3 +35,5 @@ jobs:
iec80000132008
grinstead1997introduction
renyi1961measures
hamblin1973questions
groenendijk1984studies
3 changes: 2 additions & 1 deletion .github/workflows/lint-changed-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ concurrency:

jobs:
lint-changed-files:
runs-on: ubuntu-latest
# Pinned to match the noble binary repo used below (issue #199).
runs-on: ubuntu-24.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ permissions: read-all

jobs:
lint-project:
runs-on: ubuntu-latest
# Pinned to match the noble binary repo used below (issue #199).
runs-on: ubuntu-24.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand Down
36 changes: 36 additions & 0 deletions _subfiles/_cor-question-information-bound.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
:::{#cor-question-information-bound}
#### An answer carries at most the logarithm of the number of possible answers

Let $A$ be the [answer](#def-answer) to a [question](#def-question) with [finitely many](https://morrison-lab.github.io/mcs/functions.html#def-finite-set) [possible answers](#def-possible-answer), $k$ of them,
about a [discrete random variable](https://morrison-lab.github.io/pds/random-variables.html#def-discrete-rv) $X$
with finite [entropy](https://morrison-lab.github.io/pds/expectation.html#def-entropy).
With base-2 [logarithms](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-logarithm),
the [mutual information](#def-mutual-information) between $X$ and the answer is at most $\log_2 k$ [bits](#def-bit):

$$\mutinfof{X}{A} \le \log_2 k,$$

with equality exactly when the $k$ possible answers are equally likely.
For a [polar question](#def-polar-question), $k = 2$,
so the answer carries at most $1$ bit about $X$.

:::

::: {.proof}

Each [possible answer](#def-possible-answer) is a nonempty [set](https://morrison-lab.github.io/mcs/sets.html#def-set) of values of $X$ with positive [probability](https://morrison-lab.github.io/pds/probability-basics.html#def-probability),
so the answer $A$ has exactly $k$ values with positive probability,
and its [entropy](https://morrison-lab.github.io/pds/expectation.html#def-entropy) is finite.
By @thm-answer-information and then @thm-entropy-at-most-log-values,

$$
\begin{aligned}
\mutinfof{X}{A}
&= \entropyf{A} \\
&\le \log_2 k,
\end{aligned}
$$

with equality exactly when $A$ is [uniform](https://morrison-lab.github.io/pds/random-variables.html#def-uniform) on its $k$ values.
A [polar question](#def-polar-question) has $k = 2$ possible answers, and $\log_2 2 = 1$.

:::
10 changes: 10 additions & 0 deletions _subfiles/_def-answer.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:::{#def-answer}
#### Answer

For a [question](#def-question) about $X$,
write $a(x)$ for the [possible answer](#def-possible-answer) that holds the value $x$.
The **answer** to the question is the [random variable](https://morrison-lab.github.io/pds/random-variables.html#def-random-variable)

$$A \eqdef a(X).$$

:::
9 changes: 9 additions & 0 deletions _subfiles/_def-polar-question.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:::{#def-polar-question}
#### Polar question, yes-no question

A **polar question**, or **yes-no question**, about $X$ is a [question](#def-question)
with exactly two [possible answers](#def-possible-answer):
the values of $X$ for which some statement holds, labeled "yes",
and the values for which it fails, labeled "no".

:::
8 changes: 8 additions & 0 deletions _subfiles/_def-possible-answer.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:::{#def-possible-answer}
#### Possible answer

A **possible answer** to a [question](#def-question) about $X$
is one of the [subsets](https://morrison-lab.github.io/mcs/sets.html#def-subset) of $\srcalph$, as in @def-question,
that make up the question.

:::
11 changes: 11 additions & 0 deletions _subfiles/_def-question.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:::{#def-question}
#### Question

Let $X$ be a [discrete random variable](https://morrison-lab.github.io/pds/random-variables.html#def-discrete-rv),
and let $\srcalph$ be the [set](https://morrison-lab.github.io/mcs/sets.html#def-set) of its [values](https://morrison-lab.github.io/pds/random-variables.html#def-realization)
with positive [probability](https://morrison-lab.github.io/pds/probability-basics.html#def-probability).
A **question** about $X$ is a [collection](https://morrison-lab.github.io/mcs/sets.html#def-collection)
of nonempty, [disjoint](https://morrison-lab.github.io/pds/probability-basics.html#def-mutually-exclusive) [subsets](https://morrison-lab.github.io/mcs/sets.html#def-subset) of $\srcalph$
whose [union](https://morrison-lab.github.io/mcs/sets.html#def-union) is $\srcalph$.

:::
33 changes: 33 additions & 0 deletions _subfiles/_exm-answer-information.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
:::{#exm-answer-information}
#### Two polar questions about the same number
<!-- no-figure: the example compares two numbers, with nothing to plot -->

Let $X$ be as in @exm-question,
let $A$ be the [answer](#def-answer) to each of the two questions below in turn,
and use base-2 [logarithms](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-logarithm).

- **"Is $X \ge 32$?"**
Each [possible answer](#def-possible-answer) has [probability](https://morrison-lab.github.io/pds/probability-basics.html#def-probability) $32/64 = 1/2$,
so its [surprisal](#def-surprisal) is $1$ [bit](#def-bit),
and the [entropy](https://morrison-lab.github.io/pds/expectation.html#def-entropy) of the answer, its [expected](https://morrison-lab.github.io/pds/expectation.html#def-expectation) surprisal, is $1$ bit.
By @thm-answer-information, the answer carries $\mutinfof{X}{A} = 1$ bit about $X$.
- **"Is $X = 0$?"**
The possible answer "yes" has probability $1/64$ and the possible answer "no" has probability $63/64$,
so the entropy of the answer is

$$
\begin{aligned}
\entropyf{A}
&= -\tfrac{1}{64} \log_2 \tfrac{1}{64} - \tfrac{63}{64} \log_2 \tfrac{63}{64} \\
&\approx 0.094 + 0.022 \\
&\approx 0.116 \text{ bits}.
\end{aligned}
$$

By @thm-answer-information, the answer carries about $0.116$ bits about $X$.

The reply "yes" to "Is $X = 0$?" is worth $6$ bits,
but it is rare,
so on average asking "Is $X = 0$?" gains far less than the $1$ bit from "Is $X \ge 32$?".

:::
23 changes: 23 additions & 0 deletions _subfiles/_exm-entropy-at-most-log-values.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
:::{#exm-entropy-at-most-log-values}
#### A fair coin and a loaded coin
<!-- no-figure: the example compares two numbers, with nothing to plot -->

A coin toss $X$ has $k = 2$ values,
so @thm-entropy-at-most-log-values gives $\entropyf{X} \le \log_2 2 = 1$ [bit](#def-bit).

- A fair coin is [uniform](https://morrison-lab.github.io/pds/random-variables.html#def-uniform) on its two values,
so by the equality case of @thm-entropy-at-most-log-values
its [entropy](https://morrison-lab.github.io/pds/expectation.html#def-entropy) equals $\log_2 2 = 1$ bit.
- A coin that lands heads with [probability](https://morrison-lab.github.io/pds/probability-basics.html#def-probability) $1/4$
has entropy below $1$ bit:

$$
\begin{aligned}
\entropyf{X}
&= -\tfrac{1}{4} \log_2 \tfrac{1}{4} - \tfrac{3}{4} \log_2 \tfrac{3}{4} \\
&\approx 0.500 + 0.311 \\
&\approx 0.811 \text{ bits}.
\end{aligned}
$$

:::
13 changes: 13 additions & 0 deletions _subfiles/_exm-not-polar-question.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:::{#exm-not-polar-question}
#### A question with four possible answers is not polar
<!-- no-figure: the example lists four sets, with nothing to plot -->

Let $X$ be as in @exm-question.
The question "What is the remainder of $X$ divided by $4$?" has four [possible answers](#def-possible-answer),
one for each remainder $r \in \{0, 1, 2, 3\}$:
the [set](https://morrison-lab.github.io/mcs/sets.html#def-set) of values $x \in \srcalph$ whose remainder is $r$.
These four sets form a [question](#def-question),
but not a [polar question](#def-polar-question),
which has exactly two possible answers.

:::
15 changes: 15 additions & 0 deletions _subfiles/_exm-not-question.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:::{#exm-not-question}
#### Overlapping sets do not form a question
<!-- no-figure: the example lists two sets, with nothing to plot -->

Let $X$ be as in @exm-question.
The two [sets](https://morrison-lab.github.io/mcs/sets.html#def-set) $\{0, 1, \ldots, 40\}$ and $\{32, 33, \ldots, 63\}$ cover $\srcalph$,
but both hold the values $32, 33, \ldots, 40$.
They are not [disjoint](https://morrison-lab.github.io/pds/probability-basics.html#def-mutually-exclusive),
so they do not form a [question](#def-question),
and neither set is a [possible answer](#def-possible-answer) of a question made from these two sets.
When $X = 35$,
both sets hold the value of $X$,
so no single set is its answer.

:::
21 changes: 21 additions & 0 deletions _subfiles/_exm-question.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
:::{#exm-question}
#### Is the number at least 32?
<!-- no-figure: the example lists two sets, with nothing to plot -->

Let $X$ be [uniform](https://morrison-lab.github.io/pds/random-variables.html#def-uniform)
on the [integers](https://morrison-lab.github.io/mcs/number-systems.html#def-integers) $0, 1, \ldots, 63$,
so that $\srcalph = \{0, 1, \ldots, 63\}$.
The question "Is $X \ge 32$?" has two [possible answers](#def-possible-answer):

- "yes", the [set](https://morrison-lab.github.io/mcs/sets.html#def-set) $\{32, 33, \ldots, 63\}$;
- "no", the set $\{0, 1, \ldots, 31\}$.

These two sets are nonempty and [disjoint](https://morrison-lab.github.io/pds/probability-basics.html#def-mutually-exclusive),
and their [union](https://morrison-lab.github.io/mcs/sets.html#def-union) is $\srcalph$,
so they form a [question](#def-question),
and a [polar question](#def-polar-question).
If $X = 35$,
the [answer](#def-answer) is $a(35) = \{32, 33, \ldots, 63\}$,
that is, "yes".

:::
35 changes: 35 additions & 0 deletions _subfiles/_exm-sixty-three.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
:::{#exm-sixty-three}
#### The game of sixty-three
<!-- no-figure: the example lists six questions and their answers, with nothing to plot -->

In the game of twenty questions,
one player thinks of an object,
and the other identifies it by asking [polar questions](#def-polar-question).
@mackay2003information [p. 70] simplifies the game to "sixty-three":
find an [integer](https://morrison-lab.github.io/mcs/number-systems.html#def-integers) $X$ between $0$ and $63$, each equally likely, using polar questions.
Six questions suffice:

1. Is $X \ge 32$?
2. Is the remainder of $X$ divided by $32$ at least $16$?
3. Is the remainder of $X$ divided by $16$ at least $8$?
4. Is the remainder of $X$ divided by $8$ at least $4$?
5. Is the remainder of $X$ divided by $4$ at least $2$?
6. Is $X$ odd?

Reading "yes" as $1$ and "no" as $0$,
the six [answers](#def-answer) spell the binary expansion of $X$:
$X = 35$ gives $100011$.
Given the answers so far, each next question splits the values still possible into two equal halves,
so each answer has [probability](https://morrison-lab.github.io/pds/probability-basics.html#def-probability) $1/2$
and carries $1$ [bit](#def-bit),
the most that @cor-question-information-bound allows for a polar question.
The six answers carry $6$ bits in all,
which is the [entropy](https://morrison-lab.github.io/pds/expectation.html#def-entropy) $\entropyf{X} = \log_2 64 = 6$ bits.
No strategy can be sure to finish in fewer than six polar questions:
five polar questions have at most $2^5 = 32$ combinations of answers,
too few to tell $64$ values apart.

The single [variable question](#rem-question-types) "What is $X$?" has $64$ equally likely [possible answers](#def-possible-answer),
so by @cor-question-information-bound its answer carries all $\log_2 64 = 6$ bits at once.

:::
12 changes: 12 additions & 0 deletions _subfiles/_rem-question-partition-events.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
::: {#rem-question-partition-events}
#### A question partitions the sample space

The [events](https://morrison-lab.github.io/pds/probability-basics.html#def-event) $\{X \in C\}$,
one for each [possible answer](#def-possible-answer) $C$ to a [question](#def-question) about $X$,
are [disjoint](https://morrison-lab.github.io/pds/probability-basics.html#def-mutually-exclusive),
and together they hold every [outcome](https://morrison-lab.github.io/pds/probability-basics.html#def-experiment-outcome) at which $X$ takes a value in $\srcalph$,
an event of [probability](https://morrison-lab.github.io/pds/probability-basics.html#def-probability) $1$.
So, apart from an event of probability $0$, they form a
[partition of the sample space](https://morrison-lab.github.io/pds/probability-basics.html#def-partition).

:::
12 changes: 12 additions & 0 deletions _subfiles/_rem-question-partition-source.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
::: {#rem-question-partition-source}
#### Questions as sets of replies in semantics

@hamblin1973questions took a question in natural language to denote the [set](https://morrison-lab.github.io/mcs/sets.html#def-set) of propositions that count as its replies,
so that a question "sets up a choice-situation between a set of propositions".
Hamblin's account does not require those propositions to exclude one another.
@groenendijk1984studies took a question's replies to be [mutually exclusive](https://morrison-lab.github.io/pds/probability-basics.html#def-mutually-exclusive) and to cover every possibility,
so that a question [partitions](https://morrison-lab.github.io/pds/probability-basics.html#def-partition) the possibilities.
@def-question follows Groenendijk and Stokhof:
the [possible answers](#def-possible-answer) to a [question](#def-question) partition $\srcalph$.

:::
23 changes: 23 additions & 0 deletions _subfiles/_rem-question-types.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
::: {#rem-question-types}
#### Kinds of questions in grammar

@huddleston1994contrast sorts questions into three kinds,
by how each kind defines the [set](https://morrison-lab.github.io/mcs/sets.html#def-set) of its replies:

- A [polar question](#def-polar-question), such as "Is it raining?", has the two replies yes and no.
- An *alternative question*, such as "Is it red or green?", has one reply for each alternative it lists.
- A *variable question*, such as "Who called?", has one reply for each value of a variable,
here the person who called.
In English a variable question usually contains an interrogative word, such as *who*, *what*, *which*, *where*, *when*, *why*, or *how*,
so it is often called a *wh-question*.

Each kind is a [question](#def-question) with a different number of [possible answers](#def-possible-answer):
two for a polar question,
one per listed alternative for an alternative question,
and one per value of the variable for a variable question,
which can be many.
@huddleston1994contrast also separates these kinds of question from the *interrogative* clause, a grammatical form.
The two need not match:
a declarative clause said with rising intonation, such as "You're leaving?", asks a polar question.

:::
44 changes: 44 additions & 0 deletions _subfiles/_thm-answer-information.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
:::{#thm-answer-information}
#### The information in an answer is its entropy

Let $X$ be a [discrete random variable](https://morrison-lab.github.io/pds/random-variables.html#def-discrete-rv),
and let $A$ be the [answer](#def-answer) to a [question](#def-question) about $X$.
If $X$ and $A$ have finite [entropies](https://morrison-lab.github.io/pds/expectation.html#def-entropy),
then the [mutual information](#def-mutual-information) between $X$ and the answer
is the entropy of the answer:

$$\mutinfof{X}{A} = \entropyf{A}.$$

:::

::: {.proof}

Given $X=x$, the answer $A = a(X)$ equals $a(x)$ with [probability](https://morrison-lab.github.io/pds/probability-basics.html#def-probability) $1$,
so $\P(A = a(x) \mid X = x) = 1$.
Hence the [conditional surprisal](#def-conditional-surprisal) of the answer $a(x)$ given $x$ is $-\log 1 = 0$,
and its [expectation](https://morrison-lab.github.io/pds/expectation.html#def-expectation) given $X=x$ is $0$:

$$\entropyf{A \mid X=x} = 0.$$

By @thm-conditional-entropy-average,

$$
\begin{aligned}
\entropyf{A \mid X}
&= \sum_{x} p(x) \, \entropyf{A \mid X=x} \\
&= 0,
\end{aligned}
$$

where $p(x) \eqdef \P(X=x)$.
By @thm-mutual-information-reduction with $Y = A$,

$$
\begin{aligned}
\mutinfof{X}{A}
&= \entropyf{A} - \entropyf{A \mid X} \\
&= \entropyf{A}.
\end{aligned}
$$

:::
Loading
Loading