Writing Style Guide

-4 b1shop 11 February 2015 07:14PM

Write like a freight train.

Try to remove “that,” “had” or any of its derivatives. “You’ll find that you can often live without them.” vs. “You’ll find you can often live without them.”

Actually, remove every word you can. You can live without them.

When possible, place adjectives and adverbs before the words they modify. Be on a continuing mission to boldly split infinitives which have never been split before.

A colorful word is better than a colored word. When possible, replace adjectives with meaningful nouns and adverbs with meaningful verbs. “It a big mess.” vs. “It’s a debacle.” “Fournette ran hard through the line.” vs. “Fournette muscled through the line.”

Deliberately use adverbs. Long, descriptive, meaningful chains of modifiers can subtly and delightfully overwhelm the reader’s working memory. If you want your readers to process with abundant attention, dutifully remove adverbs. If you want your readers to be gleefully hypnotized, happily unpack your favorite adjectives and adverbs.

continue reading »

The Virtue of Compartmentalization

4 b1shop 15 February 2013 08:53AM

Cross posted from my blog, Selfish Meme.


I’d like to humbly propose a new virtue to add to Eliezer’s virtues of rationality — the virtue of Compartmentalization. Like the Aristoteian virtues, the virtue of Compartmentalization is a golden mean. Learning the appropriate amount of Compartmentalization, like learning the appropriate amount of bravery, is a life-long challenge.

Learning how to program is both learning the words to which computers listen and training yourself to think about complex problems. Learning to comfortably move between levels of abstraction is an important part of the second challenge.

Large programs are composed of multiple modules. Each module is composed of lines of code. Each line of code is composed of functions manipulating objects. Each function is yet a deeper set of instructions.

For a programmer to truly focus on one element of a program, he or she has to operate at the right level of abstraction and temporarily forget the elements above, below or alongside the current problem.

Programming is not the only discipline that requires this focus. Economists and mathematicians rely on tools such as regressions and Bayes’ rule without continually recanting the math that makes them truths. Engineers do not consider wave-particle duality when predicting Newtonian-type problems. When a mechanic is fixing a radiator, the only relevant fact about spark plugs is that they produce heat.

If curiosity killed the cat, it’s only because it distracted her from more urgent matters.

As I became a better programmer I didn’t notice my Compartmentalization-skills improving – I was too lost in the problem at hand, but I noticed the skill when I noticed its absence in other people. Take, for example, the confused philosophical debate about free will. A typical spiel from an actual philosopher can be found in the movie Waking Life.

Discussions about free will often veer into unproductive digressions about physical facts at the wrong level of abstraction. Perhaps, at its deepest level, reality is a collection of billiard balls. Perhaps reality is, deep down, a pantheon of gods rolling dice. Maybe all matter is composed of cellists balancing on vibrating tightropes. Maybe we’re living in a simulated matrix of 1’s and 0s, or maybe it really is just turtles all the way down.

These are interesting questions that should be pursued by all blessed with sufficient curiosity, but these are questions at a level of abstraction absolutely irrelevant to the questions at hand.

A philosopher with a programmer’s discipline thinking about “free will” will not start by debating the above questions. Instead, he will notice that “free will” is itself a philosophical abstraction that can be broken down into several, oft-convoluted components. Debating the concept as a whole is too high of an abstraction. When one says “do I have free will?” one could actually be asking:

  1. Are the actions of humans predictable?
  2. Are humans perfectly predictable with complete knowledge and infinite computational time?
  3. Will we ever have complete knowledge and infinite computational time necessary to perfectly predict a human?
  4. Can you reliably manipulate humans with advertising/priming?
  5. Are humans capable of thinking about and changing their habits through conscious thought?
  6. Do humans have a non-physical soul that directs our actions and is above physical influences?

I’m sure there are other questions lurking beneath in the conceptual quagmire of “free will,” but that’s a good start These six are not only significantly narrower in scope than “Do humans have free will?” but also are also answerable and actionable. Off the cuff:

  1. Of course.
  2. Probably.
  3. Probably not.
  4. Less than marketers/psychologists would want you to believe but more than the rest of us would like to admit.
  5. More so than most animals, but less so than we might desire.
  6. Brain damage and mind-altering drugs would suggest our “spirits” are not above physical influences.

So, in sum, what would a programmer have to say about the question of free will? Nothing. The problem must be broken into manageable pieces, and each element must be examined in turn. The original question is not clear enough for a single answer. Furthermore, he will ignore all claims about the fundamental nature of the universe. You don’t go digging around machine code when you’re making a spreadsheet.

If you want your brain to think about problems larger, older and deeper than your brain, then you should be capable of zooming in and out of the problem – sometimes poring over the minutest details and sometimes blurring your vision to see the larger picture. Sometimes you need to alternate between multiple maps of varying detail for the same territory. Far from being a vice, this is the virtue of Compartmentalization.

Your homework assignment: Does the expression “love is just a chemical” change anything about Valentine’s Day?

Gambler's Reward: Optimal Betting Size

6 b1shop 17 January 2012 08:32PM

I've been trying my hand at card counting lately, and I've been doing some thinking about how a perfect gambler would act at the table. I'm not sure how to derive the optimal bet size.

