The Dickey Amendment

:: Guns

My name is John Clements. I’m a computer scientist and programmer, and quite frankly, it’s hard for me to remain civil in discussion of the Dickey amendment, one of the most pernicious pieces of legislative ledgermain it is my deep displeasure to be familiar with.

Since the Dickey amendment of 1996, the Centers for Disease Control—responsible for safeguarding the health of the American public—has been unable to perform research on the effects or causes of gun violence.

My government—the finest on earth—makes many decisions that I disagree with. Money is spent daily in ways that I am not in support of. However, when we institute a blanket ban on funding for research into particular topics, it sends a much stronger message; not only do we not want to spend money on this or that; we’re actually afraid to discover the truth. Senator Dickey himself—the author of the amendment—has since come out against the it1.

This tactic is one of a number of what I think of as “force multiplier” or “upstream” approaches to controlling society, and I think they’re all appalling. These tactics seek to change the rules of the game, to prevent our political system from working correctly. Gerrymandering is one such tactic. Allowing unlimited corporate donations—that is, the lack of campaign finance laws—are another. Rules such as this are similar; rather than trying to persuade the public that your point is correct, you simply prevent the truth from being discovered in the first place.

In my mind, this kind of ban seeks to prevent the free flow of information, tacks perilously close to freedom of the press, and can only come from a group that is frightened that the public might discover the truth.

It’s time for us to discover the truth.

123 appears to help 357 completion

:: First-Year Data, Department Data

Some good news, here.

On my way home from SIGCSE, I drew some more pictures.

This shows how each year of incoming students handles 357. Specifically, the x axis shows quarters since the students’ first one, and the y axis shows what fraction of the students have passed 357. Each line shows a different cohort.

Some of the lines are longer than others. This is because some cohorts that take a really long time to pass 357, and also because some cohorts haven’t yet had more than 6 or 9 or 12 quarters since entry.

There’s some sobering news here—since 2005, we’ve never managed to heave more than 75% of the students over the 357 bar.

However, looking more closely, we see that more recent cohorts—specifically, those since 2010 (a.k.a. “when we started 123”) look a lot better.

incoming students updated

:: First-Year Data, Department Data

As part of our work on our recent SIGCSE paper (citation forthcoming), I took another look at our numbers of incoming students. The results surprised me. This table combines CSC, CPE, and SE students, and associates them with the quarter in which they first took a lower-level CS class.

The surprising thing about this—to me, anyway—is that our enrollments have actually been dropping over the past few years. I’m surprised.

the many uses of the AR–15 yet again

:: Guns

Do we need to go through this again? Another entry on the list. Sarcasm aside, this gun really has no plausible purpose aside from killing people. Can we please have an assault weapons ban?

  • July 20, 2012 - Aurora, CO – 12 people dead - Smith & Wesson AR–151
  • December 14, 2012 - Sandy Hook elementary school, Newtown, CT – 20 people dead - Bushmaster AR–152
  • December 2, 2015 - San Bernardino, CA – 14 people dead - Smith & Wesson AR–153
  • June 12, 2016 - Orlando, FL – 49 people dead - Sig Sauer AR–154
  • October 2, 2017 - Las Vegas, NV – 57 people dead - “AR–15-style” assault rifle5
  • February 14, 2018 - Parkland, FL – 17 people dead - “AR–15 semi-automatic assault rifle”6

on the robust difficulty of rubik’s cubes

:: speedsolving, rubik's cube

I’ve been amused (not in an evil genius way) by the once-and-future popularity of the Rubik’s cube. Had one as a kid, memorized its method, got a couple of sub–2-minute times, put it down.

Fast forward 35 years; now my son is mildly amused by the Rubik’s cube (amused enough to let his old man persuade him to make a Rubik’s Cube Halloween costume, anyway), and I decide to learn a new method (currently Roux, but who knows if it’ll last).

Along the way, though, I start wondering: how do they make sure that “scrambled” cubes at speedsolving competitions are about equally hard to solve? What if Joe Plotnik just happens to get one that’s easy?

It turns out… that’s very unlikely, due to a kind of a cool property that Rubik’s cubes have. Specifically, given a random (reachable) position of the cube, there’s about a 94% likelihood that it requires either 18 or 19 moves to solve.

These numbers come from Cube20, a team that used lots of compute power back in 2010 to determine the distribution of “moves required.” One thing they didn’t do (erm, on their front page, anyway) was to show the CDF of these numbers. Here it is:

The cool thing about this is the incredibly narrow band of likelihood; if you simply generate a position at random from the set of all possible positions, there’s a rounds-to-zero-percent chance of it requiring 15 moves or less, 3% of getting 16 moves or less, and a rounds-to–100% chance of it requiring 19 moves or less. There’s more than a 93% chance that it will require either 18 or 19 moves.

