Cryptocurrencies 2. How Hashing Puts the Crypto in “Cryptocurrency”

There are several conceptual pieces that are put together to make the working Bitcoin digital currency. The data which defines Bitcoin transactions is stored in a data structure called a blockchain.  A key feature of blockchains involves cryptographic “hashing”. That is the focus of today’s post.

A hash function is any function that can be used to map initial data of arbitrary size to fixed-size values. The initial data may be called the key or the message.  The values returned by a hash function are called hash values, hash codes, digests, or simply “hashes”. A common use for hashing in the past has been to do large-scale data storage and retrieval more efficiently, as described in Wikipedia. That link also discusses how some actual hashing calculations are done.

Here we will focus on cryptographic applications of hashing. For this purpose, hash functions are chosen which are for all practical purposes one-way. It is straightforward to start with the “message” and compute the hash. But it is not feasible to start with the hash and back-calculate the initial message, even if you know the algorithm used for the hash function. Typically the only way to find the message is to run a brute-force search of all possible inputs until you find a match.

Continue reading

Dolly Parton and the Danger of Doing What You Love

Let’s get through the easy parts quick. This Vox feature does its best to argue for, without ever explicitly stating or committing to, the thesis that Dolly Parton should be canceled because she has never said or done anything controversial, let alone anything justifying cancelation.

It is not good and is largely unworthy of comment. As much as some of you crave dunking on the proponents of cancel culture with a an intensity that sometimes feels a lot like, well…cancel culture, I’m bored with the whole family of skirmishes, vendettas, and public identity burnings.

I want to talk about sh*t jobs.

I don’t mean unpleasant, dangerous, or low status jobs. There are positive compensating wage differentials for such things. No, I submit to you that the new sh*t jobs of the modern developed economy are relatively pleasant, safe, and within the appropriate social circles, quite high status. And therein lies the trap. Let me set the scene.

You’re at a top 100 undergraduate university. English is your first language, you’re accustomed to receiving high grades, and are sufficiently socially adept that attending college parties is at least moderately enjoyable. In choosing your major, you are persuaded that you should choose the subject within which you experience the greatest pleasure executing your assignments and participating in class. While math is by no means beyond your capacity, studying it brings you little pleasure, and there is no similar mechanism for you to earn approbation from your professor or impress you classmates. You don’t get excited about telling your friends you are planning to become an engineer or chemist, and, perhaps most importantly, imagining your future self as an employee in sensible work slacks fills you with an almost crippling amount of ennui.

So you start on the path to become a writer. You know that fiction writing is a brutally competitive field, dominated by a handful of (what you imagine to be) supernovas of talent. You’re practical, you tell yourself, and imagine a career in journalism or journalism adjacent publications where you research beat stories and features, allowing yourself to get excited about climbing the ladder and eventually writing a regular column where you blow our collective minds with your insight and pith. It only takes six months into your first gig that you realize the problem. The really big problem.

Every other English major in the country had exactly the same idea. A lot of sociology, history, critical theory, and field studies majors, too. The field is flooded. But it gets worse. It’s also filled with engineers, economists, psychologists, biologists – people with specialized knowledge, often with advanced degrees, all competing with you for space in a brutally selection selective ecosystem where every ounce of attention and influence is measured to the last eyeball.

But it gets so much worse.

Thousands of those people are willing to do the job– your job — for free. For nothing. Hell, some of them are willing to pay the publisher for the opportunity to do what you considered the vocation that you were you going to use to pay your rent. How can you compete with that? It’s beyond our fears of being underbid by people willing to take less pay, of our job being outsourced to workers in another country with a lower standard of living and weaker labor laws. Nobody’s worried about the execs at their company discovering a sweatshop in Vietnam full of employees willing to pay your boss for the right to do your job.

But that is exactly what’s happened to everyone who wanted to write about sports, music, partisan politics, or, for that matter, any subculture where being a tastemaker or cultural curator is catnip for the teenage soul. There’s been a revival of unionization in the digital print business and its easy to see why: they need to close shop. Everyone who’s gotten their foot in the door and ridden the elevator up to their new 6th floor cubicle has been greeted with the same horrifying sight. Teeming masses, as far as the eye can see, all desperate for their job, for their identity, as a writer. So desperate they’ll do it for free. Some want a chance to prove themselves, but many of them just want a hobby. They competently teach 7th grade band during the day for a pay package that includes health and dental insurance, all while wearing a very sensible skort from Costco. But by night they write fiery, in-depth, shockingly well-informed features about their favorite North London soccer team, Icelandic DJ subculture, or how to get the most bang for your buck shopping at Costco. The research, the writing, the promotion, they do all of this for free.

