Sunday, March 24, 2013

Seeding tournament brackets with a d20

I realized at the last moment that I hadn't seeded my NCAA Men's Basketball tournament brackets. Usually I like to have some data driven analysis to back up my sports predictions, but

  1. I didn't have time.
  2. This is March Madness

So I figured I'd make my choices randomly. I still wanted my choices have some shot at being right, so I decided to use the d20 I had in my backpack to weight things in favor of the higher seeded teams. As there are 16 levels of seeding, simply dividing the the 11 through 20 rolls up based on seeding wouldn't work. (I only had have the faces to work with because at least 50 percent of the time, the favored team should win.) I went with rolling twice, both because this gave me enough discrete intervals to account for 16 seeding slots and, since summing the dice starts to approximate the normal distribution I'd account for the superlinear drop off in probability of upset as the difference in seeding increased. Using two d20 rolls (denoted 2d20), I even get a reasonable value for probability of a 16 seed upsettig a 1, 1 in 400. A 15 over a 2 is only 1 in 100, though, is a fair bit too low, I believe.

Still, it's a good start if you need to seed your bracket quickly.

I wrote up a quick Python script to create the table.

Here's the table. You roll twice for each game, and if the sum of the rolls is greater than or equal to the Upset Roll value for the given difference in seeding, you select the lower rank team as winner. Otherwise, advance the winner.

Seed Difference:          2d20 Upset Roll (this value or higher)
0:                        21
1:                        22
2:                        23
3:                        24
4:                        26
5:                        27
6:                        28
7:                        30
8:                        31
9:                        32
10:                       34
11:                       35
12:                       36
13:                       37
14:                       39
15:                       40

Here's the bracket I put together.

And here's the script:

"""Print out the table for building your NCAA Men's Basketball bracket via d20 rolls."""

number_of_seeds = 16
max_seed_difference = 16 - 1 #16 over 1 is a double crit
die_size = 40 #2d20 in this case. So the probability intervals are non linear

def upset_roll( seed_difference ):
    """Return the roll required for an upset"""
    interval = float(die_size-1)/float(max_seed_difference)/2.0
    half_die_size = die_size/2
    #Round down because I feel guilty for the nonlinear intervals
    return int( interval * seed_difference ) + half_die_size+1


print( "{}:          {}".format( "Seed Difference","Upset Roll (this value or higher)"))
for difference in range(0,16):
    print( "{}:                        {}".format(difference, upset_roll(difference) ) )

Tuesday, March 19, 2013

On Cody Wilson's Printable AR-15

A friend on Facebook asked for opinions on this video. It's a interview of Cody Wilson of Defense Distributed. I answered:

From an interview standpoint: Beck not being a bombastic asshole is always nice. He's a very considerate host here. Is he always like this on TheBlaze? Wilson has some very good points and their conversion is good.

From a societal standpoint: I think it's pretty clear that Wilson intends this to be a test to show how limited our government is and how society truly values the idea of freedom. He's trying to force the authoritarian mindsets' hand more than anything, to provoke a reaction. He (I think) believes (and I find it likely) that the authoritarians aren't so much a group of people but a mindset that (nearly) everyone has at least in part. This is a test of our principles, our willingness to really trust the individual with power.

What wins, the love of freedom and celebration of individual empowerment or the fear of others, avarice and the desire to control? This democratization of power isn't as inevitable or unstoppable as Beck suggests. If we're willing to give in to fear and sacrifice the very concept of liberty, which we've done in the past, if we're willing to hand the keys over to a fully authoritarian government, they can shut things down. He's worried about power creep, but he's not trying to subvert it, but shock society into choosing between unabashed authoritarism and a society that doesn't restrict individuals a priori.

From an engineering and strategic standpoint: this is a symbol. It doesn't truly democratize much, because the AR and most modern firearms are built around the assumption you have a way of producing propellants, primers and cartridges. Each of those is an additional control point (and bullets, too, but they're pretty easy).

If you want truly distributed armaments, you'll want to move to something else. Cartridgeless, I figure, probably smoothbore with sabots, as rifling is a serious pain in the ass, with liquid propellants, perhaps ethanol. And you'd use a different priming mechanism, like a piezoelectric ignitor.

You'd design a set of families of weapons along those principles: a pump with no springs (springs are hard), an autoloader with springs, an autoloader that's servo driven, etc. You'd perfect small arm smooth bore tech as well as the alternative propellants. Essentially, you're perfecting potato gun tech.

Somewhere, someone is doing this. And their probably doing it quietly for a reason, likely waiting to see the reaction to Wilson's AR-15.