>_federalist / investigation
fixed corpus · saved evidence100%read the report ↗

LINGUISTIC FORENSICS / AN EXPLORATORY STUDY

Federalist PapersA small authorship investigation

Can common grammatical words help us compare the writing of Hamilton and Madison?

Follow the evidence from a fixed research question to a cautious conclusion. Explore the texts, replay the calculations, and look at the language behind the scores.

From 17 essays to 24 word frequencies and a comparison of two author profilesTHE FEDERALIST PAPERSNo. 49QUESTIONED AUTHORSHIPoninat…17 ESSAYS / 24 WORDS / 2 AUTHORS
A comparison of recurring grammatical choices.
Loading the saved research evidence…
1

SET THE QUESTION BEFORE THE RESULTS

What are we trying to find out?

Does Federalist No. 49 resemble Hamilton's or Madison's writing more closely in its use of common grammatical words?

The essays argued for ratifying the United States Constitution under the shared name Publius. The Library of Congress lists No. 49 as “Hamilton or Madison.” That historical uncertainty motivates the question; it does not determine the answer.

Research approach

Primarily quantitative: count selected words and compare their frequencies. Add qualitative inspection: read examples to understand what the numerical differences mean.

A fixed design

Choose texts, words, preparation rules, comparison method, validation, and two reliability checks before calculating frequencies. Preserve the original plan and document changes separately.

Sources: Library of Congress authorship table · Dated research plan · Recorded amendments

2

TOOLS & RECORDS

Make the investigation reproducible

Small Python scripts performed the preparation, counting, comparisons, and checks. Each stage saved its inputs and outputs so someone else can inspect or repeat the work.

COLLECT

UTF-8 text

One essay per .txt file. Keep raw copies, prepared bodies, and quotation-free copies separately.

CALCULATE

Python + uv

Python 3.13.15, managed with uv. Standard-library scripts apply the same word rules and arithmetic to every essay.

INSPECT

CSV + JSON

CSV tables store counts and scores. JSON records store settings, fitted profiles, checksums, and verification details.

RESEARCH COMMANDS
uv sync --locked
uv run --locked python -m src.calculate_frequencies --verify
uv run --locked python -m src.verification --verify

This demonstration uses plain HTML, CSS, and JavaScript, served with Node and pnpm. The browser replays the fixed method from saved frequencies. It does not alter the corpus or the research outputs.

Recorded research environment · Counting procedure

3

CHOOSE THE COMPARISON MATERIAL

A fixed corpus of 17 essays

A corpus is a collection of texts selected for analysis. Here, eight reference essays represent each author. No. 49 is the questioned text. Jointly attributed essays are excluded from the reference samples.

Hamilton 1, 6, 21, 26, 31, 59, 70, 78

Madison 10, 14, 37, 39, 41, 43, 46, 48

Questioned 49

The intended edition is the Library of Congress presentation of a Project Gutenberg compilation. The sample spans several subjects but does not represent either author's complete writing.

Source qualification. Fifteen essays were collected as archived web-reader representations, rather than original HTML. Nos. 21 and 26 were supplied as text when the source page was inaccessible. Their association with this edition is inferred from delivery context; their full wording was not independently verified against a live page.

Full source log ↓ · Supplied-text records

4

KEEP THE EDITION, REMOVE THE WRAPPERS

Prepare every essay consistently

Remove surrounding material

Remove headings, author labels, publication details, the shared address, closing “Publius,” website material, and separately numbered notes after the signature. Keep numbered arguments within the body.

Preserve the language

Retain historical spelling, sentence wording, and quotations in the main analysis. Keep raw copies untouched. Lowercase and normalize curly apostrophes only when counting.

Download text ↓

The quotation-free copies belong to a separate reliability check. Removing appended notes may also remove authorial material; this is a limitation of the chosen preparation rule.

5

MEASURE GRAMMATICAL HABITS

Why these 24 function words?

Function words commonly express grammatical relationships: of links nouns, and joins elements, and these points to something already mentioned. A feature is a measured property, here the frequency of one selected spelling.

