关于「节庆相遇的概率:均匀相位模型为何失效」,《马来西亚移动节庆与促销排期》给出的定量结论是什么?

结论:开斋节与农历新年相隔七天以内的年份共 14 个,成组出现:1964 年至 1966 年,1996 年至 1998 年,2029 年至 2031 年,2062 年至 2063 年,2094 年至 2096 年。组与组之间相隔三十二三年,正是第一章算出的开斋节绕行周期。程序算出的 1996 年至 1998 年与公共记录中的 Kongsi Raya 年份吻合;下一组是 2029 年至 2031 年,就在眼前。

数据口径:书中销售序列与提前天数为示意;全部计算由书中程序生成。 第二章量化同比失真:在一家示意门店中,开斋节从四月移入三月,使三月同日同比为加 0.289、四月为减 0.218,而真实增长只有百分之四;用真实节日日期,十二对比较的平均绝对误差为 0.180。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 14, 1964, 1966, 1996, 1998, 2029

Aidilfitri within 7 days of Chinese New Year: 14 years
  1964(-2) 1965(-1) 1966(-2) 1996(-2) 1997(-2) 1998(-2) 2029(-2)
  2030(-2) 2031(-2) 2062(-2) 2063(-2) 2094(-2) 2095(-1) 2096(-2)
Aidilfitri within 7 days of Deepavali: 10 years
  1972(-3) 1973(-3) 2004(-3) 2005(-2) 2006(-3) 2037(-4) 2038(-3)
  2069(-3) 2070(-3) 2071(-3)
gap = festival minus Aidilfitri, days; 156 Aidilfitri checked
查看完整验算程序
# Chapter 5. p51: when Aidilfitri meets Chinese New Year or Deepavali.
# Model: Aidilfitri from the tabular calendar (p11, within a day or
# two of the announced date), Chinese New Year from the solstice rule
# (p32, corrected new moons), Deepavali from the Tula rule (p41).
# For every Aidilfitri 1950-2100 we find the signed gap in days to
# the nearest Chinese New Year and the nearest Deepavali, and list
# the years with a gap of at most W = 7 days (Malaysians call these
# Kongsi Raya and Deepa Raya). Approximate dates; confirm officially.
import math
from datetime import date

RD0, TZ, EPOCH = 1721424.5, 8 / 24, 227015
AY2000, PREC = 23.853, 50.29 / 3600


def rad(x):
    return math.radians(x % 360.0)


def new_moon(k, terms):
    jde = 2451550.09766 + 29.530588861 * k
    if not terms:
        return jde - RD0
    t = k / 1236.85
    e = 1 - 0.002516 * t
    m = rad(2.5534 + 29.10535670 * k)
    mp = rad(201.5643 + 385.81693528 * k)
    f = rad(160.7108 + 390.67050284 * k)
    c = [-0.40720 * math.sin(mp), 0.17241 * e * math.sin(m),
         0.01608 * math.sin(2 * mp), 0.01039 * math.sin(2 * f),
         0.00739 * e * math.sin(mp - m),
         -0.00514 * e * math.sin(mp + m)]
    return jde + math.fsum(c) - RD0


def sun_lon(rd):
    t = (rd + RD0 - 2451545.0) / 36525.0
    m = rad(357.52911 + 35999.05029 * t)
    om = rad(125.04 - 1934.136 * t)
    c = [280.46646, 36000.76983 * t,
         (1.914602 - 0.004817 * t) * math.sin(m),
         0.019993 * math.sin(2 * m), 0.000289 * math.sin(3 * m),
         -0.00569, -0.00478 * math.sin(om)]
    return math.fsum(c) % 360.0


def sun_at(target, lo, hi):
    for _ in range(50):
        mid = (lo + hi) / 2
        if (sun_lon(mid) - target + 180.0) % 360.0 - 180.0 < 0:
            lo = mid
        else:
            hi = mid
    return lo


def deepavali(y, terms):
    ay = AY2000 + (y - 2000) * PREC
    ts = sun_at(180.0 + ay, date(y, 10, 5).toordinal(),
                date(y, 10, 30).toordinal())
    k = int(round((ts + RD0 - 2451550.09766) / 29.530588861)) - 2
    while new_moon(k, terms) <= ts:
        k += 1
    nm = new_moon(k, terms)
    return math.floor(nm + TZ) - 1, ts, nm


def cny(y, terms):
    ws = sun_at(270.0, date(y - 1, 12, 15).toordinal(),
                date(y - 1, 12, 28).toordinal())
    wsd = math.floor(ws + TZ)
    k = int(round((ws + RD0 - 2451550.09766) / 29.530588861)) - 2
    seen = 0
    while True:
        d = math.floor(new_moon(k, terms) + TZ)
        if d > wsd:
            seen += 1
            if seen == 2:
                return d, wsd
        k += 1


def fixed_islamic(y, m, d):
    return (d + 29 * (m - 1) + (6 * m - 1) // 11 + (y - 1) * 354
            + (3 + 11 * y) // 30 + EPOCH - 1)


def festivals(lo, hi):
    raya = [fixed_islamic(h, 10, 1) for h in range(lo - 625, hi - 575)]
    raya = [r for r in raya if lo <= date.fromordinal(r).year <= hi]
    cn = [cny(y, True)[0] for y in range(lo - 1, hi + 2)]
    dv = [deepavali(y, True)[0] for y in range(lo - 1, hi + 2)]
    return raya, cn, dv


def nearest(r, xs):
    return min((x - r for x in xs), key=abs)


W = 7

if __name__ == "__main__":
    raya, cn, dv = festivals(1950, 2100)
    for name, xs in (("Chinese New Year", cn), ("Deepavali", dv)):
        hits = []
        for r in raya:
            g = nearest(r, xs)
            if abs(g) <= W:
                hits.append("{}({:+d})".format(date.fromordinal(r).year, g))
        print("Aidilfitri within {} days of {}: {} years".format(
            W, name, len(hits)))
        for i in range(0, len(hits), 7):
            print("  " + " ".join(hits[i:i + 7]))
    print("gap = festival minus Aidilfitri, days; {} Aidilfitri checked"
          .format(len(raya)))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《马来西亚多元节庆移动日历叠加、开斋节农历新年屠妖节浮动日期与促销排期对齐母典》第 5 章「节庆相遇的概率:均匀相位模型为何失效」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-313 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026313,
  author    = {Fan, Yafu},
  title     = {Moving Festival Calendars in Multicultural Malaysia: Overlaps of Hari Raya, Chinese New Year and Deepavali and the Alignment of Promotional Schedules},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论