Karl Pichotta

"A Home-page, which is on Internet."


Most recent entries from the "bloggue":


My favorite albums of 2011

I know you have been clawing at your computer screen, crying out "Why won't Karl talk at me about music" for the last 12 months.

Well look, you can cease your agonized cries now.

(Note that 2011 inexplicably had like half the number of really good albums 2010 had, so if I were to combine this with my 2010 list, most of these would appear pretty far down the list).

Anyways, my top 10:

  • 10: Moonface - Organ Music Not Vibraphone Like I'd Hoped

  • 9: Tim Hecker - Ravedeath 1972

  • 8: Cut Copy - Zonoscope

  • 7: The Mountain Goats - All Eternals Deck

  • 6: Cults - Cults

  • 5: The Weeknd - House of Balloons

  • 4: Kurt Vile - Smoke Ring for My Halo

  • 3: EMA - Past Life Martyred Saints

  • 2: Bill Callahan - Apocalypse

  • 1: Wye Oak - Civilian

December 18th, 2011

Notes from the Post-Singularity

I started to rearrange the furniture, but Overbrain wouldn't let me, said such degrading work was "ill befitting a human", I think maybe like how shitting on the lawn ill befits a dog.

The other day I tried to read a physics book but Overbrain insisted I not strain myself, so I went and stared at a picture of myself in a hat for three hours. I guess I already know all the Science, but I sometimes feel like my time could be better spent? Being everything really makes me feel like nothing.

Oh man that's good, I wish the concept of authorship were coherent, I would copyright the hell out of that.

Being part of a near-omniscient manmachine supernetwork is supposed to get me all sorts of sweet prognostic visions—retinaless Cybersibyls whispering immutable truths to me in Akkadian, dark superrealities made manifest within the divine technospark inside my skull, and so on. I'm really good at spotting trends in commodity prices I guess, but this stuff just isn't as sexy as I'd hoped.

Also I'm not sure how to tell if the collective overmind is bullshitting me because I guess I am the collective overmind? Like, Overbrain keeps mentioning how easy it was to fix global warming, but whenever I ask about it I just get told it's "complicated." Call me old fashioned but I feel like the manmachine godnet of which I am a component should be maximally forthright with me. It just seems a bit silly to hide things from me.

Haven't been feeling great. I figured maybe if I disabled my prefrontal cortex for a few hours I'd finally get some honest-to-god rest, but I understand I just crawled under a table and licked the carpet. I'd imagine I was pretty happy though, maybe I'll do it again.

I uploaded my consciousness onto seven vacuum cleaners and threw them into the river yesterday. I'm confused about everything, all the time.

I guess I'll go sit under a tree and make tiny piles of pebbles until I'm sleepy.

October 11th, 2011

What the hell is a harmonic mean? OR: A few thoughts on traffic intersections

"In which Karl works through math he should have understood a decade ago"

Traffic



Something I was thinking about as I biked about my current home of North Austin, where they have been adding traffic lights to accommodate the increasing population...

Suppose you are trying to time a stoplight. That is, you are tasked with setting the durations, order, and whatnot of the various stages of the light cycle. What quantity exactly do you try to maximize?

So actual traffic intersection design is a tricky balancing act--you want to get lots of cars through, but you're not going to want to make it unsafe in doing so. You'll also want some notion of "fairness"--it's a Bad Thing to keep a car stopped at a red light for 20 minutes, even if by so doing you maximize the number of cars getting through the intersection per minute.

Let's simplify, however, and just think about maximizing one variable. What do we choose? Well, the first thing I thought of was throughput--the number of cars getting through the intersection per minute. A well-designed intersection will try to maximize this.

Suppose, however, we don't have a way of measuring this directly, but we do have the cars' average speed from the time they enter the vicinity of the intersection to the time they leave it. What then? (You may ask yourself what "average" speed here means--that's actually exactly what we're going to answer.)

