Skip to content
HN On Hacker News ↗

The colors of a soap film | Aseem Raj Baranwal

▲ 43 points • 7 comments • by gregsadetsky • 2w ago • HN discussion ↗

Pangram verdict · v3.3

We believe that this text is a mix of AI and human-written content.

18 %

AI likelihood · overall

Mixed
82% human-written 18% AI-generated
SEGMENTS · HUMAN 34 of 50
SEGMENTS · AI 14 of 50
WORD COUNT 1,494
PEAK AI % 100% · §3
Analyzed
Oct 28
backend: pangram/v3.3
Segments scanned
50 windows
avg 30 words each
Distribution
82 / 18%
human / AI fraction
Verdict
Mixed
Pangram v3.3

Article text · 1,494 words · 50 segments analyzed

Human AI-generated
§1 Human · 0%

A soap film is a sheet of water between two layers of soap molecules, often thinner than a micrometer.

§2 Mixed · 31%

A vertical film drains under gravity and is thinner at the top, so in white light it shows bands of color ordered by thickness.

§3 AI · 100%

Newton watched them on bubbles kept under a glass cover (Opticks, Book II, Part I, Observation 17): colored rings formed at the top, widened and moved down as the water drained, and a black spot grew at the top before the bubble broke.

§4 AI · 100%

The color at thickness dd follows from two ingredients: the fraction of light the film reflects at each wavelength λ\lambda, and the three color-matching functions that the CIE (the International Commission on Illumination) uses to reduce a spectrum to a color.

§5 Human · 0%

The first is a single cosine in 1/λ1/\lambda, so the color is a fixed white minus the cosine transform of the color-matching functions, evaluated at 2nd2nd, the extra optical path traveled by light reflected from the film’s back surface, where nn is the refractive index of water.

§6 Human · 0%

The computed colors agree with the table of thicknesses that Newton compiled for them.

§7 Human · 0%

The reflected spectrum is a cosine Consider light of wavelength λ\lambda that travels normal to the film, perpendicular to its two surfaces.

§8 Human · 0%

Two beams return toward the eye.

§9 Human · 0%

One is reflected by the front surface.

§10 Human · 0%

The other crosses the film, is reflected by the back surface, and crosses the film again. Light is an electromagnetic wave: an electric field and a magnetic field that oscillate together as the wave travels. The amplitude of a beam is the size of its electric field’s oscillation, and the brightness of the beam is proportional to the square of its amplitude. In the figure, each beam is labeled with its amplitude as a multiple of the incoming beam’s amplitude.

§11 Human · 0%

d 1 r t −rt −rtt′ ≈ −r air, index 1 front surface water, index n back surface air front-surface wave back-surface wave their sum, the reflected light τ direction of travel → All the beams in the figure travel along the same line, normal to the film.

§12 AI · 100%

They are drawn side by side so that each one can be labeled.

§13 AI · 100%

The right half shows the two returning waves at one instant. The back-surface wave is the front-surface wave turned upside down, and it trails the front-surface wave by a distance τ\tau, derived below.

§14 AI · 100%

The light that reaches the eye is the sum of the two waves.

§15 Mixed · 36%

How much each surface reflects.

§16 Human · 0%

When light travels normal to a surface, its electric and magnetic fields both lie parallel to the surface.

§17 Human · 0%

In a medium of refractive index nn, the amplitude of the magnetic field is proportional to nn times the amplitude of the electric field.

§18 AI · 95%

Suppose a beam of amplitude 11 crosses a boundary from a medium of index n1n_1 into a medium of index n2n_2.

§19 AI · 100%

It splits into a reflected beam of amplitude rr and a transmitted beam of amplitude tt. Maxwell’s equations require each field to take the same value on both sides of the boundary.

§20 Human · 27%

For the electric field, this condition reads 1+r=t1 + r = t.

§21 Human · 0%

The reflected beam travels in the opposite direction, so its magnetic field points the opposite way, and the condition for the magnetic field reads n1(1−r)=n2 tn_1(1 - r) = n_2\,t.

§22 Human · 0%

