Pieces of a puzzle
Pieces of a puzzle (Photo credit: Wikipedia)

I’ve been musing on the human liking for puzzles. I think that it is based on the need to understand the world that we live in and predict what might happen next. A caveman would see that day followed night which followed the day before, so he would conclude that night and day would continue to alternate.

It would become to him a natural thing, and in most cases that would be that, but in a few cases an Einstein of the caveman world might wonder about this sequence. He might conclude that some all powerful being causes day and night, possibly for the convenience of caveman kind, but if his mind worked a little differently he might consider the pattern was a natural one, and not a divinely created phenomenon.

Embed from Getty Images

Puzzling about these things is possibly what led to the evolution of the caveman into a human being. Those cavemen who had realised that the world appear to have an order would likely have a survival advantage over those who didn’t.

The human race has been working on the puzzle of the Universe from the earliest days of our existence. Solving a puzzle requires that you believe that there is a pattern and that you can work it out.

Embed from Getty Images

The Universal pattern may be ultimately beyond our reach, as it seems to me that, speaking philosophically, it might be impossible to fully understand everything about the Universe while we are inside it. It’s like trying to understand a room while in it. You may be able to know everything about the room by looking around and logically deducing things about it, but you can’t know how the room looks from the outside, where it is and even what its purpose is beyond just being a room.

Solving a puzzle usually involves creating order out of chaos. A good example is the Rubik’s Cube. To solve it, one has to cause the randomised colours to be manipulated so that each face has a single colour on it.

English: Rubik's Cube variations
English: Rubik’s Cube variations (Photo credit: Wikipedia)

A jigsaw puzzle is to start with is chaos made manifest. We apply energy and produce an ordered state over a fairly long time – we solve the jigsaw puzzle. After a brief period of admiration of our handiwork we dismantle the jigsaw puzzle in seconds. Unfortunately we don’t get the energy back again and that’s the nature of entropy/order.

Many puzzles are of this sort. In the card game patience (Klondike), the cards are shuffled and made random, and our job is to return order to the cards by moving them according to the rules. In the case of patience, we may not be able to, as it is possible that there is no legal way to access some of the cards. Only around 80% of of patience games are winnable.

Empire Patience Playing Cards, Box
Empire Patience Playing Cards, Box (Photo credit: Wikipedia)

Other games such as the Rubik’s Cube are always solvable, provided the “shuffling” is done legally. If the coloured stickers on a Rubik’s Cube are moved (an illegal “shuffle”) then the cube might not be solvable at all. A Rubik’s Cube expert can usually tell that this has been done almost instantly. Of course, switching two of the coloured stickers may by chance result in a configuration that matches a legal shuffle.

When scientists look at the Universe and propose theories about it, the process is much like the process of solving a jigsaw puzzle – you look at a piece of the puzzle and see if it resembles in some way other pieces. Then you look for a similar place to insert your piece. There may be some trial and error involved. Or you look at the shape of a gap in the puzzle and look for a piece that will fit into it. One such piece in the physics puzzle is called the Higgs Boson.

English: LHC tunnel near point 5. The last mag...
English: LHC tunnel near point 5. The last magnets before the cavern. (Photo credit: Wikipedia)

The shape is not the only consideration, as the colours and lines on the piece must match the colours and lines on the bit of the puzzle. In the same way, new theories in physics must match existing theories, or at least fit in with them.

Jigsaw puzzles are a good analogy for physics theories. Theories may be constructed in areas unrelated to any other theories, in a sort of theoretical island. Similarly a chunk of the jigsaw could be constructed separately from the rest, to be joined to the rest later. A theoretical island should eventually be joined to the rest of physics.

Embed from Getty Images

Of course any analogy will break down eventually, but the jigsaw puzzle analogy is a good one in that it mirrors many of the processes in physics. Physical theories can be modified to fit the experimental data, but you can’t modify the pieces of jigsaw to fit without spoiling the puzzle.

The best sorts of puzzles are the ones which give you the least amount of information that you need to solve the puzzle. With patience type games there is no real least amount of information, but in something like Sudoku puzzles the puzzle can be made more difficult by providing fewer clues in the grid. A particular set of clues may result in several possible solutions, if not enough clues are provided. This is generally considered to be a bad thing.