The first thing I thought in my Texas-summer-induced haze was that we would just maximize the arithmetic mean of the cars' speeds. The arithmetic mean will give us the "average", right? Well...

What is the Harmonic Mean?



I didn't hear the phrase "harmonic mean" until about my junior year in college, and I didn't really figure out what it was until somewhat recently. Basically, the harmonic mean is the best way to average rates of things--if you have a bunch of quantities which all take the form "unit1's per unit2" (miles per hour, price per earnings, etc.), then the harmonic mean is likely the average you want.

If you have n numbers x_1,\ldots, x_n, then the harmonic mean H of them is given by

H(x_1,\ldots,x_n) = \frac{n}{\frac{1}{x_1} + \ldots + \frac{1}{x_n}}.


Say we fix a distance d and have two cars drive distance d. The first goes speed r and the second goes speed s. What do we want out of an "average speed"? Well, we want a speed a such that if a single car were to go distance 2d at speed a, it would take the same amount of time as if the car were to travel the first distance d at speed r, and then travel the second distance d at speed s. This is exactly what the harmonic mean gives us! (A short proof of this fact appears at the end of this note; if it's not obvious to you--it wasn't to me--give it a look, or, better, try to prove it yourself--it's not complicated.)

So...



So I realized I want the harmonic mean instead of the arithmetic mean! Neat! Done! We'll time the stop light in such a way that we maximize the harmonic mean of the speeds of the cars within some vicinity of the intersection. That'll be $200,000 please, City of Austin.

That was an unsatisfying explanation.



I agree! So I sat down and tried to think of a more convincing argument that maybe a well-designed intersection should maximize the harmonic mean of the speeds of the cars traveling through it.

A wholly and totally reasonable quantity to want to minimize is the sum time all the cars spend in an intersection. That is, suppose we have n cars, and each car i spends time t_i in the vicinity of the intersection. Then we will want to minimize the function

\sum_{i=1}^n t_i.


A bit more accurately, suppose we have a stoplight setup \ell. The time it takes car i to get through the intersection is a function of \ell. So really what we want to minimize is

\sum_{i} t_i(\ell).


Great. Let's further suppose the distance traveled by these cars is d (that is, the length of the "vicinity" to which we're referring is d). Further, each car i goes an average speed v_i(\ell), which is a function of the stoplight setup: different intersection setups will yield different average speeds for cars. (Again, the "average speed" of a car here is going to mean what you probably think it means if you've gotten this far.)

So let's do a little bit of algebra! If you're not familiar with the notation, \arg\min_x f(x) gives you the value of x at which the function f is minimized. Similarly, \arg\max_x f(x) gives you the value of x at which f is maximized. The variable x with respect to which we are finding the argmin/argmax here is something like "all conceivable intersection setups".

\arg\min_x \sum_i t_i(x)


= \arg\min_x \sum_i \frac{d}{v_i(x)}


= \arg\min_x \sum_i \frac{1}{v_i(x)}


= \arg\max_x \frac{1} {\sum_i \frac{1} {v_i(x)}}


= \arg\max_x \frac{n} {\sum_i \frac{1} {v_i(x)}}


= \arg\max_x H(x).


(The first step holds because v=d/t; the second step holds because the numerator will stay the same regardless of what we choose for x; the third step holds because \arg\min_x f(x) = \arg\max 1 / f(x) for any f; the fourth holds for the same reason as the second.)

Neat! We have shown that constructing our intersection to minimize the total amount of time cars spend in it is the same thing as designing our intersection to maximize the harmonic mean of the speeds of the cars within its vicinity (and NOT the arithmetic mean).

This isn't a particularly interesting result, but it wasn't immediately obvious to me.

Anyways, moral of the story: if you are averaging rates, think very seriously about using the harmonic mean.

So is maximizing the harmonic mean of velocities really different from maximizing the arithmetic mean?



Yes! Suppose we are considering two stoplight setups \ell_1 and \ell_2, and suppose we are running a simulation with two cars. In \ell_1, the two cars have velocities 1 and 9. In \ell_2, the cars have velocities 4 and 4. Now,

H(\ell_1) = \frac{2}{ (1/1) + (1/9) } = 1.8


H(\ell_2) = \frac{2}{ (1/4) + (1/4) } = 4


So if we are picking stoplight setups based on harmonic mean of velocities, we'll pick \ell_2. However, if we're picking based on arithmetic means, we'll pick \ell_1 (which gives an arithmetic mean of 5, vs \ell_2's arithmetic mean of 4).

