Sunday, December 8, 2013

An Engineer's Lament

Dear Sir, I think you may need new glasses.
    You seem confused. You used pound masses.
Even those who measure power as horses
    know that the pound is the unit for forces.
Gravity we need on some occasions,
    but it shouldn't be in all equations.
Despite what is claimed by ignorant lugs,
    it's customary to measure a mass in slugs.
I know I can't think of anything worse,
    except, perhaps, the kilogram-force.
Oh, how I hate those loathesome jackasses,
    who always express in pound-fucking-masses.

Sunday, April 7, 2013

What if North Korea isn't blowing smoke?

During a recent discussion about North Korea, it occurred to me to assess the risk that Kim Jung Un isn't just blowing smoke. How much damage could his forces do? I decided to keep things simple and a make a conservative estimate of the death toll of a North Korean nuclear strike against Seoul.

I used the population density of 16,700 people per square km from here. A conservative estimate of the most recent North Korean nuclear test suggests a 6 kiloton detonation. NUKEMAP suggests that fatalities will be equal to the population within the 4.6 psi* airblast radius and also calculates that radius. That gives us roughly ninety thousand deaths.

* Yes, I know, units. Call it 32 kPa

It's easy to see how a pre-emptive attack against North Korea can be justified. They've got the ability to kill at least ninety thousand people in a single strike. And they're threatening as much. Is there an international equivalent to assault?

And all of this ignores the casualties that would follow and uses the conservative guesses to the power of the weapons North Korea has tested. The higher estimates look more like 40 kilotons, and the corresponding deathtoll is 327 thousand people. It's quite possible that a North Korean nuke strike to wipe out the population equivalent of more than a half a US state.

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.

Wednesday, January 2, 2013

Book Review: *Strata* by Terry Pratchett

Book: Strata

Author: Terry Pratchett

Goodreads rating: 3

Strata is interesting for a few reasons: 1) the proto-Discworld and prototypical Pratchett(ian?) themes and humor 2) the moral that systems and worldviews can be taken one level deeper, as the protagonist discovers at the climax of the book. It's a deep philosophical point that's fairly well hidden in a story that otherwise feels like an overlong Discworld prototype, not quite as engaging or well written that series and more direct in it's criticisms of religion and human behavior. I think it would've been better as a shorter work.

Still, even a rough version of the quirky yet identifiable characters Pratchett does so well makes for decent reading, and as a big Discworld fan, I found them to be both familiar and alien in an interesting way. Definitely worthwhile reading if otherwise exhausted Pratchett, it's still a decent book even if you're not familiar with his work, though I'd recommend one of the top Discworld books before this one both from a quality standpoint and from an, er, intertextual standpoint.

7 Books On Being More Than Human

7 books on being more than human, a reply to Zach's "5 Sci Fi Books to Read in 2013" and at his suggestion. I picked a few books that I hadn't previously recommended, distilled a theme and then added a few more. And found that I had 7 books. As Vernor Vinge cannot be denied when it comes to the technological Singularity as a plot element, I've broken my previous rule about only including each author once

Novella and short story collection. The best pieces in the collection are the title novella -- which is more existential horror -- and "All You Zombies", the ultimate time travel story.

Stross attempts the impossible and writes a story across the Singularity. It starts in the near future at a personal level with a strong hard scifi feel and gets somewhat wackier but still plausible as the story progresses and expands across the Singularity.

First book in the Illium/Olympos series. As Wikipedia notes, it 'is a form of "literary science fiction" which relies heavily on intertextuality' where allusions abound and give depth and texture to the story and world. Even without understanding many of the references, I found it to be a great story -- posthumans living as Greek gods re-enacting the Iliad, decadent humans in a quasiparadise on earth, cybernetic intelligences comptemplating Shakespeare and a wily Odysseus on odyssey tying the threads together. I really need to reread this.

Near future world in the grip of the Singularity with AIs, universal augmented reality and a hint of dystopia thrown in. Vinge is the Singularity guy. Check out Marooned in Realtime by Vinge for a different, post Singularity take set in his The Peace War universe.

A murder mystery in a world of powerful and potentially manipulating mind-readers and a perfectly rational computerized justice system.

A different take on telepathy... what constitutes an individual when people can share thoughts?

To me, the epitome of Vinge's work. A godlike, malovent AI has been dug up by humans in the outer reaches of the galaxy, where the speed of light can be exceeded. It can only be defeated by ensconing it the "Slow Zone", where physics behaves as we know it. Most of the action takes place on a medival world inhabited by Tines, pack-intelligences the recall the gestalt from More Than Human.