# Software Algebra

Introduction

Numerical Systems

## Introduction

These pages contains practical information about applied algebra for use with development of programs and devices (nice tricks can be done with boolean algebra). This is pages for nerds... And yet - there is more to it... There was a time before it all..

Cave paintings are p.t. the oldest paintings ever found. Many where made more than 25.000 years ago, and show us stick figures for people, but with animals drawn well and colored with natural colors. They painted using sticks, sharp stones or their fingers. At some time they also invented a technique used to put their handprint in the cave - by blowing a mouthful of paint towards his or her hand against the wall or outline it with for example charcoal.. Leaving a mark waiting for its creator to return, or maybe making a mark for his or her friends. The Cro-Magnon man for instance, has shown examples where they put paintings next to others, in places where they had to crawl on their bellies, deep underground. No one really knows why they did this, for recreation, religion or story telling. Furthermore, The Cro-Magnon technology includes musical instruments (Clay flutes), and there is strong indications of counting and even a simple, 32.000 years old calendar in the form of makings in a fragment of a reindeer antler, showing cycles matching lunar cycles- unlikely that this should be the first of its kind, we can presume there has been calendars before that. We cannot be sure what they used such calendars for, we can only guess its importance for hunting (keeping systematic track of when deers would come to a river-crossing, and thereby be vulnerable to a hunting attack), gatherings of tribes, and keeping track of how many days it takes to travel from one place to another. And maybe keeping track of summer and winter time in order to know when it was about time to move before food, fresh water and shelter was out of reach.

Eventually language and mathematics evolved, becoming more and more refined. Cultures adapts techniques from each other and new forms arrive, which again is refined. Pictograms was used in Mesopotania about 5400 years ago, and 400 years later Cuneiform had evolved. The old cultures of Mesopotania had their influence uding the oldest recordnized writing system and left many clay tablets with writings in Cuneiform letters and numbers. This writing system might not have been the first, there are found artifacts from south/eastern europe which are 6500-8000 years old, having instripted symbols but they are, for the time being, only found with short instriptions and they have not been deciphered nor have they been recordnized as a actual writing system - maybe future findings will inlightning whatever this is a written language or not.

