Monday, February 23, 2009

On the Nature of Problem Solving


I spent a large portion of my weekend trying to write a program to solve a particularly stubborn nonlinear equation. I made good progress, until I reached a critical point. Discussion with everyone else revealed that they were also stuck on the same point. I promised to work on it in the afternoon, and jokingly said "In half an hour, I'll have it figured out."

It took 26 minutes to work out and understand the solution in my head, 23 minutes to code it into the computer program, and then 55 minutes to work out why I was getting divergant behaviour out of a system which should obviously converge. As usual, one little "-" sign buried deep in the code had magically disapeared.

Debugging is never fun...

If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



On Parameterizing Functions Called by Function Functions


More or less quoted from the Matlab R2007b help file:

"One way to provide parameters to the function is to write a single function that
  • Accepts the additional parameters as inputs
  • Invokes the function function
  • Contains the function called by the function function as a nested function."

Which, of course, explains everything perfectly...
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



Sunday, February 22, 2009

On Balancing Cheeseburgers


This seems easy at first - Cheeseburgers are contained in buns, which initially appear round, but anyone with experience with cheeseburgers (or anything in buns) will be able to point out that they have flattened bases. Balancing is a naturally stable position for them. The problem is balancing cheeseburgers... plural. The simple approach to this is to place the burgers next to each other on a flat horizontal surface. Since a single cheeseburger is a stable system, two independent cheese burgers will also be two independent stable systems. Given sufficient space, balancing any number of cheeseburgers is a trivial problem.

The problem only becomes non-trivial if one imposes constraints, either by limiting the space, or by limiting the type of surface to one that is either not flat, or not horizontal. Or both. For example, if the problem were to be restated as "Balance sixteen cheeseburgers on someone's head," this would transform a completely trivial problem into one that requires significant thought and skill to solve.

