Archive for the ‘Science’ Category

Abstraction

Tuesday, 16 March, 2010

In many fields, there is certain level of abstraction you need to do with your knowledge in order to apply it at a more advanced level.

As an example, consider computer programming. The most basic level is manipulating variables and control flow with branches and loops. A level of abstraction comes when you write callable functions to encapsulate repeated tasks. There’s another level when you learn about pointers and references. And then you can fling around references to functions and pass those in as parameters to other functions. Further abstraction comes with function templating, design patterns, and so on. And at some point you get to wrangling large chunks of code that are standardised enough that you can write other code to generate those chunks of code from some sort of code definition files.

When you’re writing computer code whose purpose is not to calculate some value, but to generate other computer code, then you’ve climbed a fair way up the abstraction pyramid.

I used to have a job cutting code. I’m a competent programmer. But when the people around me started writing code to parse XML files into other, more complex code, I began feeling out of my depth. It was a level of abstraction too far for me to comfortably work with. I understand the concept of code generation, and can see the benefits, but actually doing it requires mental gymnastics that don’t quite come easily enough for me.

I’ve found I have similar trouble with more advanced mathematics. I’m fine with stuff that I can link directly to practical applications, like vectors and calculus to give simple examples. But these days I get thrown all sorts of matrix algebra and graph theory and classification trees and stuff which seems one layer too far removed from reality for me to fully comprehend. At some point along the way, I reached my abstraction threshold, and everything beyond that just seems like symbol pushing, with no underlying meaning.

I’m beginning to think that my strengths in the mathematical sciences lie not in the greater realms of abstraction, but in the solid application of what I know to the real world. I’m a visual person. I understand Fourier transforms and quantum mechanics and differential equations in an intuitive way, by thinking of them in terms of how they are represented by physical systems, and feeding that back in to figure out how the mathematics must behave. I don’t work from the mathematical equation manipulating and then map that on to the physical system.

Sometimes this seems like a limitation. Other people clearly have higher abstraction limits than I do, and are comfortable applying matrix operators in a purely mathematical way when they’re three or four steps removed from representing something, while I ask questions in their presentations about what it actually means. But maybe the lower abstraction threshold allows me to make deeper connections to describing physical systems, since many people have commented on my ability to describe complex scientific principles in terms that make them readily comprehensible. To me that just seems natural, as that’s the way I understand them. I need to see all those deep connections before I feel I really understand something.

Maybe that’s why I feel uncomfortable with higher abstraction. The connections are more tenuous, or fewer, and I feel like I’m working without a safety net, a reality anchor. In my heart I feel that the strong connections must be there, but they feel elusive, ghostly – and so I don’t feel that I fully understand what’s going on.

I don’t have a snappy conclusion to this line of thought. I only really thought about it last week, and I’m still digesting it and trying to see if it helps me. I think it might be the reason I have a breadth-first approach to knowledge. Any one field becomes more abstract as you learn more about it. If my abstraction threshold is lower than average (for science/research-minded people), it could explain why I diverge into looking at something different before I have an “expert” knowledge of any one subject.

Apertures

Thursday, 11 March, 2010

Someone asked me today why the aperture number on a camera lens gets bigger as the aperture size gets smaller. Some of you no doubt already know why. But for anyone who’s ever wondered the same thing (as I did for many years when I first started using an SLR camera back in the days of film), let me explain.

The aperture is the number you see written as f/2.8 or f/8 or f/22. It describes the size of the opening inside the lens through which the light passes. There’s an iris diaphragm which can open and close to let in different amounts of light. This is useful to control for two reasons:

  1. The wider the aperture, the more light you let in to expose your film or digital camera sensor. So in dim light, it’s often better to use a wider aperture. Conversely, in bright sunlight, you can use a narrower aperture to get the same exposure at the same shutter speed.
  2. The wider your aperture the narrower your depth of field. This is a measure of the range of distances from your camera within which objects will be in focus. If your depth of field is large, lots of stuff will tend to be in focus, while if it’s narrow, only objects a precise distance from the camera will be in focus and everything else will be blurry. This might sound bad, but in many cases you want a shallow depth of field, such as to make a flattering portrait of someone – it looks better if things in the background are blurry so as not to distract your eye from the subject of the photo. So a portrait photographer will tend to use a wide aperture. On the other hand, a large depth of field is good for landscape photography, where you want everything in focus, so a landscape photographer would tend to use a narrow aperture.

The interesting thing is that to a beginner in photography the numbers of the apertures might seem to be backwards. f/2.8 is a wide aperture, letting in a lot of light, while f/22 is a narrow one, letting in relatively little light. Why is this?

The answer lies in the mysterious “f/” that precedes the aperture number. Although people usually refer to the apertures as “eff two point eight” or “eff twenty-two”, the slash symbol is actually a division sign. The f is the symbol for the focal length of the lens. If you have a standard 50mm lens, the aperture f/2.8 is 50/2.8 = 17.9mm wide. And the aperture f/22 is 50/22 = 2.3mm wide. So you see f/2.8 is quite a bit wider than f/22.

The interesting thing is that the apertures are defined in terms of the focal length of the lens. If you have a 200mm telephoto lens, then f/2.8 is 200/2.8 = 71mm wide and f/22 is 200/22 = 9.1mm wide. So in a physical sense the “same” aperture numbers are actually physically bigger on a longer lens, and physically smaller on a shorter lens.

So you might expect f/2.8 on a 200mm lens to let in more light than f/2.8 on a 50mm lens. But this isn’t the case. The 200mm lens has a field of view 4 times smaller than the 50mm lens – in other words it magnifies things by 4 times compared to the 50mm lens. After all, this is why you use a telephoto lens, to make things look bigger and closer! But the field of view being 4 times smaller means that the lens is gathering 16 times less light (it’s 4 times smaller in the horizontal direction and 4 times smaller in the vertical direction, so it sees an area 16 times smaller). But then the aperture f/2.8 on the 200mm lens is 4 times bigger than the aperture f/2.8 on the 50mm lens, so it gathers 16 times as much light (again, 4 times bigger horizontally, multiplied by 4 times bigger vertically = 16 times the area). So the physically larger aperture exactly cancels the fact that the lens is only seeing a smaller area of the image. The result is that aperture f/2.8 on a given lens gathers exactly the same amount of light as aperture f/2.8 on any other lens! (Assuming an evenly lit subject.)

So that’s why lens apertures are specified in this way. Rather than say the aperture is 5mm, or 13mm, or whatever, it’s much more convenient for figuring your exposure to express the aperture as a fraction of the focal length of the lens. Which explains the odd-looking “f/” notation, and why the numbers get bigger as the aperture gets smaller.