The Indian mathematics, -Ganitam- (meaning Mathematics) have its roots in the Vedic literature (written in Sanskrit), which is nearly 4000 years old (This I would like to have verified however). Around 5th century A.D. a system -Bijaganit- was developed, it made astronomical calculations more easy to work with. It was a short-hand method of calculation, and this features it scores over traditional conventional arithmetic. Bijaganit (Bija meaning 'another' or 'second' and Ganitam meaning mathematics), was adapted from India by Arab invaders around the year 1300. The Arab referred to the calculation method they observed as Al-Jabr ('Al' meaning The, and Jabr meaning Reunion'. The name indicates that the Arabs combined the adapted method with their own. Algebra as we know it today has lost any characteristics that betray its western origin, but the fact is that the tern 'algebra' is a corruption of the term Al-jabr which is the name the Arabs gave to Bijaganitam. The term Bijaganit is still use in India to refer to algebra.

The Egyptians and antique Greeks was rather concerned about geometry and measurement, and lots of our knowledge of trigonometry has it roots in these cultures. The Greeks made advances by introducing the concept of logical deduction and proof in order to create a systematic theory of mathematics. The Ancient Greeks had a tremendous effects on modern mathematics, but then again, the story tells nothing about what ever this due to the use of the ancient Greek mathematics as a source of inspiration.

Guttenberg's invention made it possible to reproduce literature in a, compared to the traditional rewriting, less expensive both in cost and time. And an information revolution was on its way. The story does not however, mention whatever the truth was printed, but it certainly gave people access to stories and other peoples wisdom and ignorance. Especially for those who had been thought how to read.

In 1847 the Englishman George Boole (1814-1864) invented a mathematical theoretical system about relations between items being one of two different values (True or False). But of course there was very little use for such a system. And so, it was quickly forgotten.. Almost...

In 1937 C.E. Shannon discovered that the system invented 90 years earlier by George Boole, was a handy logic system for analysis of optimization in telephone centrals. After that.. Well, I guess something happened. Using the analog radiotubes in a new way, suddenly it was possible to do some digital calculations, the transistor taking over it become even more practical to work with. With the microprocessors invention in 1971 it all went berserk, another information revolution was launched. Today, employing the ultimate in symbolic elegance, 1 and 0 to encode complex information of whatever kind one likes, ordinary people have access to enormous amount of information and the tools to process them into something useful (By the garbage in-garbage out principle, that is). This does not however mean that we actually have any need for it, nor does it mean we understand the information we are given, or even understand what the ancient paintings in caves was used for. Things are forever lost and forgotten, new things come along as we adapt.

Algebra and algorithms using information encoded by sequences of 0's and 1's are fundamental artworks to make our times technology work and behave the way we want (or gives us a chance to work in that direction). The analog world are not forgotten however, the digital representation is just a filtered abstraction to make the analog universe easier to cope with... in our minds...

When it comes to it all, there are 10 kinds of people in the world - those who can read binary and those who can't.

## Numerical Systems

Introduction to Numerical Systems

Polyadical numbers systems in general

Cuneiform - Historical

Roman numbers - Historical

**Introduction to Numerical Systems**

A range of number system has been, and is in use. When constructing somthing using algebra or mathemathics (like software or hardware) it is important to know something about the system you are using, or maybe you can use it in order to make your algebra and code elegant and effective.

**Polyadical numbers systems in general**

The welknown decimal system, using the base 10 (values 0-9) is the most common number system in the western culture. However this number system is not always the most practical system to use. The computer you are using to display these pages is (most likely - that is) based on Boolean algebra, which can be represented by mathematics and algebra using the binary number system (Base 2). Other bases are widely used, in connection with computer science, is hexadecimal (Base 16) and the Octal system (base 8). The old Babylonians used a polyadical number system with the base 60, which was practical to them (and also us in some cases).

When we, using the decimal system with base 10, write the number 5376.34 we really mean

5376.34_{(Base 10)}= 5*10^{3} + 3*10^{2} + 7*10^{1}
+ 6*10^{0} + 3*10^{-1} + 4*10^{-2}

This knowledge is handy when converting from one Polyadical number system to another, and is giving the needed information in order to understand implementations using algebra and even other languages and some areas of cryptography and deciphering.

BIN - Binary system (Base 2)

OCT - Octal system (Base 8)

DEC - Decimal system (Base 10)

HEX - Hexadecimal system (Base 16)

The use of Prefixes has also been added to our definition of numbers. The use of k (kilo) and M (Mega), Giga, Tera etc. can be really confusing. You see, one k is not always 1000, sometimes it is 1024 and one mega is sometimes 1048576 rather than 1000000 and so on. When talking about computers and its digital world, 1000 (base 10) is not a very round number, so one kilobyte (kb) have been defined as 1024 bytes and one megabyte (Mb) as 1024*1kb etc.

Here is the two different values 1000 and 1024 (both base 10) using the most common number systems (base 2,8,10 and 16) and as exponent expression:

Exp. |
Decimal |
Binary |
Octal |
Hexadecimal |

10^{3} |
1000 | 1111101000 | 1750 | 3E8 |

2^{10} |
1024 | 10000000000 | 2000 | 400 |

Note: In the important hexadecimal system, characters is used in order to represent digits with values higher than 9, ABCDEF is used. There are of course always funny hurdles when writing in special writing systems, I noticed something which could become a problem. An example is hexadecimal numbers written in Braille (a dot matrix alphabet composed of 3*2 dots.. used by people with limited visual orientation, blind etc.), as the signs for 1234567890 is the same as for ABCDEFGHIJ, and thus it is impossible for example to distinct between the values 11, 1A, A1 and AA. The best solution would be to use a different set of characters for values higher than 9 when writing using Braille. I personally have never come across this problem, I just have noticed by incidence. When it comes to this issue, you should contact the right instances to get further knowledge.

Pictographic writing was used by the Sumerians about 3400 BC, and by 3000 BC this had evolved into the Cuneiform script. The Cuneiform alphabet was used in the Sumerian empire, Persia and Babylon. Our knowledge about their system greatly relies on the fact that they used it for pressing figures on wet clay tablets and other clay works. They used the sexagesimal system (Base 60), which also seems like a normal decimal system (base 10). The Babylonians divided the day into 24 hours, each hour into 60 minutes and the minute into 60 seconds. Their definition of time is something which has been in use for atleast 4000 years. Notice, in the beginning the concept of zero had not yet introduced in that time, a blank space was in common use.

There are variations, atleast from district to district, about how to represent a given value, but they are based on the same system and could be read by all.

An example of how one could write basic Cuneiform numericals:

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 30 | 40 | 50 |

As mentioned there are variations in the exact representation, but the basic idea is the same. You can see it seems like a counting
based system, counting each angle to give the value. Their number system is similar to ours in the way that it too was a polyadical
number system. There are just a few symbols to learn in order to make numbers up to 60. Two actually... Each digit is a combination of the
numbers of tens (empty if none) + numbers of ones and represents a value of digit*60^{(Digits place)} from the right. It is just
like any other polyadical numbers.

A number like 68363_{(Base 10)} would be written in Cuneiform numbers with base 60:

18*60^{2} |
+ 59*60^{1} |
+ 23*60^{0} |
|||

= 68363 in base 10 |

This writing has much in common to our system, we use base 10, they used base 60 (with elements of base 10 when using numbers up to 60), however we use the same principle today when writing the 24 hour/day clock, our syntax is only slightly modified:

By the time 18:59:23 we really mean 18*60^{2} + 59*60^{1}+
23*60^{0} = 68363 seconds since 00:00:00, and we are just using an atleast 4000 years old system in a modern syntax.

The resemble becomes even more clear when we get to see the original numbers of what we are using today. Angles for the value of the digit, remembering that 0 has no angles.

The Romans used several number systems, mainly their own roman numbers. And also a number system taken from the antique Greeks (Which was based on a character referring to the pronouncement of the number).

Roman numbers are still in use from time to time in our days. Personally; The only reason I see is that some people seem to believe they look smart, they are not used due to any practical application compared to the our numerical system.

M = 1000, D = 500, C = 100, L = 50, X = 10, V = 5, I = 1

Other ciphers are made by combining these signs, on an addition/subtraction syntax with the I sign. The value 9 for example can be written as IX (10-1), VIIII, 3 as III or IIV, 2004 can be written as MMIV. 156 can be written as CLVI.