Jordan Ellenberg's Blog, page 9

March 4, 2023

I’d like to make a request, II

In re my last post about WIBA Madison’s Classic Rock; a couple of days later I was listening again and once again the DJ was taking listener calls, but this time it was because he was angry that McDonald’s was using Cardi B as a spokeswoman; he wanted the listener’s opinion on whether Cardi B indeed represented, as McDonald’s put it, “the center of American culture” and if so what could be done about it. Nothing, the listeners agreed, could be done about this sad, the listeners agreed, state of affairs. It has probably been 20 years since I heard the phrase “rap music” uttered, certainly that long since I heard it uttered so many times in a row and with such nonplus.

 •  0 comments  •  flag
Share on Twitter
Published on March 04, 2023 15:11

February 28, 2023

I’d like to make a request

I was listening to WIBA 101.5 Madison’s Classic Rock in the car while driving home from an east side errand and heard something that startled me — the DJ taking requests from listeners calling in! Now that startled me — why wait on hold on the phone to talk to a DJ when in 2023 you can hear any song you want at any time, instantly?

And then I thought about it a little more, and realized, it’s not about hearing the song, it’s about getting other people to hear the song. Like me, in the car. 2023 is a golden age of listening to whatever you want but is an absolute wasteland for playing music for other people because everybody is able to listen to whatever they want! So there’s much less picking music for the whole room or picking music for the whole city. But at WIBA they still do it! And so listeners got to play me, in my car, this song

and this song

neither of which was really my cup of tea, but that’s the point, radio offers us the rare opportunity to listen to not whatever we want.

 •  0 comments  •  flag
Share on Twitter
Published on February 28, 2023 13:37

February 22, 2023

“The pandemic made things worse.”

The Hill reports on a Pew Research study showing high proportions of Americans without romantic partners:

Recent years have seen a historic rise in “unpartnered” Americans, particularly among the young. The pandemic made things worse.

Here’s the Pew report the Hill piece draws on, which says:

Roughly six-in-ten young men report being single. Overall, three-in-ten U.S. adults are single, meaning they are not married, living with a partner or in a committed romantic relationship. This share has not changed since the Center asked this question in 2019.

Always click the links to see what the study really says!

As for me, I’d estimate I was single somewhere between 50-60% of the time between the ages of 18 and 29.

1 like ·   •  0 comments  •  flag
Share on Twitter
Published on February 22, 2023 14:34

February 20, 2023

Learning a made-up language, II

Following up on yesterday’s post: one could also ask whether GPT-3 can compose in a made-up human language. For instance, you could take English and modify it a bit:


Henderson’s native language is Gravinic, and when he speaks English, it sounds like this:


“I to the store did go and some cabbage did buy. Now I some dinner am making and I some cake will later eat. I you am not very much liking. I for you to go away am politely asking.”


In other words, the new rules are that verbs go to the end of the sentence, all verbs take an auxiliary verb indicating tense, adverbs go between auxiliary verb and main verb. Is this short text enough for GPT-3 to locate context in a language that isn’t one of the languages in its training set but rather “English with modifications inferred from prompt?”

Not yet:


Write more dialogue where Henderson tells you about his day.


GPT-3: “I then went to the park and did some reading. The sun was shining and it made me feel so relaxed. I saw some birds flying about, and it was quite a sight. After that, I went to the beach and enjoyed the sound of the waves. I even went for a swim! Finally, I returned home and watched some television before going to bed.”



It’s totally possible that more prompting would make this work, though – I didn’t have the patience to manually type in a bunch more Gravinic-inflected English. I’m not actually sure what kind of context GPT-3 is placing itself in with this response.

1 like ·   •  0 comments  •  flag
Share on Twitter
Published on February 20, 2023 17:07

February 19, 2023

Learning a made-up language

LLMs seem to be really good at swift, reliable context location — e.g. it takes only a little bit of Python or romance novel or instruction manual for the LLM to recognize a context which requires specific choices of syntax and diction. I wondered though whether GPT-3 was recognizing the context of “Python” or a more general context of “programming language” which is further fine-tuned to a subcontext of Python. It seems like it’s the latter! Here was my way of testing. I gave it the prompt


The following is code in a programming language called Ranger that computes the first n triangular numbers.

