What is in a QR Code?

Bar codes have been common in retail stores since the 1970s. These give a one-dimensional read of digital data. The hardware and software to decode a bar code are relatively simple.

The QR code encodes information in a two-dimensional matrix. The QR code, short for quick-response code, was invented in 1994 by Masahiro Hara of the Japanese company Denso Wave for labelling automobile parts. It can pack far more information in the same real estate than a bar code, but it requires sophisticated image processing to decode it. Fortunately, the chip power for image processing has kept up, so smart phones can decode even intricate QR codes, provided the image is clear enough.

Here is the QR code that encodes the URL for Wikipedia, i.e., the characters: “https://en.wikipedia.org/wiki/Wikipedia”.

Like most QR codes, it has three distinctive square patterns on three corners, and a smaller one set in from the fourth corner, that give information to the image processing software on image orientation and sizing.

As time goes on, more versions of QR codes are defined, with ever finer patterns that convey more information. For instance, here is a medium-resolution QR Code (version 3), and a very high resolution QR code (Version 40):

Version 3 QR Code (29×29), encodes up to 50 characters

Version 40 QR Code  (177×177), encodes up to 1852 characters

My phone could not decode the Version 40 above; the limit may be how much detail the camera could capture.

QR codes use the  Reed–Solomon error correction methodology to correct for some errors in image capture or physical damage to the QR code. For instance, this QR code with the torn-off corner still decodes properly as the URL for Wikipedia (whole image shown above):

Torn QR Code still decodes properly.

Getting down a little deeper in the weeds, this image shows, for Version 3  (29×29) QR code, which pixels are devoted to orientation/alignment (reddish, pinkish), which define the format (blueish), and which encode the actual content (black and white):

Uses Of QR Codes

A common use of QR codes is to convey a web link (URL), so pointing your phone at the QR code is the equivalent of clicking on a link in an email. Here is an AI summary of uses:

They are used to access websites and digital content, such as restaurant menus, product information, and course details, enabling a contactless experience that reduces the need for printed materials. Smartphones can scan QR codes to connect to Wi-Fi networks by automatically entering the network name (SSID), password, and encryption type, simplifying the process for users. They facilitate digital payments by allowing users to send or receive money through payment apps by scanning a code, eliminating the need for physical cash or cards. QR codes are also used to share contact information, such as vCards, and to initiate calls, send text messages, or compose emails by pre-filling the recipient and message content. For app downloads, QR codes can directly link to the Apple App Store or Google Play, streamlining the installation process. In social media and networking, they allow users to quickly follow profiles on platforms like LinkedIn, Instagram, or Snapchat by scanning a code. They are also used for account authentication, such as logging into services like WhatsApp, Telegram, or WeChat on desktop by scanning a code with a mobile app. Additionally, QR codes are employed in marketing, event ticketing, and even on gravestones to provide digital access to obituaries or personal stories. Their versatility extends to sharing files like PDFs, enabling users to download documents by scanning a code. Overall, QR codes act as a bridge between the physical and digital worlds, enhancing efficiency and interactivity across numerous daily activities.

Note that your final statement in this world might be a QR code on your gravestone.

Security with QR Codes

On an iPhone, if “Scan QR Codes” (or something similar) has been enabled, pointing the phone at a QR code in Camera mode will display the first few characters of the URL or whatever, which gives you the opportunity to click on it right then. If you want to be a bit more cautious, you can take a photo, and then open Photos to look at the image of QR code. If you then press on the photo of the QR code, up will come a box with the entire character string encoded by the QR code. You can then decide if clicking on something ending in .ru is what you really want to do.

Accessing a rogue website can obviously hurt you. And even if you aren’t dinged by that kind of browser exploit, the reader’s permissions on your phone may allow use of your camera, read/write contact data, GPS location, read browser history, and even global system changes. The bad guys never sleep. Who would have thought that a QR code on a parking meter posing as a quick payment option could empty your bank account? Our ancestors needed to stay alert to physical dangers, for us it is now virtual threats.

ACKNOWLEDGEMENT: The bulk of the content, and all the images, in this blog post were drawn from the excellent Wikipedia article “QR code”.

Denial and doomerism are products of the same collective action problem