Overall, the expected value of blackjack is small and negative. However, there is high variance in the expected value. By varying his bet size and sitting out rounds, the player can wager more money when expected value is higher and less money when expected value is lower. Overall, this can result in an edge.

However, I'm not sure what the optimal bet size is. Going all-in with a 60 percent chance of winning is EV+, but the 40 percent chance of loss would not only destroy your bankroll, it would also prevent you from participating in future EV+ situations. Ideally, one would want to not only increase EV, but also decrease variance.

Objective: Given a distribution of expected values, develop a function that transforms the current expected value into the percentage of the bankroll that should be placed at risk.

I'm not sure how to begin. Even if I had worked out the distribution of expected values. Are other inputs required (i.e. utility of marginal dollar won, desired risk of ruin)? Should the approach perhaps be to maximize expected value after one playing session? Why not a month of playing sessions, or a billion? Is there any chance the optimal betting size would produce behavior similar to the behavior predicted by prospect theory?

I eagerly await an informative discussion. If you have something against gambling, just pretend we're talking about how much of your wealth you plan on investing in an oil well with positive expected value.

(Possibly Bayesian) Statistics Question

3 b1shop 01 June 2011 03:00AM

 

This question exists in the awkward space between "things undergrads google for homework" and "things on the cutting edge," so google isn't being super helpful.

I have a number I want a computer to estimate. Right now I have two regression models and an insider methodology. The former can be used to create two normal curves. The latter creates a point estimate only, but I can back into a confidence interval/normal curve with an acceptable amount of arbitrary hand-waving. If necessary, this could be conceived of as a prior.

How can I automatically weight the three curves into a single point estimate? I vaguely remember something from an econometrics class about weighting forecasts in a way that minimized total standard error, but I tried to work the math out myself and I didn’t know how to deal with the covariances of the forecasts. Can I simply assume the forecast covariances are zero?

This seems like a good place to use Bayes’ law, but I don't know how to formally set it up.

 

Edit to Add: Bayesian statistics is still new to me, so forgive me for being a bit dense. Here's my understanding of the methodology right now.

What exactly is D in this scenario?

 

Consulting Opportunity for Budding Econometricians

12 b1shop 11 March 2011 08:49PM

As a part of my job, I recently created an econometric model. My boss wants someone to look over the math before its submitted internally throughout the company. We have a modest amount of money set aside for someone to audit the process.

The model is an ARMA(2,1) with seasonality, trend, and a dummy variable. There's no heteroscedasticity or serial correlation, but the Ramsey Reset test suggests a more different model might work better.

I currently have the data in an eviews file, so you'd need to do zero data entry.

There's a small chance this will be used in court, but none of the liability will be transferred to you. There should be an emphasis placed on parsimony. You'd have to sign a confidentiality agreement.

If you're qualified to review this/suggest a marginally better model, then this would be an easy way for you to make bank in a couple hours time. If it goes well, there might be more work like this in the future.

Let me know if you're interested.

[Draft] Holy Bayesian Multiverse, Batman!

0 b1shop 03 February 2011 01:47AM

I couldn't find the math for the quantum suicide and immortality thought experiment, so I'm placing it here for posterity. If one actually ran the experiment, Bayes' theorem would tell us how to update our belief in the multi-world interpretation (MWI) of quantum mechanics. I conclude by arguing that we don't need to run the experiment.

Prereqs: Understand the purpose of Bayes Theorem, possess at least rudimentary knowledge of the competing quantum worldviews, and have a nostalgic appreciation for Adam West.

The Fiendish Setup:

Suppose that, after catching Batman snooping in the shadows of his evil lair, Joker ties the caped crusader into a quantum, negative binomial death machine that, every ten seconds, measures the spin value of a fresh proton. Fifty percent of the time, the result will trigger a Bat-killing Rube Goldberg machine. The other 50 percent of the time, the quantum death machine will play a suspenseful stock sound effect and search for a new proton.

continue reading »

The Meaning of Life

13 b1shop 17 September 2010 07:29PM

Fifteen thousand years ago, our ancestors bred dogs to serve man. In merely 150 centuries, we shaped collies to herd our sheep and pekingese to sit in our emperor's sleeves. Wild wolves can't understand us, but we teach their domesticated counterparts tricks for fun. And, most importantly of all, dogs get emotional pleasure out of serving their master. When my family's terrier runs to the kennel, she does so with blissful, self-reinforcing obedience.

When I hear amateur philosophers ponder the meaning of life, I worry humans suffer from the same embarrassing shortcoming.

It's not enough to find a meaningful cause. These monkeys want to look in the stars and see their lives' purpose described in explicit detail. They expect to comb through ancient writings and suddenly discover an edict reading "the meaning of life is to collect as many paperclips as possible" and then happily go about their lives as imperfect, yet fulfilled paperclip maximizers.

I'd expect us to shout "life is without mandated meaning!" with lungs full of joy. There are no rules we have to follow, only the consequences we choose for us and our fellow humans. Huzzah!

But most humans want nothing more than to surrender to a powerful force. See Augustine's conception of freedom, the definition of the word Islam, or Popper's "The Open Society and Its Enemies." When they can't find one overwhelming enough, they furrow their brow and declare with frustration that life has no meaning.

This is part denunciation and part confession. At times, I've felt the same way. I worry man is a domesticated species.

continue reading »