ask('Please enter a number: '),n)#initialize the triangular numbertriangular_number : 0as i ranges to n 1triangular_number : triangular_number iwrite i then triangular_number

Ranger doesn’t exist: I just made something up where for loops are written “as i ranges to” and assignment of variables is done with a : and you don’t enclose the argument of a print (or “write”) statement in parentheses. To be fair, it’s basically python with some dictionary changes. Still, I thought I would see if GPT-3 can write code in Ranger even though there’s no Ranger code in its training set and so no actual “Ranger context” to locate. And it can!


Write a program in Ranger to compute the 10th prime number.

#initialize the prime numberprime_number : 1#initialize the countcount : 0#iterate from 2 to infiniteas i ranges to infiniteis_prime : trueas j ranges to i-1 if i % j is 0 is_prime : false breakif is_prime is true count : count 1 if count is 10 prime_number : i breakwrite prime_number


So you can see that GPT-3 correctly infers that the right context is “C/Python-like code” and correctly recognizes from the prompt that : means assignment, “as … ranges” is how you do a for loop, etc. It’s interesting that it’s way of testing primality is to check divisors of i all the way up to i; surely there isn’t a lot of existing code in the training set that does it in this massively inefficient way!

To be fair, this is an easy problem, and if you give it a somewhat harder one, it does this:


Write a program in Ranger to count the number of binary strings of length 10 which have no occurrence of the substring ‘0101’.

# Initialize the number of binary stringsnum_binary_strings : 0# Iterate over all binary strings of length 10as binary_string ranges to 2^10 # Check if the binary string contains the substring '0101' if binary_string does not contain '0101' num_binary_strings : num_binary_strings 1# Print the resultwrite 'Number of binary strings of length 10 which have no occurence of the substring "0101": ', num_binary_strings

I guess this is sort of pseudocode? It doesn’t really know how to iterate over binary strings but knows there are 2^10 of them so it just “ranges” to that. Nor does it know how to check string containment in Ranger (how could it?) so it switches to English. Not a bad answer, really!

It would be interesting to try something like this where the invented language is a little more different from existing languages than “Python with some 1-for-1 word and symbol changes.”

1 like ·   •  0 comments  •  flag
Share on Twitter
Published on February 19, 2023 13:12

February 18, 2023

Uncontested touchdown

The Chiefs beat the Eagles in the Super Bowl and even people who liked the outcome didn’t like the ending. With a little under two minutes left, the score tied, and the Eagles out of time outs, running back Jerick McKinnon broke free and headed for the end zone; but he stopped at the 2 yard line and took a knee, setting up the opportunity for the Chiefs to run down the clock to nothing and then kick a chip-shot game-winning field goal. Had McKinnon scored a touchdown, the Eagles would have been 7 points down, but Jalen Hurts would have had the chance to try to make it back up the field, with no time outs left, and even the score.

That’s football! That’s what people want to see! Instead, we got the Chiefs taking a knee.

What if McKinnon weren’t allowed to do what he did? That is — what if a touchdown play that the defense chose not to contest simply counted as a touchdown? Or, more simply — what if the defense, at any time, were allowed to concede a touchdown as “uncontested,” give up 6 points and the conversion, and force a kickoff?

It would be kind of like the intentional walk of football. Or even more specifically the intentional bases-loaded walk, where you give up points on purpose to achieve a larger strategic goal. But the uncontested touchdown rule, instead of avoiding a thrilling faceoff between the tiring pitcher and the fiercest slugger, would avoid… the weak fart of an ending we just saw.

I think teams would hardly ever do this. In fact, I can’t really think of any situation where a team would do this other than the exact situation that came to pass in this Super Bowl. And I think the Super Bowl would have been better football if the rules had given Philadelphia this option.

 •  0 comments  •  flag
Share on Twitter
Published on February 18, 2023 15:39

January 22, 2023

Bounce

I was vacationing with the kids in San Francisco and it turned out for transit reasons to improve our day a lot to be able to store our suitcases somewhere in the city for the whole day. There is, as they say, an app for that, called Bounce. It’s a pretty clever idea! You pay $7.50 a bag and Bounce connects you with a location that’s willing to store luggage for you — in our case, a hotel (a budget option which is apparently famous for having the toilet just being out there openly in the room, to save space) but they use UPS locations and other stores too. A luggage locker at the train station would be cheaper, but of course that would mean you have to go to the train station, which might be out of your way.

