Tag Archives: math

Ab Normal Statistics and joke

The normal distribution of observation data looks sort of like a ghost. A Distribution  that really looks like a ghost is scary.

The normal distribution of observation data looks sort of like a ghost. A Distribution that really looks like a ghost is scary.

It’s funny because …. the normal distribution curve looks sort-of like a ghost. It’s also funny because it would be possible to imagine data being distributed like the ghost, and most people would be totally clue-less as to how to deal with data like that — abnormal statistics. They’d find it scary and would likely try to ignore the problem. When faced with a statistics problem, most people just hope that the data is normal; they then use standard mathematical methods with a calculator or simulation package and hope for the best.

Take the following example: you’re interested in buying a house near a river. You’d like to analyze river flood data to know your risks. How high will the river rise in 100 years, or 1000. Or perhaps you would like to analyze wind data to know how strong to make a sculpture so it does not blow down. Your first thought is to use the normal distribution math in your college statistics book. This looks awfully daunting (it doesn’t have to) and may be wrong, but it’s all you’ve got.

The normal distribution graph is considered normal, in part, because it’s fairly common to find that measured data deviates from the average in this way. Also, this distribution can be derived from the mathematics of an idealized view of the world, where any variety derives from multiple small errors around a common norm, and not from some single, giant issue. It’s not clear this is a realistic assumption in most cases, but it is comforting. I’ll show you how to do the common math as it’s normally done, and then how to do it better and quicker with no math at all, and without those assumptions.

Lets say you want to know the hundred-year maximum flood-height of a river near your house. You don’t want to wait 100 years, so you measure the maximum flood height every year over five years, say, and use statistics. Lets say you measure 8 foot, 6 foot, 3 foot (a draught year), 5 feet, and 7 feet.

The “normal” approach (pardon the pun), is to take a quick look at the data, and see that it is sort-of normal (many people don’t bother). One now takes the average, calculated here as (8+6+3+5+7)/5 = 5.8 feet. About half the times the flood waters should be higher than this (a good researcher would check this, many do not). You now calculate the standard deviation for your data, a measure of the width of the ghost, generally using a spreadsheet. The formula for standard deviation of a sample is s = √{[(8-5.8)2 + (6-5.8)2 + (3-5.8)2 + (5-5.8)2 + (7-5.8)2]/4} = 1.92. The use of 4 here in the denominator instead of 5 is called the Brussels correction – it refers to the fact that a standard of deviation is meaningless if there is only one data point.

For normal data, the one hundred year maximum height of the river (the 1% maximum) is the average height plus 2.2 times the deviation; in this case, 5.8 + 2.2 x 1.92 = 10.0 feet. If your house is any higher than this you should expect few troubles in a century. But is this confidence warranted? You could build on stilts or further from the river, but you don’t want to go too far. How far is too far?

So let’s do this better. We can, with less math, through the use of probability paper. As with any good science we begin with data, not assumptions, like that the data is normal. Arrange the river height data in a list from highest to lowest (or lowest to highest), and plot the values in this order on your probability paper as shown below. That is on paper where likelihoods from .01% to 99.99% are arranged along the bottom — x axis, and your other numbers, in this case the river heights, are the y values listed at the left. Graph paper of this sort is sold in university book stores; you can also get jpeg versions on line, but they don’t look as nice.

probability plot of maximum river height over 5 years -- looks reasonably normal, but slightly ghost-like.

Probability plot of the maximum river height over 5 years. If the data suggests a straight line, like here the data is reasonably normal. Extrapolating to 99% suggests the 100 year flood height would be 9.5 to 10.2 feet, and that it is 99.99% unlikely to reach 11 feet. That’s once in 10,000 years, other things being equal.

For the x axis values of the 5 data points above, I’ve taken the likelihood to be the middle of its percentile. Since there are 5 data points, each point is taken to represent its own 20 percentile; the middles appear at 10%, 30%, 50%, etc. I’ve plotted the highest value (8 feet) at the 10% point on the x axis, that being the middle of the upper 20%. I then plotted the second highest (7 feet) at 30%, the middle of the second 20%; the third, 6 ft at 50%; the fourth at 70%; and the draught year maximum (3 feet) at 90%.  When done, I judge if a reasonably straight line would describe the data. In this case, a line through the data looks reasonably straight, suggesting a fairly normal distribution of river heights. I notice that, if anything the heights drop off at the left suggesting that really high river levels are less likely than normal. The points will also have to drop off at the right since a negative river height is impossible. Thus my river heights describe a version of the ghost distribution in the cartoon above. This is a welcome finding since it suggests that really high flood levels are unlikely. If the data were non-normal, curving the other way we’d want to build our house higher than a normal distribution would suggest. 

You can now find the 100 year flood height from the graph above without going through any the math. Just draw your best line through the data, and look where it crosses the 1% value on your graph (that’s two major lines from the left in the graph above — you may have to expand your view to see the little 1% at top). My extrapolation suggests the hundred-year flood maximum will be somewhere between about 9.5 feet, and 10.2 feet, depending on how I choose my line. This prediction is a little lower than we calculated above, and was done graphically, without the need for a spreadsheet or math. What’s more, our predictions is more accurate, since we were in a position to evaluate the normality of the data and thus able to fit the extrapolation line accordingly. There are several ways to handle extreme curvature in the line, but all involve fitting the curve some way. Most weather data is curved, e.g. normal against a fractal, I think, and this affects you predictions. You might expect to have an ice age in 10,000 years.

The standard deviation we calculated above is related to a quality standard called six sigma — something you may have heard of. If we had a lot of parts we were making, for example, we might expect to find that the size deviation varies from a target according to a normal distribution. We call this variation σ, the greek version of s. If your production is such that the upper spec is 2.2 standard deviations from the norm, 99% of your product will be within spec; good, but not great. If you’ve got six sigmas there is one-in-a-billion confidence of meeting the spec, other things being equal. Some companies (like Starbucks) aim for this low variation, a six sigma confidence of being within spec. That is, they aim for total product uniformity in the belief that uniformity is the same as quality. There are several problems with this thinking, in my opinion. The average is rarely an optimum, and you want to have a rational theory for acceptable variation boundaries. Still, uniformity is a popular metric in quality management, and companies that use it are better off than those that do nothing. At REB Research, we like to employ the quality methods of W. Edwards Deming; we assume non-normality and aim for an optimum (that’s subject matter for a further essay). If you want help with statistics, or a quality engineering project, contact us.

