Refactor monogramRefactor

Mathematics / Heat grids · Numerical error

How much of the last hundredth comes from sampling?

Lattice sampling accounts for 0.45% of the remaining discrepancy when a line heat grid doubles from 1,024 to 2,048. Keep the Gaussian pulses fixed to measure that share, then recover the missing shape from one tick.

Begin with: Weighted averages and the two signs of a checkerboard. The preceding article explains the thermometer and the crossing of its two pulses.

Lattice sampling accounts for about 0.45% of the last hundredth of a percentage point when the walls of a heat grid move from 1,024 cells away to 2,048. To see where the rest goes, keep the same two Gaussian pulses and read their weights at the actual cells and ticks. The shortfall barely moves. Put the first missing shape term back into those pulses, and the prediction agrees with the grid to five decimal places.

Insert one row between the pulse and the grid

The thermometer sits at the center of a line with absorbing walls. It reads the center minus the average of its two neighbors. At wall distance d, a cell holds h = 1/d of its heat each tick and shares the rest equally left and right. The sharp error factor C(d,1/d) adds the absolute backward thermometer weights over all cells and ticks. Subtract the free checkerboard contribution d to get R(d) = C(d,1/d) − d. Doubling the wall distance adds D(d) = R(2d) − R(d), approaching Q = √(2/(πe)) log 2 on the line.

The crossing-gap calculation followed the same pulse heights on the two grids. After restoring the thermometer scale, the wall time, the checkerboard decay and the two pulse widths, its prediction overshot the grid by 0.00969 percentage point. Insert a row between those last two calculations. Each row below uses its own pair of residuals and reports 100 × (1 − D(d)/Q).

Shortfall on the line when the wall distance doubles from 1,024 to 2,048. Changes are in percentage points.
Weights usedShortfallChange
Continuous Gaussians10.66587583%—
Same Gaussians on cells and ticks10.66583178%−0.00004405
Discrete backward weights10.65618222%−0.00964956

Divide the first drop by the total drop. Sampling accounts for about 0.45%, and replacing the sampled Gaussian profiles with the actual grid weights accounts for the other 99.55%. These shares describe the change on doubling in this order of substitutions. Errors in the individual residuals can partly cancel when the two grids are subtracted.

Keep the two pulse profiles fixed

Write c = 1 − h for the fraction that moves, r = 1 − 2h for the checkerboard damping, and gv(x) for a centered Gaussian density with variance v. At lag t, try a smooth thermometer weight U and an alternating pulse of magnitude H. One tick fixes both profiles.

U = (1 − x²/(ct)) gct(x)/(2ct),

H = 2rt gct/r(x).

The checkerboard sign at cell x and tick t is ε = (−1)x+t. The proposed weight is U + εH. A sign reversal earns twice the magnitude of the disagreeing weight. Writing (z)+ = max(z, 0), a cell earns 2(−εU − H)+. For example, if U is positive and larger than H, only the negative parity earns anything. It earns 2(U − H). Averaging both parities gives (U − H). For either sign of U the parity average is (|U| − H)+.

For the first row, integrate that average over continuous position and lag on the crossing branch. For the middle row, keep ε at each integer cell and tick and sum its earnings. Use the exact early checkerboard baseline 2rt, which sums to d. The free grid has zero disagreement through t ≤ (d − 1)/2. At late times, fold the smooth pulse by odd reflection at the absorbing walls. The two rows keep the same decay, widths and wall condition throughout.

One more comparison isolates the clock. Integrate over position at each integer tick. The shortfall changes by about −0.000000044 percentage point, roughly a thousandth of the sampling change. Almost all of that small change arrives when we put the two parities back on their own cells.

Restore the shape term that one tick predicts

A spatial wave of frequency θ is multiplied by h + c cos θ at each tick. The thermometer multiplies it by 1 − cos θ. Near frequency zero, the tick gives the smooth pulse. Near π, remove the alternating sign and rt to get the checkerboard pulse. In both neighborhoods the normalized tick has the form 1 − a(1 − cos k), where k is the offset from the peak. The smooth value is a = c and the checkerboard value is a = c/r.

log[1 − a(1 − cos k)]

= −ak²/2 + a(1 − 3a)k⁴/24 + O(k⁶).

Set κ(a) = a(1 − 3a) and write Dj for the jth derivative with respect to x. In the inverse Fourier transform k² gives −D², k⁴ gives D⁴, and k⁶ gives −D⁶. Multiply the quartic tick correction by the leading thermometer term and also keep the next term of the thermometer itself. The two spatial corrections are

ΔU = −D⁴gct/24

  − tκ(c)D⁶gct/48,

ΔH = rt[D²gat/2

  + tκ(a)D⁴gat/12], with a = c/r.

For example D⁴gv = (z⁴ − 6z² + 3)gv/v² with z = x/√v. The sign of the D² term in ΔH comes from expanding 1 + cos k at the checkerboard peak. In the cell count use U + ΔU and H + ΔH in place of U and H. In the wall calculation reflect the corrected smooth weight with the same alternating images.

The quadratic term produced the Gaussian. Retain the quartic term and the next term in the thermometer multiplier, sample again, and the shortfall becomes 10.65618%. The coefficients come directly from the tick. That is a separate check on the 99.55% attribution using a prediction for the missing shape.

Check the grid reference

Propagate the actual weights with 112 fractional bits. Each rounded update introduces at most 2−113 error per cell. An error at position x can contribute for at most the mean exit time (d² − x²)/c in the sum of absolute weights. Once a computed row is nonnegative, all its exact subsequent updates stay nonnegative and the mean exit times sum its remaining contribution. This gives R(1,024) ≈ 2.712821216507 and R(2,048) ≈ 3.012518487337, with less than 10−15 percentage point of arithmetic uncertainty in their normalized doubling shortfall before display rounding.

The Gaussian rows use numerical integration, and the 0.45% split concerns this particular doubling. The large-grid crossing law measures the discrepancy from the earlier, uncorrected model. The printable sampling test (PDF) gives the finite comparison and its checks together. The series begins with a pair of Fibonacci numbers in Recurrences and heat grids.

Start the doubling at 2,048 and the sampling share rises to 0.83%, even though the sampling change is smaller. Why did the sampling share rise from 0.45% to 0.83%? follows the moving sign change and proves that the share tends to zero.