Which means every assignment could be your last. Which means you need to get attention, no matter what. Most days it’s not that big a risk. You churn out 1-2 posts per day, mostly just recapping news or taking a few shots at someone who wrote something you don’t like or, at least, you think other people won’t like. But every now and then you shoot the moon on a big feature, going through old sources, putting together a collage of links that you think will jar readers into not only reading your work, but responding to it and, most importantly, sharing it with others on Facebook, Twitter, or even Instagram. A viral hit is the kind of thing that your overlords will remember the next time your writing hits a fallow period.

But if your feature doesn’t pan out, that could be a problem. If a beloved country singer with a reputation for virtuoso talent, kindness, and often overwhelming generosity that actually makes the world a measurably better place, well, you don’t have the luxury of letting three weeks go to waste. If you can’t find evidence that she’s a bad person, well, you’ll have to go with your gut. And your gut tells you that everyone who is successful is a bad person. Lack of evidence to their secret depravity is itself only evidence to how much they have invested to hide said depravity.

That’s the problem with trying to make what you love at 19 into a career. You’re a kid, you don’t know that much about what you’re going to like in 10 years, all you know is what is fun and what is hard. And, in rough approximation, the same things are fun and hard for all of us. Only studying the things that are fun, dodging whenever possible the things that are hard, will leave you with nothing to rely on but your talent. And, ample as that talent may be, it is unaugmented by the skills and tools that are harder and less fun to come by, tools which would differentiate you from the teaming oceans of talent sloshing against the sides of that cubicle, all desperate to do your job. For free.

Data Landfill

This semester, the textbook I am using to teach data analytics is Business Intelligence by Sharda, Delen, and Turban. In Chapter 3, the authors describe how a data warehouse fits into a business enterprise. A data warehouse (DW) is more than a spreadsheet. It is more than a two-dimensional transactional database. A DW takes expertise to build and maintain. If done correctly, users within the company will be able to quickly access important data that they need to make decisions. Having a good DW is essential for any large enterprise today.

Near the end of the chapter, the authors list problems that are encountered when technologists go in to build a DW for an enterprise.

Continue reading

In Defense of Austenland (2013)

Imagine you finish watching The Greatest Showman and immediately watch it all again. The sets are beautiful and the movie inspires you to believe in the American Dream again. Looking for someone who shares your joy, you google movie reviews. Up comes the NYT website and some reviewer has written, “I expected a movie about the circus to have clowns, but director Michael Gracey disappoints.” You would be upset and feel the need to set the internet record straight.

Today I write to defend female filmmaker Jerusha Hess and her delightful directorial debut Austenland (2013). I will not link to or quote the nasty NYT review.

Jerusha Hess is the brilliant writer of Napoleon Dynamite (2004). I loved Napoleon Dynamite so much that I used my screen printing assignment in high school art class to create custom shirts with references to the movie. If you don’t get Napoleon Dynamite, you really don’t get it. It is funny, and every visual feature is intentional.

Austenland is also funny. There are slapstick moments that made me laugh. I also enjoyed little details such as the recurring motif of characters holding fake animals. Ironically, one of the only real animals is a newborn horse foal, who ultimately turns out to be part of a lie. The fake things are real and the real things turn out to be fake. This film is meta. It has layers, like Shrek. It is only inside of the theatrical play within the theme park that the leading man expresses his true feelings.

On the surface, this film is a guilty pleasure romantic comedy. It does deliver on fantasy wish fulfillment, which I think it should. Impressively, it delivers on wish fulfillment while simultaneously delivering interesting commentary on fantasy versus reality.

Continue reading

Date-onomics

This short spark plug of a book written in 2015 by author Jon Birger was hard to put down. The book is informative on the idea of “marriage markets” and makes the case that, “college and post-college hookup culture, the decline in marriage rates among college-educated women, and the dearth of marriage-material men willing to commit are all by-products of lopsided gender ratios and a massive undersupply of college educated men.” (p. 5)

Recall from an earlier blog post, when there are more women relative to men, women compete with each other and effectively lower their “asking price” (their share of the marital benefits). This also applies to dating markets too. If you’re having trouble seeing how sex ratios matter, consider this example from the book,

“Among undergrads at UNC there are 50 percent more women than men …” That is for every 40 men there are 60 women which means 3 women for every 2 men, “If you want to visualize what 3:2 looks like, imagine you’re back in college. Imagine it’s late at night, and you’re hanging out with friends in someone’s dorm room. Imagine everyone has had a few beers, the mood is flirty, and people are thinking about pairing off. Now imagine there are three women and two men.” 

