Fun with Python

Draw your own conclusions:

Grammar vs. politics. Or, education vs. ideology.
Grammar vs. politics. Or, education vs. ideology. (click to embiggen)
The red points are data from a analysis of nonnegative Facebook comments on the pages of these presidential candidates. The black curve is the most-optimal least-squares fit of a polynomial (fourth-order, in this case) that, among the polynomials tested (orders zero through eight), minimizes the information loss of that model representation of the data. This information loss minimization is called the Akaike Information Criterion.


Fast hairy monsters high up on a wall, incognizant of their fortune, being as they are — at least on occasion — and in more than one sense of the word, ascendant, beyond the ken of three prowling, ever-watchful, and even faster (as if that were imaginable, but imagination I’ve noticed often wears the Emperor’s illusory purple), hungry — or so they yowl at me, incessantly — feline beasts known throughout the land, their domain, not just for their sleek and deadly elegance but for torturing, and in turns dismembering, in that horrifying, playful, pure-sociopath way unique (one hopes) to their species — these nimble piliferous octopeds would be glad, if they but had the ganglions for it, that I spy them, at least some of them, first.

Why doesn’t everything mix into everything else?

An acquaintance on Facebook recently asked, “I’m still not sure why the conglomerate of particles that become me keep a recognizable shape and don’t suddenly get mixed up with someone else’s, since they’re all the same as far as anyone can tell.”

That’s a good — and surprisingly deep — question. First, why don’t we collapse, one atom into another, and for that matter merge with the ground under our feet? What separates our feet from our shoes from the ground? Two reasons spring to mind.

  1. Electrons. Try and meld one molecule or atom into another, and it’s the repellent electrostatic force[1] between the electron shells surrounding an atom’s nucleus or a molecule’s atoms that keeps everything, including you, from merging into one amorphous blob of goo.
  2. The weird rules of quantum mechanics. Specifically, the Pauli exclusion principle says that any two identical fermions (particles governed by Fermi-Dirac statistics, including electrons) cannot occupy the same quantum state. (Bosons — such as photons — are governed by Bose-Einstein statistics, which does allow them to occupy the same quantum state. That’s why lasers lase.) Pauli exclusion is why electrons arrange into shells around atomic nuclei. This means none of our constituent atoms can meld into one another.

These two fundamental characteristics of our universe, in essence, are what makes chemistry chemistry . . . and why we exist as independent physical entities.

Okay, then, second: what holds everything together? Why don’t all material objects disintegrate and fly apart due to electrostatic repulsion between the constituent atoms … and become one gigantic homogeneous expanding cloud of gas? [TBD]

[1]What is an electrostatic force? Suppose we have two non-moving charged particles, with charges $q_1$ and $q_2$, and separated by a distance $r$. The static force between these two particles, known as Coulomb’s law, is proportional to the charge values and inversely proportional to the square of the distance between them. In SI units, we write the size of this force in Newtons as $$F = k_e \dfrac{q_1 q_2}{r^2}$$ where $k_e = \dfrac{1}{4 \pi \varepsilon_0} = 8.987 551 787…\times 10^9\,\mathrm{N\,m^2\,C^{-2}}$ is the vacuum permittivity, $\varepsilon_0 = 8.854 187 817…\times 10^{-12}\,\mathrm{F/m}$ (Farads per meter), and $\mathrm{C}$ is the unit of charge, the Coulomb. This is of the same form as Newton’s law of gravitational attraction between two masses. It differs in the proportionality  constant ($k_e$ vs. $\mathrm{G}$) and in that it involves the product of two charges instead of the product of two masses. Since masses are always a nonnegative quantity but charges can be positive or negative, this means Coulomb’s law differs in one other respect: the force can be either repulsive (two positive charges or two negative charges) or attractive (a positive charge and a negative charge). Thus the rule of thumb: like charges repel, unlike charges attract.

electrostatic forces
image credit:

Is Trump’s Lead Significant?

Snapshot of polling results among Republican voters over the past three months [click to embiggen]
Snapshot of polling results among Republican voters over the past three months [click to embiggen]
At the moment, The Donald leads nationally among Republicans, with 29.8% favorability. Roughly 30% of polled Republicans currently favor Trump over the rest of the Republican Field of Clowns. People argue that 30 percent is not terribly impressive. Are they right?

You have to interpret more carefully than that. Roughly 30% of polled Republicans prefer Trump over the others. That last bit is important: that many other Clowns are vying for the prize matters in the interpretation of Trump’s 29.8 percent.

Since there are fifteen Clowns in this poll, an even distribution of favorability would be 6.7% per Clown. So Trump’s 29.8% is a pretty big outlier. How big? The mean of this favorability distribution is $\mu = 6.1$%, pretty close to the 6.7% expectation. The standard deviation of this distribution of Clown favorability ratings is $\sigma = 7.4$%. Trump’s $p = 29.8$% therefore is a $\Delta = \dfrac{\left|p\, – \mu\right|}{\sigma} = 3.2$-sigma outlier, which is statistically significant. What this means is that the chance of that being just a statistical fluke (i.e., the likelihood that a random choice from among a Gaussian distribution with $\mu = 6.1$% and $\sigma = 7.4$% would land you at 29.8% or higher) is $1 – \mathrm{erf} \left(\dfrac{\Delta}{\sqrt{2}}\right) = 0.0014 = 0.14$ percent.