The obvious solution is to devise some support for the cheeseburgers. However, in doing so, one must bear in mind the stability of the base. For example, one could drive a rigid steel support through all the cheese burgers and a sufficient depth into the base to ensure stability. However, driving a steel support to far into the base (which is someone's head) would increase the probability of the base falling over. One could take the idea one step further, and drive the steel support further down, into whatever the person is standing on, however this would require a great increase in the length of the support.

As with all long supports, buckling now becomes an issue. One could increase the diameter of the support, but the diameter should not be so large that it affects the ability of the cheeseburgers to stay together. The support would thus need to have a steadily varying diameter, to ensure that it does not buckle in the lower portion of its length, and that it does not cause excessive damage to the cheeseburgers along the upper portion of its length.

Some sort of grip will need to be designed so that the base does not slip off, and a mechanism would need to be attached to the top of the support to apply a constant pressure to the cheese burgers. This is necessary to ensure that contact is maintained between the cheeseburgers and the base (which is not explicitly stated, but is certainly implied by the problem statement).

This brings one to the question of whether using a support really is balancing, however, this question is irrelevant. It is true that the problem did specifically state that the cheeseburgers must balance, but surely this is imposing an unnecessary constraint on the solutions. The problem needs to be restated so that this constraint is removed. The new problem, structured to suit the devised solution is "Get sixteen cheeseburgers to stay on someone's head." If there really was a reason that the cheeseburgers had to balance (taking the word literally), then the easiest solution would be to fit each cheeseburger with electric fans and an intelligent control system to maintain stability. But what is the difference between using the air for support and using a steel rod?

You may be asking at this point what the point to all this is. I think that's a stupid question. If you wanted to ask an intelligent question, you need to start with "Why?"
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



On Poetic Licences


Where do you get them? Are they expensive? Who decided that you had to have them? I think its a major scam to make money from stupid people. What other reason could there be for people charging money to issue a licence, just so people don't have to learn how to structure a sentence properly.

For example, take the lines "The silver-blue sky, beheld by the eye," which have obviously been chosen because they rhyme. Why doesn't the poet just say. "The sky is blue." And why does he have to point out that it can be seen. That is obvious. When ever the colour of an object is pointed out, it is generally assumed that anyone (with the notable exception of blind people) can see what colour it is, unless it is specifically stated, as in "The sky is blue, but we're six hundred metres underground, so you can't tell."

For years, poets have been doing this sort of thing, and I've never worked out why. I've always believed poets are people with insufficient grasp of language to structure a sentence properly, but not enough musical understanding to work the words into a song. Yet when one studies English at school, poetry makes up a fair portion of the curriculum. No wonder people nowadays can't speak or write English properly.
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



Wednesday, February 18, 2009

On Learning to Use Technology


There is so much out there in the way of advanced technology these days. From fancy computer systems to cellphones, smart irrigation systems and intelligent fridges and toilets. I am slowly beginning to realize that the majority of people have no clue how these technologies work, never mind how to use them. Arthur C. Clarke said that "any sufficiently advanced technology is indistinguishable from magic." This is rubbish, obviously, because someone had to develop that technology, and that someone would have needed to understand the workings behind it (presumably). The people who can't tell it is not magic are the ignorant users, who are probably not engineers. I've always wondered how things work, and I've always made an effort to understand every technology I've used, even if it is on a very elementary level.

Technology has replaced so many brains. Apart from the obvious culprit of the internet (which is, of course, always right - even when it contradicts itself), there is another major culprit that is even more widely believed. Most people know it as GPS, a few confuse it with GPRS, and most don't actually know what it stands for. A lot think it stands for Global Positioning Satellite, but these are people who don't think. If that were correct, then those who say they have had GPS installed in their cars are idiots. By definition, a satellite is something in free orbit around the earth. To install a satellite in ones car either means that one has brought down a satellite, or is planning on sending their car (together with this satellite) into space. Actually, GPS refers to any Global Positioning System, but we now use it to refer to those systems that use satellites. The interesting thing about GPS maps is that they only know what they've been told. They don't have a brain to work things out for themselves, ad they don't learn from their mistakes (neither do most people). They know nothing about road closures, and they only know about 90% of roads. I found out recently that even major roads aren't properly recorded on GPS maps.

A woman was looking for a place, which she knew was in Sandton, so she drove to Sandton. Since Sandton, is about 10 km across, and the busiest commercial hub in the country, she landed up driving through rush hour traffic for 40 minutes to get to the centre. She then phoned the place to find out where it actually was. It turns out that it is on the very edge of Sandton. She enters the address into her GPS and is told that it doesn't exist. So she phones the place again and tells them they don't exist, because they aren't on the GPS. This results in a big argument, with one side remaining calm, and the other completely losing their temper. The place she was looking for (a hospital that had occupied that address - which happens to be on a main road - for forty something years) had obviously been using the wrong address since it was built.

People need to remember to use their brains when dealing with technology. The only problem is that remembering that requires the use of a brain, an art which is only carried on by a steadily declining minority.
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



Saturday, February 14, 2009

On Stupid Children: Part II


Today I saw a child walking along with a balloon on a stick. They were pushing it along the ground, swinging it from side to side, as one would use a metal detector. The ballon popped, and the child just stood and stared. I'm not sure she understood what had happened. That's OK. The child was very young, maybe three or four years old. It was easy to forgive her. A regular dose of tuna, and she will be okay.

The thing that worried me was the mother. She stared at the balloon with exactly the same expression as the child. To me this really implies that she didn't understand what had happened either. It is her parents that failed by not giving her enough tuna as a child.

Last week, I had first hand experience on the power of tuna. I have been taking tuna oil supplements for a while now, but I decided that stopping for a week wouldn't make any difference. I was wrong. Within one week, I became an outgoing person. It was horrible. I've been back on my tuna for 6 days now, and I've turned back into a quiet nerd. Thank God. I'd hate to have to be talkative for the rest of my life.
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



On the Destructive Potential of Ants


(Editor's note: To those of you who found this by Googling "can ants be destructive", or "do ants eat brick", or something similar, I advise you read the post on Google Searches, which does contain the actual answer)

My house became infested with ants a couple of weeks ago. They're gone now, but I still can't help thinking about them. Ants are quite similar to termites in many ways. If you live in a wooden house, and your house becomes infested with termites, you have a serious problem. Termites eat wood.

But I don't live in a wooden house. And ants don't eat wood. As far as I can tell, they eat leaves, other insects, and chocolate, and cake, and almost anything else. But not wood. That eased my fears a little, until one day in the kitchen cupboard, I noticed a line of ants crawling out of a hole in the wall. Ants don't eat wood, or bricks, but they do dig. Brick and cement are no obstacle to them. That got me wondering. Could ants dig through a house until the point that it collapses. And how do I know how many holes are running through my wall. Do architects think of that sort of thing?
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



On Farmers and Equally-Spaced Trees


Driving through the Free State, the ground is almost flat, but not entirely. The terrain is scattered with small hills. At some points, these hills run parallel to the road. Along the highest ridge visible from the road, there are lines of trees, various heights and types, but all equally spaced. The arrangement and precise location of these trees is too coincidental to be a natural occurrence, and since the surrounding country side contains nothing but farms, one has to assume that the farmers must have done it.

I think it's my engineering mind that realised the problem. It's just the technical difficulties of lining the trees so precisely, often a few kilometres from the road.. One person would have had to be on the road, sitting in a car (so that his head is at the right height). He would have the direct the farmer (probably over radio), so that the farmer could mark the highest line on the hill visible from the road. He would then have to use a tape measure and mark off the intervals, and then plant the trees. It all sounds like a lot of pointless effort to me...
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



On "Take A Seat"


It was in a small town where English is a language that is rarely spoken. We were giving a presentation to some school children. The presenter was ready to begin. Standing in front of the group, he said "OK. Could you all please take a seat," indicating that they should all just sit on the floor. All the children made they way to the corner of the room where some chairs were stacked. The next ten minutes were spent waiting for children to neatly arrange the chairs. You need to be careful what you say sometimes.
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .



On Battery Terminals


When putting a 9V battery into something, I can never remember which terminal is the positive one. Normally, one side is marked with a little "+", so I just match that one up with the "+" on the object.

The other day, I was replacing the battery in a microphone, and I checked the side to look for the little "+". It wasn't there. Instead, the manufacturers had decided to put a little diagram explaining which was positive, and which was negative. Instead of simply matching the "+" signs (which has by now become an automatic reaction), I have to look at the diagram, think about its meaning, look at the top and determine which terminal is which. It really is a waste of thought.
If you enjoyed this post, then don't forget to like, tweet, +1, or upvote on reddit. If you have any questions, comments or complaints, post them using the form below.
. . . . . . . . . . . . . . . . . . . . . . . .