Continue reading

An Economist Learns Piano: Part 1

My life didn’t change all that much due to Covid-19 pandemic. I live in a small university town. I mostly continued to go to work and my kids mostly continued to play with their neighbor friends. After a brief hiatus, I ended up growing much closer to my neighbors. One nearby couple are even the godparents my most recently born child.

The university at which I teach is a liberal arts school…. And I teach economics. I knew that these music-type of students and professors were out there, but I didn’t have much exposure. I recently obtained a zero-priced piano and had a good 2-hour conversation with a music major. This post illustrates part of I’ve learned so far. First, a graph.

Whether we want to or not, many of us know the musical scale thanks to The Sound of Music. What I didn’t know was that there is not a uniform distance between all of those notes. Along the x-axis is the note labels (do re mi fa so la ti do). The pitch is characterized by an increment called a step. Given some arbitrary pitch for the first note, do, each subsequent note is a specific number of steps away. The pattern is that each increment between notes is 1 step, except the step from mi to fa and from ti to do. Those are half steps. The result is a segmented function.

Now, this pattern can be applied to a piano.

There are a total of 88 keys on a piano. Some are black, others are white. But all of them are a half-step increment from the prior and subsequent key. IDK why there are small black keys and big white ones. But pianos would be a lot bigger without the narrower black keys. Every single white key on a piano is labeled with a letter. The letter *does not move*. A ‘C’ is always a ‘C’.

What can move is the scale label, do, which can be any key. The pattern identified in the graph above must be maintained. To play ‘in the key of C’ means that ‘C’ is identified as do. The remaining keys can be labeled.

The key of ‘C’ is easy because the entire scale can be played on all white keys.

Those two half steps that we mentioned earlier? Those might have been on a black key – except that there is no black key between ‘B’ and ‘C’ or between ‘E’ and ‘F’. The B-C keys are adjacent. That means that their pitch is a half-step apart – exactly what is necessary for the pitch difference between mi and fa. The same is true for the E-F step and the pitch difference between ti and do.

What about the black keys? We can see their roll by placing do on a different lettered key. We can start on ‘D.  

do to re is a full step, from ‘D’ to ‘E’ – skipping the black half-step that’s between them. For re to mi we need to skip a key, all keys are a half step apart. So? To the black key! We skip ‘F’ and land on the subsequent black key. Then, fa falls on ‘G’, a half step and a single key higher in pitch. ‘A is a full step away from ‘G’, so that’s so. la is another full step away on ‘B‘. Recall that all of the keys are separated by a half-step – the key colors are 100% unimportant. ti is a full step higher – but there is no key separating ‘B’ and ‘C’. So, we skip up to the black key again just as we did with mi. Finally, do is a single key and a half step more.

There you have it! One of the things that a pianists can do is play the entire scale, from do to do, starting from any lettered key on the piano. I can’t do that yet, but golly I certainly feel like I have a better handle of what I’m even looking at.

PS – My conversation took a long time and I had to nail down the difference between 1) The note label, 2) the pitch step increments, & 3) the piano key letter labels. Key letter labels and the note labels are ordinal variables while the steps are cardinal. So, the graph at the top of this post isn’t the only important relationship. The graph below includes the relationship between the step and key letter labels. A graph of the note label and the key letter labels requires a rudimentary knowledge of flats and sharps (with two different do’s).

Economic Research on COVID-19

The past 12 months has been dominated by COVID-19, the related recession, the government response, and other matters. But it has not just dominated our lives, it has also dominated new research, including research by economists!

Working papers from the National Bureau of Economic Research are one place to track on-going research by economists. While not all economic research is released as an NBER working paper (there are other series, and some economists just post them on their own website or department page), the volume of NBER papers should tell us something about the trends.

Here’s a chart showing the weekly NBER working papers that are in some way related to COVID-19. The first batch of three papers was released in late February, one long year ago. The second batch of nine papers came one month later. Since then, there have been papers released every single week, with the exception of the week of Christmas.

In total, there have 373 papers released that relate to COVID-19. The peak comes in late May and early June, with 61 papers released in a 4-week period and 21 of those papers coming out on May 25 alone. Since the May-June peak, we’ve seen a slow decline in papers on COVID-19, and we are now at our lowest level, with just 14 papers released in the past 4 weeks.

Continue reading

Cryptocurrencies, 1: What Exactly Is Bitcoin?

