## Puzzles

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'sWltQx2cRpB2OWsFoyASBw',sig:'4YYVgwl3SSTo-vNa1xzo8FharPwafFrN2yNz_Z48dXs=',w:'447px',h:'384px',items:'128392634',caption: false ,tld:'com',is360: false })}); ```

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'16Tyw62CShxWLlu7t4ibnQ',sig:'JhY8nBOGX7k7djuBD9eQidro_1J2KcfzZ_9DdMLiX4I=',w:'339px',h:'508px',items:'559537535',caption: false ,tld:'com',is360: false })}); ```

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.

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.

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.

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'IixWArQWSRhmyI0YN4622A',sig:'TtUekvM7vIk72E-epjvFD2EqjUEmNJs_EWAan5UAxJY=',w:'507px',h:'338px',items:'525848873',caption: false ,tld:'com',is360: false })}); ```

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.

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.

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'91Do7EOKSrBinI-yVP82MA',sig:'jMa1HWVw4vdPJbqnSOlYrBaXwxlhEdJFV91nJoa528M=',w:'478px',h:'358px',items:'548134059',caption: false ,tld:'com',is360: false })}); ```

## This title is secret

``` Embed from Getty Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'Zn6X6ygPSsp13-pi4qGZNw',sig:'AJg1aaCojOwEx7HWHUNkoRegqr3af9joizOZ4eTi-hc=',w:'414px',h:'594px',items:'563021711',caption: false ,tld:'com',is360: false })}); ```

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.

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.

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.

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'QS3ZFNYvQst5B8Kx56Xrbg',sig:'meM0VZAsgQnYwKKjQXAjrkAmsXytIS1nAsW8ruy2Rw4=',w:'507px',h:'338px',items:'170993847',caption: false ,tld:'com',is360: false })}); ```

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.

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.

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!

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”.

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.

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'pf9AlkwlS2d7orlOaGkISQ',sig:'lWmcvisaBVFz6WU7kuRpc7twW3qkjoHrQMNxZ-KzrPE=',w:'525px',h:'328px',items:'591196797',caption: false ,tld:'com',is360: false })}); ```

## Atoms versus Electrons

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.

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.

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.

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'SN4N1SIoQmVczWio46tnuQ',sig:'oHtaOEQ_liKeJxEWGFEbZ2ms-Ifnu7Z6owDpvrpwMu8=',w:'478px',h:'359px',items:'479631237',caption: false ,tld:'com',is360: false })}); ```

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.

``` http://www.gettyimages.com/detail/165690246 ```

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'g7wBmmfZThh1S-qVAf8sxg',sig:'N2AELeXq1WeZjf_jiaFoZ5aqMVmnhGFkDX3Gu7ylIDM=',w:'528px',h:'326px',items:'491557256',caption: false ,tld:'com',is360: false })}); ```

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.

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!

## Seeing things

``` Embed from Getty Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'lYb9z9NaRdx9ogfkTaZ6gQ',sig:'VsKrOqwZnOpinfUiphL-JNmHwhdqalZcQmKrlvw7bFQ=',w:'594px',h:'396px',items:'490152514',caption: false ,tld:'com',is360: false })}); ```

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.

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!)

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?

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.

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'htsM_ceMTKRQtvcnDK-mpQ',sig:'3_1fnR7IruROv6VH7QNeZXlKy0MUrcLrvW4xdEPu5pk=',w:'339px',h:'509px',items:'558944897',caption: false ,tld:'com',is360: false })}); ```

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.

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.

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'p5QA2r86SzRvth00aOu-JQ',sig:'2J47Kt2dcrI27Lf4bcPHoMR1BxGGmb_KEn4hoZ4q-sI=',w:'507px',h:'338px',items:'121981203',caption: false ,tld:'com',is360: false })}); ```

## Cycling through life

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'3xDDjYpkRWNmrWJBloMVpA',sig:'oDdv_k5kBreetBXnm9H-SSUL5xQRYQTXWPZYtrTo2kI=',w:'501px',h:'340px',items:'sb10066698cb-001',caption: false ,tld:'com',is360: false })}); ```

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.

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.

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.

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.

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.

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.

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.

## In the Zone

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

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.

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.

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.

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'kKBXH_YLQStrbchPXpgCeA',sig:'F4UT2n6jHkYKyOko5gBt0UF_Adj4wV7x3CZFuGfNfjM=',w:'414px',h:'414px',items:'527951137',caption: false ,tld:'com',is360: false })}); ```

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'z5J4TdT9Tp9CJcu8tWbn0A',sig:'9WYiOWLP0ZZnrX7AU2bHyfFqjDHZsD62y7IqKTykiVU=',w:'407px',h:'421px',items:'482178627',caption: false ,tld:'com',is360: false })}); ```

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!

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'_h0aZnR_Q5NWdjZGNVooCQ',sig:'kgx8_YV4rnMMolsaHpliLZASE42cq0xZtqsSkPqZsXY=',w:'508px',h:'338px',items:'CB6973-001',caption: false ,tld:'com',is360: false })}); ```

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 Imageswindow.gie=window.gie||function(c){(gie.q=gie.q||[]).push(c)};gie(function(){gie.widgets.load({id:'-jdT1J5XSTBR5mVq28idLQ',sig:'2gaKmEI1nBFvOOXyD83GRCzPoPXL05emNtHhX_rMZJc=',w:'521px',h:'329px',items:'76185387',caption: false ,tld:'com',is360: false })}); ```