I’ve also meant to write about the phrase “other things being equal”, Ceteris paribus in Latin. All this math only makes sense so long as the general parameters don’t change much. Your home won’t flood so long as they don’t build a new mall up river from you with runoff in the river, and so long as the dam doesn’t break. If these are concerns (and they should be) you still need to use statistics and probability paper, but you will now have to use other data, like on the likelihood of malls going up, or of dams breaking. When you input this other data, you will find the probability curve is not normal, but typically has a long tail (when the dam breaks, the water goes up by a lot). That’s outside of standard statistic analysis, but why those hundred year floods come a lot more often than once in 100 years. I’ve noticed that, even at Starbucks, more than 1/1,000,000,000 cups of coffee come out wrong. Even in analyzing a common snafu like this, you still use probability paper, though. It may be ‘situation normal”, but the distribution curve it describes has an abnormal tail.

by Dr. Robert E. Buxbaum, November 6, 2013. This is my second statistics post/ joke, by the way. The first one dealt with bombs on airplanes — well, take a look.

Calculus is taught wrong, and is often wrong

The high point of most people’s college math is The Calculus. Typically this is a weeder course that separates the science-minded students from the rest. It determines which students are admitted to medical and engineering courses, and which will be directed to english or communications — majors from which they can hope to become lawyers, bankers, politicians, and spokespeople (the generally distrusted). While calculus is very useful to know, my sense is that it is taught poorly: it is built up on a year of unnecessary pre-calculus and several shady assumptions that were not necessary for the development, and that are not generally true in the physical world. The material is presented in a way that confuses and turns off many of the top students — often the ones most attached to the reality of life.

The most untenable assumption in calculus teaching, in my opinion, are that the world involves continuous functions. That is, for example, that at every instant in time an object has one position only, and that its motion from point to point is continuous, defining a slow-changing quantity called velocity. That is, every x value defines one and only one y value, and there is never more than a small change in y at the limit of a small change in X. Does the world work this way? Some parts do, others do not. Commodity prices are not really defined except at the moment of sale, and can jump significantly between two sales a micro-second apart. Objects do not really have one position, the quantum sense, at any time, but spread out, sometimes occupying several positions, and sometimes jumping between positions without ever occupying the space in-between.

These are annoying facts, but calculus works just fine in a discontinuous world — and I believe that a discontinuous calculus is easier to teach and understand too. Consider the fundamental law of calculus. This states that, for a continuous function, the integral of the derivative of changes equals the function itself (nearly incomprehensible, no?) Now consider the same law taught for a discontinuous group of changes: the sum of the changes that take place over a period equals the total change. This statement is more general, since it applies to discrete and continuous functions, and it’s easier to teach. Any idiot can see that this is true. By contrast, it takes weeks of hard thinking to see that the integral of all the derivatives equals the function — and then it takes more years to be exposed to delta functions and realize that the statement is still true for discrete change. Why don’t we teach so that people will understand? Teach discrete first and then smooth as a special case where the discrete changes happen at a slow rate. Is calculus taught this way to make us look smart, or because we want this to be a weeder course?

Because most students are not introduced to discrete change, they are in a very poor position  to understand, or model, activities that are discreet, like climate change or heart rate. Climate only makes sense year to year, as day-to-day behavior is mostly affected by seasons, weather, and day vs night. We really want to model the big picture and leave out the noise by considering each day or year as a whole, keeping track of the average temperature for noon on September 21, for example. Similarly with heart rate, the rate has no meaning if measured every microsecond; it’s only meaning is as a measure of the time between beats. If we taught calculus in terms of discrete functions, our students would be in a better place to deal with these things, and in a better place to deal with total discontinuous behaviors, like chaos and fractals, an important phenomena when dealing with economics, for example.

A fundamental truth of quantum mechanics is that there is no defined speed and position of an object at any given time. Students accept this, but (because they are used to continuous change) they come to wonder how it is that over time energy is conserved. It’s simple, quantum motion involves a gross discrete changes in position that leaves energy conserved by the end, but where an item goes from here to there without ever having to be in the middle. This helps explain the old joke about Heisenberg and his car.

Calculus-based physics is taught in terms of limits and the mean value theorem: that if x is the position of a thing at any time, t then the derivative of these positions, the velocity, will approach ∆x/∆t more and more as ∆x and ∆t become more tightly defined. When this is found to be untrue in a quantum sense, the remnant of the belief in it hinders them when they try to solve real world problems. Normal physics is the limit of quantum physics because velocity is really a macroscopic ratio of difference in position divided by macroscopic difference in time. Because of this, it is obvious that the sum of these differences is the total distance traveled even when summed over many simultaneous paths. A feature of electromagnetism, Green’s theorem becomes similarly obvious: the sum effect of a field of changes is the total change. It’s only confusing if you try to take the limits to find the exact values of these change rates at some infinitesimal space.

This idea is also helpful in finance, likely a chaotic and fractal system. Finance is not continuous: just because a stock price moved from $1 to $2 per share in one day does not mean that the price was ever $1.50 per share. While there is probably no small change in sales rate caused by a 1¢ change in sales price at any given time, this does not mean you won’t find it useful to consider the relation between the sales of a product. Though the details may be untrue, the price demand curve is still very useful (but unjustified) abstraction.

This is not to say that there are not some real-world things that are functions and continuous, but believing that they are, just because the calculus is useful in describing them can blind you to some important insights, e.g. of phenomena where the butterfly effect predominates. That is where an insignificant change in one place (a butterfly wing in China) seems to result in a major change elsewhere (e.g. a hurricane in New York). Recognizing that some conclusions follow from non-continuous math may help students recognize places where some parts of basic calculus allies, while others do not.

