What does Code-Switching Thresholds and Monolingual Precision conclude, in numbers, about “Not Laziness: Switch Points Obey Two Grammars”?
Answer: This figure gives the laziness hypothesis a sharp consequence. If speakers changed language at random positions, each switch would break the equivalence constraint with probability 0.5714. In a corpus of 200 switches the random model expects about 114.3 violations. Poplack reported the opposite: violations of the constraint were rare in her data. The last line of the program turns this into a likelihood ratio. Suppose we observe 2 violations, and give the constrained model a small allowance for slips (eps 0.01). The base-ten logarithm of the likelihood ratio between the constrained model and the random one is 68.5. This is not a close contest.
Scope of the numbers: Parameters are illustrative and all calculations are generated by the book's programs; nothing corresponds to a real customer, conversation or sale, and Malay, Hokkien, Cantonese, English and Mandarin are treated as equals. This is not linguistic doctrine and not business advice to any individual or company.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.01, 0.5714, 114.3, 200, 68.5
| frame | cuts | licit |
|---|---|---|
| bought-book-yesterday | 4 | 1 |
| eat-at-hawker-centre | 4 | 1 |
| very-cheap-price | 2 | 2 |
| shop-that-sells-durian | 2 | 0 |
| where-do-you-want-to-go | 3 | 0 |
| my-friend-s-car | 2 | 2 |
| i-like-this-design | 3 | 3 |
| deliver-tomorrow | 1 | 0 |
| all frames: 21 cuts, 9 licit, licit share 0.4286 | ||
| random switching breaks the constraint with p = 0.5714 | ||
| corpus of 200 switches: random model expects 114.3 breaks | ||
| observed 2 breaks, eps 0.01: log10 LR = 68.5 |
Show the full program
# Chapter 1. p11: where may a Chinese-English sentence switch language?
# Model: the equivalence constraint (Poplack 1980). A switch between
# position i and i+1 is licit when the words before the cut form the same
# set in both word orders, so neither grammar is broken at the juncture.
# Eight synthetic frames, Chinese order first, English order second; the
# glosses are illustrative and stand for whole constituents.
import math
FRAMES = [
("bought-book-yesterday", "S T V D N", "S V D N T"),
("eat-at-hawker-centre", "S P L1 L2 V", "S V P L1 L2"),
("very-cheap-price", "Adv Adj N", "Adv Adj N"),
("shop-that-sells-durian", "V O N", "N V O"),
("where-do-you-want-to-go", "S W G Q", "Q S W G"),
("my-friend-s-car", "P F N", "P F N"),
("i-like-this-design", "S V D N", "S V D N"),
("deliver-tomorrow", "T V", "V T"),
]
def licit_cuts(zh, en):
a, b = zh.split(), en.split()
ok = 0
for i in range(1, len(a)):
if set(a[:i]) == set(b[:i]):
ok += 1
return ok, len(a) - 1
def log10_lr(n, k, p_rand, eps):
# log10 of P(data | constrained) / P(data | random switching)
good = k * math.log10(eps) + (n - k) * math.log10(1 - eps)
bad = k * math.log10(p_rand) + (n - k) * math.log10(1 - p_rand)
return good - bad
if __name__ == "__main__":
tot_ok = tot_all = 0
print("frame cuts licit")
for name, zh, en in FRAMES:
ok, allc = licit_cuts(zh, en)
tot_ok += ok
tot_all += allc
print("{:<26} {:>4} {:>6}".format(name, allc, ok))
share = tot_ok / tot_all
print("all frames: {} cuts, {} licit, licit share {:.4f}".format(
tot_all, tot_ok, share))
p_rand = 1 - share
print("random switching breaks the constraint with p = {:.4f}"
.format(p_rand))
n, k, eps = 200, 2, 0.01
print("corpus of {} switches: random model expects {:.1f} breaks"
.format(n, n * p_rand))
print("observed {} breaks, eps {}: log10 LR = {:.1f}".format(
k, eps, log10_lr(n, k, p_rand, eps)))Single source and citation
Fan, Y. (2026). Information Theory of Code-Switching, Lexical-Gap Compensation and Monolingual Precision Equivalence in Multilingual Markets (Version 1.0.0), Chapter 1: Not Laziness: Switch Points Obey Two Grammars. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-381 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026381,
author = {Fan, Yafu},
title = {Information Theory of Code-Switching, Lexical-Gap Compensation and Monolingual Precision Equivalence in Multilingual Markets},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 2 · The Information at a Switch Point: Surprisal, Word Length and Uniform Density
- Chapter 3 · The Bit Ledger and the Degree of a Lexical Gap
- Chapter 4 · The Audience-Coverage Threshold: When an Inserted Word Becomes a Decoding Failure
- Chapter 5 · An Upper Bound on Insertion Density, and the Register Signal
- Chapter 6 · Monolingual Constructional Equivalence: Precision Without Insertion
- Chapter 7 · Classical Sources: Yan Fu's Three Difficulties, Confucius on Names, Jerome's Sense for Sense and Schleiermacher's Two Paths
- Chapter 8 · Field Tools and Checker Specifications: the Insertion Ledger, Four-Kit Checkers and a Pre-registered Test