Bourbon science!

The following results were achieved through a single blind study (Tracy was the blinder, however, so her results are not blinded at all):

Bourbons ranked (with control scotch)

Maker’s Mark Woodford Reserve Four Roses Dewar’s 12 year

Tracy 3 2 4 1

Tom 2 1 4 3

Peter 1 3 2 4

Dan 2 1 4 3

Clear winner: Woodford Reserve. Now you know, thanks to SCIENCE!

Rational

I’m pretty sure I have never done a rational thing in my entire life. And probably neither has anyone else. “Rational”, as used by economists, seems to mean things which are optimal with respect to my current abilities. Consider the case of a 15th century person. It seems to me that the optimal thing to do is to quickly develop a germ theory of disease and then start a dang industrial revolution ASAP. Anything else, and you are pretty much just treading water.

What is the “rational” thing I should currently be doing?

Java got this wrong

All variables should be private final by default. Making the defaults different from good design practices is a gateway to troubles. Coders (and especially students) have a job that is hard enough. Make the defaults support them doing their job right. final should be the default, and mutable should be a keyword for variables that need to change over time. Don’t even get me started on the fact that putting no declaration in front of a method makes it package protected, a status which it is impossible to give a function in any other way.

Java’s got 99 problems, but segfault ain’t one. final is, though.

Planning horizons

Nuclear power is safe. Or it can be. If the organization running the plant has a sufficiently long planning horizon, they will make wise decisions and not have a CEO who hides in his office while the plants melt down.

So, the proposed rule is: only groups whose planning horizon is 100 years or more are allowed to run a nuclear power plant. Question for the world: can you name such an organization?

Candidates: The Catholic Church. The Corporation (the organization that runs Harvard). The International Criminal Court? Anyone else? Having nuclear power provided by professors, priests, and judges doesn’t sound like the right way to run things. As for more traditional governments, I suggest that the planning horizon is necessarily no more than three election cycles. Far-thinking senators may work for things that pay off in 18 years, but presidents max out at 12, and representatives max out at 6. Realistically, probably half of that for most politicians. This is, of course, why climate change is a hard problem – it requires a 200 year planning horizon, and immediate collective action to avoid too large of a catastrophe.

Maybe The Long Now Foundation really can get people thinking longer term. I certainly hope so.

Praise and scorn – regressing to the mean

Because people to regress to the mean, scolding always seems to work, and praise never seems to work. But this is a statistical illusion brought on by bosses with no knowledge of math and a surplus of hubris. I was reminded of this phenomenon when I read a blog post by FemaleScienceProfessor who wrote about a departmental chair who is relentlessly negative.

After someone does a great job, it is likely that they will do a poorer job on the next thing as they regress to their own mean. Thus, if a boss are not aware of this, praise will seem ineffective, as the response to praise will be a poorer job than the previous time. Note though, that the next job is highly likely to be worse no matter what – the effect of the praise is likely small as compared to the regression effect. On the other hand, if someone does a poor job, then it is quite likely that they will do a better job next time. In this, they will be regressing to the mean from the below, rather than from above (progressing to the mean?). Thus, to the boss who is unaware of this effect, scolding will seem super-effective because after the scolding, the person did a better job the next time (which they would have done anyway as the regressed to the mean).

All of this together, means that a boss who has not taken this effect to heart can end up becoming a scolding nagging passive-aggressive constantly-negative boss, because, in their experience, negative feedback is the only thing that appears to get results. The tricky thing, and this requires humility on the part of the boss, is to accept that these “results” would have been obtained without the boss’s praise or scolding, simply through a well-understood statistical phenomenon. When managing people, you are not as influential as you think you are, and their response to praise is not a reflection on you.

Consider a random number generator that generates a number uniformly at random between 0 and 10, inclusive. I want a nice high average, so I will give it a scolding whenever my random number generator spits out a number 0, 1, or 2. If it spits out a number higher than 2 the next time, my scolding will be counted as successful. If it spits out a number 8, 9, or 10, then I will praise it! If it spits out an 8, 9, or 10 the next time, then I will count my praise as successful. I implemented code to do this, and the code can be seen here. The results were as follows, after generating 1,000,000 random numbers in a row:

Total Successful Unsuccessful
Praise 273,042 74,701 (27%) 198,340 (73%)
Scorn 272,115 198,430 (73%) 73,685 (27%)

From this, we can see that praise is ineffective at encouraging random number generators (it only works 27% of the time), but scolding and punishment are 73% effective! This is, of course, absurd. The random number generator isn’t responding to our praise or punishment at all. It just happens to be true that we are less likely to get two high numbers in a row than a number that is high followed by a non-high number. The output, if high, is likely to regress to the mean. But if we really believed that we could determine the output of the random number generator, we would be forced to conclude that being a jerk totally works!

Any bosses who think they are first-order determiners of employee success and do not take this effect into account, will tend to become jerks over time.

Forty five

I am 45 times faster at programming than my students. I just verified this again, in two different (Jr and Sr) classes with two different populations. 45 seems like a huge number in this context. It means that every 60 seconds of me programming corresponds to 45 minutes of their programming. How can I speed them up?