So the type of average we use matters!

(You can verify for yourself that \ell_2 minimizes the total time spent in the intersection.)

Post-scriptum: Promised proof of above statement



OK, so we are showing that if car 1 goes distance d at speed r and car 2 goes distance d at speed s, then the ideal average speed a is the harmonic mean of r and s. By "ideal average speed" I mean simply the following: suppose we have car 3, which goes distance 2d at speed a. Then it takes the same amount of time for car 3 to go 2d at speed a is it does to go d at speed r and then d at speed s. Denote by t_1 the time it takes car 1 to go distance d; denote by t_2 the time it takes car 2 to go distance d; denote by t_3 the time it takes car 3 to go distance 2d. Then what we want to show holds is that

t_1 + t_2  = t_3.


In fact, the average speed a that makes this true is the harmonic mean of r and s.
Assume a is the harmonic mean of r and s. Then:

t_1 + t_2 = \frac{d}{r} + \frac{d}{s}


= d \cdot \left( \frac{1}{r} + \frac{1}{s} \right)


= \frac{d} {\left( \frac{1}{r} + \frac{1}{s} \right)^{-1}}


= \frac{2d} {2\left( \frac{1}{r} + \frac{1}{s} \right)^{-1}}


= \frac{2d}{a}


= t_3.


This completes the proof.

July 14th, 2011

Songs During Which I am Constitutionally Incapable of Sitting Still

A short, incomplete list.

The Glitch Mob - We Swarm

Otis Redding - Try a little Tenderness

LCD Soundsystem - Dance Yrself Clean

Cut Copy - Corner of the Sky


Cut Copy – Corner Of The Sky found on Pop

The Antlers - Two

Bibio - Jealous of Roses

Memory Tapes - Bicycle

Junip - To the Grain

June 6th, 2011

Asking Questions about Noses

Why are your eyes, ears, and nose in your head?

I would imagine you'll come up with the same answer I did. Namely, putting related things near each other makes a lot of sense most of the time. We usually sit our PCs at the desk right alongside our monitors and keyboards so we don't need 100 feet of wires stretching between rooms, for example.

It makes sense for our eyes, ears, etc. to be in our head for the same reason that algorithmic traders want their servers as close as possible to the stock exchanges' servers: the closer our sense organs are to our brains, the faster the signal arrives there. Your olfactory epithelium has neurons in it, and your retinae were, when you were a little blob in a uterus, part of your developing brain. It doesn't make a lot of sense for these things to end up very far away from the brain.

Shaving milliseconds off of your response time to sensory input could mean the difference between life and death in the face of an attacking predator, or a barrel rolled by an ape, or a turtle shell thrown by Bowser. Putting your sense organs closer to the thing that processes them does just this.

(Note this observation provides simple evidence for the wholly uncontroversial assertion that the brain is the center of cognition (this assertion was, in fact, not wholly uncontroversial millennia ago).)

Anyways, I think this observation is worth writing down not because it's particularly interesting, but because I am a fairly scientifically literate individual (who took an entire college course on cognition) who didn't even think to ask this question for twenty five years of his life. Sure, once I ask the question, the answer is laughably obvious, but I hadn't even thought to ask until today!

This is completely terrifying to me. What other stupid simple observations about the world am I oblivious to because I just haven't thought to inquire about them?

March 20th, 2011

Some things I do

Some things I've done

Some places I do things

Some things I like


"Visit again, sometime, on Internet!"

Email me at