Skip to content

Add the backward half of MacKay exercise 8.11 - #194

Merged
d-morrison merged 3 commits into
mainfrom
claude/8-11-exercise-backward
Nov 12, 2026
Merged

d-morrison merged 3 commits into
mainfrom
claude/8-11-exercise-backward

Conversation

@d-morrison

@d-morrison d-morrison commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Ezra · project thread

This is the third PR in a stack. Merge #191 first, then #193, then this one.

Why

The review on #193 asked for exercise 8.11 to be split into one exercise per part. The split put #193 over the 300-line cap, so the backward parts move here. With them, the page answers MacKay's question in full.

What

  • exr-reversed-n-gram-model and its solution show that, given all the later variables, a variable in an N-gram model depends only on the N − 1 variables just after it.
  • exr-backward-n-gram-conditional-entropy and its solution show that the backward conditional entropy equals the forward one from Add MacKay exercise 8.11, part 1: the forward direction #193.
  • exr-reversed-text-information and its solution answer the question: the reversed text carries no more information per character. People find guessing backward harder because a guesser that predicts with g in place of the true conditional pmf f pays H(f, g) = H(f) + D(f‖g) bits.

Checks

  • check-term-links passes locally with the CI inputs.
  • quarto render entropy.qmd --to html builds, and every cross-reference resolves.

https://claude.ai/code/session_019xfc9pXuEzzVRdTKMWnCh8


Generated by Claude Code

Two exercises: a stationary N-gram model read backward is again an
N-gram model, and so its backward conditional entropy equals the
forward one. The second solution closes the 8.11 question: the
reversed text carries no more information per character, and the
backward guessing game is harder only because people's backward
guesses are worse.

Stacked on the PR with the remark and the first two exercises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pXuEzzVRdTKMWnCh8
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The review on the backward PR noted that the last exercise asked two
things (lab rule 7) and that the closing paragraph reused p, which the
solution had defined as shorthand for a joint probability. The
interpretation is now exr-reversed-text-information, and its pmfs are
f (true) and g (the guesser's).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pXuEzzVRdTKMWnCh8

Copy link
Copy Markdown
Contributor Author

Commit 1a5b778 addresses both review suggestions:

  • Two asks in one exercise (rule 7): The interpretation question is now its own exercise, exr-reversed-text-information, with its own solution. exr-backward-n-gram-conditional-entropy now asks only for the entropy identity.
  • p reused: The closing argument now uses $f$ for the true conditional pmf and $g$ for the guesser's, so p is used only for the joint-probability shorthand.

Term links pass, and entropy.qmd renders with every cross-reference resolved.

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The review noted that "If not, why..." leaked the answer to the
first question and split the exercise into two asks. The exercise
now asks for one comparison and the explanation it supports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pXuEzzVRdTKMWnCh8
@github-actions

Copy link
Copy Markdown

Claude finished review — View run


Prior verdict stands. This round's one commit, 4874dd9, only rewords _subfiles/_exr-reversed-text-information.qmd, so the earlier review still applies.

The commit replaces the two-question prompt (more information per character? if not, why is the backward game harder?) with one imperative. The new text reads: "compare the information per character in a reversed text and in the text read forward, and use that comparison to explain the difference in difficulty described in @rem-reversed-text-guessing." That settles both rule 7 and rule 8 points from the last round. The "If not, why…" wording no longer hands the student the answer. The @exr-… and @rem-reversed-text-guessing references are the same ones the earlier rounds confirmed resolve. The commit adds no math, so there is nothing to check against the macros.

Findings

  • Suggestion (rule 7, minor), _subfiles/_exr-reversed-text-information.qmd:5-6: The prompt still joins two tasks: compare the information per character, then explain the difficulty. They are chained, since the second uses the first's result, so I am not asking for a split. Nothing else to raise.
  • Noted (rule 12): The prose lines break at clause boundaries, so there is nothing to flag.

Verdict

Ready for merge, with the optional suggestion above. No new defects were found, and the prior Ready-for-merge verdict still stands.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "4874dd901f87abb95f143bf2dffb6e18f21a05e3",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked the reworded prompt in _subfiles/_exr-reversed-text-information.qmd: it is now a single neutral instruction, the cross-references are unchanged and resolve, and no math was added.",
  "holistic_assessment": "The change is a one-file wording fix that resolves the earlier rule 7 and rule 8 suggestions, with no integration, regression, or scope concerns."
}

Reviewed commit: 4874dd9

@github-actions

Copy link
Copy Markdown

💰 Cost: $0.1895 (review) — run

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/ids/pr-preview/pr-194/

Built to branch gh-pages at 2026-11-12 09:24 UTC.

@d-morrison
d-morrison changed the base branch from claude/8-11-exercise to main November 12, 2026 23:54
@d-morrison
d-morrison merged commit 7b812bf into main Nov 12, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants