What does Flying Stars, Compass and Facial Ratios conclude, in numbers, about “Discretising Twenty-Four Mountains and Compass Error”?
Answer: Chapter 3 computes the effects of compass error: at a standard deviation of 3 degrees, 0.1594 of readings cross into another mountain, the period-9 chart changes for 0.1063, and the near-the-edge call flips for 0.3118; with no stated north, a declination of 5 degrees moves 0.3333 of houses to another mountain.
Scope of the numbers: Compass errors, declinations, facial dimensions and landmark errors are illustrative parameters; chart rules follow conventions stated in the book. Marked boxes separate evidence, runnable Python programs, classical sources and hypotheses.
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.1063, 0.1594, 0.3118
sigma mountain palace chart (p9) jian xiang kong wang
1 0.0531 0.0177 0.0354 0.1063 0.1062
2 0.1063 0.0354 0.0708 0.2124 0.1970
3 0.1594 0.0531 0.1063 0.3118 0.2524
4 0.2125 0.0708 0.1417 0.3896 0.2848
5 0.2655 0.0886 0.1770 0.4389 0.3043
check: mountain rate = E|error| / 15
= sigma sqrt(2 / pi) / 15,
which is 0.1596 at sigma 3
Reading: with an error of 2 to 3 degrees, one reading in
nine to one in six names the wrong mountain, and the chart
for period 9 changes two times in three of those. The status
of being near an edge, which decides whether replacement
charts apply, is the least stable of all: an error of 3
degrees flips it for 0.3118 of houses.Show the full program
# Chapter 3. p05: Compass error and how often the chart changes.
# Twenty-four mountains of 15 degrees; ren is centred on 345 degrees.
# A true facing direction, uniform around the circle, is read with a
# normal error of standard deviation sigma (2 to 5 degrees covers
# a careful reading near steel, concrete and wiring). We report the
# probability that the reading
# names a different mountain (kua shan);
# names a different palace, that is trigram (chu gua);
# changes the chart of period 9 (both side charts compared);
# changes the "near an edge" status, within 3 degrees of a mountain
# boundary (jian xiang, where replacement charts are used);
# changes the "void" status, within 1.5 degrees of a boundary
# (kong wang).
# Integration on a 0.1 degree grid of true angles and an 81-point grid
# of errors from -4 to +4 sigma.
import math
LOSHU = {"SE": 4, "S": 9, "SW": 2, "E": 3, "C": 5, "W": 7,
"NE": 8, "N": 1, "NW": 6}
PALACE_OF = {v: k for k, v in LOSHU.items()}
PATH = ["C", "NW", "W", "NE", "S", "N", "SW", "E", "SE"]
OPP = {"N": "S", "S": "N", "E": "W", "W": "E", "NE": "SW", "SW": "NE",
"NW": "SE", "SE": "NW"}
PAL_ORDER = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"]
MOUNTAINS = ("ren zi gui chou gen yin jia mao yi chen xun si bing wu "
"ding wei kun shen geng you xin xu qian hai").split()
def norm(x):
return (x - 1) % 9 + 1
def fly(c, sign):
return {p: norm(c + sign * k) for k, p in enumerate(PATH)}
def polarity(number, pos):
cardinal = number in (1, 3, 7, 9)
return (1, -1, -1)[pos] if cardinal else (-1, 1, 1)[pos]
def side(base, pal, pos):
n = base[pal]
ref = LOSHU[pal] if n == 5 else n
return fly(n, polarity(ref, pos))
def chart(period, i):
base = fly(period, 1)
sit = PAL_ORDER[i // 3]
face = OPP[sit]
return base, side(base, sit, i % 3), side(base, face, i % 3), sit, face
def category(period, i):
base, m, f, sit, face = chart(period, i)
if m[sit] == period and f[face] == period:
return "wang shan wang xiang"
if m[face] == period and f[sit] == period:
return "shang shan xia shui"
if m[face] == period and f[face] == period:
return "shuang xing hui xiang"
return "shuang xing hui zuo"
def m_index(deg):
return int(((deg - 337.5) % 360) // 15)
def edge_dist(deg):
x = (deg - 337.5) % 15
return min(x, 15 - x)
CHARTS = [chart(9, i)[1:3] for i in range(24)]
def rates(sigma):
errs = [-4 * sigma + 0.1 * sigma * k for k in range(81)]
w = [math.exp(-0.5 * (e / sigma) ** 2) for e in errs]
sw = sum(w)
tot = [0.0] * 5
n = 0
for t10 in range(3600):
t = t10 / 10 + 0.05
mi, ed = m_index(t), edge_dist(t)
for e, wt in zip(errs, w):
r = t + e
mj, er = m_index(r), edge_dist(r)
tot[0] += wt * (mi != mj)
tot[1] += wt * (mi // 3 != mj // 3)
tot[2] += wt * (CHARTS[mi] != CHARTS[mj])
tot[3] += wt * ((ed < 3) != (er < 3))
tot[4] += wt * ((ed < 1.5) != (er < 1.5))
n += 1
return [x / (sw * n) for x in tot]
if __name__ == "__main__":
print(" sigma mountain palace chart (p9) jian xiang"
" kong wang")
for s in (1, 2, 3, 4, 5):
r = rates(float(s))
print(" {:5d} {:10.4f} {:8.4f} {:12.4f} {:12.4f} {:11.4f}".format(
s, *r))
print(" check: mountain rate = E|error| / 15")
print(" = sigma sqrt(2 / pi) / 15,")
print(" which is {:.4f} at sigma 3".format(
3 * math.sqrt(2 / math.pi) / 15))
print("\nReading: with an error of 2 to 3 degrees, one reading in")
print("nine to one in six names the wrong mountain, and the chart")
print("for period 9 changes two times in three of those. The status")
print("of being near an edge, which decides whether replacement")
print("charts apply, is the least stable of all: an error of 3")
print("degrees flips it for 0.3118 of houses.")Single source and citation
Fan, Y. (2026). Xuankong Flying-Star Permutations, Twenty-Four-Mountain Compass Discretization and Craniofacial Ratio Metrology (Version 1.0.0), Chapter 3: Discretising Twenty-Four Mountains and Compass Error. 5D Library. https://doi.org/10.5281/zenodo.24090215
DOI: 10.5281/zenodo.24090215 · Read the monograph · 5DL-B-082 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026082,
author = {Fan, Yafu},
title = {Xuankong Flying-Star Permutations, Twenty-Four-Mountain Compass Discretization and Craniofacial Ratio Metrology},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090215},
url = {https://doi.org/10.5281/zenodo.24090215}
}Other chapter answers in this book
- Chapter 1 · The Lo Shu, the Flight Path and the Dihedral Group
- Chapter 2 · Sum to Ten, Three Combinations and the Conventions of Replacement
- Chapter 4 · Thirds, Five Eyes, the Golden Ratio and Selfie Perspective
- Chapter 5 · Landmark Error and the Barnum Effect
- Chapter 6 · The Royal Cubit, Canons of Proportion and Evidence
- Chapter 7 · Shen Kuo on the Compass, and the Texts of Xuankong and Physiognomy
- Chapter 8 · A Ten-Flag Audit and a Pre-Registered Blind Paired Test