Monday, July 16, 2018

Elements of Relativity

I'm pleased to announce the publication of my textbook on relativity for beginners, The Elements of Relativity.


Relativity is one of the greatest achievements of 20th-century physics, yet we physicists are reluctant to teach it to anyone but advanced students. This is a missed opportunity because lots of people are interested in relativity and there are few real barriers for beginners. You don't need much prior knowledge of math or physics (only some basic geometry and algebra) to gain a complete a complete understanding of special relativity (which includes topics such as how we can travel into the future faster, and E=mc2). Mostly you need to practice disciplined thinking in terms of reasoning from assumptions to conclusions, and being able to identify why an apparently counterintuitive conclusion does not actually violate your assumptions. And that's what makes it a great college course for general education.

General relativity (GR, which includes black holes and gravitational waves) does require a lot of math for a complete understanding, but this does not justify leaving GR entirely out of a general education course on relativity.  For GR a conceptual understanding is goal enough, and the important concepts can be taught in a way that builds on (and reinforces understanding of) special relativity.

In 2009 I decided to teach a course like this. There was no textbook that really matched the course, so I used bits of various textbooks and resources. I soon realized that I needed a unified textbook, so I started writing one. I taught the course several more times with different drafts of my book, and after many years The Elements of Relativity is finally ready for public consumption.

Although the book is for beginners, it is not fluff; it makes you think. If you enjoy thinking and you're interested in relativity, this book is for you. The book would also help physics majors solidify their understanding, if their formal training has emphasized mathematical over conceptual understanding.

You can order the book directly from Oxford University Press, or from Amazon.

Monday, February 15, 2016

New perspectives on teaching and learning

As part of a Fulbright grant supporting my sabbatical to Portugal, I taught a "Topics in Astrophysics" course to master's students.  Going outside my usual comfort zone was good for me, and will help me be a better teacher when I go back to UC Davis.

One thing I take back is a renewed appreciation for the fact that each student starts from a unique place.  Having taught at the same university for nine years, it becomes second nature to assume that a student who passed certain courses understands certain concepts thoroughly.  I think I become a bit judgmental when I encounter a student who "should" (according to they courses they have passed) know something but doesn't.  As a fresh arrival in Lisbon, I had no preconceptions about students' prior knowledge.  This helped me create a better learning environment in general, and it also helped me "coach" each student without judging---an attitude I want to maintain when I get back to my regular teaching duties.  Of course, I still have to judge when I assign grades---but not before then.

I also have a renewed appreciation that being a student isn't easy. On my first day in the classroom, I felt like an outsider.  What are the expectations?  Will I crash and burn?  Students deal with these thoughts all the time, and with reason, because so often they are being graded.  When they come to a university they have to learn the system, navigate the courses, work and manage their finances, and learn to function in a new city.  I gained new respect for students by having to do some of these things as well.

Being a visiting professor teaching a topics course was liberating---nothing I did would be considered a precedent in future years, nor did I try to follow any template from previous years.  I tried lots of new things.  To prevent running the course completely outside the comfort zone of the Portuguese students, I just consulted with them rather than wonder what they would think.  I do this back home too, but this experience will help me do more.

Of course, I hope the students got something out of it as well. Having regular homework was apparently an unusual experience for them.  They initially thought it took too much time to do so much homework, but they began to appreciate that doing the homework is the only way to really learn.  But this dynamic worked only because I slowed the pace of the class to make sure they really had time to digest all the lessons they could learn from the homework---and that in turn was made possible by fact that this was a "topics" course without any predefined list of topics to cover.  So I don't know right now what I can change when I teach a more standard courses. But I am changed.

Not one of the ideas here is new, but they tend to fade when I teach over and over in the same setting.  Teaching in an entirely new environment was a great experience that will freshen up my teaching when I go home.  I highly recommend it, and I thank the Portuguese Fulbright Commission for supporting it.

Sunday, February 7, 2016

Sports: more random than you think (part 2)

In two recent posts I debunked the idea that some NFL teams vary greatly in their home-field advantage, and I showed how the same thinking tool can be used to confirm that NFL teams do vary in their skill.  In this post I ask the same question of NFL experts: does the variation in their game-picking accuracy reflect a true variation in skill or expertise?

The previous posts explain how to do this.  First, calculate how much variation must randomly creep in to the results even if there is no true variation in skill.  Then, compare this to the documented variation in results. If the model and data exhibit about the same amount of variation, you can claim that there is no evidence for true variation in skill.  True variation in skill will result in performances outside the envelope of simulated performances.

I found a nice list of the records of 133 expert pickers for the 2015 regular season (256 games in all) at nflpickwatch.com. Here is the histogram of their correctness percentages (blue):


The green histogram is a simulation of 100 times as many experts, assuming they all have a "true" accuracy rate of 60.5%.  That is, each pick has a 60.5% chance of being correct, and the actual numbers for each expert reflect good or bad luck in having more or fewer of these "coin tosses" land their way.  I simulated so many experts (and then divided by 100) so that we could see a smooth distribution.  A few things stand out in this plot:

  • No one did better than the simulation.  In other words, there is not strong evidence that anyone is more skilled than a 60.5% long-term average, even if they happened to hit nearly 67% this season.  Of course, we can't prove this; it remains possible that a few experts are slightly more skilled than the average expert.  The best we can do is extend the analysis to multiple seasons so that the actual data more closely approach the long-term average.  In other words, the green histogram would get narrower if we included 512 or 1024 games, and if some of the spread in the blue histogram is really due to skill, the blue histogram will not narrow as much.
  • A few people did far worse than the simulation.  In other words, while the experts who outdid everyone else probably did so on the basis of luck, the ones who did poorly cannot rely on bad luck as the explanation.  They really are bad.  How could anyone do as poorly as 40% when you could get 50% by flipping a coin and 57.5% by always picking the home team?
  • Because the home team wins 57.5% of the time, the experts are adding some knowledge beyond home-team advantage---but not much.  Or rather, they may have a lot of knowledge but that knowledge relates only weakly to which team wins.  This suggests that random events are very important.  Let's contrast this with European soccer; I found a website that claims they correctly predict the winner of a soccer match 88% of the time.  European soccer has few or none of the features that keep American teams roughly in parity with each other: better draft picks for losing teams, salary cap, revenue sharing, etc.  It's much more of a winner-take-all business, which makes the outcomes of most matches rather predictable.  In leagues with more parity, random events have more influence on outcomes.
  • If you remove the really bad experts (below 53%, say) the distribution of the remaining competent experts is tighter than the distribution of simulations.  How can the actual spread be less than the spread in a simulation where all experts are identically skilled?  It must be that experts follow the herd: if some team appears hot, or another team lost a player to injury, most experts will make the same pick on a given game.  This is not in my simulation, but it surely happens in real life, and it would indeed make experts perform more similarly than in the simulation.

My simulation neglects a lot of things that could happen in real life.  For example, feedback loops: let's say the more highly skilled team gets behind in a game because of random events.  You might think that this would energize them.  Pumped up at the thought that they are losing to a worse team, they try that much harder, and come from behind to win the game.  Nice idea, but if it were true then the final outcomes of games would be incredibly predictable.  The fact that they are so unpredictable indicates that this kind of feedback loop is not important in real life. The same idea applies regarding an entire season: if a highly skilled team finds itself losing a few games due to bad luck, we might find them trying even harder to reach their true potential.  But the fact that most NFL teams have records indistinguishable from a coin toss again argues that this kind of feedback loop does not play a large role. Of course, teams do feel extra motivation at certain times, but the extra motivation must have a minimal impact on the chance of winning.  For every time a team credits extra motivation for a win, there is another time where they have to admit that it just wasn't their day despite the extra motivation.

Monday, February 1, 2016