Dr. Robert Buxbaum (my thanks to Dr. John Klein for showing me discrete calculus).

Why random experimental design is better

In a previous post I claimed that, to do good research, you want to arrange experiments so there is no pre-hypothesis of how the results will turn out. As the post was long, I said nothing direct on how such experiments should be organized, but only alluded to my preference: experiments should be organized at randomly chosen conditions within the area of interest. The alternative, shown below is that experiments should be done at the cardinal points in the space, or at corner extremes: the Wilson Box and Taguchi design of experiments (DoE), respectively. Doing experiments at these points implies a sort of expectation of the outcome; generally that results will be linearly, orthogonal related to causes; in such cases, the extreme values are the most telling. Sorry to say, this usually isn’t how experimental data will fall out. First experimental test points according to a Wilson Box, a Taguchi, and a random experimental design. The Wilson box and Taguchi are OK choices if you know or suspect that there are no significant non-linear interactions, and where experiments can be done at these extreme points. Random is the way nature works; and I suspect that's best -- it's certainly easiest.

First experimental test points according to a Wilson Box, a Taguchi, and a random experimental design. The Wilson box and Taguchi are OK choices if you know or suspect that there are no significant non-linear interactions, and where experiments can be done at these extreme points. Random is the way nature works; and I suspect that’s best — it’s certainly easiest.

The first test-points for experiments according to the Wilson Box method and Taguchi method of experimental designs are shown on the left and center of the figure above, along with a randomly chosen set of experimental conditions on the right. Taguchi experiments are the most popular choice nowadays, especially in Japan, but as Taguchi himself points out, this approach works best if there are “few interactions between variables, and if only a few variables contribute significantly.” Wilson Box experimental choices help if there is a parabolic effect from at least one parameter, but are fairly unsuited to cases with strong cross-interactions.

Perhaps the main problems with doing experiments at extreme or cardinal points is that these experiments are usually harder than at random points, and that the results from these difficult tests generally tell you nothing you didn’t know or suspect from the start. The minimum concentration is usually zero, and the minimum temperature is usually one where reactions are too slow to matter. When you test at the minimum-minimum point, you expect to find nothing, and generally that’s what you find. In the data sets shown above, it will not be uncommon that the two minimum W-B data points, and the 3 minimum Taguchi data points, will show no measurable result at all.

Randomly selected experimental conditions are the experimental equivalent of Monte Carlo simulation, and is the method evolution uses. Set out the space of possible compositions, morphologies and test conditions as with the other method, and perhaps plot them on graph paper. Now, toss darts at the paper to pick a few compositions and sets of conditions to test; and do a few experiments. Because nature is rarely linear, you are likely to find better results and more interesting phenomena than at any of those at the extremes. After the first few experiments, when you think you understand how things work, you can pick experimental points that target an optimum extreme point, or that visit a more-interesting or representative survey of the possibilities. In any case, you’ll quickly get a sense of how things work, and how successful the experimental program will be. If nothing works at all, you may want to cancel the program early, if things work really well you’ll want to expand it. With random experimental points you do fewer worthless experiments, and you can easily increase or decrease the number of experiments in the program as funding and time allows.

Consider the simple case of choosing a composition for gunpowder. The composition itself involves only 3 or 4 components, but there is also morphology to consider including the gross structure and fine structure (degree of grinding). Instead of picking experiments at the maximum compositions: 100% salt-peter, 0% salt-peter, grinding to sub-micron size, etc., as with Taguchi, a random methodology is to pick random, easily do-able conditions: 20% S and 40% salt-peter, say. These compositions will be easier to ignite, and the results are likely to be more relevant to the project goals.

The advantages of random testing get bigger the more variables and levels you need to test. Testing 9 variables at 3 levels each takes 27 Taguchi points, but only 16 or so if the experimental points are randomly chosen. To test if the behavior is linear, you can use the results from your first 7 or 8 randomly chosen experiments, derive the vector that gives the steepest improvement in n-dimensional space (a weighted sum of all the improvement vectors), and then do another experimental point that’s as far along in the direction of that vector as you think reasonable. If your result at this point is better than at any point you’ve visited, you’re well on your way to determining the conditions of optimal operation. That’s a lot faster than by starting with 27 hard-to-do experiments. What’s more, if you don’t find an optimum; congratulate yourself, you’ve just discovered an non-linear behavior; something that would be easy to overlook with Taguchi or Wilson Box methodologies.

The basic idea is one Sherlock Holmes pointed out (Study in Scarlet): It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts.” (Case of Identity). Life is infinitely stranger than anything which the mind of man could invent.

Robert E. Buxbaum, September 11, 2013. A nice description of the Wilson Box method is presented in Perry’s Handbook (6th ed). SInce I had trouble finding a free, on-line description, I linked to a paper by someone using it to test ingredient choices in baked bread. Here’s a link for more info about random experimental choice, from the University of Michigan, Chemical Engineering dept. Here’s a joke on the misuse of statistics, and a link regarding the Taguchi Methodology. Finally, here’s a pointless joke on irrational numbers, that I posted for pi-day.

The Scientific Method isn’t the method of scientists

A linchpin of middle school and high-school education is teaching ‘the scientific method.’ This is the method, students are led to believe, that scientists use to determine Truths, facts, and laws of nature. Scientists, students are told, start with a hypothesis of how things work or should work, they then devise a set of predictions based on deductive reasoning from these hypotheses, and perform some critical experiments to test the hypothesis and determine if it is true (experimentum crucis in Latin). Sorry to say, this is a path to error, and not the method that scientists use. The real method involves a few more steps, and follows a different order and path. It instead follows the path that Sherlock Holmes uses to crack a case.

The actual method of Holmes, and of science, is to avoid beginning with a hypothesis. Isaac Newton claimed: “I never make hypotheses” Instead as best we can tell, Newton, like most scientists, first gathered as much experimental evidence on a subject as possible before trying to concoct any explanation. As Holmes says (Study in Scarlet): “It is a capital mistake to theorize before you have all the evidence. It biases the judgment.”

