Thread on Programming Ability

Ethan Mollick brought this Nature article to my attention. One of the authors Chantel Prat, is also on the thread.

The sample size for this study is only 36, so we should think of it as preliminary work toward understanding how people learn to program.

Their abstract, with emphasis added by me:

This experiment employed an individual differences approach to test the hypothesis that learning modern programming languages resembles second “natural” language learning in adulthood. Behavioral and neural (resting-state EEG) indices of language aptitude were used along with numeracy and fluid cognitive measures (e.g., fluid reasoning, working memory, inhibitory control) as predictors. Rate of learning, programming accuracy, and post-test declarative knowledge were used as outcome measures in 36 individuals who participated in ten 45-minute Python training sessions. The resulting models explained 50–72% of the variance in learning outcomes, with language aptitude measures explaining significant variance in each outcome even when the other factors competed for variance. Across outcome variables, fluid reasoning and working-memory capacity explained 34% of the variance, followed by language aptitude (17%), resting-state EEG power in beta and low-gamma bands (10%), and numeracy (2%). These results provide a novel framework for understanding programming aptitude, suggesting that the importance of numeracy may be overestimated in modern programming education environments.

Learning Python, at least at first, is more like learning a foreign natural language than it is like doing arithmetic problems.

There are still many open questions in this area, so I see this paper as an important small step in the right direction. I have also done a study on this topic.

History according to Polybius

It’s unusual for me to sit down on a weekend morning and read *literally checks notes* Polybius. This was assigned to me for a seminar. Here’s his proposal for the inevitable endless cycle of human leadership structures:

  1. Some humans are still alive. They band together because they are too weak to survive alone.
  2. A strong man who bravely defends the group in his youth becomes a monarch. “Kingship” is the next progression. Polybius assumes that people could consent to be under the leadership of a powerful and noble man.
  3. The king has children. The people venerate the descendants of the good king, but these princes and princesses will be spoiled and selfish. The princes “gave way to their appetites owing to this superabundance…” Thus, kingship becomes tyranny.
  4. Nobles overthrow the tyrants, and so become aristocrats. “But here again when children inherited this position of authority from their fathers, having no experience of misfortune and none at all of civil equality and liberty of speech… they abandon themselves to greed… and… rape…” The aristocracy becomes a corrupt oligarchy.
  5. Democracy emerges when people have “killed or banished the oligarchs” and the people remember being mistreated by kings. How does Polybius think democracy ends? Once again, it’s the new generation and the corruption they indulge in. Where do they end up? “… democracy in its turn is abolished and changes into a rule of force and violence.”
  6. There are two ways to get back to stage 1 monarchy. Life in the decline of a democracy is chaotic enough that people willingly back a strong man to protect them. Alternatively, he presents a “floods, famines, failure of crops… all arts and crafts perish…” scenario. A natural disaster, regardless of what stage in the political cycle humans were at before, will position the survivors to start again at monarchy.
Continue reading

Overfitting Celebrity Pitches

The Washington Post created a fun infographic of celebrity baseball pitches.

I use this graphic in my Data Analytics class. Students are tempted to draw inferences about individuals from this data set. John Wall and Michael Jordan are great athletes, but in this case they are underperforming Avril Lavigne and George W. Bush. Do we conclude that Sonia Sotomayor missed her calling as an MLB player?

The first lesson here is that we should not assume we can predict where Harrison Ford’s next pitch will go based on observing just one pitch. A single pitch should be considered a random draw from a distribution centered around Ford’s average ability. Any single pitch could be an outlier.

Snoop Dog features twice on this graph. In 2012 he got the ball in the strike zone. Had we only seen that, we would want to conclude that he is a great pitcher. However, in 2016 he was way off to the right. In either case, overconfidence that he is predictably near a single pitch would have been a mistake.

