I'm trying something a little different today: an experiment!
When you click the Ready button above, it'll generate 10 random numbers adding to something between 1 and 1000. You have 5 seconds to try to enter their sum. Unless you're the biologically unlikely lovechild of Leonhard Euler and Euclid himself, it'll probably be pretty difficult. To get an answer in 5 seconds you'll need to sacrifice a lot of accuracy. (You can also press enter in the input box instead of clicking ready)
Now try changing the dropdown from "sum" to "avg". Your goal is to guess the average in 5 seconds. You will probably find this substantially easier.
Then comes the fun part: observe that, for 10 numbers, the sum is 10 times the average. So change it back to sum and, instead of trying to guess the sum, guess the average and multiply it by 10.
I based this experiment on an observation in the first chapter of Thinking, Fast and Slow, that we could calculate the average length of a bunch of lines much more easily than their total length. Kahneman's theory is that this is because we think prototypically; ie, we have already formed a general impression of the lines that are on the page, and our notion of that average tends to be pretty accurate.
I started thinking about the relationship between sums and averages, and that particular problem when you look at, say, a list of file sizes that all seem relatively small, but their total size is deceptively large. Could we build a better intuition for adding up sets of large numbers quickly? This is where the multiply-average technique technique comes in.
Still, it's not clear whether Kahneman's shape averaging actually translates into symbolic reasoning. Do we get an intuitive sense of the size of numbers the same way we get a sense of the size of shapes? I'm not sure, but I definitely got faster and more accurate results when I used the average. I'd also be interested to test out how much you sacrifice with non-trivial multiples (20 is probably okay, but what about if there's 37 numbers?). The code and a stand-alone demo are available on Github if you'd like to mess around with it.
Being able to throw out quick experiments like this is, I think, one of the great benefits of knowing how to code. Not everyone needs to be able to build Facebook from scratch, but being able to take a little idea and make it into a real thing is enormously valuable.
The primary thing when you take a sword in your hands is your intention to cut the enemy, whatever the means. Whenever you parry, hit, spring, strike or touch the enemy's cutting sword, you must cut the enemy in the same movement. It is essential to attain this. If you think only of hitting, springing, striking or touching the enemy, you will not be able actually to cut him.
— Miyamoto Musashi
Today I had a few reasons to think about good and bad software design. Often, badly designed software is designed badly. That might seem tautological, but there's another, very common way that badly designed software happens: when it isn't designed at all. For these projects, there's no overall vision. Things just... happen, and after enough things have happened, you have your software. It mostly works, but it is missing that particular quality that well designed things seem to need: intention.
Intention is the quality of something that is done for a reason, and whose various decisions and actions are aligned toward that reason. It may sound obvious – why would you do things without a reason? – but it is surprisingly common that people do things for no reason at all. They'll often have a goal, and often they'll take actions or make decisions, but those actions aren't actually designed to achieve the goal. That link between goal and action is intention.
A lack of intention seems to be a particular hallmark of large, long-running software projects. Perhaps at the beginning individual people exercised intention over the software, but some of them leave, new people come in, and often the same code is changed by many different people with different goals. The invention of the product manager was to some degree a response to this problem; that person is tasked with maintaining the intention of the software at a product level. But many projects still don't have a product manager and, even so, who is maintaining intention at the level of the code itself?
That said, software doesn't have to be in a team to lack intention. One of the most amusing phenomena is Eliezer Yudkowsky's Guessing the Teacher's Password, where students just say correct-sounding words in the hope that they'll happen upon a correct answer. The most common expression of this in programming is Shotgun Debugging, where you have a bug and just make changes at random until it fixes itself. You wanted to fix the bug, and you did fix the bug, but your fix had no intention.
In a more general sense, it seems easy to inadvertantly act without intention. You pick some course of action and follow it because it seems good, never mind whether it actually brings you closer to your goal. I don't even mean that it doesn't, but rather that you never even thought to check. And while you can certainly still do things without intention, it's hard to imagine those things ever being more than mediocre.
There's a peculiar habit I've noticed when I'm transitioning between activities. Often the best way to get started on something is to just jump right in; I know that if I go check my email or read internet junk first I'll just get distracted, and the time between activities is critical because I haven't got into a rhythm yet. But the weird thing is, I seem to have accreted little rituals that I do before I start working on something. These include choosing music to listen to, making coffee, moving things around on my desk, and, yes, checking my email and reading junk on the internet.
These are distinct from just regular recreational activities for a couple of reasons. Firstly, you don't set out to do them recreationally. Instead, they're considered part of work time; they're a work-like activity that isn't actually work. Secondly, they're things that you do even when you're transitioning from fun to work, leading to the bizarre phenomenon where you sometimes finish reading junk on the internet, go to do some work, and then start reading junk on the internet again.
I think of these as interstitials, mainly inspired by the term in software meaning a (usually unwelcome) screen that you have to click through before the one you wanted to see. By analogy, these interstitials are activities that pop up just before you do the activity you actually set out to do. Sometimes they're fairly benign – a coffee isn't likely to disrupt you significantly – but complex interstitials can easily make everything you do harder. Even something relatively benign like choosing music can go off the rails if you can't find the right thing to listen to, or you get distracted because your amp won't turn on.
The antidote to interstitials is simple in theory: just immediately start doing something. I've found timetabling helps with that, but I'm sure other methods would work too. Often the preparatory rituals aren't necessary, and if they are you can go back to them once you've got a bit of a rhythm going.
I wrote a while back about the idea of the brain as an association machine. The main point I made then was that it makes disassociation very difficult, and it's hard for us to forget things or break existing habits. However, there's another aspect I've been meaning to write about, which is the way that association machines can (and can't) do logic.
Implication is a fairly foundational part of logic, and it's just statements of the form "if X is true, then Y is true", which you write X → Y. For example, you could write "all humans are mammals" as "human → mammal". However, it would be incorrect to assume that because all humans are mammals, then all mammals are humans. That is to say, X → Y doesn't mean Y → X. That's a different thing, sometimes called equivalence: rich people have lots of money, people with lots of money are rich, rich ↔ lots of money. This is also sometimes said to "imply both ways", and mixing up one-way and two-way implication is a very common error.
But why is it so common? It's not like we often confuse addition and subtraction, or up and down. And it's tough to imagine that an artificial intelligence, for example, would make the same mistake, even if it wasn't very clever. However, presented with a situation where every murderer plays videogames (murderer → gamer), there's no end of people lining up to say that gamer → murderer. As in that example, it has the distinction of being a very harmful and common mistake. So for us to keep making it there must be a fairly compelling reason.
My proposition is that the association machine doesn't do one-way implication. By its very nature, an association is two-way; if you hear about gamers and murderers together a lot, you don't intuitively tease out the causation there, you just think about one whenever you hear about the other. The main theory for why conditioning works is exactly this. If every time you get fed a bell is rung, you have food → bell, but for some reason that turns into food ↔ bell and you end up slobbering whenever a bell rings. Two-way implication is natural to our associative machinery.
This can sometimes have disastrous effects on your understanding of success. For example, if being a famous musician → going to parties and dressing like a rock star, that's a very different thing than being a famous musician ↔ going to parties and dressing like a rock star. If you mistakenly think the latter, you're going to spend a lot of time working on your dancing and wardrobe skills, and very little time working on music. Quite often the trappings of success can feel like real success, but easier.
Another popular one is acting as if something is true. Let's say you have to finish an assignment and then you won't have to think about it anymore. Finished assignment → not thinking about assignment, except... uh oh... finished assignment ↔ not thinking about assignment. Now if you ignore the assignment, it feels like you're done with it. Amusingly, things like acting as if you're confident in order to become confident do work, but only because you're tricking the very same two-way associative machinery in your own head.
But just because two-way implication is natural and intuitive doesn't mean we're doomed. Obviously people manage to use one-way implication both in and out of logic, it just takes a bit more effort to do. Maybe we can't rely on all our associations being rigorously constructed, but we can take the time to reason through the ones that are important and make sure we've got the right implication.
Today I was thinking about music, and the particular quality that music has of being rhythmic. It's interesting, because in a lot of other ways visual art and musical art share similar characteristics. Although visual art is often static and musical art is often dynamic, that's not necessarily the case; movies, for example, are dynamic visual art. However, even with that in mind, musical art is usually rhythmic and visual art is usually not, except when the two are used together.
But what would it look like if you could make non-audial music? Visual music? An animation that you watch that beats with a rhythm, dances and moves in front of you. It's obviously possible to convey emotion and mood visually, so you should be able to do a lot of what you can do with sound. You could have different instruments, as in animations that move according to specific rules. You would still have an energy and a tempo to play with, still be able to represent complex interactions between different instruments as they catch your attention or fade into the background.
In a way you might even have more flexibility, because our auditory senses are quite limited in discriminative ability. You could produce far more complex soundstages with no sound, because our ability to track complex visuals is so much better. There'd even be some spectacular possibilities in live performance, where you could have entire visual orchestras controlling individual instruments, being mixed and laid out in real time by a visual conductor. All of this in total silence – I wonder what it would be like.
Of course, sound and vision do have fundamentally different mechanics, and it's not clear that, for example, our sense of musical consonance would translate well into visual consonance. This visual music would probably have different rules to audial music and end up developing in a substantially different direction. But that's fine; visual music is more like a neat analogy, the point is finding out what you could create with rhythmic visuals.
Though maybe, if visual music ever got big enough, you could bring the two back together. Not like a music video now, where the visuals are really just a prop for the music, but where the video and the audio are their own separate rhythmic art pieces that come together to make something exceptional.