|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Computer
Science is no more about computers than astronomy is about telescopes." |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| A
puzzle
Multiplication of fractional numbers Discrete Systems, Computing and Formal logic
|
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| It all started with my roommate in academy offering me an innocuous puzzle to solve. He said "if you were to weigh all integer weights from 1 to 40 using a physical balance and just 4 standard weights, (placed on either pans) how would you do it. What would be your choice of the 4 standard weights?" I will urge you to toy with this puzzle at least a few minutes to enjoy the essence of this article. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The
solution to that puzzle turned out to be 1, 3, 9, 27. By using the combinations
of only these weights in either pans as above it was possible to measure
any weight between 1 and 40. That was very interesting - because these numbers showed a property. 1, 3, 9 and 27 were three raised to the powers of zero, one, two and three respectively. Why this pattern?
The fact that all numbers however great could be expressed as a unique combination of sums and subtracts of radicals of three, each used only once, and in such a structured and predictable* manner, offered great possibilities to me and it was not easy to sleep with it for all these years. It could have many applications. One of which - it could be a number system!
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Before you grow skeptical and leave at this stage. I would like to clarify the following.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The Algorithm The algorithm whose code is here can be described as a "reach and step back" algorithm. Reach for the highest radical of three which is greater than the target number. Now measure the gap between the radical and the target number. If the gap between the number and the radical is greater than half of the radical value, then step back by inserting a negative value equal to the next smaller radical. If the gap is smaller than the half value, then insert the next nearest lower radical as a positive value to continue in the forward direction. The resultant gap that remains is to be filled by the using the same above algorithm recursively till the target number is reached.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| How a number system? Because you could represent any number simply using three symbols: + - and 0 placed in the respective place values of 3^0, 3^1, 3^2 and so on. Like 34343=
+59049 -19683 -6561 +2187 -729 +81 -1 Any number can be represented, this software generates this for any number. Negative
whole numbers For example -78=
-81 +3 The
sign was contained in the number. This could be most useful, especially
for computers. We do not need to send an extra bit to represent the
sign + or - . Therefore it has cut down all the complications that we
face in trying to represent a negative number in binary system. ( The
1's complement and 2's complement methods). The existing system needs
a difficult algorithm to do mathematical operations on these signed
operands. The beauty was also that you could obtain a negative of a
number by just inverting the symbols in their own places and vice versa.
So that was an easy transform. How
do we recognise a negative number by looking at it? Why such a property should come our way. And why this is unique to the number three does not seem to have any easy apparent answers but its worth investigating. Perhaps from group theory. I used to call it the tristate number system - indicating the three states that the digits can resolve to. A friend suggested that the symbols themselves be called trits - like bits, digits. So we shall call them trits hereafter. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| It was enticing to investigate this for fractional numbers now. Representing fractional numbers is a big problem for computers. For example, if we were given to express .4386 in binary, the binary system would go on generating a stream of numbers inching its value towards the desired value, but alas it could have denoted only 57% of the value in the first two significant digits {.011binary/.4386} = {(.25+.125)/.4386}, and upto 85% by the third place of binary decimal {(.25+.125+.0625)/.4386} and 99% by only the fourth place of decimal. But the real difficulty of working with binary fractional numbers comes in terms of including the sign inside the number and then working with them. The practical schemes worked out include a sign bit typically and create overflow errors at the most significant bit. Lets begin with what our tristate digits (trits) after the radix point (tristate point) looks like. Like any other place value system they would be 3^-n : 3^-1, 3^-2, 3^-3 and so on. They would be 1/3, 1/9, 1/27 and so on.(tristate point like decimal point, binary point) Lets see what happens if we add these tristate fractional numbers: 1/3 + 1/9 + 1/27 + 1/81 + ....An interesting property shows up here too. The summation of 3^n where n tends to minus infinity is a convergent series that equals exactly to .5
In other words, if we added an infinite string of tristate numbers after the tristate point, we could at best make up a number no greater than .5 So to define .5 - we would run into an infinite string of digits, although reaching 99% of the value in 5 digits of tristate (trits). And we could use one of the other values in the middle to reach any other point in the middle. But definitely, we can cover this whole zone between 0 and .5 with great accuracy. BUT, this covers exactly only half the length between 0 and 1 on the number line. Whereas the binary system covers the whole zone between 0 to 1 because summation of 2^-n and n tends to infinity is equal to 1. This might appear unpromising at first sight, for tristate, but as we shall see below this is exactly what should be expected if we are to move the tristate miracle down to the real domain representation. This will be resolved by a two pronged approach. For numbers greater than .5 and less than 1 we shall use the same numbers but expressed as subtracts from 1. This bi-directional zooming ( z and 1-z) can get us to any point in the number line. Positive
fractional numbers for all z such that (.5 < z < 1) the numbers get expressed as +.-tristate, for example +.-+0- or +.00-+0- (hence the part after tristate point as subtracts from unity) Negative
Fractional numbers But as a pay off from this two pronged approach to reaching a number on the real plane quickly which would result in far greater resolution. By resolution I mean that we can represent fractional numbers far more accurately without running into huge strings of numbers after the tristate point. The beauty is that this convention we have just chosen turns out to be the natural one because the resultant tristate numbers work through the arithmetic operations with the same generality. This is illustrated later. This is the inventive step. The discrete has become truly continuous. Lets
try to represent a few numbers as tristate fractional numbers. 0.4389 =
To represent a number between .5 and 1 Lets say the number is 0.7182818 This number is larger than .5, so we shall find the 1s complement of it. (subtract from 1) which is equal to 1 - 0.7182818 = 0.2817182 .2817182 =
*The 1/6th values and balance are compared at every stage. Red>Green. When the magnitude of the balance is less than 1/6 value, the next digit is a zero. This is as per the algorithm discussed later. There is an interesting variation to this worth studying. .2817182 = 0.+0---++0+0+---++
Therefore -.2817182 = 0.-0+++--0-0-+++-- [ Inverting the bits ] Therefore .7182818 = +.-0+++--0-0-+++-- [ Expressed as 1 - z ] If we add 2 (+-.0) we get
+-.0000000000000000 Therefore, the Euler number e = 2.7182818 can be expressed as +0.-0+++--0-0-+++-- *Note: Why 1/6 value ? Algorithm
for fractional numbers
The algorithm is
For
negative fractional numbers |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The
representation of the number zero |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Irrational
Real numbers I would like to experiment with reaching the values of some of the traditional irrational numbers like pi, e , roots of prime numbers etc using the tristate numbers and see if it results in any efficiencies or patterns. Some of these are are called transcendental numbers because it is provable that they are not roots of any polynomial expression. May we explore these for patterns. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Resolution How does the resolution of a tristate number compare to the binary system for an arbitrary rational number? The following two figures are about a similar question being asked by Brian Hayes for base 2 and base 3 systems, as compared to the base e.
But tristate
is more than just ternary. 0.4389 =
In this arbitrary example, we find that the tristate is more efficient than the base 3 at every point along the resolution. It is apparent why this ought to be the case. The tristate system has exactly the same pieces but it can be opportunistic about it. This gives it an advantage. How can we quantify that advantage. We can see that towards the end the tristate numbers are accurate by many folds over their Base 3 counterparts. Equiprobable? Perhaps, we have now reached the theoretical limit of packing numbers into digits. Let us get further insight by considering a worst case scenario for tristate. Consider the case of .5 which is pretty much one of the worst case. Any other case is expected to be equal or better. .5 also happens to be one of the worst cases of base 3 and performs similarly. .5 = 1/3 + 1/9 + 1/27 + 1/81 + .... = .333333 + .111111 + .037037 + .012345 +
= 67% of the target value in first significant digit
89% of the value in the second digit
98.76% of the value of the target number in the
first four significant digits
99.58% in the first five digits
with the next digit it goes to 99.86% accuracy. Therefore .5 = .++++++(tristate) If 99.5% in first five digits is the case with .5 which is the worst case, we can expect to do better than this for any other arbitrary number on the number line. In binary system, .5 would be expressed to 100% accuracy in just one significant digit (0.1binary) after the binary point, but thats the best case scenario for the binary system. It would be nowhere nearly as good if it were to express .51785 for example, a number only 3.5% away from .5 In the end, we have to analyse which systems produce best results overall for most points on the number line. That is the point I am trying to make. Some formal treatment may be in order. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Simple and Efficient Operations Another exciting feature that follows is the much more efficient and simplified algorithm for mathematical operations. The Tristate system appears to be nature's chosen one. Addition The ground
rule are pretty much like normal arithmetic with the following rules,
carried out right to left. Commutative and Distributive laws apply. Examples
+++-+0
345 Addition of two fractional numbers Align the radix point (tristate point) and plain add.
0.++00--
.4389 The rules
are Commutative and Distributive laws apply. Example
+0-+0
75 Multiplication of two fractional numbers +0.-0+++--0-0-+++--
2.7182818
The result is +.+--+-0-+-+-0+0++00+++0-++
which is equal to 1.1930720112 calculated
upto the 16th place. The result varies from the 5th place of
tristate point because one of the operands .4389 was only calculated
to the 4th place of tristate.
Division
One of the strategies could
be working with reciprocals. For example if m/n is to be determined, we
could work with m x 1/n The terrain of the tristate has been so
fecund so far that we could perhaps find a relation between the expressions
of n and 1/n. If we could do that we shall have an easy operation for
division. It should be expected that an easy transform should exist because
division is a basic mathematical operation and only an inverse of the
multiplication operation. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The many advantages to computing systems have been outlined above. We only need to implement them to demonstrate. George Boole - an English mathematician in 1850s formulated some rules of formal logic using logical constructs like the AND OR NOT etc called the Boolean Algebra. Many often confuse Boolean Algebra as one and the same as binary computers or binary arithmetic. Boolean Algebra uses two truth values - True and False, hence his system in bivalued. Binary is also bivalued - zero and one, but the similarity ends there. The constructs of AND NOT OR were later created in hardware in the form of logic gates in binary hardware. But there is no reason to think that these gates cannot be created in trivalue systems. Sometimes, I have heard people say we cant have trinary computers because we would have to reinvent Boolean Algebra. We dont have to. In fact a trivalued system (and our tristate in particular) may have some unique advantages in predicate calculus, as described below. Some hardware attempts for trinary has been done in the past. We might gain from their past work. It should be simple to extend from binary systems because the additional symbol used is zero - which stands for neutrality and goes unchanged in most/all transforms. The opposite of true is false. The opposite of one is not zero. However the opposite of positive is negative. Tristate would allow you to define truth values in varying magnitudes which can simply add or nullify each other. This should be more useful for formal logic, especially if they have to deal with tautologies which are not black or white but shades of gray. Fuzzy logic for example. Suppose they had to sum them up or do other transforms on them, like multiplication or matrices. There are also a class of statements which are neither true nor false, perhaps, meaningless, unknown, indeterminate. The neutrality symbol could come useful for that sort of argument. There have been many who have suggested a third value for truth including Aristotle, William of Occam of Occams Razor fame and many others subsequently. Łukasiewicz worked on his own three-valued propositional calculus, which with just 3 axioms is the most elegant axiomisation of propositional logic and is most used today. And there exists a discipline called Multiple valued logic. A friend is working on designing an Universal Turing Machine based on tristate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3-ary
systems Our 8PSK and 16PSK systems are an evolution from the the above. What if we could have 3 PSK and 9PSK instead. Perhaps 3 axis's could be more efficient than our current quadrature based designs. It could perhaps be easiest to resolve these points in a spectral constellation diagram. The dendritical structure of tristate numbers look so much like a trellis.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data
Compression One of the ways, to achieve greater data compression lies in our ability to define a point on the number line more and more efficiently (accurately using less digits). As we have established that tristate is efficient in representing numbers, a compression will definitely arise out of it. Also the beauty of tristate lends naturally to progressively encoded information, a situation whose applicability is in all data communication. We shall need to design our algorithms which could take advantage of this. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Applications of the Tristate concepts in other fields.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||