Disappearing people to El Salvador is bad. Unilaterally raising tariffs is unconstitutional and bad. Threatening an American city with violently imposed martial law is really bad. Unilaterally defunding USAID of their legislated resources was bad. The consistent spectacle of cruelty is a spewing sewer geyser of bad. There’s so much bad that I can’t really do it justice here. I’d call it the death of democracy by a thousand papercuts, but these feel more like slashes from raptor claws looking for each and every weakness in an ever-diminishing cage.

Enumerating what is bad and what it means if things get worse is not what I want to write about today. What I want to discuss is how we collectively comment and respond to it. Obviously there is a wide spectrum of responses that we can sift through and evaluate, but broadly there seems to be three categories.

  1. This is fantastic
  2. This is catastrophically bad
  3. Sure, it’s bad, but it’s not that bad.

I don’t care about the first category. If you are cheering this on, well, I can’t help you. You’re either entirely detached or a person whose lens on the world allows them to enjoy personal cruelty and institutional arson. Persuading you otherwise through a blog post is way, way above my pay grade. What I’m interested in understanding, and possibly mediating, is the conversation between types 2 and 3.

Whether you identify as a “highly alarmed” 2 or a “calmly observant” 3, I want you to step back and consider the possibility that you are in 80% agreement with the alternative type, you just don’t know it.

Consider your typical policy expert. They are engaged with the same information ecoystem as everyone else, but there is a policy channel or mechanism they participate in via their expertise. They observe the general sentiment that things are bad, hearing each day about things that are specifically bad. But sometimes there is a news item that either they created (“Here’s a new bad thing I found”) or are impeccably credentialed to comment on (“You can trust me when I say this bad thing is especially bad”). They aren’t going to abstain from contributing or commenting just because other bad things are happening. And neither is anyone else who shares their vein of expertise. Further, those who aggregate or broadly comment on such things will contribute as well. The system quickly becomes oversaturated, and that oversaturation incentivizes and selects for a darker, sometimes panicked tone. There’s a collective action problem here because individuals cannot coordinate to produce an coherent message, ordinal queue, or collective tone.

That’s the primary collective action problem. The secondary problem occurs at the level of commentators who, either because of political or personal temperament, are skeptical of anything that achieves the status of conventional wisdom in the commentariat. Each time a newly weakened democratic guardrail or act of indiscriminate cruelty raises the collective tone beyond what would be a “normal” response in an unsaturated information environment, the skeptic will feel compelled to lower the temperature. This response, however, backfires because it is not engaged with by the uncoordinated collective, but rather an individual. An indvidual, often, who is the relevant expert in question, who knows exactly why it is very bad, and has no interest in the collective temperature, but rather the validity of the narrow and specific bad thing. As experts in narrow fields don’t like being told they’re wrong by non-experts, they likely see the temperature of their own language rise, making the marginal discussion of the bad thing in question more, not less, angry and concerned. The skeptic has not only made things, from their own point of view, worse, they have procured further evidence that the conventional wisdom is overly panicked, compelling them to try to tamp down that much harder on the next wave of concern.

What we are left with is an inner and outer set of collective action problems that are recursively feeding into cohorts of panicking experts fueling doomer fatalism while smug denialists reassure every frog who will listen that their cozy pots of water are not in fact getting warmer.

I’m sure it’s obvious that I’m in the camp that thinks the United States is in greater institutional danger at the moment than at any time since the Civil War. What might not be clear is that I think that the probability of an actual collapse to early 20th century authoritarianism within the next 20 years is about 2 to 4%.** Mathematically, that is a slim chance, but in terms of expected cost its terrifying. Many of you may have read my tone as an implied near inevitability (>90%), a hurricane at sea that is rapidly approaching the shore. Some of you may actually hold that belief, that the US is exactly on track to becoming a failed state, and upon seeing my estimated probability of collapse think me a denialist myself (NB: To be clear, even if the worst doesn’t come to bear there will still be terrible costs along the way). In the context of our discussion, it doesn’t actually matter whether I’m right or wrong. What matters is the failure of collective tone to actually reveal the beliefs held by the individuals that comprise it.