Solving these two equations gives the Fresnel coefficients for normal incidence, r=n1−n2n1+n2,t=2n1n1+n2.r = \frac{n_1 - n_2}{n_1 + n_2}, \qquad t = \frac{2n_1}{n_1 + n_2}.

§23 Human · 0%

In the soap film, the index is 11 for air and nn for water.

§24 Human · 0%

At the front surface, light passes from air into water, so r=(1−n)/(1+n)r = (1-n)/(1+n) and t=2/(1+n)t = 2/(1+n). For n=1.33n = 1.33, r=−0.142r = -0.142.

§25 Human · 0%

At the back surface, light passes from water into air.

§26 Human · 0%

The two indices trade places, and the reflection coefficient becomes (n−1)/(n+1)=−r(n-1)/(n+1) = -r.

§27 Human · 0%

The two reflections therefore have opposite signs.

§28 Human · 0%

On its way out, the back-surface beam passes through the front surface from water into air, with transmission coefficient t′=2n/(1+n)t' = 2n/(1+n). This beam is transmitted, reflected and transmitted again, so it returns with amplitude t (−r) t′  =  −r⋅4n(1+n)2  =  −r (1−r2).t\,(-r)\,t' \;=\; -r\cdot\frac{4n}{(1+n)^2} \;=\; -r\,(1 - r^2). The last step uses (1+n)2−(1−n)2=4n(1+n)^2 - (1-n)^2 = 4n. For water, 1−r2=0.981 - r^2 = 0.98. From here on I approximate 0.98≈10.98 \approx 1, which changes the back-surface beam’s amplitude by 2%2\%, so the two returning beams have amplitudes rr and −r-r.

§29 Human · 0%

How far the second beam trails the first. The back-surface beam travels an extra distance 2d2d inside the water, where the wavelength shortens to λ/n\lambda/n.

§30 Human · 0%

It therefore falls behind the front-surface beam by 2d/(λ/n)=τ/λ2d/(\lambda/n) = \tau/\lambda wavelengths, where τ=2nd\tau = 2nd is the optical path difference between the two beams. In air, where the wavelength is λ\lambda, this is a distance τ\tau, as in the figure. Each wavelength of delay is one full cycle of the oscillation, so the back-surface wave is shifted in its cycle by the angle φ=2πτ/λ\varphi = 2\pi\tau/\lambda.

§31 Human · 0%

This angle is called the phase difference.

§32 Human · 0%

Two waves with different phases are added by writing each one as a complex number whose magnitude is the amplitude and whose angle is the phase, as in the Euler’s identity post. A shift by the angle φ\varphi multiplies the complex number by eiφe^{i\varphi}. The light reflected by the film therefore has amplitude r−r eiφ  =  r (1−eiφ),φ=2πτλ.r - r\,e^{i\varphi} \;=\; r\,\big(1 - e^{i\varphi}\big), \qquad \varphi = \frac{2\pi\tau}{\lambda}. The reflectance RR is the fraction of the incoming light that the film reflects.

§33 Human · 0%

Brightness is proportional to the square of the amplitude, so RR is the squared magnitude of this complex number.

§34 Human · 0%

Since ∣1−eiφ∣2=(1−cosφ)2+sin2φ=2−2cosφ|1 - e^{i\varphi}|^2 = (1 - \cos\varphi)^2 + \sin^2\varphi = 2 - 2\cos\varphi, R(λ)  =  2r2(1−cos2πτλ)  =  4r2sin2 (πτλ).R(\lambda) \;=\; 2r^2\Big(1 - \cos\frac{2\pi\tau}{\lambda}\Big) \;=\; 4r^2 \sin^2\!\Big(\frac{\pi\tau}{\lambda}\Big).

§35 Human · 0%

Taking n=1.33n = 1.33 constant across the visible band, r2=0.0201r^2 = 0.0201, so RR lies between 00 and 4r2=8.0%4r^2 = 8.0\%.

§36 Human · 0%

In the wavenumber σ=1/λ\sigma = 1/\lambda, R=2r2(1−cos2πστ)R = 2r^2(1 - \cos 2\pi\sigma\tau) is a single cosine with period 1/τ1/\tau.

§37 AI · 100%