It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts (Holmes, Scandal in Bohemia).

Holmes barely tolerates those who hypothesize before they have all the data: “It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts.” (Scandal in Bohemia).

Then there is the goal of science. It is not the goal of science to confirm some theory, model, or hypothesis; every theory probably has some limited area where it’s true. The goal for any real-life scientific investigation is the desire to explain something specific and out of the ordinary, or do something cool. Similarly, with Sherlock Holmes, the start of the investigation is the arrival of a client with a specific, unusual need – one that seems a bit outside of the normal routine. Similarly, the scientist wants to do something: build a bigger bridge, understand global warming, or how DNA directs genetics; make better gunpowder, cure a disease, or Rule the World (mad scientists favor this). Once there is a fixed goal, it is the goal that should direct the next steps: it directs the collection of data, and focuses the mind on the wide variety of types of solution. As Holmes says: , “it’s wise to make one’s self aware of the potential existence of multiple hypotheses, so that one eventually may choose one that fits most or all of the facts as they become known.” It’s only when there is no goal, that any path will do

In gathering experimental data (evidence), most scientists spend months in the less-fashionable sections of the library, looking at the experimental methods and observations of others, generally from many countries, collecting any scrap that seems reasonably related to the goal at hand. I used 3 x5″ cards to catalog this data and the references. From many books and articles, one extracts enough diversity of data to be able to look for patterns and to begin to apply inductive logic. “The little things are infinitely the most important” (Case of Identity). You have to look for patterns in the data you collect. Holmes does not explain how he looks for patterns, but this skill is innate in most people to a greater or lesser extent. A nice set approach to inductive logic is called the Baconian Method, it would be nice to see schools teach it. If the author is still alive, a scientist will try to contact him or her to clarify things. In every SH mystery, Holmes does the same and is always rewarded. There is always some key fact or observation that this turns up: key information unknown to the original client.

Based on the facts collected one begins to create the framework for a variety of mathematical models: mathematics is always involved, but these models should be pretty flexible. Often the result is a tree of related, mathematical models, each highlighting some different issue, process, or problem. One then may begin to prune the tree, trying to fit the known data (facts and numbers collected), into a mathematical picture of relevant parts of this tree. There usually won’t be quite enough for a full picture, but a fair amount of progress can usually be had with the application of statistics, calculus, physics, and chemistry. These are the key skills one learns in college, but usually the high-schooler and middle schooler has not learned them very well at all. If they’ve learned math and physics, they’ve not learned it in a way to apply it to something new, quite yet (it helps to read the accounts of real scientists here — e.g. The Double Helix by J. Watson).

Usually one tries to do some experiments at this stage. Homes might visit a ship or test a poison, and a scientist might go off to his, equally-smelly laboratory. The experiments done there are rarely experimenti crucae where one can say they’ve determined the truth of a single hypothesis. Rather one wants to eliminated some hypotheses and collect data to be used to evaluate others. An answer generally requires that you have both a numerical expectation and that you’ve eliminated all reasonable explanations but one. As Holmes says often, e.g. Sign of the four, “when you have excluded the impossible, whatever remains, however improbable, must be the truth”. The middle part of a scientific investigation generally involves these practical experiments to prune the tree of possibilities and determine the coefficients of relevant terms in the mathematical model: the weight or capacity of a bridge of a certain design, the likely effect of CO2 on global temperature, the dose response of a drug, or the temperature and burn rate of different gunpowder mixes. Though not mentioned by Holmes, it is critically important in science to aim for observations that have numbers attached.

The destruction of false aspects and models is a very important part of any study. Francis Bacon calls this act destruction of idols of the mind, and it includes many parts: destroying commonly held presuppositions, avoiding personal preferences, avoiding the tendency to see a closer relationship than can be justified, etc.

In science, one eliminates the impossible through the use of numbers and math, generally based on your laboratory observations. When you attempt to the numbers associated with our observations to the various possible models some will take the data well, some poorly; and some twill not fit the data at all. Apply the deductive reasoning that is taught in schools: logical, Boolean, step by step; if some aspect of a model does not fit, it is likely the model is wrong. If we have shown that all men are mortal, and we are comfortable that Socrates is a man, then it is far better to conclude that Socrates is mortal than to conclude that all men but Socrates is mortal (Occam’s razor). This is the sort of reasoning that computers are really good at (better than humans, actually). It all rests on the inductive pattern searches similarities and differences — that we started with, and very often we find we are missing a piece, e.g. we still need to determine that all men are indeed mortal, or that Socrates is a man. It’s back to the lab; this is why PhDs often take 5-6 years, and not the 3-4 that one hopes for at the start.

More often than not we find we have a theory or two (or three), but not quite all the pieces in place to get to our goal (whatever that was), but at least there’s a clearer path, and often more than one. Since science is goal oriented, we’re likely to find a more efficient than we fist thought. E.g. instead of proving that all men are mortal, show it to be true of Greek men, that is for all two-legged, fairly hairless beings who speak Greek. All we must show is that few Greeks live beyond 130 years, and that Socrates is one of them.

Putting numerical values on the mathematical relationship is a critical step in all science, as is the use of models — mathematical and otherwise. The path to measure the life expectancy of Greeks will generally involve looking at a sample population. A scientist calls this a model. He will analyze this model using statistical model of average and standard deviation and will derive his or her conclusions from there. It is only now that you have a hypothesis, but it’s still based on a model. In health experiments the model is typically a sample of animals (experiments on people are often illegal and take too long). For bridge experiments one uses small wood or metal models; and for chemical experiments, one uses small samples. Numbers and ratios are the key to making these models relevant in the real world. A hypothesis of this sort, backed by numbers is publishable, and is as far as you can go when dealing with the past (e.g. why Germany lost WW2, or why the dinosaurs died off) but the gold-standard of science is predictability.  Thus, while we a confident that Socrates is definitely mortal, we’re not 100% certain that global warming is real — in fact, it seems to have stopped though CO2 levels are rising. To be 100% sure you’re right about global warming we have to make predictions, e.g. that the temperature will have risen 7 degrees in the last 14 years (it has not), or Al Gore’s prediction that the sea will rise 8 meters by 2106 (this seems unlikely at the current time). This is not to blame the scientists whose predictions don’t pan out, “We balance probabilities and choose the most likely. It is the scientific use of the imagination” (Hound of the Baskervilles)The hope is that everything matches; but sometimes we must look for an alternative; that’s happened rarely in my research, but it’s happened.