Solution in red for puzzle to the left
Solution in red for puzzle to the left (Photo credit: Wikipedia)

Some puzzles are logic puzzles, such as the ones where a traveller meet some people on the road who can only answer “yes” or “no”. The problem is for the traveller to ask them a question and deduce the answer from their terse replies. The people that he meets may lie or tell the truth or maybe alternate.

Scientists solving the puzzle of the Universe are very much like the traveller. They can question the results that they get, but like the people that the traveller meets, the results may say “yes” or “no” or be equivocal. Also, the puzzle that the scientists are solving  is a jigsaw puzzle without edges.

English: Example of a solution of a Hashiwokak...
English: Example of a solution of a Hashiwokakero logic puzzle. Deutsch: Beispiel einer Lösung eines Hashiwokakero Logikrätsels. (Photo credit: Wikipedia)

Everyone who has completed a jigsaw puzzle knows that the pieces can be confusing, especially when the colours in different areas appear similar. For scientists and mathematicians a piece of evidence or a theory may appear to be unrelated to another theory or piece of evidence, but often disparate areas of study may turn out to be linked together in unexpected ways. That’s part of the beauty of study in these fields.

Embed from Getty Images


This title is secret

Embed from Getty Images

Everyone has secrets. Even a hermit in a cell has secrets, not the least of which is what made him become a hermit. His overt reasons may be plausible, but it is likely that for most persons his overt reasons would not be quite enough to drive them into seclusion.

I don’t believe that anyone can be completely open and still be sane. It may be that a person, while being non-racist in actions and philosophy sometimes has thought that is racially biassed. The person will probably then suppress those thoughts as wrong or unnatural.

Thoughts in the Night, Dreams During the Day
Thoughts in the Night, Dreams During the Day (Photo credit: Wikipedia)

Couples often claim to be one hundred percent open with each other, but this is unlikely to be true. One person may have eaten the last chocolate, and remains strategically silent when the other partner remarks that they thought that there was one more left.

One partner may prefer Indian cuisine but may silently go along with the other partners desire for Thai or Japanese if he or she has no strong feelings about the matter on a particular occasion. Over time however partners will know one another’s preferences and a compromise will be reached.

Pad Thai at Sarah's restaurant in Toronto, Canada.
Pad Thai at Sarah’s restaurant in Toronto, Canada. (Photo credit: Wikipedia)

Families may have secrets – the skeletons in the cupboards. Very often the emergence of such secrets may be disturbing or traumatic and may shake the family to the core. The secret may be something that the family knows but which is get from outsiders, or one or two family members may keep from the rest : “Well, Aunty P and Uncle Q were never formally married, you know.”

Firms often have secrets. A firm may fail, and few people outside the firm may have seen it coming. Either the firm purposefully has been optimistic in its accounts and its presentation to the outside world, or the accounts may have been in a mess and the warning signs missed both internally and externally.

Intellectual Property Owners Association
Intellectual Property Owners Association (Photo credit: Wikipedia)

Firms have other secrets, such as the exact processes that are used to produce their product. Such secrets are believed by the firm to give them an advantage over their competitors, so they do all that they can to prevent the competitors from learning their secrets.

Often a firm will keep a yet to be launched product a secret, again so that competitors can’t steal the ideas. This has led to big launches and product announcements that are covered by the media, often for products which are not significantly different from previous products already released.

Embed from Getty Images

Of course, one firm will know that another firm has secrets, and so firms will spy on one another, there will be leaks of information, and all sorts of skullduggery will ensue!

There will be political secrets too, and a great deal of energy is put into uncovering such secrets and exposing them for political gain. The media are always searching for political secrets, simply to sell more publications.

World wide governments spy on each other. While this information can be used to find out if another government has hostile intentions, it can also be used to assess the threat that the other government poses.

The 33 convicted members of the Duquesne spy r...
The 33 convicted members of the Duquesne spy ring (FBI print). (Photo credit: Wikipedia)

An example of this was spying on Iraq gave the United State government an excuse to invade Iraq, because spying had been said to have revealed that “Weapons of Mass Destruction” had been developed in Iraq. This turned out to be untrue, and whether or not spying had really erroneously indicated that such weapons had been developed has been a topic of debate ever since.