The Cumulative Distribution Function

The cumulative distribution function (CDF) is a long name for a simple concept---a concept you should become familiar with if you like to think about data.

One of the most basic visualizations of a set of numbers is the histogram: a plot of how frequently various values appear.  For example, measuring the heights of 100 people might yield a histogram like this:



This technique is taught to kids even in preschool, where teachers often record the weather (cloudy, rainy, sunny, etc.) on a chart each day.  Over several weeks, a picture of the frequency of sunny days, rainy days, etc, naturally emerges.  (Sometimes it seems as if the histogram is the only data visualization kids learn in school.)

The CDF is a different way to visualize the same data.  Instead of recording how often a particular value occurs, we record how often we see that value or less.  We can turn a histogram into a CDF quite simply.  Start at the left side of the height histogram: four people have a height in the 1-1.1 m range so clearly, four people have a height of 1.1 m or less. Now, we move up to the next bin: five people are in the 1.1-1.2 m range so including the four shorter people we have nine with height 1.2 m or less.  We then add these nine (the "or less" part) to the number in the next bin to obtain the number with height 1.3 m or less.  This total then becomes the number of "or less" people to add to the number of people at 1.4 m, and so on.  (This procedure is similar to integration in calculus.)  The final result is:


(Notice that this graph shows smaller details than the histogram; I'll explain that at the end.) What is this graph useful for?  If we want to know the percentage of people over 6 feet (1.8 m), we can now read it straight off the CDF graph!  Just go to 1.8 m, look up until you hit the curve, and then look horizontally to see where you hit the vertical axis.  In our example here, that is about 95%:



This means 95% of people are 6 feet or shorter; in other words 5% are taller than 6 feet.  Compared to the histogram, the CDF makes it blazingly fast to look up the percentage taller than 6 feet, shorter than 5 feet (1.5 m), or anything of that nature.  (Beware: I made up these data as a hypothetical example, so don't take this as an actual comment on human height.)

Plotting two CDFs against each other is a great way to visualize nonuniformity or inequality.  We often hear that around 20% of the income in the US goes to the top 1% of earners.  A properly constructed graph can tell us not only the percentage that goes to the top 1%, but also the percentage that goes to the top 2%, the top 5%, the bottom 5%, etc---all in a single glance.  Here's how we do it. Get income data from the IRS here: I chose the 2013 link in the first set of tables. Here's a screenshot:


I won't even attempt to turn this into a histogram because if I use a reasonable portion of the screen to represent most people ($0 to $200,000, say), the richest people will have to be very far off the right-hand edge of the screen. But if I squeeze the richest people onto the screen, details about most people will be squeezed into a tiny space. Turning the income axis into a CDF actually solves this problem, because the CDF will allocate screen space according to the share of income. We will be able to simultaneously see the contribution of many low-income people and that of a few high-income people. (I'm going to use "people", "returns" and "families" interchangeably rather than try to break things down to individuals vs. families.)

OK, let's do it.   In the first bin we have 2.1 million returns with no income.  So the first point on the people CDF will be 2.1 million, and the first point on the income CDF will be $0. Next, we have 10.6 million people (for 12.7 million total on the people CDF) making in the $1 to $5000 range, say $2500 on average.  So these 10.6 million people collectively make $26.5 billion.  The second point on our income CDF is therefore $0+$26.5 billion = $26.5 billion. We carry the 12.7 million total returns and $26.5 billion total income over to the next bin, and so on.  At the end of the last bin, we find 147 million returns and $9.9 trillion in total income.  Dividing each CDF by its maximum amount (and multiplying by 100 to show percentage) we get this blue curve:


We can now instantly read off the graph that the top 1% of returns have 15% of the income, the top 5% have 35%, the bottom 20% have 2%, and so on. In a perfectly equal-income society, the bottom 5% would take 5% of the income, the bottom 10% would take 10%, etc---in other words, the curve would follow a diagonal line on this graph.  The more the curve departs from the diagonal line, the more unequal the incomes.  We can measure how far the curve departs from the line and use that as a quick summary of the country's inequality---this is called the Gini coefficient.  (The Wikipedia article linked to here has a nice summary of Gini coefficients measured in different countries and different years, but you have to scroll down quite a bit.)

A few remarks for people who want to go deeper:

  • the plotting of two CDFs against each other, as in the last plot shown here, is referred to as a P-P plot.  A closely related concept is the Q-Q plot.
  • I emphasize again that the CDF and the histogram present the same information, just in a different way.  However, there is one advantage to the CDF: the data need not be binned. When making a histogram, we have to choose a bin size, and if we have few data points we need to make these bins rather wide to prevent the histogram from being merely a series of spikes. For the height histogram, for example, I generated 100 random heights and used bins 10 cm (about 4 inches) wide.  Maybe 100 data points would be better shown as a series of spikes than a histogram---but then the spikes in the middle might overlap confusingly.  The CDF solves this problem by presenting the data as a series of steps so we can see the contribution of each point without overlap.  If a CDF has very many data points you can no longer pick out individual steps but the slope of the CDF anywhere still equals the density of data points there.
  • my income numbers won't match a more complete analysis, for at least three reasons.  First, Americans need to file tax returns only if they exceed a certain income, so some low-income families may be missed in these numbers.  Second, the IRS numbers here contain only a "greater than $10 million" final bin.  I assumed an average income of $20 million in this bin, which is a very rough guess. To do a better job, economists studying inequality supplement the IRS data I downloaded with additional data on the very rich; they find that the top 1% make more like 20% of the total, so my guess was on the low side.  Finally, I made no attempt to disentangle individual income from family income as a better analysis would.



Sunday, January 17, 2016

Sports statistics are more random than you think

In a previous post I modeled the home-field advantage (the difference between a team's winning percentage at home and on the road) in the NFL using 10 years of won-lost data.  The NFL average advantage is 15%, but individual teams range from zero to 35%.  It is natural to look for reasons why one team is so good at home while another is relatively good on the road, but I took a more skeptical approach.  I showed that this 0--35% spread in the advantage as "measured" over 160 games (10 years) is exactly what is expected if each and every NFL team has the same "true" (15%) home advantage.   The thinking tool behind this---that the process of measuring increases the apparent scatter---is so important that it's worth more explanation.

Let's recap the reasoning, this time with the simpler example of won-lost record.  Imagine 32 people (each representing one NFL team) sitting at a table, tossing coins.  In the long run you know each person should average 50% heads. But after 16 tosses (representing one NFL season), we know that some of them will exhibit an average above 50% and others will be below 50%.  We know this is due to random events rather than some coins being "more effective" than others at producing heads.  We can actually calculate (or simulate) the expected spread in the 32 measured heads percentages, and compare it with the actual spread.  If a coin produces a heads percentage well outside this spread, we might suspect that it's a trick coin.  We can use exactly the same math to calculate the expected spread in seasonal won-lost records if each game is essentially a coin toss; performances outside this spread can be attributed to a team consistently doing something better (or worse) than their competitors.

Fans may be aghast at the suggestion that each game is essentially a coin toss.  How can I suggest this when players give it their all, shedding blood, sweat and tears?  The key is that the players (and coaches) are quite evenly matched, with equal amounts of blood, sweat and tears on both sides.  Each team still has a tremendous amount of skill and could beat any non-NFL team, but in any league worth watching the teams are sufficiently evenly matched so that random events are important---otherwise we would not bother to play or watch the games!  I also hasten to add that what I have outlined so far is not a conclusion---it is a framework for drawing conclusions about the importance of true skill differences relative to random events.  Presumably there are real differences in skill, both for individuals and teams.  This framework merely helps us counteract the human tendency to attribute every observed outcome to a difference in skill.

Before I present the data and the outcome of the coin-toss model, I ask you to make a prediction.  Surely a team can come by a 9-7 or 7-9 record if each game is a coin toss, but how likely do you think a 10-6 or 6-10 record is?  What about 5-11 or 11-5? A 5-11 team is usually described as "hapless", and an 11-5 team is to be feared, so I'm guessing most fans would think 11 heads in 16 tosses is extremely unlikely.

And the answer is....



The bars in the figure show a simulation of one NFL season, and the curve shows the average of 1,000 simulated seasons.  In the particular season shown, one team compiled a 13-3 record despite having only a 50% chance of winning each game! The curve shows that the average number of such teams per season is about 0.27; in other words, this model predicts a 13-3 team about once every four years.  Keep in mind that the bars can fluctuate a lot from season to season: often there is a big spike or valley somewhere, other times an outlier like 2-12, and so on.  The particular season shown is just one possible realization of the way a season can depart from the average season; a typical simulated season actually shows greater departures from the curve.

The curve shows that in this model (where all teams are equal), we expect one 4-12 (and one 12-4) team, two 5-11 (and two 11-5) teams, four 6-10 (and four 10-6) teams, five or six 7-9 (and five or six 9-7) teams, and six or seven 8-8 teams. Teams at 3-13 should appear about every 4 years, as should teams at 13-3.  We would have to wait about 17 years for a 2-14 team, and somewhere in those 17 years we should also see a 14-2 team (you can read this from the blue curve by noting that in any given season about 1/17 of a team is expected to compile a 14-2 record). A 1-15 team and a 15-1 team are expected every 128 years. while 0-16 and 16-0 are expected every 2048 years.

Now let's look at the actual 2015 NFL regular season with the same blue curve:

The Panthers' 15-1 record is clearly unexpected in our coin-toss model; in other words, the Panthers really were good in 2015.  The Cardinals' 13-3 would appear every 4 years or so in the coin-toss model, so a hard-core skeptic could say this could be random.  However, unlike in the coin-toss model, there is typically at least one 13-3 team per NFL season, so most actual 13-3 teams cannot be average teams that got lucky. At the other end of the spectrum, we have two 3-13 teams (Browns and Titans) and for the same reason we should not suppose that these are average teams that got unlucky.

Next, there are three teams (Broncos, Patriots, and Bengals) that compiled 12-4 records, while we expected only one team to do so in the coin-toss model.  Give credit to those teams. But teams with 11-5 and below could well be average teams with some good luck.

Even as we have to admit that an 11-5 team might be an average team that got some lucky breaks, we have to admit that the handful of really good and really bad teams cast serious doubt on the coin-toss model as a complete explanation.  To further test the model we can look at additional seasons, and we quickly see that 2015 was not a fluke; for example the 2014 season had five teams at 12-4, versus only one predicted by the model.  As any NFL fan knows, a simple model in which any team has a 50% chance of winning any game is wrong.* However, the fact that only a handful of teams beats the coin-toss model in any given year illustrates an important point: random events can cause a great deal of spread in won-lost records.  Not every outcome should be attributed to differences in skill.

Given that differences in skill and random events are both important, can we construct a model that incorporates both?  Yes, but that's too much for one post.** What I want to emphasize here is that random events nearly always cause the spread in outcomes to be larger than the spread in skill.  Consider a simple model with some bad teams, many middling teams, and some good teams.  Some of the bad teams will be luckier than others, so the bad teams will compile records that range from terrible to nearly middling.  Some of  the good teams will be luckier than others, so the good teams will compile records that range from excellent to just above middling.  And as we have seen, the middling teams will spread out.  So there is more spread in win-loss records than there is in skill levels.

The fact that data scatter more than the intrinsic distribution is nearly universal. Accounting for this is a key part of just about any scientific data analysis.  The general public relates more easily to examples from sports, though, so some of the most accessible explanations are based on sports-related examples. If you want to go a bit further, try the Scientific American article "Stein's Paradox in Statistics."  If you prefer to keep it simple, just remember this: attributing some of the observed variance to random events requires attributing less of it to intrinsic factors such as skill differences between teams.  It is very easy to forget this and attribute too much to intrinsic variation.  Of course, variations in skill are much more important than random events in many sports, like the 100-m dash. But most team-sport leagues have feedback mechanisms to maintain some level of parity between teams (in the US, at season end the worst teams get the first draft picks; in European football the worst teams get demoted to a lesser league).  This opens a wider door for random events.

Another piece of data supporting the relatively large role of randomness, especially in the NFL, is the fact that experts generally predict winners and losers with only 60% accuracy.  This is astonishingly low considering that if you simply pick the home team every time, you will already have 57.5% accuracy!  These experts aren't idiots---random events are just really important.  A future post will assess how much of the apparent variation in expert performance must itself be random.


*Testing additional seasons was a natural way to further test this particular model, but in other cases it is not so easy.  For example, if a team has a good record but is on the edge of what could be compiled randomly, we might look at another year of data to see if the team continues to have a good record.  But the team changes from year to year!  Even if it's mostly the same team, the use of longer-term data is not entirely straightforward.  A similar statement goes for individual performances from year to year.  This is one of the things that makes sports statistics so interesting!

**I might address this in a future post.  A quick preview is that the coin-toss model can easily be extended to biased coins.  For example, the Patriots have won about 75% of their games over the past 10 years, so we could represent the Patriots using a coin that comes up heads 75% of the time.  (In practice we would use a computer's random number generator.)

Sunday, January 10, 2016

Logarithms and units

One of the things that every intro calculus student learns is: $${d\ln x\over dx} = {1\over x}$$ This property of the logarithm leads to something else, which turns out to be useful to physicists and astronomers, but is never explicitly taught. If we rearrange this equation to read $${d\ln x} = {dx\over x}$$ we see that a given change in the logarithm (\(d\ln x\)) corresponds to a given fractional change in x. This equation also implies that the logarithm of anything is unitless, as follows:

  • the right side of this equation, \({dx\over x}\), is unitless regardless of the units of x;
  • therefore the left side, \(d\ln x\), must also be unitless; 
  • \(d\ln x\) must have the same units as \(\ln x\);
  • therefore \(\ln x\) must also be unitless, regardless of the units of x. 
Physics students keeping track of their units can be stumped: what units does the log of a current or a voltage have? This tiny bit of math helps us see that the answer is "none."

The fact that \(d \ln x\) specifies a fractional change in x has further repercussions in astronomy, because it is traditional to quote the measurement of a flux \(f\) in the magnitude system: $$m = -2.5 \log_{10} {f\over f_0}$$ where \(f_0\) is some reference flux. This means that a quoted uncertainty in the magnitude of a star or galaxy, \(dm\), specifies a fractional uncertainty in the flux. Let's work out the details: \(\log_{10} x\) is the same as \({\ln x \over \ln 10}\) so $$dm = -{2.5\over \ln 10}  d\ln{f\over f_0} $$ $$dm = -{2.5\over \ln 10} {df\over f} $$ Because \(\ln 10\approx 2.30\), we get \(dm \approx -1.086 {df\over f}\).  For quick estimation purposes, the magnitude uncertainty is about the same as the fractional uncertainty in flux.

This explains why a 0.1 mag uncertainty is about a 10% flux uncertainty, regardless of the magnitude. One should not say that a 0.1 mag uncertainty is a 1% uncertainty in an \(m=10\) star, nor a 0.5% uncertainty in an \(m=20\) galaxy.  For the quantity that matters---the flux of the object---a 0.1 mag uncertainty implies about a 10% uncertainty regardless of the flux.

Monday, January 4, 2016

Seeing Patterns That Don't Exist: Sports Edition

I found a good example of how not to think about data in Time magazine's 2015 "Answers Issue." Among the many examples of analysis that could have been deeper, one stood out:


"Which team has the best home-field advantage?" is essentially one big graphic illustrating the home-field advantage (the difference between its winning percentages at home and away) for every major American sports team. On top of this graphic, they have placed some random observations.  I cannot resist critiquing a few of these before I get to my main point:

  • "Stadiums don't generally have a great influence on win percentage except in baseball, where each stadium is unique."   If they mean only that playing-field peculiarities play no role in sports where all playing fields are identical, then---duh!  If they are saying that peculiarities of the playing field do have a great influence in baseball, then---whoa!   These peculiarities could play a role, but Time hasn't shown any data, or even a quote from a player, to support this.
  • "The Ravens [the team with the best overall home-field advantage, with a 35% difference: 78% at home vs 43% away] play far better when in Baltimore. They lost every 2005 road game but were undefeated at home in 2011."  Why would they compare the road record in 2005 to the home record six years later?  This is a clue that they are "cherry-picking": looking for specifics that support their conclusion rather than looking for the fairest comparison.  I don't follow sports much but I know six years is enough time to turn over nearly the entire team, thus making this a comparison between the home and road records of essentially different teams (with different coaches).  This is easy enough to look up: the 2005 Ravens were 0-8 on the road and 6-2 at home (a 75% difference with a 6-10 overall record), while the 2011 Ravens were 4-4 on the road and 8-0 at home (a 50% difference with a 12-4 overall record). This suggests the Ravens maintain a substantial home advantage, not only when they are a strong team overall but also when they are a weak team.  Rather than make this "substantial and consistent" point Time's factoid misleads us into thinking that a single team has an overwhelming home advantage.
  • "Grueling travel---especially in the NHL and NBA, where many road games are back-to-back---can take a toll on visitors."  This may explain why the NBA overall has a 19% home advantage---but why then does the NHL have only a 10% home advantage, nearly the lowest of the four major sports? It seems as if Time's "data-driven journalism" is limited to "explaining" selected facts without a serious attempt to investigate patterns.
Now to the main point.  A skeptical, data-driven person must ask: couldn't many of these numbers have arisen randomly?  The overall home advantage in the NFL is 15%: a 57.5% winning percentage at home, vs. 42.5% on the road. Imagine that each of the 32 teams has a real 15% home advantage.  They play only 8 home and 8 away games each season, so a typical team expects something like a 5-3 record at home and 3-5 on the road. If random events cause them to win just one more home game and lose just one more road game, they now have an apparent 50% home advantage (6-2 or 75% at home, vs 2-6 or 25% on the road).  They could also randomly win one less at home and one more on the road, for an apparent 0% home advantage.  This is roughly equal to Time's "worst" team, the Cowboys (to whom we will return later).  So the observed spread in home-field advantage is plausibly due to randomness, without requiring us to believe that the Cowboys really have no home advantage and that the Ravens really have a huge home advantage.

In science we have something called Occam's razor: we prefer the simplest model that matches the data.  A complicated model of the NFL is one in which we assign a unique home-field advantage to each team.  A simpler model is that each team has a true 15% home advantage, and that the spread is only in the apparent advantage as measured by the actual won-lost record.  The previous paragraph shows that the simpler model is plausible, at least for a single year.  How do we make this more quantitative and compare to Time's 10 years of data?  Let's flip a coin for the outcome of each game.   This has to be a biased coin, with a 57.5% chance of yielding a win for the home team and 42.5% for the visitors.  We don't need a physical coin; it's easier to use a computer's random number generator.  For each of 32 NFL teams, we flip this "coin" 160 times (for the ten years of games examined by Time) and just see what are the minimum and maximum home vs. away differences.  This takes surprisingly few lines of code in Python:

import numpy
import numpy.random as npr
nteams = 32
ngames = 80 # ten years of home (or away) games in NFL
homegames = (npr.random(size=(nteams,ngames)))>=0.425
homepct = homegames.sum(axis=1)/float(ngames)
awaygames = (npr.random(size=(nteams,ngames)))>=0.575
awaypct = awaygames.sum(axis=1)/float(ngames)
print numpy.sort(homepct-awaypct)


This prints out a set of numbers reflecting the apparent 10-year home advantage for each of 32 simulated teams, for example:

[-0.0375 -0.0125  0.      0.0125  0.0625  0.075   0.1     0.1125  0.1125
  0.1125  0.125   0.125   0.125   0.1375  0.1375  0.1375  0.15    0.15
  0.1625  0.175   0.175   0.175   0.175   0.175   0.2     0.2125  0.225
  0.2375  0.25    0.275   0.275   0.35  ]

As you can see, the largest apparent home advantage is 35%, exactly matching the Ravens, and the smallest apparent home advantage is -3.75%, about the same as the Cowboys' -2%.  Time's entire premise is consistent with being a mirage!

This modeling approach is at the heart of science, and is really fun. There are several directions we could take this if we had more time, and they are illustrative of the process of science:

  • making my statement "consistent with a mirage" more precise. I did this by running many simulations like the one above and I found that a number as large as 35% comes up 17% of the time (meaning in 17% of simulated 10-year periods of football). Thus there is no evidence that the Ravens have a greater than 15% home advantage.*  And even if they do, the fact that the average simulation (31%) comes so close to their record means that most of their apparent advantage is likely to be random. The burden of proof is on those who think the effect is real, to tease out what the effect is and show that it can't be random.  If you find something that really doesn't fit the simple model, congratulations---you have made a discovery!  For example, it is plausible that (as Time suggests) the Cowboys do well on the road because they are "America's team."  With 10 years of data, their home vs. road record is still consistent with the NFL average, but if you like the "America's team" hypothesis you may be able to prove it by looking at 30 or more years of data, where random fluctuations will be smaller.
  • making a more sophisticated model.  I have to stress how brain-dead my model is. For example, each simulated team has a 50% winning record overall.  This is a really simple model that would be inadequate for predicting, for example, the lengths of winning streaks.  We could make the model more sophisticated by programming in the overall winning percentage of each team. I'm fairly confident this won't affect the home advantage, because most teams have a 10-year winning percentage not too far from 50% (in the 40-60% range, with the Ravens at 60.5%), and the exceptions (the Lions with 30% and Patriots with 77% overall winning percentage) still have home advantages consistent with the typical 15%.  But if you were determined to test the simple home-advantage model, you would want to write the extra code to make sure.  (Note that calling for a more sophisticated model here does not violate Occam's razor.  We know that some teams truly are good and some truly are bad, so we should include this in our model if we want to model the data thoroughly.  It just so happens that overall winning percentage is probably not important in modeling home-field advantage.)
  • modeling additional features of the data.  Upgrading the model as described in the previous paragraph would allow you to have even more fun, because this model would allow you to predict other things like the lengths of winning streaks.  It is truly satisfying to have a relatively simple model that explains a wide variety of data.
  • making your model more universal (in this case, extending it to additional sports). This is actually pretty easy; even Time may be capable of this.  Modifying my Python script to do basketball is trivial: just change the home/road winning percentages to 59.5%/40.5% and the number of games at each venue to 41 per year, or 410 in ten years. Before we do that, let's predict what will happen: random fluctuations will play a smaller role in an 82-game season.  The "best" and "worst" teams in the NBA will therefore show smaller deviations from the NBA average (19%) than we saw in football.  In fact, the Jazz lead the NBA with an apparent 27% advantage and the Nets trail with 12%---both consistent with my simulations. I encourage interested readers to do hockey and baseball for themselves.  
I can imagine two types of results from modeling a wide variety of sports, each of which would be rewarding.  First, it could be that randomness explains the variations in all sports.  This would be an impressive achievement for such a simple model.  Second, it could be that randomness explains the variations in most sports, but that there is some interesting exception.  If baseball is an exception then perhaps baseball stadiums do matter.  If Denver is an exception, then perhaps altitude matters.**  

The same thinking tool can be used in many other contexts. The New York Times set a great example with How Not To Be Misled By The Jobs Report.  They showed how uncertainties in the process of counting jobs could lead from an actual job gain of 150,000 to a wide range of apparent job gains, and thus to misleading conclusions about the economy if people take any one jobs report too seriously.

Summary: whether in science, in data-driven journalism, or just as part of being a thinking person, you should have a model in mind when you look at data or make observations.  This will prevent you from over-interpreting apparent features and help you make true discoveries.

*If you think the 17% indicates something unlikely, consider that it is not much less than the chance of getting two heads in two coin tosses, and no one would suggest that there must be something special about a coin that yields two heads in two tosses.  To even think about investigating something further, you should demand that what you observe would have arisen randomly in less than 5% of simulations.

**Spoiler alert: it turns out that neither baseball nor Denver is an exception.  

Friday, October 30, 2015

A great piece of science journalism

I really enjoyed this New York Times article about scientists measuring the melting of Greenland's ice sheet.  It has so many great elements:

  • beautiful images and video. We often think of science as complicated and abstract, but the beauty of nature is what drives a lot of us to keep at it.  Capturing our work with a beautiful image is a worthy goal for scientists who want the public to be able to relate to their work.  In this article, the images and video are especially well integrated into the text, rather than standing apart from it.

  • the whole story of the research.  Too often we see just the final result, but this article explains so much more: why the team thinks the research is worthwhile, how they got funding for it, how hard they work, and how persistent and creative they are at problem-solving in pursuit of their measurements.

  • scale: this is one of the most difficult things for scientists to convey.  This team is measuring the melting in one small part of the ice sheet, but with the hope of extrapolating to the entire ice sheet.  The article literally zooms in from a view of all Greenland to a view of the campsite, and then---very importantly---zooms us back out to see the big picture again.

  • we practice thinking scientifically. Even those who are quite familiar with the basics of global warming and sea level rise will learn an important nuance: models of ice melt are far cruder than the reality.  The greater the extent to which these rivers flow under the ice sheet, the faster we may lose the ice sheet and get truly substantial sea level rise.  These measurements will help us improve the model and therefore the forecast.  This article also shows how good scientists withhold judgment until the facts are in: although massive ice loss is an alarming prospect, the team "might even learn...that the water is refreezing within the ice sheet and that sea levels are actually rising more slowly than models project."


  • Good job, NYT!  This is a model for science journalism.

    Tuesday, February 10, 2015

    Fallacy of composition

    Paul Krugman's column yesterday focused on an application of the fallacy of composition: the false belief that what is true of the parts must be true of the whole. This is one of my favorite fallacies to teach because I never learned about it as a student and it can be surprisingly counterintuitive.

    Imagine that one year growing corn turns out to be more profitable than growing soybeans. The logical thing for each farmer to do is plant more corn the next spring; in fact to maximize your profit you should plant all your fields in corn, right? But if all farmers do this, corn prices will plummet and soybeans will become very valuable. Planting a lot more corn is a logical thing to do for one farmer, but not for farmers as a whole.

    Krugman's column does not use the term fallacy of composition, but it is essentially the same idea for debt: each family has to balance its budget, so the government has to also, right? Wrong. When I was younger I swallowed this argument hook, line, and sinker when I heard it from politicians. But the analogy is false. When society as a whole goes into debt, it goes into debt to itself, or some subset of itself. The dynamic is completely different, because this type of borrowing can spur the economy as a whole.  This is not to say that government debt is always harmless, but those who make debt-is-harmful arguments should at least give substantive reasons rather than a false analogy. Any politician who makes this analogy now instantly loses all credibility with me.

    A related effect is Simpson's paradox. A school may have improving test scores for each racial/ethic group individually, but it can still be true that the school as a whole has decreasing test scores. How? The racial/ethnic composition of the school is changing, with more disadvantaged groups living in the area. This brings the overall average down regardless of improvements within each group.

    I taught this fallacy when I taught a first-year seminar in scientific reasoning, and it may seem like one of those counterintuitive puzzles that has little application in the real world. But Krugman's final sentence reminded me of the real-world importance of effective reasoning: "if the euro does fail, here’s what should be written on its tombstone: 'Died of a bad analogy.'”



    Monday, January 26, 2015

    Number needed to treat

    The New York Times' Upshot series has an excellent article on visualizing medical statistics today. This is a great way to learn how to think about numbers that affect your life.

    Wednesday, March 19, 2014

    SIRC Solar System


    This is a summary of my Science in the River City workshop aimed
    at fifth-grade solar system standards.

    I started by projecting this opinion piece responding to the release
    of a new survey showing that 26% of Americans answered the question
    "Does the Earth go around the Sun, or does the Sun go around the
    Earth?" incorrectly.  The opinion piece was a bit snarky and
    unforgiving; educators know that everyday experience (eg, seeing the
    Sun rise and set) is extremely powerful.  People who think the Sun
    goes around the Earth are at least processing what they see and
    building some kind of model to account for it. The vast majority of
    people who "know" that the Earth goes around the Sun are probably just
    memorizing something their teachers told them, and probably could not
    cite evidence or build an argument to support this statement.  But the
    latter is a much more valuable skill in today's society, and the Next
    Generation Science Standards (NGSS) call for our kids to practice this skill.
    So, I asked the teachers to role-play in pairs, one building an
    argument that the Sun goes around the Earth and the other vice
    versa. Try it...it's hard!

    The #1 argument for Sun-around-Earth is, of course, rising and
    setting, but there aren't a lot of obvious strong arguments for the
    other way.  Kids will try to invoke authority, such as "NASA launches
    rockets that can see what's going on" but I steer them away from that;
    people concluded Earth-around-Sun long before rockets were built, so
    they should be able to use simpler observations.  One pair of teachers
    played out the two models using their bodies so they could see the
    consequences of each, and that's exactly what I recommend whenever
    possible.  They showed that the Sun's daily motion could be explained
    by the Sun-around-Earth model or by a spinning-Earth model (which is
    not the same as Earth-around-Sun).  Lesson: don't stop creating models
    once you find one that fits, as other models might fit the data too!

    If we had no other data, we might not be able to choose between these
    models.  In such cases we should try to bring other observations to
    bear, and/or deduce further consequences of each model. An example of
    the latter: if the Earth is spinning, why don't we feel it?  We feel
    dizzy when we spin on a merry-go-round....but if the merry-go-round
    took 24 hours to complete one turn the effects might be too small to
    feel.  So that was worth thinking about, but inconclusive. Can we
    bring other data to bear? Well, just about everything in the night sky
    rises and sets and rises again in about 24 hours, so the
    Sun-around-Earth model has to become the
    entire-universe-turns-around-Earth model.  But it's a lot easier to
    believe that one thing (Earth) spins than that everything in the
    universe contrives to revolve around Earth in 24 hours. Preferring the
    simpler model is called Occam's razor, and we do that all the
    time in real life. (Think of situations where someone is caught
    red-handed doing something they shouldn't, and they say "This isn't
    what it looks like" and tell a complicated story...do you believe the
    simple story or the complicated story?)

    The real physical proof that the Earth spins is quite subtle. One is the
    Coriolis effect: we can measure the effects of being on a slowly spinning
    "merry-go-round".  I showed the teachers a great kinesthetic activity
    for this (described in a previous post).  Another is the Foucault
    pendulum, which is not easy to demonstrate in a school but which kids
    may have seen in science museums.  A third is even more modern:
    astronomers can directly measure velocities of celestial objects using
    the Doppler shift (the same principle is used by radar speed guns),
    and we constantly have to correct for the velocity of the observatory.
    Because of Earth's rotation, stars that are rising appear to be moving toward
    us and stars that are setting appear to be moving away from us.

    So the Earth spinning accounts for the daily (apparent) motions of Sun
    and stars...so why do we think Earth goes around the Sun? (Do you see
    how much reasoning we had to do to even get to this question?) Anyone
    who looks at the stars periodically must have noticed that you can't
    see the same stars all year round.  And because the presence of the
    Sun in the sky defines when we can't see stars, that means that the
    Sun moves relative to the stars.  Another way to say this is that,
    unlike the Sun, the stars don't take exactly 24 hours to (appear to)
    go around; they take 23 hours and 56 minutes.  So the Sun may be
    opposite a certain star (ie the star is high up at midnight) at a
    certain time of year, but over months will creep around the sky to
    prevent us from seeing that star, and after 365 days the Sun will be
    back to its original position relative to the stars.  Earth's rotation
    period is either 24:00 or 23:56; it can't be both!  (It could be
    neither, but considering that possibility may cause cognitive
    overload.)

    If we again use majority rule or Occam's razor, it's simpler to think
    that the stars are fixed and that the Sun moves relative to the Earth
    (note how little this conclusion has to do with the basic observation
    that the Sun rises and sets each day, which is caused by Earth
    spinning).  But there are at least two models which involve the Sun
    moving relative to Earth, and again I had teachers play the roles of
    Sun and Earth to demonstrate a model where Sun is stationary and Earth
    moves, and vice versa.  Both of these models account for the
    observations equally well (so far), and the moving-Earth model has the
    disadvantage that we don't feel the Earth move.  This is one reason
    many ancient Greek thinkers did not endorse the moving-Earth
    hypothesis. But Galileo figured out that if you are in a laboratory
    moving at constant velocity, you can't feel it move---think of a smooth plane
    ride at 500 mph.  Earth doesn't move at constant velocity, but it changes its
    velocity so slowly that the effects are really small.

    The other thing the ancient Greeks figured out is that the
    moving-Earth hypothesis means that we should see parallax. Think about
    sitting in a moving car.  The roadside trees appear to rush by, but
    the distant mountains appear to move very slowly.  If the Earth moves,
    we ought to be able to see an effect like this by comparing nearby and
    distant stars.  I taped some stars around the room and some teachers
    played this out.  If Earth is still, we will not see parallax.  The
    Greeks looked for parallax but did not see it, so they favored the
    stationary-Earth hypothesis; they weren't stupid!  It just turned out
    that even the nearest stars are so far away that the parallax effect is
    tiny and could not be measured until modern times.

    Using parallax we can determine that the nearest star is about 300,000
    times more distant than the Earth-Sun distance (that comparison is natural
    because it is Earth's motion over that distance that gives rise to the parallax
    effect).  It's as if your car moved one mile but you were asked to discern the
    difference in your view of mountains 300,000 miles away (eg, on the
    Moon).  This can be illustrated dramatically by drawing a one-inch
    Earth-Sun model on the board, and then drawing a long line
    representing the distance to the next star and asking the kids to stop
    me when they thought I had arrived.  Kids (even most adults) have no
    idea how much 300,000 times is; they ask me to stop after 5 feet or
    so, but I keep going.  When I run out of board, I get a roll of toilet
    paper and start unrolling it, as a way to illustrate a very long line.
    I keep going even when they tell me to stop. Then, when I run out of
    toilet paper, I go to the back room and get a cart full of hundreds of
    rolls of toilet paper!  It is really dramatic and fun. It's also fun
    to write out the number of miles to the next nearest star on the
    board: about 24,000,000,000,000 miles. (Kids and even most adults have
    little idea what a "trillion" really means.)

    Finally, because a light looks dimmer the greater its distance from
    us, we can calculate how much light a typical star emits (as opposed
    to the very small amount of its light that we receive).  Correcting
    for this distance factor, it turns out that stars emit about as much
    light as our Sun!  Some emit more, some less, but the bottom line is
    that each star is a sun unto itself, or if you prefer, the Sun is just
    another star.  In the 1600's, long before parallax was ever measured,
    the astronomer Christiaan Huygens turned this argument on its head:
    assuming the star Sirius is as luminous as our Sun, how far away would
    it have to be to appear so dim?  His conclusion was 30,000 times as
    far as the Sun; this is lower than the true value, but only because Sirius is
    actually substantially more luminous than the Sun.  And his number was
    certainly big enough to convey some of the vastness of the universe.

    The Moon does go around the Earth, so we used that to address the
    gravity standard.  I did the donutapult demo, which illustrates that
    for anything to move in a circle there must be a force directed toward
    its center; therefore the Moon is pulled on by a force directed toward
    Earth's center.  We can relate that to gravity (ie, the force we feel
    every day here on Earth's surface) by looking at a globe and noting
    that, anywhere on Earth, "down" means toward the center of the Earth.
    Therefore (Occam's razor again) we don't need to hypothesize about a
    mysterious force keeping the Moon in its orbit; it could well be the
    same force that makes apples fall. (Proving that it's the same force
    goes beyond the fifth grade standards.)

    Finally, we discussed scale models, as scale is a crosscutting concept
    in the NGSS. There is no better way to make people appreciate how
    empty space is than to build a scale model of the solar system! Rather
    than write up our discussion, I refer you to my previous blog posts on
    the scale model project I led at Peregrine School: intro, poster assignment,
    and completion.

    A few links you may find useful:




    Thursday, February 27, 2014

    Climate 101B: Uncertainty and Model-independence

    Following up on my previous post, a few more points are worth making
    regarding the scientific process.

    First, regarding uncertainty.  Earth's atmosphere and oceans do form a
    more complicated system than the simple model I described.  For
    example, here's one way in which it is possible that temperatures
    would not rise much in response to carbon dioxide impeding the outward
    flow of heat.  When temperatures go up initially, that means more
    water vapor in the atmosphere.  If that water vapor condenses into
    clouds, the extra clouds could reflect enough sunlight back into space
    to reduce the heating and make temperatures fall back to normal.  This
    mechanism would act like a thermostat keeping Earth's surface within a
    narrow temperature range, and we wouldn't need to worry about keeping
    our carbon emissions in check.  So, if you heard Arrhenius's warming
    prediction in 1896, you could easily say, "but there's a lot of
    uncertainty in that prediction because we don't understand cloud
    formation.  Maybe there won't be that much warming.  It's uncertain."

    The point I want to make is that uncertainty cuts both ways. Water
    vapor is itself a greenhouse gas, so if the extra vapor does not
    condense into clouds, the greenhouse warming will be accelerated.
    Yes, the prediction is uncertain....but that means that more extreme
    outcomes, as well as less extreme outcomes, are possible.

    If a little bit of warming produces clouds which shut down further
    warming, we would call that a negative feedback loop; negative because
    any change contains the seeds of its own reversal.  If instead a bit
    of warming creates water vapor which accelerates the warming, we would
    call that a positive feedback loop; positive because a little movement
    encourages further movement in the same direction.  One reason climate
    is complicated is that it is full of feedback loops, another example
    being that reduced ice coverage causes more sunlight to be absorbed,
    which reduces ice coverage further, etc.  So what's the verdict on the
    cloud formation?  We still don't know; it may depend on how much
    small-particle pollution we produce, because these small particles
    provide the seeds for cloud condensation.  But meanwhile, temperatures
    keep rising.  So while we puzzle over the details, let's not forget
    the big picture: we keep making Earth's carbon-dioxide blanket thicker
    and thicker.

    Second point: I've repeatedly stressed the important of models in terms of
    understanding a system. Models are great for exploring a variety of
    scenarios, but is there anything we can say about climate that does
    not depend on what model we adopt?  Such model-independent statements
    can be valuable anchors when we're not sure which model to adopt.  I'd
    like to focus particularly on a (more or less) model-independent
    statement regarding sea levels.  We can get rid of models and just
    accumulate data regarding sea levels and carbon dioxide levels in the
    past, and then we can simply ask, what is the typical sea level when
    the carbon dioxide level is 400 parts per million, as we have now
    caused it to be? (It's up from about 275 before the Industrial
    Revolution.)

    The answer is shocking: 24 meters, or 80 feet!  Go ahead and play with
    this interactive flood map to see what such a rise will do to your
    state or country.

    Now I have to give a few caveats. First, changes in carbon dioxide
    concentration and sea levels occurred very slowly in the past.
    Although we are pumping carbon dioxide in very quickly, it's quite
    likely that it will be hundreds or even a few thousand years before
    the effects of the carbon input are fully realized and sea levels rise
    this much.  Essentially no one is predicting these sea levels within
    our children's lifetimes.  But still....this will be a lot for our
    great-great-grandchildren to deal with.  And yes, there's uncertainty on this
    prediction. Sea levels may rise less than this.  But they may also rise more
    than this.

    Second caveat: this prediction is not entirely model-independent. To
    be an extreme devil's advocate, if CO2 levels in the past were somehow
    a natural effect of higher sea levels rather than a cause, then we could not
    use past data to predict what would happen when we artificially increase
    CO2 levels today.  To be clear, I invoke that scenario not because I
    believe it, but simply to highlight how an apparently
    model-independent statement is often not entirely
    model-independent. If all kinds of crazy models are allowed into the
    discussion, then very few truly model-independent statements can be
    made.  But within the scope of "reasonable" models, we can say that
    sea levels will rise by around 24 meters; we just don't know long
    that will take.  Predicting how long it will take requires a model!

    If you are interested in further reading, start with this Skeptical
    Science post, which summarizes this publication in an approachable
    way.  Skeptical Science, by the way, is a good resource for rebutting
    common climate myths.

    Wednesday, February 26, 2014

    Climate 101

    Nice article today in the New York Times: Study Links Temperature to a 
    Peruvian Glacier’s Growth and Retreat. It's a good example of how news
    about climate change could easily be misread as indicating more doubt
    than there really is.  The headline makes it sound as if the link between
    glaciers and temperature is so tenuous that this is the first evidence of it,
    and that it has been established for only one glacier.  The truth is very
    different, even though the headline and article are not wrong once you
    understand the context. This post is aimed at helping teachers
    and students with the basics, and then use that to parse the news.

    Over a century ago, it was known that carbon dioxide impedes the flow
    of heat (in the form of infrared light) from the Earth out into space,
    while not impeding the flow of heat (mostly in the form of visible
    light) from the Sun to the Earth.  If not for this natural greenhouse
    effect, Earth would be much colder.  Teachers can demonstrate quite
    directly that carbon dioxide impedes the flow of infrared light, but
    many teachers may not have the right equipment.  Here's a video
    comparing the temperature rise of two bottles, one with elevated
    levels of carbon dioxide and the other with standard air.  And here's
    a nice video using an infrared camera to show quite directly that
    infrared light is largely blocked by carbon dioxide.

    Around the same time (1896) Svante Arrhenius recognized that humans
    were pumping ever more carbon dioxide into the atmosphere, and that
    this would lead to warming.  But "warming" sounded reasonably
    beneficial, especially given Arrhenius's prediction that it would take
    place slowly over thousands of years.  Arrhenius did not account for
    the large increase in population over the ensuing century, nor for the
    large increase in per-capita use of fossil fuels (cars, airplanes,
    etc). Worldwide, we now emit about 17 times the carbon dioxide emitted
    in 1896, so change is coming much faster.  And now we know that an
    increase in temperature is not as beneficial as it may sound because
    it can radically change weather patterns, which imposes large costs on
    humans as well as on many species which cannot move and adapt rapidly
    enough.  Apart from that, Arrhenius deserves kudos for his prescience.

    Yet if we heard this prediction in 1896 we would be justified in
    expressing some skepticism. Earth's atmosphere and oceans (where most
    of the excess heat is deposited) form a complicated system, and the
    response of a complicated system to a simple input (more heat) may
    well not be a simple result (higher temperature).  But healthy
    skepticism goes only so far; unless you have a better model, you have
    to admit that the best model predicts warming.  Just saying "it's a
    complicated system" does not give you the right to reject all models.
    In this case, you would have to figure out where the extra heat would
    go without causing increased temperatures, and you would have to have
    some evidence to motivate belief in that model.

    Fast forward to 2014.  Warming is here, and we've learned a lot about
    climate models in the meantime. We did find complications (El Nino,
    for one), but the simple model was reasonable in its overall
    prediction.  More heat does mean a higher temperature.

    One way "climate skeptics" (I put the term in quotes because
    oil-company funding leads to a kind of "skepticism" different from the
    detached sort of skepticism we encourage in science) sow doubt about
    this result is to suggest that the warming may be due to natural
    cycles.  There certainly are natural climate cycles, but rather than
    treat them in detail here I want to make a bigger point about how
    science works: When a model makes a prediction and the prediction
    comes true, we should gain confidence in the model, and we should lose
    confidence in models which made contrary predictions
    . Yes, it's
    conceivable that the greenhouse model's prediction came true through
    a fluke of natural cycles rather than accurately modeling how nature works
    ...but how much confidence would you put on that possibility? 

    A prediction is a powerful thing, so let's note the distinction between
    a prediction and a retrodiction (or postdiction), which is when you make a
    hypothesis after looking at the data.  Using data (rather than laws of
    physics or other guiding principles) to generate hypotheses is a fine
    thing to do, but because "patterns" can randomly appear in data you
    cannot confirm the hypothesis with the same data which generated it;
    you must seek out new data. (Admittedly, even scientists sometimes
    forget to apply this principle.)  Climate skeptics can suggest
    alternative causes for the warming after looking at the data, but we
    should have much more confidence in the model which actually predicted
    the data.

    Now, the news: a reconstruction of the timeline of growth and
    shrinkage of a Peruvian glacier shows that shrinkage is most highly
    correlated with temperature and not with other factors such as
    precipitation.  You have to get halfway through the article to get the
    background:

    land ice is melting virtually everywhere on the planet...the pace seems to have accelerated substantially in recent decades as human emissions have begun to overwhelm the natural cycles. In the middle and high latitudes, from Switzerland to Alaska, a half-century of careful glaciology has established that temperature is the main factor controlling the growth and recession of glaciers. But the picture has been murkier in the tropics. There, too, glaciers are retreating, but scientists have had more trouble sorting out exactly why. 

    So, you may have started reading the article thinking that scientists
    understood very little about glaciers if they were just now finding a
    "link" between glacier shrinkage and temperature, but you now see
    that a lot of important knowledge has already been established.
    Newspaper articles are designed to tell you what's new first, so it's not
    the writer's fault that this background was buried deep in the article.
    Nevertheless, in practice many readers will just read the headline and
    skim the first part of the article, thus missing this crucial background.
    Teachers and students should be aware of this when reading science news.

    But wait, there's more! The article goes on to explain how the details
    of tropical glaciers are different from most glaciers (intense
    sunlight can vaporize the ice directly, and the sunlight lasts
    year-round) but that one group of scientists has studied the matter
    and still concluded that temperature is the driving factor in
    shrinking tropical glaciers. "But a second group believes that in some
    circumstances, at least, a tropical glacier’s long-term fate may
    reflect other factors. In particular, these scientists believe big
    changes in precipitation can sometimes have more of a role than
    temperature."  In other words, this is a legitimate scientific dispute, but
    it is about the details of a very specific type of glacier and has little or
    nothing to do with overall concerns about glaciers (or sea ice)
    melting worldwide, much less about the reality of climate change.  Yet
    someone who wants to sow doubt about climate change can point to this
    and say "scientists don't really understand why glaciers melt" and people
    who don't read the article carefully may well be snookered by that.
    Please make sure you (and, if you are a teacher, your students) don't
    get snookered.

    My next post discusses two more aspects of the nature of science---uncertainty
    and model-independent statements---in the context of climate.

    Friday, February 21, 2014

    One Percenters

    We've been bombarded all winter with stories of cold and snowy weather in the eastern US, but the news was just released that January 2014 was the fourth-warmest January on record.  How can this be? The eastern US covers less than 1% of the Earth's area, so (as this essay nicely puts it) "if the whole country somehow froze solid one January, that would not move the needle on global temperatures much at all."  That essay is worth reading because it goes on to explain how subjectively people do perceive global warming: something as unrelated to global warming as being in a cold room does have an influence on the opinions voiced in a survey.   Educators should be aware of this, and actively work on making students think objectively and use data.


    Wednesday, January 29, 2014

    Mostly Harmless

    In the Hitchhiker's Guide to the Galaxy, "mostly harmless" is the
    Encyclopedia Galactica's assessment of Earth (which is not important
    enough to merit a longer entry).  This made me think that looking at
    the solar system through alien's eyes might help students learn about
    it.  I conducted Science in the River City workshop for earth science
    teachers based on this idea, and this is a list of resources for such
    teachers.

    First, I highlighted a graphing activity I had done with elementary
    kids; that experienced is described in great detail here. (Feel free
    to download and copy the graph.)  I extended the activity to graphing the
    surface temperatures of the planets as a function of distance from the
    Sun, which led to the greenhouse effect discussion below, but now it
    occurs to me that a great way to extend this activity would be to jigsaw
    it: assign one group of students to graph size vs distance from the Sun,
    another to graph temperature vs distance from the Sun, another to graph
    density vs distance from the Sun, etc, and then the groups come together
    to think about what it all implies for the formation of the solar system.

    Second, when discussing the formation of the solar system and
    describing how small grains of dust started to stick together, I
    wanted to show a video clip but had some technical difficulties.  Here
    is the link; start at 3 minutes into the video and go for 2.5 minutes.
    (If you have time, the whole episode is worth watching.  It's from the
    How the Earth Was Made series, which has some really nice
    visualizations and is constructed around evidence, which is a key
    feature missing from many science documentaries.  It tells science
    like the detective story it is.  That's generally a good thing, but in
    this case the implication that this particular astronaut doing this
    particular demonstration singlehandedly saved the theory is a bit of
    an exaggeration.)



    Extrasolar planets: http://exoplanets.org/ has the most up-to-date
    info. Even better, they have built-in graphing tools so you and
    your students can easily explore the data.

    Earth's surface temperature: I got my plot from the most authoritative
    source for modern temperatures, NASA's Goddard Institute for Space Studies.
    This link only scratches the surface of climate change data because it deals
    with modern temperature measurements (as opposed to long-ago temperatures
    inferred from ice cores etc) but as the greenhouse effect was not the focus of
    the workshop I won't try to compile a list of links here.  (For those
    not attending the workshop: we graphed planets' surface temperatures
    vs distance from the Sun, and we saw the general pattern that farther
    from Sun equals colder, but we also saw that Venus is a real outlier
    from this pattern.  That's because Venus has had a runaway greenhouse
    effect.  Earth also has a natural greenhouse effect which keeps us
    from being frozen, but which is now being augmented by a manmade
    greenhouse effect.  I did tell the teachers that Earth has a "carbon
    cycle" which will absorb the extra carbon dioxide through the oceans
    into rocks, but I forgot to mention that it will take hundreds of
    thousands of years; I didn't mean to imply that humans can carry on
    regardless. Venus' greenhouse effect is "runaway" because its
    carbon cycle shut down when its oceans boiled.)

    Finally, a few links I didn't get time to show but which will help you
    appreciate the size of the universe (and the sizes of things in it):
    the classic Powers of Ten video and an interactive tool.


    Thursday, January 2, 2014

    One Plus z

    This marks the launch of a new series of posts, aimed at astronomy and physics majors. In the course of my teaching I've noticed a few topics---such as propagation of errors and reduced mass---which seem to fall through the cracks between classes.  Students hear a bit about reduced mass in more than one class, but never seem to get a satisfying explanation in any one class.  Their lab instructor taught them how to propagate errors but never made them think about why.  And so on.  This first post is much more specific---how to think about redshifts and velocity dispersions in cosmology---but fits the bill because it seems to fall through the cracks between textbooks.  Practitioners know that "you need to divide by 1+z" but documentation of this is hard to come by.  So here we go.

    In cosmology, we often want to measure the rest-frame velocity dispersion of a galaxy cluster, but what we actually measure is the redshift dispersion. How are they related? Redshift z is defined in terms of emitted and observed wavelengths as
    This means that 1+z is a stretching factor; it is the ratio of observed to emitted wavelengths.  So you will see the combination 1+z over and over, rather than z by itself.  Get used to thinking in terms of 1+z!

    The Doppler shift formula tells us the wavelength stretching factor in terms of velocity:

    You will often see this called the relativistic Doppler formula, as opposed to the simpler low-velocity approximation used in many situations. But I suggest thinking of this as the Doppler formula because  high velocities are common in astrophysics, and this correct version is simple enough to memorize. Habitually using the low-velocity approximation can get you in trouble.

    The Doppler formula can be inverted to obtain
    Now imagine two galaxies, one at rest1 in the cluster frame (with velocity v1 in our frame) and a second moving with some velocity v21 relative to the cluster which implies some velocity v2 in our frame.  According to the Einstein velocity addition law,
    Substituting the inverted Doppler formula into this, we obtain a complicated-looking expression for v21/c:
    which we can simplify in a few steps:

    Because of my poor equation formatting, I have to remind you here that this is an expression for v21/c, where v21 represents a velocity in the cluster frame rather than in our frame. This gets us close to our goal because we want to know the velocity dispersion in the cluster frame. But this is as far as we can go without an approximation. A useful approximation in this context is that so define and eliminate z2 using :
    Taylor expanding this about we obtain
    This is true for any small redshift difference, so it must be true if delta represents the redshift dispersion of the cluster (thus making v21 represent the velocity dispersion of the cluster). Therefore

    However, there is a much more elegant way to derive the same result. Imagine a hypothetical observer on the first galaxy. Because of the definition of 1+z as the ratio of wavelengths, it must be true that 1+z2 = (1+z1)(1+z21) where z21 is the redshift of galaxy 2 as seen by galaxy 1 (z1 and z2 are, as before, redshifts seen by us). Therefore

    Again we use an approximation: so that we can use the low-velocity approximation for the Doppler shift, . Therefore
    which is the same result as before.  We don't actually need special-relativistic reasoning if we simply use the definition of redshift to isolate the one nonrelativistic velocity in the problem.

    We can better expose the equivalence of these two approaches by taking the idea of daisy-chaining wavelength ratios and applying it directly to the Doppler law:

    This just says that galaxy 2's wavelength ratio ("ratio'' here is relative to a laboratory standard) observed by us is its wavelength ratio observed by galaxy 1, times galaxy 1's wavelength ratio observed by us.   In a few lines of algebra, you can show that the above expression leads directly to the Einstein velocity addition law.  The addition law can be derived in more than one way, but to me this is the most intuitive way.  Thus, daisy-chaining Doppler factors and using the velocity addition law are not contrasting approaches; they are actually the same thing.

    Exercise for the reader: show that the expression above does indeed lead to the Einstein velocity addition law.

    Footnotes:
    1 I specify "at rest" here only so that later it will be easy to think of this galaxy’s redshift as the mean cluster redshift.