Showing posts with label Computers. Show all posts
Showing posts with label Computers. Show all posts

Sunday, May 10, 2009

Primordinal Soup

Time and again here, we will be returning to THAT man, Kurt Godel, the guy who proved that not everything is provable within mathematics.

A simple example follows, it is called "The Goldbach Conjecture", and involves prime numbers.

Now, a prime number is a number which has no factors, that is, can only be divided by itself and 1.

Obviously, no even number (apart from 2) can be a prime number, since all even numbers are divisible by 2.

Which of these are prime numbers? 3, 11, 21, 31, 41, 51.

The answers are 3, 11, 31, and 41, because 21 is 7x3, 51 is 17x3. These are called "composites".

The Goldbach Conjecture says this:

"Every even number is the sum of two (odd) prime numbers" (the word "odd" is there because 2 is excluded).

Let's call this the "GC" property of a number

Examples:

12 = 5 + 7
22 = 19 + 3 = 17 + 5
32 = 19 + 13 = 29 + 3
42 = 19 + 23 = 29 = 13 = 31 + 11 = 37 + 5

are all "GC".

The question arises: Is the Goldbach Conjecture true?

That is, is EVERY even number like this? Actually, it has never been proved or disproved. We just know that there are lots of them. No highest even number has ever been found, yet there is no proof that that there are infinitely many of them.

It has been speculated that this is one of those truths which can never be proved, the existence of which was showed by Godel in 1931.

There IS stuff out there that is true, but nevertheless cannot be proved.

Let's introduce a similar concept - the "Reverse Goldbach Conjecture". This says:

"Every even number is the difference of two (odd) prime numbers".

Let's call this the "RGC" property.

This has ramifications for computers.

Let's pick a number, say a trillion.

Is It GC or RGC or both, or neither?

You can write a program to test all primes up to a trillion to test if it is GC, and the program will finish at 1 trillion with an answer, YES, or NO. This called a "bounded" test.

However, testing for RGC is a bit more complicated, simply because a subtraction is involved. Testing for RGC has to start at 1 trillion and go UP, trying to find two odd primes which, when the smaller is subtracted from the larger, a trillion emerges.

It is not obvious how far up the number ladder we will have to go to get such a pair, if we ever find one.

For being GC, the testing process terminates in a finite amount of time, always.

For being RGC, the testing process may take us to numbers so high, it may take decades to find the pair, but there also exists the possibility that such a pair does not exist. Either way, we may never know. This kind of test is called "unbounded".

I mentioned computers because computers are particularly good at making loops to test for ever-increasing numbers.

The ramification is that the programmer must make sure his "loops are "bounded", and never "unbounded".

I have made that mistake myself with simple FORTRAN programs.

Tuesday, May 05, 2009

A relection on Technology



Okay, so this image is only vaguely related to the subject matter here. It shows dispersion of white light into it's constituent colors.

Light passing through a glass prism.

To explain fiber optics, it is necessary to start at the beginning. When light passes through something more dense than air, it is refracted, that is what makes ponds seem shallower than they are, and leads to illusions like this:



The pencil appears bent because the light from it is bent, that is, the trajectory is altered.

This is what is happening:



What happens if the angle of incidence is increased? There will come a point when the emergent ray just creeps along the interface. What happens when the angle of incidence is increased even further?

THIS:



The right-most example is what happens - the light beam is completely reflected.
100% reflection, unlike ordinary mirrors,which absorb some of the light, Total Internal Reflection reflects ALL the light.

Scientists of the digital age realised that this could be the basis for very efficient communication, in that a light beam (laser) could be reflected like this many times along a glass tube, thus:



Pluses: Loss of information zero; noise, zero.

Minuses: Optical cable is expensive.

In short, fiber-optic technology utilises perfect mirrors. Yet another application of lasers Normal light does not work because it has a finite coherence length (more about that later)

All done with mirrors.

Saturday, January 17, 2009

I can get along very well without such a program

Computers are so commonplace nowadays, many people do not understand why they are so useful.

Here is the rub, computers understand nothing but two numbers, a “1” and a “0”. They are just, when all said and done, a bunch of switches that are either “on” (a “1”) or “off” (a “0”).l

Humans do not see this level, All we see are games, photos, movies, etc.

But the real reason computers work is that these very zeroes and ones can be looked upon in more than one way.

It is similar to the USE-MENTION distinction in English. To elaborate, the word “bubblegum” is a word. I don’t chew it. I just look at the word. However, I DO chew bubblegum. The quotation marks signify the “mention” of the word, as without them, the word is actually “used” in the sentence – I chew bubblegum. It describes an action.

“bubblegum” describes the word. Bubblegum describes the product.

Computers understand the 1s and 0s in at least four different ways, in the same way that bubblegum above is understood in two ways.

Here is a short computer program in the computer language AKIKOKAKOLA to do the sum 1 + 1 = 2:

0001 PROGRAM STUPID
0002 INTEGER x, y, z
0003 x = 0
0004 y = 0
0005 z = 0
0006 PRINT “Hi, this program adds 1 and 1”
0007 INPUT “Please type in 1”, x
0008 INPUT “Please type in 1 again”, y
0009 IF ((x = 1).AND.( y = 1 ))THEN CONTINUE ELSE GOTO 0002
0010 PRINT “Thank you for your input”
0011 z = x + y
0012 PRINT “The answer is “, z
0013 PRINT “Congratulations!”

Line 1 is the program name (STUPID because it just does 1 + 1 )

Line 2 introduces x, y and z.

Lines 3 – 5 starts them off at zero.

PRINT outputs text to the screen. INPUT does the same but accepts numbers as well. Lines 7 and 8 ask you to type in “1”

Line 9 is the most important, It is a test to make sure you have typed in the two “1”s. If you did, the program CONTINUEs. If you didn’t, it makes a jump back to line 2, and starts again.

The last two lines give the result, 2.

All the words above are represented inside the computer as 1’s and 0’s. Here is where the USE-MENTION distinction comes in, only with computers, there are more than two meanings to the 1’s and 0’s.

The “x”, etc are regarded as data, i.e. information (numbers). INPUT, PRINT, GOTO, etc are “commands”, i.e. instructions. The 0001, 0002, etc are locations in logical steps to be done one after the other.

The most important aspect of computers is in line 0009. The 1’s and 0’s that are in the computer are here to be regarded as “locations” to be “jumped” to, depending on if the “data” inside the “x” and “y” is correct or not. It is this capability to “jump” unique to computers, as opposed to calculators, that enables more complex calculations to be performed (such as 2 + 2 = 4)

The point is that a sequence of 1’s and 0’s can be regarded as representing a number (1), a character (i.e. letter), an instruction (GOTO) or a location (0002 or 0010).

That’s four, so to revert back to our English language analogy, it could be termed the NUMBER-CHARACTER-INSTRUCTION-LOCATION distinction.

This is the sole reason why computers are so powerful.

Incidentally, there is no such computer language as AKIKOKAKOLA, I made it up, but the program principles raised here can be implemented in FORTRAN, PASCAL, BASIC, LISP, and even COBOL (in COBOL, there would be at least 70 lines, as opposed to my thirteen)

The age of writing bespoke computer programs is largely dead now, for the simple reason ICL implemented a package in the late 1980’s called “Quickbuild”, which wrote it’s own programs.

Writing programs is now limited to scientists who need to design simulations based on the latest models of how something works, be it galaxy evolution, black hole physics, or even something as humble as quantum mechanics.