Governments routinely spy on their own citizens too. If a government suspects that certain of its citizens are secretly planning revolt they may keep a close watch on them. Also, governments may take an interest in someone if they are suspected of planning to commit a crime. In many cities around the world it is almost impossible to walk down the street without passing a number of surveillance cameras.

Shot of the perpetrator by a surveillance came...
Shot of the perpetrator by a surveillance camera in the lobby of the Serena Hotel in Kabul. (Photo credit: Wikipedia)

Indeed such surveillance cameras are common these days. People have been accustomed to seeing them on the roads and in shops, and most are accepting of them. The argument is that if you have no secret to hide, then the cameras are not a concern, and people believe that if there is a camera, then this will frequently deter people from misbehaving.

This is more or less true, though there are enough videos on YouTube of idiots doing silly things in front of security cameras. Those people don’t have any secrets from them!

English: A payload surveillance camera made by...
English: A payload surveillance camera made by Controp and distributed to the U.S Government by ADI Technologies. (Photo credit: Wikipedia)

Sometimes secrets are good. You would not set a password and then tell everyone about it, of course, and your password keeps your stuff secret from any possible attackers. Before the rise of Internet banking things were kept secret by locking them up in a box or safe. These days your password might be what is kept in the safe!

Cryptography is looked after by Alice and Bob and friends. These characters, invented by cryptographers, are forever exchanging secret messages, which are usually something like “This is Alice”. They use various cryptographical messages means to keep their secret information secret, usually using things like “private keys” and “public keys”.

Public key making
Public key making (Photo credit: Wikipedia)

Cryptography has arisen as a result of the Internet’s total lack of security or secrecy. When the Internet was built no one could have predicted the need for security. After all, it was only a tiny network connecting a few research and educational institutions and joining it was by invitation. Everyone knew everyone else.

Pretty soon, though, the Internet grew too large for everyone to know everyone else and security was needed. At first login accounts were all that way necessary, but soon that was insufficient. Black Hat hackers joined the Internet, and they were interested in breaking into your account to read your emails to your girlfriend, your mother, or your cannabis dealer.

English: A stereotypical caricature of a villa...
English: A stereotypical caricature of a villain (i.e. generic melodrama villain stock character, with handlebar moustache and black top-hat). (Photo credit: Wikipedia)

Password requirements got stricter and stricter as the Black Hats got cleverer and cleverer at breaking password security but people still use passwords like “password” and “12345”. There are now so many people connected to the Internet that there is a certain safety in numbers. Just like birds flock together so that an individual’s chances of becoming prey are small, so an individual’s private information is probably safe, unless by chance, they are the one in the millions who is picked on by the Black Hatter.

Embed from Getty Images



Atoms versus Electrons

English: Underside of a DVD-R disc, modified t...
English: Underside of a DVD-R disc, modified to have transparent background. Français : Dessous d’un DVD (sur fond transparent) Frysk: DVD/dûbelskiif (Unterkant) (Photo credit: Wikipedia)

In “Being Digital” by Nicolas Negroponte, he touches in the Introduction on the irony of printing a physical book whose theme is the digital world and how we are moving holus bolus into it. Most human activities can be performed on line, and at the moment that we want to do them. We can watch a movie, do our banking and communicate face to face with others, and many other social things.

Nevertheless, there persists in many people a strong desire to do things the non-digital way. People go to the cinema to sit in uncomfortable seats, eat over expensive popcorn, to crane their necks at huge images on a vast screen and be blasted with a (usually) over loud sound track. They presumably return home, having breathed the same air and germs as dozens of others for a couple of hours, with ringing ears and throbbing heads.

The Westgarth Cinema, former home of the Valha...
The Westgarth Cinema, former home of the Valhalla, as it was in 2004 (Photo credit: Wikipedia)

Why? They could have caught the same movie while sitting in their own comfortable chairs at home, with the volume set to a comfortable level, eating whatever snacks they fancy, all without the hassles of driving to the cinema, finding and paying for parking, going through ticketing and most importantly, at a time of their own choosing.