In the physical sciences, a result lying three or more standard deviations away from the null hypothesis value is the typical bar for publishable significance. $\mathrm{erf}$ is the error function:

$$\mathrm{erf}(z) = \dfrac{1}{\sqrt{\pi}} \int_{-z}^z e^{-t^2} dt$$

and is the probability of a random variate lying between $-z$ and $+z$ in a distribution with zero mean and standard deviation $\frac 12$. Now, the 0.14% result above would hold if the favorability distribution were a normal (i.e., Gaussian) distribution, which it certainly is not. But the conclusions should correspond closely enough to reality to use as an approximate guide.

The next candidate down is Carson at 16.0%, and Bush is third at 8.3%. Carson is only 1.3 sigma out from the mean (Bush: $0.3\,\sigma$), which corresponds to the likelihood of his favorability rating being where it is or higher due to random chance is 18 percent (Bush: 77%).

Conclusion: Trump’s and Carson’s leads above the rest of this particular Republican Field of Clowns are currently significant, while for the rest it’s a coin toss in terms of preference — even for Bush.

Update 9/10: Numbers and graphic updated from original to reflect values current as of 10 September.

Nutballs and the Mode

Atheist Republic's Kaaba: Love Wins
A stylized Kaaba (click to embiggen).

Recently, Atheist Republic (AR) posted this image (⇒) in response to the Supreme Court’s decision (pdf) that legalizes marriage in the U.S. It is a Photoshopped image of the Kaaba in Mecca. The reaction from noisome elements of the Muslim community has been, predictably, swift, violent, and largely incoherent (cf. the Facebook post or AR’s original Twitter post for a sampling). AR’s post is fine; I think it is timely, in good taste, and makes a good point. However, I think AR made a mistake.

AR responded to the growing shit storm in a subsequent post on their web site (WARNING: one image, about ¾ of the way into the post, is deeply disturbing), electing to show a number of select examples of the insults and threats they’ve received to make a point:

Please keep in mind that these aren’t members of ISIS or Al-Qaeda making these statements, but rather are your everyday average Muslim.


…these aren’t extremists or jihadists, they’re just average Muslims. These are the ones who call themselves “moderate”.

And, if you are feeling particularly thick-headed:

To make it clear that these are supposed “moderate” Muslims, I’d like to point out that we know for a fact that one of these men is a US citizen. This particular commenter has specifically asked for information from one of our admins that he suspects lives in his area, and threatened said admin with physical violence against this admin and their family.

A skewed distribution (click to embiggen). Where do you think IPLs reside?

One thought kept nagging me as I read AR’s response: AR furnishes no valid evidence or argument to support the all-too-common claim that these select nutballs are “your everyday average Muslim” (as opposed to the crazies that carry out terrorist attacks in the name of their religion or, more accurately, their ignorant, deranged ideology). It seems likely to me that the cretinous whackjobs sprinkling AR’s posts with turds are neither average nor representative of Muslims in general. These whackjobs are — like our own noisome right-wing nutballs — an abnormally incoherent, ignorant, and vocal minority. I’ve no doubt average Muslims are as willingly delusion-controlled as our average Christians here in the U.S., but I have to question that the infantile profane loudmouths of either organized delusion system lie anywhere near the peaks (i.e., the modes) of their respective population distributions.

The excerpts above — and, indeed, AR’s entire argument — illustrate several common logical fallacies. In the first two excerpts, the author is arguing by assertion. This is a counterproductive rhetorical tactic. It raises people’s hackles, to your disadvantage.

The third excerpt is somewhat more interesting. First, it cherry-picks an anecdotal example. (The example itself also seems hardly relevant — a red herring.) This is a surprising mistake, since cherry-picking is perhaps the most common logical fallacy for which rationalists such as AR criticize religionists and the right-wing.

In this excerpt the author also equates being a U.S. citizen with being “moderate”, with no supporting argument or evidence. As recent events in the U.S. have shown repeatedly, there is nothing moderate about the beliefs of U.S. terrorists, Muslim or not. This is  a false equivalence, perhaps the second most common logical fallacy employed by the right (or maybe the third, behind strawman argument).

This is not an apology for “average” adherents to horrifically damaging organized delusion systems. From all that I’ve seen, Western religions are among the most senseless and destructive invented concepts in the history of humankind. But accuracy, precision, and validity in our claims and arguments, whatever the context, matter.

We rationalists are — or should be — better than this.


Seriously, you do not need to see this image — it cannot be unseen.

 Speaking of crazies, is there much, if any, difference between a Muslim terrorist who slaughters innocents in a medical treatment building and, say, a Christian terrorist who slaughters innocents in an African American church? Or between that (or any other) Muslim terrorist and a Christian terrorist who shoots dead a medical doctor during church services?