Everybody knows that Bitcoin is a “digital currency”. But what does that really mean, and what is Bitcoin really good for? Who developed it? Turns out, oddly, that we don’t actually know. Can you buy a pizza with it? Turns out that perhaps the most famous pizza purchase of all time was made with Bitcoin.

Continue reading

Academia as tax shelter

A very brief story:

My advisor was Laurence Iannaccone, student of Gary Becker, seminal and in many ways founding contributor to the economic study of religion, now of Chapman University. His observation is a common one in academia, a point of pride for some even, though that varies greatly by discipline, as does their market options outside of the academy. And, yes, flexible work schedules, post-tenure job security, and sometimes picturesque campuses all should be counted towards the total compensation of those fortunate enough to secure a faculty appointment. But the power of the observation goes far beyond proper labor market accounting.

As I find so often to be the case, there is good sociology to be done, but the best first step in doing so is a little bit of economics. To wit:

The academy is, on average, considerably to the left of the population at large. Now this difference, mind you, is grossly exaggerated by your typical right-wing windbag who seems to think that universities begin and end in the English department, but the difference remains. So why would your typical economics, chemistry, or architecture professor tend to be left of the popular center? Well, if the median self-identified lefty got to choose the federal and state tax rates, what would they be? Ok, and how much of that will I have to pay out of my non-pecuniary income? Until they figure out how to tax the thrill of pursuing my own self-determined research agenda, not very much. Taxes are cheap when half of your compensation is non-pecuniary.

The academy is a club.

Scratch that.

The academy is a hierarchy of nested clubs. Which means that we often suffer from exclusionary FOMO akin to fourth tier English gentry trying to marry off five daughter in the early 19th century. Membership in those clubs– those famed research groups, donor-named centers, or even (god forbid) schools of thought — they become more than just sources of funding, workshop critique, and coauthor match-making sock hops. These clubs become the well springs from which ever increasing portions of our non-pecuniary income come from. They become our social networks, our friends, and even ,with a handful of co-authors you’ve gone into scientific battle alongside, a second family. The next time you see someone dig in their heels, seemingly denying the mounting evidence that they were on the wrong side of a scientific argument, don’t just blindly assume they are too stubborn and arrogant to acknowledge they might have been wrong. Consider how unfunded or, more importantly, how lonely they stand to be if they’re the first to give up the fight.

It’s why we covet tenure so much. Don’t get me wrong, everyone wants job security. But for most of us, the prospect of being laid off doesn’t necessarily include the possibility of being jettisoned from what you’ve slowly constructed as a separate parallel universe within which you have carefully curated the technical, educational, and social capital necessary to produce your career and life. If you get laid off from programming for Netflix, the next few weeks or months will be unpleasant, scary even. You may begin to doubt your ability or life choices. But that next job will come, and you will as often as not find yourself with a nearly identical life on the other side.

There are those in the academy though for whom this is all they’ve ever known. Bachelors, doctorate, tenure-track academic placement. Throw in a post-doc and that’s 20 years, and you’re entire adult life, in and around universities. Even if they’re from a field fortunate enough to have robust private sector options, how much will doubling your salary really soften the blow for such a person?

I say all of this now not as a critique of academia, or even to lead to prescriptions or advice. You want my advice? Fine, here: don’t go straight to grad school. Dip your toe in the real world, see how you like it. Come back in a few years with a little experience and distaste for office life. It’ll serve you well when your dissertation hits one of its many inevitable nadirs.

Rather, I invite you to consider this: what does the world start to look like when our utility comes less from the goods that we buy and the experiences we have, and more from the clubs we are members of? What does it look like when those clubs find newer and better ways to monitor our behavior and our expressed beliefs? What does it look like when the purging of membership rolls becomes a part of the culture of those clubs?

Emily Oster on Vaccines in February 2021

My third post on Covid data heroes features Dr. Emily Oster. Emily is a mom. Lot’s of economists are moms, but few have incorporated it quite as much into their careers. Emily has written a book on pregnancy and a new one on what to do with the kids after they are born. She does a great job explaining scientific research in a way that is easy to understand.

Emily made a big push to collect data on schools and covid back when there was crippling uncertainty about how dangerous it is to let children go to school in person.

She has a great email newsletter and substack. Her latest post is called “Vaccines & Transmission Redux Redux”. In this post, she distills the latest research to give practical advice on when kids can see grandparents once the vaccines are out.

For a long time now, some families have been avoiding close contact with elderly relatives. When can we go back to normal?

Continue reading