What does Melanopic Light and Blue-Light Lenses conclude, in numbers, about “A Light Meter, a Lens and a Notebook”?

Answer: Chapter 8 gives a light-meter routine and a self-test plan: seeing a 10-minute effect needs about 36 nights per arm. Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses.

Scope of the numbers: Its spectra, lenses, people and days are illustrative models; all calculations are generated by its programs; the book is not medical advice, diagnoses or treats no condition, and tinted lenses must never be worn to drive at night. Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's 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: 10, 16, 36

night-to-night sddelta 10 mindelta 5 min
101663
1536142
2063252
simulated power, sd 15, delta 10, 36 nights per arm: 0.804
simulated power with only 7 nights per arm: 0.266
Show the full program
# Chapter 8. p16: How many nights does a self-test need? Nights with
# and without glasses, in random order; sleep latency varies from night
# to night with standard deviation sd. Nights per arm to detect a true
# difference delta (two-sided 0.05, power 0.80): n = 2 ((1.95996 +
# 0.84162) sd / delta)^2. A simulation with seed 104 checks the power of
# the planned size. The clear lens of p07 is the natural sham.
import math
import random

rng = random.Random(104)
ZA, ZB = 1.95996, 0.84162


def nights(sd, delta):
    n = 2 * ((ZA + ZB) * sd / delta) ** 2
    return int(n) + (n > int(n))


def power(n, sd, delta, reps=4000):
    hits = 0
    for _ in range(reps):
        a = [rng.gauss(delta, sd) for _ in range(n)]
        b = [rng.gauss(0.0, sd) for _ in range(n)]
        ma, mb = math.fsum(a) / n, math.fsum(b) / n
        va = math.fsum((x - ma) ** 2 for x in a) / (n - 1)
        vb = math.fsum((x - mb) ** 2 for x in b) / (n - 1)
        hits += abs(ma - mb) / ((va + vb) / n) ** 0.5 > ZA
    return hits / reps


if __name__ == "__main__":
    print("   night-to-night sd   delta 10 min   delta 5 min")
    for sd in (10, 15, 20):
        print("   {:17d}   {:12d}   {:11d}".format(
            sd, nights(sd, 10), nights(sd, 5)))
    n = nights(15, 10)
    print("   simulated power, sd 15, delta 10, {} nights per arm:"
          " {:.3f}".format(n, power(n, 15, 10)))
    print("   simulated power with only 7 nights per arm: {:.3f}".format(
        power(7, 15, 10)))

Single source and citation

Fan, Y. (2026). Melanopic Spectral Integration, Blue-Light Melatonin Suppression and Lens Transmittance Optimization (Version 1.0.0), Chapter 8: A Light Meter, a Lens and a Notebook. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-104 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026104,
  author    = {Fan, Yafu},
  title     = {Melanopic Spectral Integration, Blue-Light Melatonin Suppression and Lens Transmittance Optimization},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book