You are now at the conclusion of the scientific process. In fiction, this is where the criminal is led away in chains (or not, as with “The Woman,” “The Adventure of the Yellow Face,” or of “The Blue Carbuncle” where Holmes lets the criminal free — “It’s Christmas”). For most research the conclusion includes writing a good research paper “Nothing clears up a case so much as stating it to another person”(Memoirs). For a PhD, this is followed by the search for a good job. For a commercial researcher, it’s a new product or product improvement. For the mad scientist, that conclusion is the goal: taking over the world and enslaving the population (or not; typically the scientist is thwarted by some detail!). But for the professor or professional research scientist, the goal is never quite reached; it’s a stepping stone to a grant application to do further work, and from there to tenure. In the case of the Socrates mortality work, the scientist might ask for money to go from country to country, measuring life-spans to demonstrate that all philosophers are mortal. This isn’t as pointless and self-serving as it seems, Follow-up work is easier than the first work since you’ve already got half of it done, and you sometimes find something interesting, e.g. about diet and life-span, or diseases, etc. I did some 70 papers when I was a professor, some on diet and lifespan.

One should avoid making some horrible bad logical conclusion at the end, by the way. It always seems to happen that the mad scientist is thwarted at the end; the greatest criminal masterminds are tripped by some last-minute flaw. Similarly the scientist must not make that last-mistep. “One should always look for a possible alternative, and provide against it” (Adventure of Black Peter). Just because you’ve demonstrated that  iodine kills germs, and you know that germs cause disease, please don’t conclude that drinking iodine will cure your disease. That’s the sort of science mistakes that were common in the middle ages, and show up far too often today. In the last steps, as in the first, follow the inductive and quantitative methods of Paracelsus to the end: look for numbers, (not a Holmes quote) check how quantity and location affects things. In the case of antiseptics, Paracelsus noticed that only external cleaning helped and that the help was dose sensitive.

As an example in the 20th century, don’t just conclude that, because bullets kill, removing the bullets is a good idea. It is likely that the trauma and infection of removing the bullet is what killed Lincoln, Garfield, and McKinley. Theodore Roosevelt was shot too, but decided to leave his bullet where it was, noticing that many shot animals and soldiers lived for years with bullets in them; and Roosevelt lived for 8 more years. Don’t make these last-minute missteps: though it’s logical to think that removing guns will reduce crime, the evidence does not support that. Don’t let a leap of bad deduction at the end ruin a line of good science. “A few flies make the ointment rancid,” said Solomon. Here’s how to do statistics on data that’s taken randomly.

Dr. Robert E. Buxbaum, scientist and Holmes fan wrote this, Sept 2, 2013. My thanks to Lou Manzione, a friend from college and grad school, who suggested I reread all of Holmes early in my PhD work, and to Wikiquote, a wonderful site where I found the Holmes quotes; the Solomon quote I knew, and the others I made up.

Musical Color and the Well Tempered Scale

by R. E. Buxbaum, (the author of all these posts)

I first heard J. S. Bach’s Well Tempered Clavier some 35 years ago and was struck by the different colors of the different scales. Some were dark and scary, others were light and enjoyable. All of them worked, but each was distinct, though I could not figure out why. That Bach was able to write in all the keys without retuning was a key innovation of his. In his day, people tuned in fifths, a process that created gaps (called wolf) that prevented useful composition in affected keys.

We don’t know exactly how Bach tuned his instruments as he had no scientific way to describe it; we can guess that it was more uniform than the temper produced by tuning in fifths, but it probably was not quite equally spaced. Nowadays electronic keyboards are tuned to 12 equally spaced frequencies per octave through the use of frequency counters.  Starting with the A below “middle C”, A4, tuned at 440 cycles/second (the note symphonies tune to), each note is programmed to vibrate at a wavelength that is lower or higher than one next to it by a factor of the twelfth root of two, 12√2= 1.05946. After 12 multiples of this size, the wavelength has doubled or halved and there is an octave. This is called equal tempering.

Currently, many non-electric instruments are also tuned this way.  Equally tempering avoids all wolf, but makes each note equally ill-tempered. Any key can be transposed to another, but there are no pure harmonies because 12√2 is an irrational number (see joke). There is also no color or feel to any given key except that which has carried over historically in the listeners’ memory. It’s sad.

I’m going to speculate that J.S. Bach found/ favored a way to tune instruments where all of the keys were usable, and OK sounding, but where some harmonies are more perfect than others. Necessarily this means that some harmonies will be less-perfect. There should be no wolf gaps that would sound so bad that Bach could not compose and transpose in every key, but since there is a difference, each key will retain a distinct color that JS Bach explored in his work — or so I’ll assume.

Pythagoras found that notes sound best together when the vibrating lengths are kept in a ratio of small numbers. Consider the tuning note, A4, the A below middle C; this note vibrates a column of air .784 meters long, about 2.5 feet or half the length of an oboe. The octave notes for Aare called A3 and A5. They vibrate columns of air 2x as long and 1/2 as long as the original. They’re called octaves because they’re eight white keys away from A4. Keyboards add 4 black notes per octave so octaves are always 12 notes away. Keyboards are generally tuned so octaves are always 12 keys away. Based on Pythagoras, a reasonable presumption is that J.S Bach tuned every non-octave note so that it vibrates an air column similar to the equal tuning ratio, 12√2 = 1.05946, but whose wavelength was adjusted, in some cases to make ratios of small, whole numbers with the wavelength for A4.