What are the outcomes you are concerned about? What do you think are the odds they will each come to be realized? If we want to take small steps towards improving communication and increasing the quality of collective beliefs, I think we need evolve social norms around communicating our beliefs more directly, even, yes, quantifiably. That way, when our beliefs are internalized in the information zeitgeist, they retain more of their intended meaning, regardless of the tone that emerges after a couple cycles through the collective wash.

** Yes, a 4% chance of democratic collapse within a decade is very large. Think about it this way – if 4% was anywhere near normal, the US would have probabilistically collapse to authoritarianism long ago.

Teaching Business Statistics Graphs with Chart Crimes

Many people take a basic statistics course in college. Those course usually include an overview of standard graphs and best practices for visualizing data.

To keep that section from getting boring (“here’s a line graph… here’s a bar chart…”) you can borrow my slides on #chartcrimes  Teaching people best practices is more engaging when you can show real examples of charts gone wrong.

These are pictures I dropped directly into slides and talked through:

P.S. Joke I made about this section of my textbook:

Older post about teaching stats to Gen Z: Probability Theory for the Minecraft Generation

$1 Million or I Quit: CTE Deaths in Football and Hockey

Former teammates of athletes who died of CTE would require $6 million to offset this disamenity and $1 million to be indifferent between exiting and staying in the profession.

So concludes a paper by Josh Martin. I thought this paper would be about a small group, since CTE deaths mostly happen among long-retired players with few or no former teammates still playing. But it turns out there were a fair number of early deaths, and each player had many teammates who can be affected, totaling 23% of NHL players and 14% of NFL players:

But teams mostly won’t pay worried players enough extra to stay, especially in hockey. So many of them retire early:

Athletes who were teammates with a former teammate who died with CTE for three or more years and played for a team with them at least two years before their death are 7.22 percentage points more likely to retire than characteristically similar non-treated players in the same years. Relative to the pre-treatment mean, this represents a 69% increase.

People still respond to incentives though, and if you do pay them enough they mostly take the risk and stay:

The remaining players will take measures to protect themselves, like skipping games to recover from concussions:

Michael previously pointed out here that these concerns matter more for certain positions, like running backs:

If you want millionaires to show up every week to willingly endure the equivalent of a half-dozen car accidents, you’re going to have to pay them.

This all makes for a good illustration of the theory of compensating differentials, which is sometimes surprisingly hard to observe in the labor market. But sports tend to have the sort of data we can only dream of elsewhere. Which other workers have millions of people observing, measuring, and debating their on-the-job productivity and performance?

This summer I was one of thousands of people crowding into Foxborough just to watch them practice:

The NFL season kicks off today, and I say the players deserve the millions they are about to earn.

Older Workers Have Not Dropped Out of the Labor Force

A recent blog post from the St. Louis Fed claims that:

“Both younger and older workers withdrew from the labor force in large numbers during the pandemic: In fact, their participation rates plummeted. Yet, within two years, the younger workers had bounced back to their pre-pandemic participation rates. But the older workers have not.”

They include a chart which seems to back up that assertion:

However, if you look closely, you will see that the older workers’ age group is open-ended. It includes 55-year-olds, as well as 95-year-olds. Given that the US population is aging, this seems like a poor choice.

While not available currently in the FRED database, there is data from BLS available for older workers that is not open-ended. For example, we can look at workers ages 55-64, who are older but still young enough that they are mostly below traditional retirement age. I use that data and compare with the 25-54 age group (note: because the 55-64 data isn’t available seasonally adjusted, I use the non-adjusted data for both age groups, then use a 12-month average, so my chart doesn’t exactly replicate the chart above):

By using a closed-end age group for older workers, we see that labor force participation has not only recovered from the pandemic, but it exceeds the pre-pandemic peak for both prime-age and older workers, and had done so by the Spring of 2023. In fact, both are now about 1 percentage point above February 2020. If we want to go to the first decimal place, older workers have actually increased their labor force participation slightly more: 1.1 vs 0.9 percentage points. But these are close enough, given that this is survey data, to say the recovery has been roughly equal.

The St. Louis Fed blog concludes by saying that early workforce retirements “will continue to depress the labor force participation rate of workers aged 55 and older for the foreseeable future.” But it’s not true that the LFPR of older workers is depressed! Provided that we exclude those 65 and older.

Bears and Bulls Battle Over Nvidia Stock Price