So… cubing competitions are almost certainly fair. Neat!

Cal Poly Quarter Numbering

:: Cal Poly, Department Data

People often ask me what the heck is going on with Cal Poly’s nutty quarter numbering system. I’m going to try to summarize it.

Before I begin, I think I’m probably suffering from Stockholm syndrome, here; I’m kind of fond of it, even though it’s non-intuitive.

Actual History

Based on a very brief conversation with Debbie Dudley, it appears that the current system was designed in 2006, during the migration to PeopleSoft. At that time, Cal Poly had to devise a system for numbering quarters both in the future and in the past (that is, the new system also had to represent existing records of past students).

The rest of this is still largely hypothetical; please feel free to write and correct me about anything I’ve gotten wrong; I think that trying to understand how the system arose helps me (and you?) to understand its quirks a bit better.

(Semi) Hypothetical History

Problem: we need a way to represent a particular quarter (e.g.: Fall 2006) as a number. It would be really convenient to be able to sort in a sane way, etc. etc.

Solution: well, let’s use integers, not floats (for what are hopefully obvious reasons). Let’s use the year, then a digit for the quarter. What digits should we use for the quarters? Well, we should probably stay away from zero, because it’s not clear what year a zero would belong to. Okay, let’s use 2, 4, 6, and 8 for the four quarters. This spaces out the four quarters, and allows for the insertion of additional terms, should it become necessary.

So, how should we write Fall 2006? We could write “20068”. But… let’s try to cut that down to four digits.

(Knowing what I now know, I can’t see why you would want to do this unless PeopleSoft has some kind of internal restriction or performance penalty regarding numbers with more digits. Let’s assume this is the case.)

Well, maybe we can encode the century as a single digit. Let’s use “2” for the century from 2000 — 2099. So Fall 2006 becomes 2068.

Great! So how do we represent Spring 1997?

If we’re using century codes, then the one before “2” should be “1”. So in this case, Winter 1997 would be written as 1972.

Apparently, though, we decided that this was confusing, and that we should instead use a “0” for the 1900s, so that Winter 1997 is instead written as 0972.

This scheme is not awful, but it does have some problems if you try to subtract numbers or increment or decrement quarter numbers, because going from a fall quarter to the next winter quarter requires adding four… unless the year is 1999, in which case you have to add 1004. Oh well.

Okay, so let’s summarize. How the heck do we actually read one of these numbers?

Examples of quarter numbers:

  • 2174 : 2000 + 17 = 2017, 4 = Spring. Spring 2017.

  • 2102 : 2000 + 10 = 2010, 2 = Winter. Winter 2010.

  • 976 : 1900 + 97 = 1997, 6 = Summer. Summer 1997.

Parsing a Cal Poly (San Luis Obispo) quarter number:

Actually, I’m going to be precise, and just give you some code.

Yes, in Racket.

#lang typed/racket

;; given a quarter, return its season: "Fall", "Winter", etc.
(define (qtr->season [qtr : Natural]) : Season
  (match (modulo qtr 10)
    [2 "Winter"]
    [4 "Spring"]
    [6 "Summer"]
    [8 "Fall"]))

;; return the year in which a quarter number falls
(define (qtr->year [qtr : Natural]) : Natural
  (define century-code (floor (/ qtr 1000)))
  (define year-code (modulo (floor (/ qtr 10)) 100))
  (define century-offset
    (match century-code
      [0 1900]
      [2 2000]
      [_ (raise-argument-error 'qtr-year
                               "qtr with century code of 0 or 2"
                               0 qtr)]))
  (+ century-offset year-code))

more students in smaller classes

:: Department Data

Good news, folks! We’re continuing to deliver reasonably sized classes for our students. Specifically, more than 90% of our SCUs are currently delivered in classes of size less than 40. The last time we managed that was back in winter of 2011. On the other hand, if you think that class sizes should be below 30, we’re not doing so well.

Here’s the college as a whole (we’re better):

knowing what’s out there

:: Programming, Teaching

I’m teaching a class to first-year college students. I just had a quick catch-up session with some of the students that had no prior programming experience, and one of them asked a fantastic question: “How do you know what library functions are available?”

In a classroom setting, teachers can work to prevent this kind of question by ensuring that students have seen all of the functions that they will need, or at least that they’ve seen enough library functions to complete the assignment.

But what about when they’re trying to be creative, and do something that might or might not be possible?

Let’s take a concrete example: a student in a music programming question wants to reverse a sound. How can this be done?