Lastly, I use this graph to illustrate the concept of overfitting (investopedia definition). I suggest a model that is obviously inappropriate. What if we conclude from these data that anyone with the last name of Bieber will not be able to throw the ball in the strike zone? That model surely will not generalize. The problem is that if we test that prediction on the same data we used to train the model, the misclassification rate will be zero. If possible, start with a large data set and set aside some portion of the data for validation, before training a model. Having validation data for assessment is a good way to check that you haven’t modeled the noise in your training set.

John Duffy Experiments and Crypto

John Duffy and Daniela Puzzello published a paper in 2014 on adopting fiat money. I think of that paper when I hear the ever-more-frequent discussions of crypto currencies around me. To research the topic, I went to John Duffy’s website. There I found a May 2021 working paper about adopting new currencies in which they directly reference crypto. Before explaining that interesting new paper, first I will summarize the 2014 paper “Gift Exchange versus Monetary Exchange.”

Continue reading

More computer jobs than San Francisco

The U.S. Bureau of Labor Statistics reports Occupational Employment and Wages from May 2020 for

15-0000 Computer and Mathematical Occupations (Major Group). The website contains a few interesting insights.

Where are the computer jobs in the United States? When looking just at total numbers of jobs, three major population centers make it into the top 7 areas: NYC, LA, and Chicago. San Francisco is ahead of Chicago, while San Jose is behind Chicago. In terms of the total number of jobs, the D.C. area is ahead of any West Coast city. Is Silicon Valley not as central as we thought?

Here’s a map of the U.S. that isn’t just another iteration of population density.

When metropolitan areas are ranked by employment in computer occupations per thousand jobs, then New York City no longer makes the top-10 list. San Jose, California reigns at the top, which seems suitable for Silicon Valley. The 2nd ranked area will surprise you: Bloomington, IL. A region of Maryland and Washington D.C. shouldn’t surprise anyone. If you aren’t familiar with Alabama, then would you expect Huntsville to rank above San Francisco in this list?

Huntsville, AL is not a large city, but it is a major hub for government-funded high-tech activity. The small number of people who live there overwhelmingly selected in to take a high-tech job. For an example, I quickly checked a job website to sample in Huntsville. Lockheed Martin is hiring a “Computer Systems Architect” based in Huntsville.

Anyone familiar with Silicon Valley already knows that the city of San Francisco was not considered core to “the valley”. Even though computer technology seems antithetical to anything “historical”, there is in fact a Silicon Valley Historical Association. They list the cities of the valley, which does include San Francisco. (corrected an error here)

The last item reported on this Census webpage is annual mean wage. For that contest, San Francisco does seem grouped with the San Jose area, at last. The computer jobs that pay the most are in Silicon Valley or next-door SF. Those middle-of-the-country hotspots like Huntsville do not make the top-10 list for highest paid. However, if cost of living is taken into account, some Huntsville IT workers come out ahead.

Teaching through my R mistakes

I blogged earlier about a new textbook that I am adopting for an analytics course. The first few chapters are primarily an introduction to using the R coding language within RStudio. One of the resources I’m posting for students this week is screen capture videos of me manipulating data in RStudio.

Sometimes I make mistakes, shockingly. I’m a professional, and yet sometimes I still make careless typos in R. I found out that my version of R was outdated, right when I was in the middle of recording a lecture.

I could have deleted the footage of my mistakes. I could have re-recorded a clean smooth video in which I run command after command without saying “ok… I got an error”.

Continue reading

Reading Sarah Ruden’s The Gospels

Sarah Ruden is an scholar of ancient literature who has translated classic works such as The Aeneid. Her new book is an English translation of the 4 first books of the Bible’s New Testament, the Gospels.

If you buy a standard Bible, there is usually only a 2-page preface to a 500+ page book. Ruden’s introduction and glossary takes up closer to 50 of the first pages. I would pay just to read the introduction. Ruden describes what it was like, as a professional translator of classics, to approach the Gospels. A reader who is already familiar with the Bible will learn as much from this introduction as from the translation itself. It’s rare to hear the Gospels discussed simply as books instead of as weapons wielded by all sides of the culture wars. I found it interesting to learn about how the Gospels, stylistically, compare to other ancient texts.