Aside from octaves, the most pleasant harmonies are with notes whose wavelength is 3/2 as long as the original, or 2/3 as long. The best harmonies with A4 (0.784 m) will be with notes with wavelengths (3/2)*0.784 m long, or (2/3)*0.784m long. The first of these is called D3 and the other is E4. A4 combines with D3 to make a chord called D-major, the so-called “the key of glory.” The Hallelujah chorus, Beethoven’s 9th (Ode to Joy), and Mahler’s Titan are in this key. Scriabin believed that D-major had a unique color, gold, suggesting that the pure ratios were retained.

A combines with E (plus a black note C#) to make a chord called A major. Songs in this key sound (to my ear) robust, cheerful and somewhat pompous; Here, in A-major is: Dancing Queen by ABBA, Lady Madonna by the BeatlesPrelude and Fugue in A major by JS Bach. Scriabin believed that A-major was green.

A4 also combines with E and a new white note, C3, to make a chord called A minor. Since E4 and E3 vibrate at 2/3 and 4/3 the wavelength of A4 respectively, I’ll speculate that Bach tuned C3 to 5/3 the length of A4; 5/3*.0784m =1.307m long. Tuned his way, the ratio of wavelengths in the A minor chord are 3:4:5. Songs in A minor tend to be edgy and sort-of sad: Stairway to heaven, Für Elise“Songs in A Minor sung by Alicia Keys, and PDQ Bach’s Fugue in A minor. I’m going to speculate the Bach tuned this to 1.312 m (or thereabouts), roughly half-way between the wavelength for a pure ratio and that of equal temper.

The notes D3 and Ewill not sound particularly good together. In both pure ratios and equal tempers their wavelengths are in a ratio of 3/2 to 4/3, that is a ratio of 9 to 8. This can be a tensional transition, but it does not provide a satisfying resolution to my, western ears.

Now for the other white notes. The next white key over from A4 is G3, two half-tones longer that for A4. For equal tuning, we’d expect this note to vibrate a column of air 1.05946= 1.1225 times longer than A4. The most similar ratio of small whole numbers is 9/8 = 1.1250, and we’d already generated one before between D and E. As a result, we may expect that Bach tuned G3 to a wavelength 9/8*0.784m = .88 meters.

For equal tuning, the next white note, F3, will vibrate an air column 1.059464 = 1.259 times as long as the A4 column. Tuned this way, the wavelength for F3 is 1.259*.784 = .988m. Alternately, since 1.259 is similar to 5/4 = 1.25, it is reasonable to tune F3 as (5/4)*.784 = .980m. I’ll speculate that he split the difference: .984m. F, A, and C combine to make a good harmony called the F major chord. The most popular pieces in F major sound woozy and not-quite settled in my opinion, perhaps because of the oddness of the F tuning. See, e.g. the Jeopardy theme song, “My Sweet Lord,Come together (Beetles)Beethoven’s Pastoral symphony (Movement 1, “Awakening of cheerful feelings upon arrival in the country”). Scriabin saw F-major as bright blue.

We’ve only one more white note to go in this octave: B4, the other tension note to A4. Since the wavelengths for G3 was 9/8 as long as for A4, we can expect the wavelength for B4 will be 8/9 as long. This will be dissonant to A4, but it will go well with E3 and E4 as these were 2/3 and 4/3 of A4 respectively. Tuned this way, B4 vibrates a column 1.40 m. When B, in any octave, is combined with E it’s called an E chord (E major or E minor); it’s typically combined with a black key, G-sharp (G#). The notes B, E vibrate at a ratio of 4 to 3. J.S. Bach called the G#, “H” allowing him to spell out his name in his music. When he played the sequence BACH, he found B to A created tension; moving to C created harmony with A, but not B, while the final note, G# (H) provided harmony for C and the original B. Here’s how it works on cello; it’s not bad, but there is no grand resolution. The Promenade from “Pictures at an Exhibition” is in E.

The black notes go somewhere between the larger gaps of the white notes, and there is a traditional confusion in how to tune them. One can tune the black notes by equal temper  (multiples of 21/12), or set them exactly in the spaces between the white notes, or tune them to any alternate set of ratios. A popular set of ratios is found in “Just temper.” The black note 6 from A4 (D#) will have wavelength of 0.784*26/12= √2 *0.784 m =1.109m. Since √2 =1.414, and that this is about 1.4= 7/5, the “Just temper” method is to tune D# to 1.4*.784m =1.098m. If one takes this route, other black notes (F#3 and C#3) will be tuned to ratios of 6/5, and 8/5 times 0.784m respectively. It’s possible that J.S. Bach tuned his notes by Just temper, but I suspect not. I suspect that Bach tuned these notes to fall in-between Just Temper and Equal temper, as I’ve shown below. I suspect that his D#3 might vibrated at about 1.104 m, half way between Just and Equal temper. I would not be surprised if Jazz musicians tuned their black notes more closely to the fifths of Just temper: 5/5 6/5, 7/5, 8/5 (and 9/5?) because jazz uses the black notes more, and you generally want your main chords to sound in tune. Then again, maybe not. Jimmy Hendrix picked the harmony D#3 with A (“Diabolus”, the devil harmony) for his Purple Haze; it’s also used for European police sirens.

To my ear, the modified equal temper is more beautiful and interesting than the equal temperament of todays electronic keyboards. In either temper music plays in all keys, but with an un-equal temper each key is distinct and beautiful in its own way. Tuning is engineering, I think, rather than math or art. In math things have to be perfect; in art they have to be interesting, and in engineering they have to work. Engineering tends to be beautiful its way. Generally, though, engineering is not perfect.

Summary of air column wave-lengths, measured in meters, and as a ratio to that for A4. Just Tempering, Equal Tempering, and my best guess of J.S. Bach's Well Tempered scale.

Summary of air column wave-lengths, measured in meters, and as a ratio to that for A4. Just Tempering, Equal Tempering, and my best guess of J.S. Bach’s Well Tempered scale.

R.E. Buxbaum, May 20 2013 (edited Sept 23, 2013) — I’m not very musical, but my children are.

Chaos, Stocks, and Global Warming

Two weeks ago, I discussed black-body radiation and showed how you calculate the rate of radiative heat transfer from any object. Based on this, I claimed that basal metabolism (the rate of calorie burning for people at rest) was really proportional to surface area, not weight as in most charts. I also claimed that it should be near-impossible to lose weight through exercise, and went on to explain why we cover the hot parts of our hydrogen purifiers and hydrogen generators in aluminum foil.

I’d previously discussed chaos and posted a chart of the earth’s temperature over the last 600,000 years. I’d now like to combine these discussions to give some personal (R. E. Buxbaum) thoughts on global warming.

Black-body radiation differs from normal heat transfer in that the rate is proportional to emissivity and is very sensitive to temperature. We can expect the rate of heat transfer from the sun to earth will follow these rules, and that the rate from the earth will behave similarly.

That the earth is getting warmer is seen as proof that the carbon dioxide we produce is considered proof that we are changing the earth’s emissivity so that we absorb more of the sun’s radiation while emitting less (relatively), but things are not so simple. Carbon dioxide should, indeed promote terrestrial heating, but a hotter earth should have more clouds and these clouds should reflect solar radiation, while allowing the earth’s heat to radiate into space. Also, this model would suggest slow, gradual heating beginning, perhaps in 1850, but the earth’s climate is chaotic with a fractal temperature rise that has been going on for the last 15,000 years (see figure).

Recent temperature variation as measured from the Greenland Ice. A previous post had the temperature variation over the past 600,000 years.

Recent temperature variation as measured from the Greenland Ice. Like the stock market, it shows aspects of chaos.

Over a larger time scale, the earth’s temperature looks, chaotic and cyclical (see the graph of global temperature in this post) with ice ages every 120,000 years, and chaotic, fractal variation at times spans of 100 -1000 years. The earth’s temperature is self-similar too; that is, its variation looks the same if one scales time and temperature. This is something that is seen whenever a system possess feedback and complexity. It’s seen also in the economy (below), a system with complexity and feedback.

Manufacturing Profit is typically chaotic -- something that makes it exciting.

Manufacturing Profit is typically chaotic — and seems to have cold spells very similar to the ice ages seen above.

The economy of any city is complex, and the world economy even more so. No one part changes independent of the others, and as a result we can expect to see chaotic, self-similar stock and commodity prices for the foreseeable future. As with global temperature, the economic data over a 10 year scale looks like economic data over a 100 year scale. Surprisingly,  the economic data looks similar to the earth temperature data over a 100 year or 1000 year scale. It takes a strange person to guess either consistently as both are chaotic and fractal.

gomez3

It takes a rather chaotic person to really enjoy stock trading (Seen here, Gomez Addams of the Addams Family TV show).

Clouds and ice play roles in the earth’s feedback mechanisms. Clouds tend to increase when more of the sun’s light heats the oceans, but the more clouds, the less heat gets through to the oceans. Thus clouds tend to stabilize our temperature. The effect of ice is to destabilize: the more heat that gets to the ice, the more melts and the less of the suns heat is reflected to space. There is time-delay too, caused by the melting flow of ice and ocean currents as driven by temperature differences among the ocean layers, and (it seems) by salinity. The net result, instability and chaos.

The sun has chaotic weather too. The rate of the solar reactions that heat the earth increases with temperature and density in the sun’s interior: when a volume of the sun gets hotter, the reaction rates pick up making the volume yet-hotter. The temperature keeps rising, and the heat radiated to the earth keeps increasing, until a density current develops in the sun. The hot area is then cooled by moving to the surface and the rate of solar output decreases. It is quite likely that some part of our global temperature rise derives from this chaotic variation in solar output. The ice caps of Mars are receding.

The change in martian ice could be from the sun, or it might be from Martian dust in the air. If so, it suggests yet another feedback system for the earth. When economic times age good we have more money to spend on agriculture and air pollution control. For all we know, the main feedback loops involve dust and smog in the air. Perhaps, the earth is getting warmer because we’ve got no reflective cloud of dust as in the dust-bowl days, and our cities are no longer covered by a layer of thick, black (reflective) smog. If so, we should be happy to have the extra warmth.

The Gift of Chaos

Many, if not most important engineering systems are chaotic to some extent, but as most college programs don’t deal with this behavior, or with this type of math, I thought I might write something on it. It was a big deal among my PhD colleagues some 30 years back as it revolutionized the way we looked at classic problems; it’s fundamental, but it’s now hardly mentioned.

Two of the first freshman engineering homework problems I had turn out to have been chaotic, though I didn’t know it at the time. One of these concerned the cooling of a cup of coffee. As presented, the coffee was in a cup at a uniform temperature of 70°C; the room was at 20°C, and some fanciful data was presented to suggest that the coffee cooled at a rate that was proportional the difference between the (changing) coffee temperature and the fixed room temperature. Based on these assumptions, we predicted exponential cooling with time, something that was (more or less) observed, but not quite in real life. The chaotic part in a real cup of coffee, is that the cup develops currents that move faster and slower. These currents accelerate heat loss, but since they are driven by the temperature differences within the cup they tend to speed up and slow down erratically. They accelerate when the cup is not well stirred, causing new stir, and slow down when it is stirred, and the temperature at any point is seen to rise and fall in an almost rhythmic fashion; that is, chaotically.

While it is impossible to predict what will happen over a short time scale, there are some general patterns. Perhaps the most remarkable of these is self-similarity: if observed over a short time scale (10 seconds or less), the behavior over 10 seconds will look like the behavior over 1 second, and this will look like the behavior over 0.1 second. The only difference being that, the smaller the time-scale, the smaller the up-down variation. You can see the same thing with stock movements, wind speed, cell-phone noise, etc. and the same self-similarity can occur in space so that the shape of clouds tends to be similar at all reasonably small length scales. The maximum average deviation is smaller over smaller time scales, of course, and larger over large time-scales, but not in any obvious way. There is no simple proportionality, but rather a fractional power dependence that results in these chaotic phenomena having fractal dependence on measure scale. Some of this is seen in the global temperature graph below.

Global temperatures measured from the antarctic ice showing stable, cyclic chaos and self-similarity.

Global temperatures measured from the antarctic ice showing stable, cyclic chaos and self-similarity.

Chaos can be stable or unstable, by the way; the cooling of a cup of coffee was stable because the temperature could not exceed 70°C or go below 20°C. Stable chaotic phenomena tend to have fixed period cycles in space or time. The world temperature seems to follow this pattern though there is no obvious reason it should. That is, there is no obvious maximum and minimum temperature for the earth, nor any obvious reason there should be cycles or that they should be 120,000 years long. I’ll probably write more about chaos in later posts, but I should mention that unstable chaos can be quite destructive, and quite hard to prevent. Some form of chaotic local heating seems to have caused battery fires aboard the Dreamliner; similarly, most riots, famines, and financial panics seem to be chaotic. Generally speaking, tight control does not prevent this sort of chaos, by the way; it just changes the period and makes the eruptions that much more violent. As two examples, consider what would happen if we tried to cap a volcano, or provided  clamp-downs on riots in Syria, Egypt or Ancient Rome.

From math, we know some alternate ways to prevent unstable chaos from getting out of hand; one is to lay off, another is to control chaotically (hard to believe, but true).

 

Statistics Joke

A classic statistics joke concerns a person who’s afraid to fly; he goes to a statistician who explains that planes are very, very safe, especially if you fly a respectable airline in good weather. In that case, virtually the only problem you’ll have is the possibility of a bomb on board. The fellow thinks it over and decides that flying is still too risky, so the statistician suggests he plant a bomb on the airplane, but rig it to not go off. The statistician explains: while it’s very rare to have a bomb onboard an airplane, it’s really unheard of to have two bombs on the same plane.

It’s funny because …. the statistician left out the fact that an independent variable (number of bombs) has to be truly independent. If it is independent, the likelihood is found using a poisson distribution, a non-normal distribution where the greatest likelihood is zero bombs, and there are no possibilities for a negative bomb. Poisson distributions are rarely taught in schools for some reason.

By Dr. Robert E. Buxbaum, Mar 25, 2013. If you’ve got a problem like this (particularly involving chemical engineering) you could come to my company, REB Research.

For parents of a young scientist: math

It is not uncommon for parents to ask my advice or help with their child; someone they consider to be a young scientist, or at least a potential young scientist. My main advice is math.

Most often the tyke is 5 to 8 years old and has an interest in weather, chemistry, or how things work. That’s a good age, about the age that the science bug struck me, and it’s a good age to begin to introduce the power of math. Math isn’t the total answer, by the way; if your child is interested in weather, for example, you’ll need to get books on weather, and you’ll want to buy a weather-science kit at your local smart-toy store (look for one with a small wet-bulb and dry bulb thermometer setup so that you’ll be able to discuss humidity  in some modest way: wet bulb temperatures are lower than dry bulb with a difference that is higher the lower the humidity; it’s zero at 100%). But math makes the key difference between the interest blooming into science or having it wilt or worse. Math is the language of science, and without it there is no way that your child will understand the better books, no way that he or she will be able to talk to others who are interested, and the interest can bloom into a phobia (that’s what happens when your child has something to express, but can’t speak about it in any real way).

Math takes science out of the range of religion and mythology, too. If you’re stuck to the use of words, you think that the explanations in science books resemble the stories of the Greek gods. You either accept them or you don’t. With math you see that they are testable, and that the  versions in the book are generally simplified approximations to some more complex description. You also get to see that there the descriptions are testable, and that are many, different looking descriptions that will fit the same phenomena. Some will be mathematically identical, and others will be quite different, but all are testable as the Greek myths are not.

What math to teach depends on your child’s level and interests. If the child is young, have him or her count in twos or fives, or tens, etc. Have him or her learn to spot patterns, like that the every other number that is divisible by 5 ends in zero, or that the sum of digits for every number that’s divisible by three is itself divisible by three. If the child is a little older, show him or her geometry, or prime numbers, or squares and cubes. Ask your child to figure out the sum of all the numbers from 1 to 100, or to estimate the square-root of some numbers. Ask why the area of a circle is πr2 while the circumference is 2πr: why do both contain the same, odd factor, π = 3.1415926535… All these games and ideas will give your child a language to use discussing science.

If your child is old enough to read, I’d definitely suggest you buy a few books with nice pictures and practical examples. I’d grown up with the Giant Golden book of Mathematics by Irving Adler, but I’ve seen and been impressed with several other nice books, and with the entire Golden Book series. Make regular trips to the library, and point your child to an appropriate section, but don’t force the child to take science books. Forcing your child will kill any natural interest he or she has. Besides, having other interests is a sign of normality; even the biggest scientist will sometimes want to read something else (sports, music, art, etc.) Many scientists drew (da Vinci, Feynman) or played the violin (Einstein). Let your child grow at his or her own pace and direction. (I liked the theater, including opera, and liked philosophy).

Now, back to the science kits and toys. Get a few basic ones, and let your child play: these are toys, not work. I liked chemistry, and a chemistry set was perhaps the best toy I ever got. Another set I liked was an Erector set (Gilbert). Get good sets that they pick out, but don’t be disappointed if they don’t do all the experiments, or any of them. They may not be interested in this group; just move on. I was not interested in microscopy, fish, or animals, for example. And don’t be bothered if interests change. It’s common to start out interested in dinosaurs and then to change to an interest in other things. Don’t push an old interest, or even an active new interest: enough parental pushing will kill any interest, and that’s sad. As Solomon the wise said, the fire is more often extinguished by too much fuel than by too little. But you do need to help with math, though; without that, no real progress will be possible.

Oh, one more thing, don’t be disappointed if your child isn’t interested in science; most kids aren’t interested in science as such, but rather in something science-like, like the internet, or economics, or games, or how things work. These areas are all great too, and there is a lot more room for your child to find a good job or a scholarship based on their expertise in theses areas. Any math he or she learns is certain to help with all of these pursuits, and with whatever other science-like direction he or she takes.   — Good luck. Robert Buxbaum (Economics isn’t science, not because of the lack of math, but because it’s not reproducible: you can’t re-run the great depression without FDR’s stimulus, or without WWII)