Why indeed. Mostly I think that it is the sense of occasion, of doing something special, that drives us to visit cinemas and theatres. There is the excitement of getting up and going out there, being social, going to an actual cinema, buying and eating actual popcorn and ice blocks, sitting in a seat made damp and sticky by some previous customer, of being blasted out of one’s seat by the sound system and blinded by the brightness of the pictures on the screen.

English: The ancient (restored) theatre in Rho...
English: The ancient (restored) theatre in Rhodes, Acropolis, Greece. Français : Le théâtre antique (restauré) de Rhodes, sur l’Acropole. Grèce. (Photo credit: Wikipedia)

At one time it used to be that new movies would only released into cinemas, and they would then be circulated through the cinema chains, so you might wait, literally, years to see a particular movie. Less popular movies may not even have reached local cinemas if they did not make enough money.

While they were not a digital medium, video tapes started to erode the monopoly that the cinemas held. The local video store became an institution. Movies good or bad could be obtained locally, and the only restriction imposed by the movie companies was that tapes were not released for movies that were circulating in the cinemas.

English: Global, Chapel Place, Headingley. Loo...
English: Global, Chapel Place, Headingley. Looking north across North lane to Chapel Place. The video and DVD store was once Hufton’s grocers. Back then it housed 3 shops – see a picture from 1933 on Leodis.org http://www.leodis.org/display.aspx?id=2002712_27164858 (Photo credit: Wikipedia)

Of course, the movie companies could not keep new movies under wraps for too long before illegal copies of their “blockbusters” became available so the delay before movies reached local outlets were reduced. A new category of movies – “straight to video” – became common. These were movies which the movie studios made which did not warrant being released through the cinema chains.

Video technology proved to be a mostly transient phenomenon. DVD and later Blue Ray technology was developed and this was true digital technology. A movie could be pressed onto one or two disks, and sound and video quality was hugely improved over both cinema and video tape technology. The era of the “Home Theatre” was born.

Embed from Getty Images

Both video tapes and DVDs were susceptible to copying. This causes huge issues for the movie studios as, from their point of view, a DVD copied is one less DVD sold, and thus copying was, in their view, cutting into their profits. As a result, the DVD producers started encrypting their products, but of course they needed to let their customers view the DVDs that they have purchased.

It is likely that this encryption, plus the threat of prosecution for illegal copying deterred many people from casual copying, but a small minority are determined to circumvent such barriers, which they saw as preventing them from doing “legitimate” copying, for example for backup purposes. When a single game may cost more than $100, and a single scratch could render the disk useless, they argue that a backup of the DVD is essential.

One of Negroponte’s main points was that we are switching from transporting physical objects (atoms) to transferring only digital data (bits), and piracy is a case in point. It is easy to transfer the contents of a DVD if you can decrypt it and copying is merely the matter of a couple of clicks. Pirated (or decrypted) games will circulate on the Internet within hours of their release.

On the other hand, some enterprising software firms actually distribute their software on the Internet for anyone to download. All that you have to do is pay for the key to decrypt it. Others have found that if you allow someone to play a game, that if they like it enough they will pay for boost and assists as they play the game. These are known as “in app purchases” and are common in phone and tablet app downloaded for free.

Embed from Getty Images

Much the same applies in the world of books. Most books are available in digital or ebook form and some people download thousands of free or decrypted ebooks are store them on their handheld devices. It makes me wonder if they are even going to read any of them, as I have about half a dozen books that I have downloaded which I haven’t got around to reading yet. Maybe this is a collector passion and not bibliophilia as such!

Some people do get a lot of pleasure from reading real books. They love the heft, the smell, the texture of a real book and this love of physical books may fade as people get used to reading on a screen, until, one day perhaps, real books will seem quaint and old-fashioned, just cinemas and theatres are tending to become.

English: Stack of books in Gould's Book Arcade...
English: Stack of books in Gould’s Book Arcade, Newtown, New South Wales (NSW), Australia. (Photo credit: Wikipedia)

I like the digital media, especially the subset of digital media that I can store on my computers. I like being able to watch what I want when I want to watch it. I like the easy portability of digital media. Although I can see the attraction of watching Robbie Williams or Lady Gaga in the flesh, I’ll pass on that and maybe watch them on YouTube instead, where I can watch their performance virtually, with clarity, with good sound. The mosh pit can have it to themselves!

Robbie Williams concert
Robbie Williams concert (Photo credit: Wikipedia)