Nvidia is a huge battleground stock – – some analysts predict its price will languish or crash, while others see it continuing its dramatic rise. It has become the world’s most valuable company by market capitalization.  Here I will summarize the arguments of one bear and one bull from the investing site Seeking Alpha.

In this corner…semi-bear Lawrence Fuller. I respect his opinions in general. While the macro prospects have turned him more cautious in the past few months, for the past three years or so he has been relentlessly and correctly bullish (again based on macro), when many other voices were muttering doom/gloom.  

Fuller’s article is titled Losing Speed On The AI Superhighway. This dramatic chart supports the case that NVDA is overvalued:

This chart shows that the stock value of Nvidia has soared past the value of the entire UK stock exchange or the entire value of US energy companies. Fuller reminds us of the parallel with Cisco in 2000. Back then, Cisco was a key supplier of gateway technology for all the companies scrambling to get into this hot new thing called the internet. Cisco valuation went to the moon, then crashed and burned when the mania around the internet subsided to a more sober set of applications. Cisco lost over 70% of its value in a year, and still has not regained the share price it had 25 years ago:

… [Nvidia] is riding a cycle in which investment becomes overinvestment, because that is what we do in every business cycle. It happened in the late 1990s and it will happen again this time.

…there are innumerable startups of all kinds, as well as existing companies, venturing into AI in a scramble to compete for any slice of market share. This is a huge source of Nvidia’s growth as the beating heart of the industry, similar to how Cisco Systems exploded during the internet infrastructure boom. Inevitably, there will be winners and losers. There will be far more losers than winners. When the losers go out of business or are acquired, Nvidia’s customer base will shrink and so will their revenue and earnings growth rates. That is what happened during the internet infrastructure booms of the late 1990s.

Fuller doesn’t quite say Nvidia is overvalued, just that it’s P/E is unlikely to expand further, hence any further stock price increases will have to be produced the old-fashioned way, by actual earnings growth. There are more bearish views than Fuller’s, I chose his because it was measured.

And on behalf of the bulls, here is noob Weebler Finance, telling us that Nvidia Will Never Be This Cheap Again: The AI Revolution Has Just Begun:

AI adoption isn’t happening in a single sequence; it’s actually unfolding across multiple industries and use cases simultaneously. Because of these parallel market build-outs, hyper-scalers, sovereign AI, enterprises, robotics, and physical AI are all independently contributing to the infrastructure surge.

…Overall, I believe there are clear signs that indicate current spending on AI infrastructure is similar to the early innings of prior technology buildouts like the internet or cloud computing. In both those cases, the first waves of investment were primarily about laying the foundation, while true value creation and exponential growth came years later as applications multiplied and usage scaled.

As a pure picks and shovels play, Nvidia stands to capture the lion’s share of this foundational build-out because its GPUs, networking systems, and software ecosystem have become the de facto standard for accelerated computing. Its GPUs lead in raw performance, energy efficiency, and scalability. We clearly see this with the GB300 delivering 50x per-token efficiency following its launch. Its networking stack has become indispensable, with the Spectrum-X Ethernet already hitting a $10b annualized run rate and NVLink enabling scaling beyond PCIe limits. Above all, Nvidia clearly shows a combined stack advantage, which positions it to become the dominant utility provider of AI compute.

… I believe that Nvidia at its current price of ~$182, is remarkably cheap given the value it offers. Add to this the strong secular tailwinds the company faces and its picks-and-shovels positioning, and the value proposition becomes all the more undeniable.

My view: Out of sheer FOMO, I hold a little NVDA stock directly, and much more by participating in various funds (e.g. QQQ, SPY), nearly all of which hold a bunch of NVDA.  I have hedged some by selling puts and covered calls that net me about 20% in twelve months, even if stock price does not go up.   Nvidia P/E (~ 40) is on the high side, but not really when considering the growth rate of the company. It seems to me that the bulk of the AI spend is by the four AI “hyperscalers” (Google, Meta, Amazon, Microsoft). They make bazillions of dollars on their regular (non-AI) businesses, and so they have plenty of money to burn in purchasing Nvidia chips. If they ever slow their spend, it’s time to reconsider Nvidia stock. But there should be plenty of warning of that, probably no near time crisis: last time I checked, Nvidia production was sold out for a full year ahead of time. I have no doubt that their sales revenue will continue to increase. But earnings will depend on how long they can continue to command their stupendous c. 50% net profit margin (if this were an oil company, imagine the howls of “price gouging”).