Ruben’s enthusiasm for listening to the voices of ancient writers is contagious. She makes it all sound so interesting that anyone, regardless of their previous stance on god (the lowercase g is her idea of what the ancients would write), will want to keep reading. Speaking as someone who has already read the New Testament, I have never been more excited to read the Gospels as I was after finishing Ruden’s introduction. Ruden promises to deliver to modern readers the voices of the ancient writers, with as much accuracy as possible.

Continue reading

If you are ever in Birmingham AL…

Alabama is not a top international tourist destination, and I’m not going to argue that it should be. However, if you are ever in Birmingham, AL…

The restaurant scene if amazing. There are really excellent James Beard award winning restaurants. You can find authentic Southern cooking and BBQ. This is one of the most affordable places to make a foodie weekend. BhamNow curates some good articles on local restaurant news.

Our most famous place is the Birmingham Civil Rights Institute. The struggle for civil rights put Birmingham on the map (I don’t mean in a good way).

Something to understand about the city is that it’s small and easy to get around by car. You can do lots of things in one day. You could quickly go from the Civil Rights Institute over to the Art Museum (free admission).

If you like history or big machines then you will appreciate being able to walk through Sloss Furnaces. This is what remains of a real 20th century blast furnace. Unlike the Art Museum, I would say come see it now before it gets demolished or closed.

Also related to the defunct iron and steel industry is the park around the giant Vulcan statue. The park offers a great view of the city. There is a small museum about digging iron ore out of Red Mountain and how people could die in the steel mills. At this point I will mention, for our international audience, that Birmingham was named after the city in England. We aspired to be the “Birmingham of America”.

If you want to hike Red Mountain, a giant network of hiking trails is just a 15-minute drive from the city. The dirt is red. You can tell this was a rich iron seam. Two other good hiking spots are Ruffner Mountain and Moss Rock Preserve. None of the mountains around here are dramatic, but these are nice places to go when the weather is good. You might want to hike so you can justify eating more.

For kids, I recommend Railroad Park. It’s a nice city park where freight trains go by regularly. Birmingham was not built around a river – it was built around a railroad. Close by is the McWane Science Center that has lots of hands-on exhibits for kids. I would not recommend McWane for adults, although their IMAX movie offerings could be of interest and the Pizitz Food Hall across the street is fun.

If you live in the American South and have not yet visited Birmingham for a weekend, then you are missing out! Of course there are many more things I could say about the city, but just what I listed above will keep you busy.

Not all robots have faces

Through Twitter, I have become aware of the SNOO. I’m quoting SNOO literature

Unfortunately, babies don’t sleep well on flat, still beds in totally quiet rooms. In fact, over 50% of

babies still wake up once a night after 6 long months. That’s a problem because poor baby sleep

causes the #1 new parent stress: EXHAUSTION!

SNOO gives a perfect 4th trimester of gentle shushing and rocking…all night long. And, it quickly

responds to your babies’ fussies with stronger sound and jiggly motion…

The bed hears your baby cry and rocks them back to sleep! I can probably count the number of times I have slept through the night in the past 6 years on two hands. If used wisely, this machine sounds like an incredible gift to families. (I can also see problems if used unwisely.) If the baby is crying for longer than 3 minutes, then the machine turns off and the expectation is that a parent needs to step in.

This reminds me of Tyler Cowen’s book Average is Over.

Continue reading

Covid Pandemic Diary Part 2

I pick up from my previous post in May 2020.

That tweet from early May captures some of the joys and frustrations of working from home with small children. It was hard to get work done. My career suffered. At the same time, in my case, there were happy moments. My kids got more time with me and also with each other. One reason I didn’t go crazy is that we could get outside and the weather was decent throughout “lockdown”.