Seeing things

Embed from Getty Images

I sometimes suspect that I return to the same topics time and again. Not too often I hope, because that will put people off reading this blog (in case anyone does!) This is possibly a topic which I may have already addressed, but hopefully this post will be interesting anyway.

It seems obvious to me that we all see things differently, and I’m talking about vision here, not “seeing” as a philosophical point of view. Some are short sighted, some long sighted, and others have impaired vision. I see a colour as a shade of blue, while my wife sees it as a shade of green.

Toyota Celica 2.0 GT (ST202) shown in Bright T...
Toyota Celica 2.0 GT (ST202) shown in Bright Turquoise Pearl (colour code 756). (Photo credit: Wikipedia)

One could argue that the difference is merely where the line is drawn, but I think that it is more than that. Apart from the physical differences in the lenses of our our eyes, we may have differences in the physical structure of the rest of our eyes, perhaps in the rods and the cones, and it is highly likely that the physical structures of our brains are different, and our minds (which I think of as the software that runs of the hardware of the brain) are definitely different.

It’s no surprise then that my wife and I disagree on whether a colour is a shade of blue or of green. (Actually we disagree about a lot of things. I believe that it goes with being married for 40+ years!)

Plymouth Valiant 100 of some 40 years ago seen...
Plymouth Valiant 100 of some 40 years ago seen on street in New Orleans (Photo credit: Wikipedia)

In Googling around as I write this post I found an article about the brain’s colour processor. Interestingly it has a section entitled “Color is Personal” which is a part of my theme for this post. This section, however, is not really relevant to my theme as the author then discusses Achromatopsia, where damage to the colour processor causes all sensation of colour to disappear.

It seems that even in our own brains and thinking processes the idea of colour is not fixed. I read another article which describes our own personal perception of colours as “malleable”. The implication of this is that a person might describe a colour as “a shade of green” one day, and “a shade of blue” on another day. Is there no hope of a definitive answer?

Newton's color circle, showing the colors corr...
Newton’s color circle, showing the colors correlated with musical notes and symbols for the planets (Photo credit: Wikipedia)

A physicist could help us out, couldn’t he/she? He/she could measure the frequency of the light and say, definitively, that the colour is blue, or it is green, couldn’t he/she? Well, sort of. This would work for very simple colours, but real world colours are rarely made up of just one colour. The scientist’s scope would likely show a range of frequencies resembling a mountain range. That blue/green colour might have traces or red or violet, and is fairly certain to have more than one peak in the blue/green range.

Albert Einstein showed us that if a scientist was moving at a high speed relative to us, he/she would measure the frequencies in the colour differently from a scientist whose spectroscope was alongside us and not moving or moving at the same speed as us.

General Relativity
General Relativity (Photo credit: Wikipedia)

The ambient light has an effect on the colours that we perceive. A red object in red light doesn’t look red. Other objects of different colours look different in a red light. Similarly, it is difficult to determine the colours of cars and other objects under the yellow/orange sodium lights. According to Wikipedia, the colour of a street light has effects other than simple colour perception – it appears to affect peripheral vision.  New LED technology may be able to remove some of these deficiencies.

There are innumerable effects which affect or perception of colour. The most recently famous illusion is the dress which appears to people to be either black and blue or white and gold, but there are many such illusions. One which I came across a long time ago is the chessboard illusion. In this illusion, two square appear to be different colours, but are in fact the same colour. This illusion is usually shown in monochrome, but the illusion works in colour too, and depends on the shadow of the cylinder to produce the effect.

Embed from Getty Images

One brain is very like any other brain. When a scientist shows someone a colour on a card, the same areas of the brain show activity in all individuals, if we exclude some cases where brain function is abnormal for some reason. We can’t delve very much deeper into this issue as we don’t know what this activity signifies, beyond the bare fact that the person was shown a card with a colour on it. We certainly can’t tell if they see it as a shade of blue or a shade of green, and we can’t tell what their subjective experience is when the brain activity occurs.

In some individuals a number or letter may invoke a sensation of colour. Such people might have the sensation of seeing something green when they think of or read the number 6. I don’t know if this imprinted behaviour because the person was presented with a green symbol when first learning their numbers or whether or not it was merely a chance association that arose at a different time, or indeed if it was because of some neurological happening or trauma that has allowed the association to happen.

