`isSquare`

function. But in fact it seems to be safe.
JavaScript’s `sqrt`

function is supposed to adhere to the IEEE specification for floating-point arithmetic. That specification requires that the calculated square root of any finite representable number can never be less than the floor of the correct root. (My authority for this statement is *The Handbook of Floating Point Arithmetic*, by Jean-Michel Muller et al., Birkhäuser, 2010, pp. 265–267.) I have checked that the statement is true for all \(N^2\) with \(N \in \{1, 10^9\}\).

http://www.4cornersmedia.co.uk/hexagonalgeometry/newspherepacking.html

https://www.reddit.com/r/math/comments/72rkvk/calling_all_mathematicians_a_new_way_to_stack/

]]>But thinking through it was great! Thank you for your analysis.

Here was my writeup

—-

After the first round, every chick has a 1/4 probability to be unpecked. (1/2^2)

Of the unpecked chicks,

1/2 are immortal singletons, and 1/2 are in pairs.

So there is a

1/4 * 1/2 = 1/8 chance of immediately becoming a singleton unpecked chicken and therefore immortal, plus a 1/8th chance of ending up in a pair of unpecked chicks. (And a 6/8th chance of being pecked).

For each unpacked pair, there are four outcomes:

1/4: a pecks b

1/4: b pecks a

1/4: a pecks b and b pecks a

1/4: neither pecks the other.

Let the number of immortal chicks coming from a pair = u. Then,

u = 1/2 + 1/4u

3/4u = 1/2

u = 2/3

From above, the expected fraction of *chicks in pairs* is 1/8, so the fraction of *pairs* is 1/16 of the total chick count.

1/8+ 1/16(2/3) ~= .1667

]]>In the statement of the Hurwitz theorem, should it be \((\sqrt{5}b^2)^{-1}\)? ]]>

If a, b are relatively prime positive integers, and if \(|bx-a|<|dx-c|\) for all pairs c, d of relatively prime positive integers satisfying \(d\le b\) and \(c/d\ne a/b\), then a/b is called a best approximation of the 2nd kind (BA2) to x. Every BA2 to x is a BA1 to x, but not conversely. A fraction is a BA2 to x if and only if it is a convergent of the continued fraction for x.

A theorem of Hurwitz states that for every real irrational x there are infinitely many rational approximations a/b with \(|bx-a|<(\sqrt5 b)^{-1}\). So if you use \(|bx-a|^{-1}\) as a measure of the merit of the approximation a/b, you'll find that every real irrational has a sequence of approximations of unbounded merit. If you use \((b|bx-a|)^{-1}\), you'll find that each quadratic irrational has only approximations of bounded merit. The precise behavior of \(\log|b\pi-a|/\log b\) as a/b runs through approximations to pi is not known.

]]>As for the Carnival — of course, I’d be delighted. ]]>

P.S. May I include a link to this post on this month’s Aperiodical Carnival of Mathematics?

]]>