Light can also bounce back and forth inside the film several times before it leaves.

§38 AI · 100%

Summing all of these reflections gives the exact Airy formula (Born and Wolf, §7.6). Its higher harmonics cos(2πkστ)\cos(2\pi k\sigma\tau), for integers k≥2k \ge 2, shrink by a factor r2≈0.02r^2 \approx 0.02 from each kk to the next, and the two-beam formula stays within about 4%4\% of it. Three numbers from a spectrum For the CIE 1931 standard observer, light with spectral power P(λ)P(\lambda) is described by three tristimulus values X=∫P xˉ dλ,Y=∫P yˉ dλ,Z=∫P zˉ dλ,X = \int P\,\bar x\,d\lambda, \qquad Y = \int P\,\bar y\,d\lambda, \qquad Z = \int P\,\bar z\,d\lambda, where xˉ,yˉ,zˉ\bar x, \bar y, \bar z are the tabulated color-matching functions. Two lights with the same (X,Y,Z)(X, Y, Z) look identical to the standard observer, and since yˉ\bar y is the eye’s sensitivity to brightness, YY is the luminance.

§39 AI · 100%

Light reflected by the film has P=SRP = SR for an illuminant with spectrum SS.

§40 Human · 0%

I use D65, the CIE’s standard representation of average daylight (Newton viewed his bubbles “by Reflexion of the Skies when of a white Colour”), normalized so that a perfect reflector has the white point W=(0.950, 1, 1.089)W = (0.950,\ 1,\ 1.089).

§41 AI · 100%

The sRGB standard specifies the 3×33 \times 3 matrix and the encoding curve that take (X,Y,Z)(X, Y, Z) to the color a screen displays.

§42 AI · 100%

The color is a cosine transform Substitute RR into the three integrals and change variables to σ=1/λ\sigma = 1/\lambda.

§43 Human · 9%

Define three weight curves on the wavenumber axis by wx(σ) dσ  =  S(λ) xˉ(λ) dλ∫S yˉ dλ,w_x(\sigma)\,d\sigma \;=\; \frac{S(\lambda)\,\bar x(\lambda)\,d\lambda}{\int S\,\bar y\,d\lambda}, and wyw_y, wzw_z likewise, so that their integrals are the three components of WW.

§44 Human · 0%

With w=(wx,wy,wz)w = (w_x, w_y, w_z), the tristimulus values of the film are (XYZ) (d)  =  2r2(W−c^(τ)),c^(τ)=∫w(σ)cos(2πστ) dσ,τ=2nd.\begin{pmatrix} X \\ Y \\ Z \end{pmatrix}\!(d) \;=\; 2r^2\big(W - \hat c(\tau)\big), \qquad \hat c(\tau) = \int w(\sigma)\cos(2\pi\sigma\tau)\,d\sigma, \qquad \tau = 2nd.

§45 AI · 100%

The vector c^(τ)\hat c(\tau) is the cosine transform (the real part of the Fourier transform) of the three weight curves, evaluated at the path difference. The black film.

§46 AI · 100%

At d=0d = 0 the cosine equals 11 at every wavelength, so c^(0)=W\hat c(0) = W and the film reflects nothing: the two reflections cancel exactly.

§47 Human · 0%

For small dd, R(λ)≈4r2(πτ/λ)2R(\lambda) \approx 4r^2(\pi\tau/\lambda)^2 is proportional to 1/λ21/\lambda^2, so the first light reflected by a thin film is weighted toward short wavelengths. Its chromaticity, in the CIE coordinates (x,y)=(X,Y)/(X+Y+Z)(x, y) = (X, Y)/(X + Y + Z), is (0.266,0.281)(0.266, 0.281), bluer than the white point at (0.313,0.329)(0.313, 0.329).

§48 Human · 0%

This bluish gray is the faint blue that Newton lists right after black.

§49 Human · 0%

At d=10d = 10 nm the film reflects 0.18%0.18\% of the light, less than a tenth of the 2%2\% reflected by a single water surface but not zero, and Newton could see “the Images of some things (as of a Candle or the Sun) very faintly reflected” from the black spot.

§50 Human · 0%

The orders.