Research approach
Primarily quantitative: count selected words and compare their frequencies. Add qualitative inspection: read examples to understand what the numerical differences mean.
LINGUISTIC FORENSICS / AN EXPLORATORY STUDY
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.
SET THE QUESTION BEFORE THE RESULTS
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.
Primarily quantitative: count selected words and compare their frequencies. Add qualitative inspection: read examples to understand what the numerical differences mean.
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
TOOLS & RECORDS
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.
One essay per .txt file. Keep raw copies, prepared bodies, and quotation-free copies separately.
Python 3.13.15, managed with uv. Standard-library scripts apply the same word rules and arithmetic to every essay.
CSV tables store counts and scores. JSON records store settings, fitted profiles, checksums, and verification details.
uv sync --locked
uv run --locked python -m src.calculate_frequencies --verify
uv run --locked python -m src.verification --verifyThis 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.
CHOOSE THE COMPARISON MATERIAL
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.
KEEP THE EDITION, REMOVE THE WRAPPERS
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.
Retain historical spelling, sentence wording, and quotations in the main analysis. Keep raw copies untouched. Lowercase and normalize curly apostrophes only when counting.
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.
MEASURE GRAMMATICAL HABITS
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.
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
MAKE DIFFERENT LENGTHS COMPARABLE
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.
This version selector updates stages 6–9. It chooses among the three predefined analyses; it does not change the method.
A TRANSPARENT COMPARISON
n − 1 before taking the square root.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.
TEST THE METHOD BEFORE NO. 49
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.
Choose an essay and run the trial to see the training set and distances.
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.
APPLY THE UNCHANGED METHOD
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.
CHECK DEPENDENCE ON REASONABLE CHANGES
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.
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.
CONNECT NUMBERS TO LANGUAGE
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.
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.
“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.
Per-essay distributions ↓ · Repeated expressions ↓ · Annotated examples ↓
CHECK THE IMPLEMENTATION
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.
CONCLUDE IN PROPORTION TO THE EVIDENCE
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.
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 ↗OPEN THE RECORD
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.