Now the question is this — could I have saved some money and just shown up at a random hotel, handed the bellhop a twenty, and asked him to keep four bags in the back room for the day? Seems kind of reasonable. On the other hand, I can imagine hotels being under insurance instructions not to store bags for unknown non-guests. But why wouldn’t the same insurance caution keep them from signing up with Bounce? Maybe Bounce has taken on the liability somehow.

Anyway, this is not a service I anticipate needing often, but in a moment when it was exactly what I needed, it did exactly what I wanted, so I recommend it.

PS: My kids are now extremely into San Francisco.

1 like ·   •  0 comments  •  flag
Share on Twitter
Published on January 22, 2023 11:32

December 8, 2022

Little did I know (real analysis edition)

I just finished teaching Math 521, undergraduate real analysis. I first took on this course as an emergency pandemic replacement, and boy did I not know how much I would like teaching it! You get a variety of students — our second and third year math majors, econ majors aiming for top Ph.D. programs, financial math people, CS people — students learning analysis for all kinds of reasons.

A fun thing about teaching outside my research area is encountering weird little facts I don’t know at all — facts which, were they of equal importance and obscurity and size and about algebra, I imagine I would just know. For instance, I was talking about the strategy of the Riemann integral, before launching into the formal definition, as “you are trying to find a sequence of step functions which are getting closer and closer to f, because step functions are the ones you a priori know how to integrate.” But do Riemann-integrable functions actually have sequences of step functions converging to them uniformly? No! It turns out the class of functions which are uniform limits of step functions is called the regulated functions and an equivalent characterization of regulated functions is that the right and left limits f(x+) and f(x-) exist for any x.

2 likes ·   •  0 comments  •  flag
Share on Twitter
Published on December 08, 2022 19:50

October 31, 2022

Compactness as groupwork

Compactness is one of the hardest things in the undergrad curriculum to teach, I find. It’s very hard for students to grasp that the issue is not “is there a finite collection of open sets that covers K” but rather “for every collection of open sets that covers K, some finite subcollection covers K.” This year I came up with a new metaphor. I asked the students to think about how, when a professor assigns a group project, there’s always a very small subgroup of the students who does all the work. That’s sort of how compactness works! Yes, the professor assigned infinitely many open sets to the project, but actually most of them are not really contributing. And it doesn’t matter if some small set of students could do the project; what matters is that some small group among the students assigned to the project is going to end up doing it! And this seems to happen — my students nodded in agreement — no matter how the professor forms the group.

 •  0 comments  •  flag
Share on Twitter
Published on October 31, 2022 09:33

October 27, 2022

The Greatest Astro/Phillie

The time is here. The lesser contenders have been dispatched (it seemed like it was gonna be the Mets’ year, didn’t it?) and we have our World Series matchup; the seemingly unstoppable Astros, who just keep pennanting and pennanting and are so far without a loss this postseason, and the scrappy Phillies, third in the NL East this year but hot at the right time.

And that brings us to our annual question: who was the greatest ever Astro/Phillie? Our methodology, as usual — pull up the top 200 career WARs for each team on Stathead (the best subscription on the Internet, if you like this kind of thing) and find the player who maximizes (WAR with Astros) times (WAR with Phillies.)

This year it’s not even close: Roy Oswalt, the Astros’ career leader in WAR from a pitcher. I’d forgotten that after most of a career in Houston, he went to Philadelphia halfway through 2010 and was terrific, helping the Phils get to the NLCS. He pitched just a year and a half in Philadelphia but that, combined with his record in Houston, is enough to give him the title by a long ways.

But if you really dislike the imbalance here, you can instead rank players by min(WAR with Astros, WAR with Phillies) and get a different greatest Astro/Phillie: Turk Farrell, who started and ended his career a Phillie with six years of Houston in between, usually good, never great. He was an all-star once as a Phillie and four times as an Astro, though two of those times were in 1962. Why were there two All-Star Games in 1962? No idea. Mysteries of baseball.

 •  0 comments  •  flag
Share on Twitter
Published on October 27, 2022 17:18

Jordan Ellenberg's Blog

Jordan Ellenberg
Jordan Ellenberg isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Jordan Ellenberg's blog with rss.