English: A graph or how the brain interprets color
English: A graph or how the brain interprets color (Photo credit: Wikipedia)

Anyhow, when we see something, there are many stages to the process that  starts with light leaving the object, reaching our eyes, being refracted by the lens of the eye to form an image on the retina at the back of the eye, being sensed by the rods and cone cells in the retina, and sending signals to the brain, which then processes the data.

The amazing thing here is that the image sent to the brain is pretty messy. The eye is not a perfect sphere, the retina is curved in three dimensions and the resolution is pretty rubbish. The retina has at least one major gap in it, rods and cones are not evenly distributed across the retina. Our perception however, is smooth and break free. We have our image processing hardware and software in the brain to that for that.

Retinoblastoma retina scan before and after ch...
Retinoblastoma retina scan before and after chemotherapy (Photo credit: Wikipedia)

It means we can watch a soccer match, and we can see the black and white panels or the ball rotating as it spins across the television screen, when the unprocessed image that reaches our eyes may be quite blurred. Seeing is believing!

Embed from Getty Images

Cycling through life

English: cycle that rotates on its axis Españo...
English: cycle that rotates on its axis Español: ciclo que gira sobre su propio eje (Photo credit: Wikipedia)

I’ve been thinking about cycles. A cycle is something that repeats, like the rotation of a wheel, or the rotation of the earth. A true cycle never has an end until something external affects it, and the same is true for the start of a cycle in that something external to the cycle has to happen to start the cycle off.

Conceptually, a perfect cycle would be something like a sine or cosine wave. It’s called a wave because if plotted (amplitude versus time) it resembles a wave in water, with its peaks and troughs. It’s fundamental constants are the distance between the waves and the amplitude of the maximum of each cycle.

Embed from Getty Images

The sine and cosine waves are derived from a circle – when a radius of the circle rotates at a constant rate, the sine and cosine can be measured off a diagram of the circle and the rotating radius. The point where the radius touches the circle is a certain distance above the horizontal diameter of the circle and is also a certain distance to the right of the vertical diameter of the circle. If the radius of the circle is one unit, then the sine is the height and the cosine is the distance to the right.

English: SINE and COSINE-Graph of the sine- an...
English: SINE and COSINE-Graph of the sine- and cosine-functions sin(x) and cos(x). One period from 0 to 2π is drawn. x- and y-axis have the same units. All labels are embedded in “Computer Modern” font. The x-scale is in appropriate units of pi. Deutsch: SINUS und COSINUS-Graph der Funktionen sin(x) und cos(x). Eine Periode von 0 bis 2π ist dargestellt. Die x-Achse ist in π-Anteilen skaliert entsprechend 0 bis 2π bzw. 0° bis 360° (Photo credit: Wikipedia)

As the radius sweeps around the circle the sine of the angle it makes to the horizontal diameter goes from zero when the angle is zero and the radius lies along the horizontal diameter to one unit when it is at 90 degrees to the horizontal diameter. When the angle increases further, the sine decreases until it is again zero at 180 degrees, and as it sweeps into the third quadrant of the circle it goes negative, increasing to one unit again at 270 degrees (but downwards) and finally returning to zero at 360 degrees. 360 degrees is (simplistically) the same as zero degrees and so the cycle repeats.