A factor of 10, I would believe. But this is in my junior and senior classes, and I’m not referring to the bad students. Things which take me 25 or 36 minutes take them 27 hours (example 1 (25 minutes for me, 20+ hours for them) and example 2 (36 minutes for me, unknown for them)). Things which take me 3 minutes take them 2 hours. Do you remember starting out a slow programmer and getting faster? If so, what helped you? If you teach CS, what is your multiplier? The last time I asked this question, the discussion happened on Facebook and now most comments are lost to time. But it was valuable, and I would like to save it for the future.

Atoms

Ask an average undergraduate: Is matter composed of atoms? Yes. Why do you think so?

I realized I have no idea why I am so sure that matter is composed of atoms. It seems a really useful explanatory model with lots of power, but nobody in any class I ever took argued for any evidence that we were made of little molecules and those molecules were indivisible atoms (well, not so indivisible, but you get my point). Einstein apparently got the Nobel prize for his explanation that “molecules are real, because otherwise Brownian motion makes no sense” (an overly crude characterization, for which I pre-emptively apologize. Particularly since he actually made quantitative predictions based on this idea). Somehow, we went from classical motion to quantum, and never once in jr high (Physical Science), high school (AP Physics AB and AP Chemistry), college (the common core) , or grad school (but that was CS and so the question did not come up), do I recall someone presenting me with a demonstration or even argument that atoms are real, and that matter is, in that sense, indivisible past a certain point. Way to make a very interesting point, Alan Sokal

Random Integer

I was reading an article in New directions in the philosophy of mathematics[1] on the subway, and one of the authors talked about how Kolmogorov’s axiomatization of the foundations of mathematics was obviously incorrect because it couldn’t express the “intuitively obvious” notion of selecting an integer uniformly at random.

Now wait a minute — perhaps these notions are intuitive to mathematicians, but upon thinking about it I have no idea how one might express the notion of choosing an integer uniformly at random. Some fun facts about this supposedly-intuitive process, all of which are true with probability 1: the number will contain more digits than there are atoms in the universe, it will take longer than the age of the universe to write down the number, the number chosen will not be expressible in any simpler notation (like exponential notation or any other notation one could come up with), and any computer program which output this number would take up as much space as the number itself.

All of which caused me to want to look more at Kolmogorov’s attempts at a foundation to math, and to formulate a handy rule of thumb. If you think you are right and Kolmogorov is wrong, then you are probably wrong. Also, a fun little insight from a colleague in the Math side of the Math/CS department: Looked at the right way, Peano’s axioms are slightly circular! 0 is defined as 0. 1 is defined as succ(0) the successor to 0. 2 is defined as succ(succ(0)), the successor to the successor to 0. But how can we distinguish 2 from the other integers? We count the parentheses! Since there are 2 parentheses, we know the number being represented is 2. But this process to define 2 actually uses the number 2 (count up to 2 parentheses), which, unless done very carefully, is not okay.


[1] – I was reminded how much I like reading the philosophy of mathematics upon hearing the news of the passing of Professor Alvin White, who taught “Philosophy of Mathematics” at Harvey Mudd College — one of the best classes I ever took.

Math fun

A new math rule! Validated below, and brought to you by the subset of my students who are all too willing to make bad leaps of illogic when solving problems.

\frac{16}{64} = \frac{1\not{6}}{\not{6}4} = \frac{1}{4}
\frac{26}{65} = \frac{2\not{6}}{\not{6}5} = \frac{2}{5}
\frac{19}{95} = \frac{1\not{9}}{\not{9}5} = \frac{1}{5}
\frac{49}{98} = \frac{4\not{9}}{\not{9}8} = \frac{4}{8}

Experimental hypothesis: \frac{ab}{bc} = \frac{a}{c} for all a, b, and c.

Data: See above.*

Data confirms the hypothesis! New rule now in effect.

* Derived from here

Philosophy of science

I was reminded by a recent blog post* about a feature of science that we don’t like to talk about very much, which is its opposition to reason. In science, when mathematical proof (the highest standard and purest form of reasoning we have as humans) disagrees with the results of an experiment, then that reasoning is deemed wrong.

St Thomas Aquinas was the very paragon of reason – he thought and thought and thought and thought, and based all of his conclusions on the axioms contained in The Bible, plus a few more from the Greeks. Going back to the Greeks, we find that Aristotle too was the paragon of reason – he thought and thought and thought. However, neither ever really tested their ideas against the world. Aristotle, if he had, would have almost immediately discarded his “heavy things fall faster” model, despite the fact that such a model makes a lot of sense. But dropping an olive and a big rock at the same time would have settled the question, and show the empirical falseness of his rational truth.

The world doesn’t care about reason and rationality and proof. Instead, the world simply is what it is. It is with science that we seek to predict how things will work, but when our rational predictions based on our developed models fail to predict behavior in the world, it is not the world that is wrong, it is our (now slightly falsified) models. So when we say “Math and Science”, we are really talking about two systems of thought which are actually much more opposed than one might think.

          —Written by a guy who is a computer scientist in a CS/Math department and is frequently called upon to cover math courses, and, like the sidebar says, tends to overthink things a bit.

* – Although Tracy can attest that I have been thinking about this on and off for a bit now.