As usual, nothing here should be considered advice to buy or sell any security.

Sports observations (an intermittent series)

In no particular order:

$50k in cash compensation is always worth more to employees than $50k in water slides and sagely advice. College football programs that don’t have as many resources tied up in highly paid assistant coaches and non-pecuniary amenities have a short term advantage in the new NIL landscape. Programs will adjust over time, but a lot of that money is locked in for the next 3-5 years.

Referee review has been a mixed bag at best, and a net negative in soccer, but baseball pitching has advanced to the point where it is no longer about beating the batter so much as fooling the umpire. It’s not the raw velocity of pitches that is overwhelming the naked eye, it’s the amount that pitches are now breaking when they cross the plate combined with catchers’ acumen at “framing” pitches with small movements of the mitt. Batters are routinely striking out without ever facing a pitch in the strikezone. #RoboUmps

The English Premiere League has long been the perfect of example of bureaucratic and “focus group” failure. I could go on at length. Watching a handful of games this weekend, it is increasingly clear that they are comfortable letting their league turn into mid 1990’s NHL hockey, with clutching and grabbing replacing skill or, counter-intuitively, even effort. There will be much hand-wringing mid season as to why so many great players are injured, why the order of the league table mostly reflects injury luck, and why teams are overly dependent scoring on boring corner kicks and randomly alotted penalties rather than teamwork and skill. Sigh.

Speaking of the Premiere League, it’s also been interesting watching a sort of resource curse play out with Manchester City two years in a row. There are certain players that are truly one of a kind that every team should want, but few can afford. There is a catch though. When you have one of a kind players there is incentive to train for strategies and tactics that only work optimally with those specific players. If those players are unavailable, a team finds itself having to choose between tactics they can no longer execute optimally or a tactics they have not trained in extensively. Last year Manchester City lost the best midfielder in the world to season long injury, a player who by himself can execute the defensive and offensive duties of what would normally be two specialist players. Playing him by himself in a “single pivot” without defensive support lets you have a numerical advantage elsewhere. Forcing a more mortal human to take on that responsibility, however, proved quite risky. This year they are trying to play without their long time goalie who was, without hyperbole, the greatest passer of the ball to ever play in goal. Watching someone else try to do a job that literally only one human being has ever been able to do has been illustrative of the perils of becoming dependent on irreplicable assets.

Is AI learning just MOOCs again?

I created a provocative title for fun. Tyler pointed me to this podcast:

Joe Liemandt  – Building Alpha School, and The Future of Education (Apple podcast link)

I suppose I’m sold on their claim that most kids can learn basic facts and some academic skills from an iPad app. Listen all the way through if you are going to listen at all, because even some cracks in the tech product are revealed after the big pitch in the beginning.

I have been using Duolingo to review my high school French and Spanish. I think the few minutes a day I spend have helped drag some vocabulary back out of long-term storage. Although, as I recently heard a comedian say, “All my friends who have Duolingo are still speaking English to me.”

Folks should consider whether AI learning apps is just MOOCs again. Essentially, they need to get kids to watch (short, this time) videos of lecture content. MOOCs were longer lecture content videos. Maybe shorter is the key, combined with personalized feedback. Maybe not, for getting cheap effective comprehensive education that scales.

Last year I wrote Why Podcasts Succeeded in Gaining Influence Where MOOCs Failed

About half an hour in, Liemandt asserts that anyone in America would agree that kids learn life skills through “sports” not school. That’s an oversimplification, but I agree that sports ranks higher than “math class” for developing leadership ability.

Since they at Alpha School believe that have solved quickly learning facts, it’s interesting to hear how they do the rest of “education.” The school must fill enough time that the parents don’t have to see their kids half the day and also teach leadership/ communication/character. Alpha school is expensive ($40,000 a year) and there are many paid adults involved who are called “guides and coaches.”

The extracurriculars that Alpha school offers sounds a lot like what most kids can do in some form at a good public middle school or high school in America.  I wrote about the value of outside-class activities in college here: The Value of Student Organizations and On-Campus Education: Anecdotal Evidence from Tim Keller