Graphing process of y = sin x (where x is the ...
Graphing process of y = sin x (where x is the angle in radians) using a unit circle. (Photo credit: Wikipedia)

The cosine starts at one unit at zero degrees, decreases to zero units at 90 degrees, decreases further to one unit downwards (conventionally called minus one) at 180, then increases to zero again at 270 degrees and finally to complete the cycle, it increases to one unit at 360 degrees.

When plotted against the angle, the sine and cosine produce typical wave shapes, but shifted by 90 degrees. If the radius rotates at a constant speed, the sine and cosine can be plotted against time, which produces a curve like the track of a point on a wheel as it is rolled at constant speed.

animation of rolling circle generating a cyclo...
animation of rolling circle generating a cycloid; black and white, anti-aliased (Photo credit: Wikipedia)

While these curves are pleasingly smooth and symmetrical, in the real world we can only get close to these ideals. A wheel will slip on the surface that it is turning on, friction on axles slows a freely spinning wheel, lengthening each “cycle” by small amounts, altering the curves so that they are minutely different at different times.

If an ellipse is drawn inside the circle such that it touches the circle at the points where circle touches the horizontal diameter, the radius will cut the ellipse at some point and it turns out that the curves plotted from the intersection point are still sine and cosine curves. However the heights or amplitudes of the curves are different.

English: Section of ellipse showing eccentric ...
English: Section of ellipse showing eccentric and true anaomaly (Photo credit: Wikipedia)

An ellipse is approximately the shape of the orbit of a planet about a sun for reasons that I won’t go into here. It isn’t an exact ellipse, mainly because of the effects of other bodies, though it is accurate enough that things like the length of a planet’s year doesn’t vary significantly over many lifetimes. The most accurate atomic clocks can be used to measure the differences but they only need to be adjusted infrequently by very small to keep in line with astronomical time.

To account for these errors the astronomer Ptolemy devised an ingenious scheme. An ellipse can be looked on as result of imposing a smaller cycle of rotation on a larger one, a bit like having a jointed rod, with the larger part connected to the centre of a circle and the smaller part connected to the end of the larger part. If the smaller rod rotates at a constant speed at the end of the larger rod then the tip of the smaller rod draws out a more complex path. If the correct rotation rate is chosen, as is the correct starting angle between the two rods, then the tip of the smaller rod will draw out an ellipse.

Circles on an old astronomy drawing, by Ibn al...
Circles on an old astronomy drawing, by Ibn al-Shatir (Photo credit: Wikipedia)

Ptolemy suggested that the variations from an ellipse could be modelled by imposing other smaller cycles on the first two cycles, and indeed this does result in more accurate descriptions of the orbits.

Ptolemy got a bad press because he believed that these cycles were real manifestations of reality, and his system of epicycles on epicycles on epicycles was hugely complex, but his system can be extended to model any physical system to any degree of accuracy required. It can be proved mathematically that his process exactly matches any equation if the process is taken to infinity. It’s one method of fitting a curve to arbitrary data.

Illustration of Gauss-Newton applied to a curv...
Illustration of Gauss-Newton applied to a curve-fitting problem with noisy data. What is plotted is the best fit curve versus the data with the fitting parameters obtained via Gauss-Newton. (Photo credit: Wikipedia)

In particular Ptolemy was able to use his methods to calculate the distance of the planets, which was a singular success for his method. It is the sort of technique which is used today to calculate the orbits of newly discovered comets – when it is discovered the astronomer has only one point of location so he/she cannot predict the orbit. When the comet’s next position is measured, the astronomer can start to predict the orbit. A third observation can vastly improve the accuracy of the calculation of the orbit.

Subsequent observations allow the orbit to be refined even more until the astronomer can accurately predict the complete orbit of the comet and its periodicity using something like Gauss’ method as described in the link. In essence the procedure of observation, calculation and prediction/re-observation is the same as Ptolemy used, even though the underlying physics and philosophy is different. Ptolemy’s ideas may seem quaint to us, but in his time we knew much less about the universe, and, given the era in which he was working his ideas were not that outlandish. He did not even know that the planets revolved around the sun. He didn’t know about gravity as a universal force.

Claudius Ptolemäus, Picture of 16th century bo...
Claudius Ptolemäus, Picture of 16th century book frontispiece (Photo credit: Wikipedia)

In the Zone

(Ugh! I forgot to post this last week. My apologies)

English: Two programmers
English: Two programmers (Photo credit: Wikipedia)

Programming, as I’ve probably said before is a strange occupation. You start with a blank sheet, steal bits and pieces from where ever you can find them and glue them together modify them, add some bits of original (to you) code and try to think of all the possible ways your program can go wrong.

Then you try and break your code (and usually succeed at first). Programming is still very much an art form. Of course things have changed a lot over the years, and we are able to use the work of others to help us in our endeavours, but my first paragraph is still true.

This image was selected as a picture of the we...
This image was selected as a picture of the week on the Farsi Wikipedia for the 13th week, 2011. (Photo credit: Wikipedia)

In the beginning there was “Hello World”. This is probably the simplest program that does something visible. It doesn’t take any information in and its output, the words “Hello” and “World” are not very useful in themselves. Actually, I’d say that there is an even simpler program that takes no input, produces no output, and in the process changes nothing. A “null” program if you like.

A programmer writing a new program may well jump in and start coding by grabbing some other code that he or she has access to, but that stolen code was developed, ultimately, from “Hello World” or the null program.

Picture of "hello world" in C by Use...
Picture of “hello world” in C by User:aarchiba. (Photo credit: Wikipedia)

A good programmer is one who steals code from elsewhere and modifies it to do what he or she wants. There is no stigma of plagiarism attached to this process, and it is in fact strongly encouraged that programmers share code. A spoof news item that I came across stated that all programming courses would be replaced with a course on how to find code on “Stack Overflow“.  I’ve been unable to find the link again, but I believe that the item was on “The Onion“, a well known satirical website.

Of course, such a  process may propagate errors or bugs across many programs, but it is such an effective strategy that it is used more often than not. If code exists to solve a problem then it would be silly to pass it by and write it ones self, maybe introducing bugs to the code. The advantage of “borrowing” code is that while errors and bugs may be in the borrowed code, many eyes will have looked at the code and there is nothing more that programmers like than pointing out bugs in the code of other programmers.

Wheel bugs mating
Wheel bugs mating (Photo credit: Wikipedia)

Stack Overflow allows anyone to post code and comment (up to a point), so code posted may not be top quality, but other programmers are quick to jump if they see bugs or inefficiencies in code. Contributors will also point out code which doesn’t follow standards or conventions in the programming language being used. This is considered useful, as the code, if modified, can be accessed and understood more easily, and may often be safer and free of more bugs than unconventional code.

Embed from Getty Images

When a program is written it starts out as literally a few lines of code or even an empty file. Any programmer knows that a program grows swiftly and in ways that can’t be foreseen until it may be of enormous size. It won’t be all written in one sitting but is usually written in stages. I personally like to write my programs in very small chunks, building on what has gone before. I think that many programmers use this process, though there may be others who write a sizeable chunk of code before testing it.

Ah, testing! Testing is the less enthralling parts of writing programs. Any program must be tested, to ensure that it does all that is required and nothing else. Generally the program being written doesn’t do all that is required and does things that shouldn’t happen, and initially it is likely to crash or produce cryptic error messages under some conditions.

Embed from Getty Images

Testing is supposed to reduce the number of such unwanted happenings, and the programmer may do some rudimentary testing and may handle at least some errors. However the programmer will realise that users who are unfamiliar with how the program is written may well do something that he has not expected.

So clever people have developed ways of automatically testing programs. To do this they have had to write the programs that are used to test programs. And of course those testing programs may have bugs. You can see where that leads to!

Zebra (programming language)
Zebra (programming language) (Photo credit: Wikipedia)

When a programmer knows a programming language really well, he is able to literally think in that language. The word “literally” has been devalued in recent time, but I am using it in the true sense of the word. This is hard for some people to understand as they think of language as something like French or Tagalog, and they can’t understand how one can think in a programming language, which is qualitatively different from a spoken language.

An interesting thing happens when a true programmer is programming something. His thought processes become so involved in the process of programming and in thinking in the programming language that he loses track of the outside world. That’s why programmers are whimsically thought to subsist on fizzy energy drinks and dialled in pizza. It is because those things are easily acquired and the programmer can keep programming.

Embed from Getty Images

A programmer “in the zone” is so embedded in the world of the program that he or she may often be reluctant to leave that world and respond to irritations like bodily needs and colleagues. I doubt that there is a real programmer who has not surfaced from a deep dive into the depths of a programming problem and realised that all his colleagues have left and it is late at night or very early in the morning. That’s the reason programmers stay after all other people have left – they know that they can slay the current bug with just a few more changes and a few more runs of the program.

The zone has similarities to the state of meditation. While meditation is passive though, programming is an active state. In both cases the person basically disconnects from the world, so far as he or she can, and the concentration is directed internally. Now that I think about it, any deep thought, be it meditation, programming, or philosophising, even playing a sport at a very high level, needs such concentration that much of the world is disregarded and the exponent enters the zone.

Embed from Getty Images