Something that happened quietly is that two-income parents hired private nannies and never mentioned it on social media. I know there are lots of families who did not do that and had a hellish year trying to parent while working from home. In my case, daycare was back open in June with extra health precautions.

Late Spring was a time when it seemed like the United States might be the worst-performing country. Certain parts of Asia were models of efficiency and cooperation, by comparison.

Late May is when I breathlessly tweeted that I had purchased a box of masks. Finally, the supply caught up with demand. Masks became plentiful and cheap. That helped us find ways to be together without such a high chance of spreading germs.

July 2020 – My public school system (which had gone virtual in the Spring) announced that elementary parents would have a choice of in-person (with masks) or virtual for the Fall. Our schools have been open all year (with masks) and no major outbreaks.

High school and middle school students did more forced remote days than elementary-aged kids. I really appreciated the creativity and flexibility. Remote school is harder on younger kids (and parents of younger kids).

I emailed my city representative to ask for a drive-through testing site in our city. He said he would bring it up at the council meeting that night. Within two weeks, they had done it! This was incredible. I did not expect that because of one request this would suddenly just happen. I suppose there were enough people who wanted it already. It probably helped that city council elections were right around the corner and he could take credit for doing something helpful. Twice in 2020, I used my city hotline to get an appointment for a Covid test.  

In August, my university got ready to bring students back for some in-person classes, while also offering remote options for every class. The campus sprouted one-way walking stickers and masks were required everywhere.

Economists moved conferences online. On September 10, 2020 I stayed up a little late to catch one of my Chinese colleagues presenting at the ESA worldwide virtual conference. My daughter didn’t want to stay in bed, so I let her stare at the Zoom meeting for a bit.

I have said nothing so far about politics in 2020, the year of politics. The televised debate between President Trump and now-President Biden in September of 2020 was a stressful event for me. If we can’t even speak to each other, then no amount of good ideas will help us solve problems. That sad moment in American history made me more determined to maintain this blog as a place to talk about ideas.

The Fall of 2020 was when intellectual soldiers like Alex Tabarrok were alerting us to the fact that we could have vaccines if the government would let us. I was following that news and doing some signal-boosting. Some of my friends on social media announced that they were participating in vaccine trials – thanks!

My university offered rapid tests to employees at the end of the Fall semester. It almost felt like a miracle to be able to just know in 15 minutes if I was carrying Covid or not (yes, I know about the false negatives).

There were moments in peak-wave when local hospitals were full because of Covid. Alabama’s worst month as measured by deaths was January 2021. When Covid was spreading widely in December 2020, I believe a lot of people did not expect that vaccines would be available so soon in the future. On the margin, a few more people might have foregone holiday parties if they had known.

Vaccines became available to medical professionals around January 2021. That was exciting news, since we had all been feeling bad about the doctors and nurses treating infectious Covid patients.

Earlier than I expected, I was able to get the Pfizer vaccine because of my “educator” status in the state of Alabama. It is convenient that I live near UAB hospitals. They had the technology for cold storage and administering the Pfizer vaccine. It was a huge relief to get the vaccine while teaching in-person classes. Since I had been following vaccine news closely, it felt like a huge achievement.

There was a period of time when conversation among my neighbors and colleagues revolved around the vaccine. Water cooler talk was “which one did you get?” or “did you have side effects?”  People told stories about how a friend called to tell them that one place had extra doses at the end of the day. Even when it was technically reserved for old people only, some young people found connections. One of my students told me he wouldn’t be in class because he was going to drive 6 hours to another state to get a vaccine. I don’t want to make the system sound corrupt, because it largely was not. It’s just a fact that some places couldn’t distribute all of their doses to the people who were designated for them. It was better to get the leftovers into arms than waste them.

I treasured that energy, and I miss it. Now, in May 2021, after all the work that went into producing vaccines, Americans are refusing to show up for shots.