My students at Samford are especially good at taking on leadership roles and creating a thriving community. Residential college provides a good testing ground for leadership and there are real “market tests” of success for things like sorority events, as the Alpha school encourages for older kids.

I applaud people trying to innovate. I think we’ll see more educational apps in schools, and that will be great. I’m not trying to dump on Alpha School. I just think the underperformance arc of MOOCs should temper our enthusiasm.

Can the President Fire a Member of the Federal Reserve Board of Governors?

That’s exactly what he tried to do this past Monday. Trump announced on social media that Lisa Cook, appointed by Biden in 2022, is now fired. Things are about to get awkward.

First, Trump can’t simply fire Fed governors willy-nilly. Remember when DOGE was involved in all of those federal workforce lay-offs earlier in the year? I know, it seems like forever ago. The US Supreme Court ruled on the legality of those firings, including some at government corporations and ‘independent agencies’. The idea behind such entities is that they are supposed to be politically insulated and less bound by the typical red tape of the government. But Trump’s administration argued that the separation from the rest of the executive branch is a fiction and that there is no one else in charge of them if not the president. The Supreme Court agreed with the administration, with one exception.

Continue reading

You Read It Here First

The subjects of two of our posts from 2023 are suddenly big stories.

First, here’s how I summed up New Orleans’ recovery from hurricane Katrina then:

Large institutions (university medical centers, the VA, the airport, museums, major hotels) have been driving this phase of the recovery. The neighborhoods are also recovering, but more slowly, particularly small business. Population is still well below 2005 levels. I generally think inequality has been overrated in national discussions of the last 15 years relative to concerns about poverty and overall prosperity, but even to me New Orleans is a strikingly unequal city; there’s so much wealth alongside so many people seeming to get very little benefit from it. The most persistent problems are the ones that remain from before Katrina: the roads, the schools, and the crime; taken together, the dysfunctional public sector.

The New York Times had a similar take yesterday:

Today, New Orleans is smaller, poorer and more unequal than before the storm. It hasn’t rebuilt a durable middle class, and lacks basic services and a major economic engine outside of its storied tourism industry…. New Orleans now ranks as the most income-unequal major city in America…. In areas that attracted investment — the French Quarter, the Bywater and the shiny biomedical corridor — there are few outward signs of the hurricane’s impact. But travel to places like Pontchartrain Park, Milneburg and New Orleans East that were once home to a vibrant Black middle class, and there are abandoned homes and broken streets — entire communities that never regained their pre-Katrina luster…. Meanwhile, basic city functions remain unreliable.

I wrote in 2023 about a then-new Philadelphia Fed working paper claiming that mortgage fraud is widespread:

The fraud is that investors are buying properties to flip or rent out, but claim they are buying them to live there in order to get cheaper mortgages…. One third of all investors is a lot of fraud!… such widespread fraud is concerning, and I hope lenders (especially the subsidized GSEs) find a way to crack down on it…. This mortgage fraud paper seems like a bombshell to me and I’m surprised it seems to have received no media attention; journalists take note. For everyone else, I suppose you read obscure econ blogs precisely to find out about the things that haven’t yet made the papers.

Well, that paper has now got its fair share of attention from the media and the GSEs. Bill Pulte, director of the Federal Housing Finance Agency and chairman of Fannie Mae and Freddie Mac, has been going after Biden-appointed Federal Reserve Governor Lisa Cook over allegations that she mis-stated her primary residence on a mortgage application:

Pulte has written many dozens of tweets about this, at least one of which cited the Philly Fed paper:

Now President Trump is trying to fire Cook. Federal Reserve Governors can only be fired “for cause” and none ever have been, but Trump is using this alleged mortgage fraud to try to make Cook the first.

The Trump administration seems to have made the same realization as Xi Jinping did back in 2012– that when corruption is sufficiently widespread, some of your political opponents have likely engaged in it and so can be legally targeted in an anti-corruption crackdown (while corruption by your friends is overlooked).

I’m one of a few people hoping for the Fed to be run the most competent technocrats with a minimum of political interference:

But I’m not expecting it.

Remember, you read it here first.