Subject words such as army or tax can distinguish topics rather than writers. Common grammatical words offer a simple way to investigate recurring writing habits with less direct dependence on subject matter. Topic and context can still affect them.

This is a teaching selection fixed in advance, not a claim that these are the best authorship markers. Count each spelling regardless of its grammatical role. Keep function words in the analysis; do not apply a stopword filter.

Try the word-counting rule

Whole words follow [a-z]+(?:'[a-z]+)*. Internal apostrophes stay; hyphens split words. Numbers and punctuation are ignored. Word forms are not combined.

Reason for examining common words: Mosteller & Wallace (1963) · Fixed feature specification

6

MAKE DIFFERENT LENGTHS COMPARABLE

Count words, then calculate rates

A longer essay offers more opportunities for a word to occur. Convert raw counts to occurrences per 1,000 words, using all essay words as the denominator. Keep essays separate so each has equal weight in its author's profile.

frequency per 1,000 = selected-word count ÷ total essay words × 1,000
EXPLORE THE SAVED DATAMain analysis

This version selector updates stages 6–9. It chooses among the three predefined analyses; it does not change the method.

7

A TRANSPARENT COMPARISON

How do we measure resemblance?

  1. For each word, average the essay rates separately for Hamilton and Madison. Every essay gets equal weight.
  2. Calculate the word's standard deviation across the training essays together: how much the rates vary. Use sample scaling, dividing the squared deviations by n − 1 before taking the square root.
  3. Find the absolute difference between the test essay's rate and each author's mean. Divide both differences by the same training standard deviation.
  4. Average these standardized differences across usable words. The smaller distance indicates the closer profile.
word contribution = |test rate − author's mean| ÷ training standard deviation
author distance = average of the usable word contributions
Inspect all fitted word quantities for No. 49

A word with exactly zero training variation is omitted; none were omitted in these analyses. A distance gap at most 1e-12 is recorded as inconclusive. That tolerance handles numerical equality, not evidential strength. Distances are not probabilities.

8

TEST THE METHOD BEFORE NO. 49

Can it identify the known authors?

Leave-one-essay-out validation means temporarily treating one reference essay as unknown. Remove it completely, build profiles and scaling from the remaining 15, then compare it with both authors. Repeat for all 16 essays.

The held-out essay must not influence its own author averages or scaling. Otherwise, information about the answer enters the test: data leakage.

REPLAY A KNOWN-AUTHOR TRIALfixed method

Choose an essay and run the trial to see the training set and distances.

Both distances for every held-out essay. The shorter bar is the closer profile; the table gives the exact saved values.

Always choosing one author gives 8 correct assignments out of 16. All three versions achieved 16 out of 16, but the trials share training texts and are not independent experiments. This small sample does not establish general accuracy.

Training-only preprocessing and data leakage

9

APPLY THE UNCHANGED METHOD

Which profile is closer to No. 49?

After validation, fit the two author profiles and scaling from all 16 references. No. 49 contributes to neither. Apply the same distance formula and decision rule.

Smaller means closer under this method. The gap is not an authorship percentage.
10

CHECK DEPENDENCE ON REASONABLE CHANGES

Does the result survive both checks?

Feature check

Remove the, a, of, and, leaving 20 features. Keep the original total-word denominator. This tests dependence on that frequent subset; frequency alone does not imply dominance after scaling.

Quotation check

Remove consistently identified direct quotations and retain the original 24 features. Recalculate total words and word counts. Keep titles, ambiguous fragments, and the main analysis copies.

For each check, rerun all 16 known-author trials and the No. 49 comparison. Recalculate training means and scaling each time.

All versions favor Madison. Distances across different feature sets and scaling are not directly comparable measures of evidential strength.
Quotation decisions have limits. The review identified 33 marked passages: 27 removed and 6 retained. Removing the 27 passages removed 1,093 words from 10 essays. The review took place after the main result was known, so it was not blinded. Unmarked borrowed wording may remain.
Inspect all 33 quotation decisions and the removal totals
11

CONNECT NUMBERS TO LANGUAGE

What lies behind the scores?

For the main comparison, rank all words by the size of the difference between their Hamilton and Madison contributions. Inspect the top four: on, in, at, these. The first three favor Madison; these favors Hamilton. These four are for interpretation; the attribution still uses all 24 words.

Signed contribution to the overall distance gap: right favors Madison; left favors Hamilton. Each value is the word's standardized contribution difference divided by 24.
All 24 feature contributions, ranked

Patterns that support the comparison

On occurs more often in every Madison reference than in any Hamilton reference, and that separation remains after quotation removal. No. 49's rate is closer to Madison's mean.

But “rest on” occurs in both No. 49 and Hamilton's No. 31. A shared expression is not an exclusive author marker.

Examples that complicate it

“In time of peace” occurs nine times in Hamilton's military discussion in No. 26, illustrating a possible topic effect. No. 49 uses at only in “at the expense of” and “at large.”

These favors Hamilton's average, although No. 49's rate is below every Hamilton reference. Closer to a mean does not mean typical of that author.

A concordance shows a word in its surrounding context. The saved collection contains all 1,414 occurrences of these four words, with 96 annotated examples, including all 53 occurrences in No. 49.

CONCORDANCE EXPLORER / MAIN ANALYSISAll 1,414 contexts ↓

Per-essay distributions ↓ · Repeated expressions ↓ · Annotated examples ↓

12

CHECK THE IMPLEMENTATION

Are the calculations trustworthy?

Recorded research verification checked word boundaries, apostrophes, equal essay weighting, sample scaling, ties, constant features, and separation of training and evaluation texts. An independent calculation checked the saved results.

The independent audit used a separate character scanner and 50-digit decimal arithmetic. It checked 1,156 count cells, 1,156 frequency cells, and 102 distances across the three versions. The largest numerical difference was below 1e-12. Repeated calculations agreed, and the saved evidence remained unchanged.

The browser replay is being checked against the saved results.

These checks support implementation correctness. They cannot establish historical authorship or accuracy on texts outside this small sample.

Recorded verification summary · Independent comparisons ↓

13

CONCLUDE IN PROPORTION TO THE EVIDENCE

A stable resemblance, with limits

Under the specified function-word method, Federalist No. 49 is closer to Madison's reference profile. The method correctly classified all 16 known-author essays, and both reliability checks retained the Madison assignment.

These results support a limited attribution within this comparison. They do not prove who wrote the essay or yield a probability of authorship.

What limits the conclusion?

  • Only eight reference essays per author, and only two candidate authors.
  • Topic effects, borrowed language, and editorial variation.
  • Some very close validation distances, particularly No. 78.
  • Supplied-text provenance for Nos. 21 and 26 and a quotation review made after the main result was known.
  • No independent, previously unseen final test corpus.

How does it compare with historical research?

Mosteller and Wallace's 1963 study used broader statistical analyses, including discriminant and Bayesian methods. It found evidence favoring Madison for all 12 disputed essays.

Our No. 49 result agrees in direction. This classroom experiment is much smaller and does not reproduce their statistical model or its evidential strength.

Read the original research ↗
References
  1. Library of Congress. Federalist Papers: full text and authorship table. Corpus attributions and edition information.
  2. Mosteller, F., & Wallace, D. L. (1963). Inference in an Authorship Problem: A Comparative Study of Discrimination Methods Applied to the Authorship of the Disputed Federalist Papers. Journal of the American Statistical Association, 58(302), 275–309.
  3. Scikit-learn developers. Common pitfalls: data leakage. Documentation version 1.9.1, consulted 15 November 2026. Used for evaluation principles; the calculations use project scripts.
↳

OPEN THE RECORD

All data, tables, and research records

Browse complete CSV tables and JSON records, including all fitted training quantities, source logs, quotation decisions, concordances, manifests, and preserved historical outputs. Every item links to its original saved file.