2008-10-24
AltSci Concepts

Computer Journal

Computer Journal
back
AltSci Concepts Small Wide World US$20
Small Wide World
Small Wide World

Base-N Math Without Zero

by Joel R. Voss aka. Javantea
jvoss@altsci.com
June 2, 2008

Can I do base N math without zero? Of course. We just pretend that zero doesn't exist. Let's do base 10 without zero.

1 2 3 4 5 6 7 8 9 11
The first thing I notice is that there are only 9 in the first set and no ten. So we end up skipping 10. it becomes a base-9 setup, right? 11 is the 10th number. But 11 means 10 * 1 + 1. If it's base 9 it's 9 * 1 + 1 = 10. Does this make sense?

Thesis: It is possible to create a valid mathematical representation of numbers without the use of zero.

The roman numeral is base 10 without a zero, right?

i ii iii iv v vi vii viii ix x
xi xii xiii xiv xv xvi xvii xviii xix xx
The above does make sense. Each row has 10 and each row makes sense.

Let's do base 4 like the above, but with my idea injected:

a b c d
da db dc dd
the above makes sense because I have 1 2 3 4, then 4+1 4+2 4+3 4+4. But wait there's a problem, what comes after dd? dda 4+4+1, yowch. It works though.

I could even use decimals:

1 2 3 4 41 42 43 44 441 442 443 444 4441 4442 4443 4444
Does this make sense in a hex conversion? Only if you add the zero.
0001 0002 0003 0004 0005
What does it look like in a base 4 with zero?
0 1 2 3 10 11 12 13 20 21 22 23 30 31 32 33 100 101 102 103...

Using my system, it's much more ugly for large numbers, but who uses large numbers anyway? What if the biggest number I use is 26? 444-4444=28. If I wanted, I could use the position of lesser numbers to give me more digits.

Lemme see if that works: 4444, 4443, 4434, 4344, 3444, 4442, 4424, 4244, 2444, ... so now the numbers are just code. How many of them can I make with 4444? It's 1111 1112 1113 and so on, so it's 4^4 256. Since I only need 64, I could use 4^3 instead. The problem is that this is acting like this is a code designed by someone with a zero, right? Well... let's analyze it eh?

We aren't really adding anymore, what are we doing?

Delimiter required.

1 2 3 4 (4)
11 12 13 14 21 22 23 24 31 32 33 34 41 42 43 44 (4*4)
(4*4*4)
111 112 113 114 121 122 123 124 131 132 133 134 141 142 143 144
211 212 213 214 221 222 223 224 231 232 233 234 241 242 243 244
311 312 313 314 321 322 323 324 331 332 333 334 341 342 343 344
411 412 413 414 421 422 423 424 431 432 433 434 441 442 443 444

5 = 11, 6 = 12

It's just like zero based without the zero wowza..
Triumph of non-zero base N math, who would've guessed.

5 = 4*1 + 1, 6 = 4*1 + 2, ... Let's take a look at the larger.
21 = 2*4 + 1 = 9 correct
44 = 4*4 + 4 = 20 correct
111 = 4*4*1 + 4*1 + 1 = 21 correct
144 = 4*4*1 + 4*4 + 4 = 36 correct!
444 = 4*4*4 + 4*4 + 4 = 84 correct...

Why do we need zero again?

Assume that we don't have delimiters and only want to use 21 - 84 (assume that 1-20 exist, but we don't use them for our alphabet and thus are able to write text in 21-84). Then our text will look like:

25 = a = 121, ... 51 = z, 52 = space, 61 = 1, 62 = 2, 63 = 3, 64 = 4.

b = ['111', '112', '113', '114', '121', '122', '123', '124', '131', '132', '133'
, '134', '141', '142', '143', '144', '211', '212', '213', '214', '221', '222', '
223', '224', '231', '232', '233', '234', '241', '242', '243', '244', '311', '312
', '313', '314', '321', '322', '323', '324', '331', '332', '333', '334', '341',
'342', '343', '344', '411', '412', '413', '414', '421', '422', '423', '424', '43
1', '432', '433', '434', '441', '442', '443', '444']
aoffset = 25

this is a test --> 224 134 141 223 243 141 223 243 121 243 224 131 223 224
Simple enough if you're interested in that sort of thing.

Method

math1.py
def dec2base4nozero(dec):
	b = """0 1 2 3 4 11 12 13 14 21 22 23 24 31 32 33 34 41 42 43 44 111 112 
113 114 121 122 123 124 131 132 133 134 141 142 143 144 211 212 213 214 
221 222 223 224 231 232 233 234 241 242 243 244 311 312 313 314 321 322 
323 324 331 332 333 334 341 342 343 344 411 412 413 414 421 422 423 424 
431 432 433 434 441 442 443 444""".split()
	b[0] = ''
	if dec >= len(b):
		return ""
	#end if
	base4nozero = b[dec]
	return base4nozero
#end def dec2base4nozero(dec)

def base4nozero2dec(base4):
	dec = 0
	base4r = ''
	for c in base4:
		base4r = c + base4r
	#next c
	n = 0
	for c in base4r:
		dec += int(c) * (4**n)
		n += 1
	#next c
	return dec
#end def dec2base4nozero(base4)

print '1   = ', dec2base4nozero(1), 'base 4 without zero'
print '2   = ', dec2base4nozero(2), 'base 4 without zero'
print '15  = ', dec2base4nozero(15), 'base 4 without zero'
# Note that 201 is not supported yet, it will return blank.
print '201 = ', dec2base4nozero(201)

print '1   = ', base4nozero2dec(dec2base4nozero(1))
print '2   = ', base4nozero2dec(dec2base4nozero(2))
print '15  = ', base4nozero2dec(dec2base4nozero(15))
# Note that 201 is not supported yet, it will 0 here.
print '201 = ', base4nozero2dec(dec2base4nozero(201))

Usage

When faced with strange ways of looking at the world, we often take for granted that our way of thinking is one of many ways to describe what we understand the world. Learning more about different ways of thinking is helpful for problem-solving skills. For example, given a coded message that contained only 1, 2, and 3, would you convert it to base 4 or base 3? If you assume that a zero exists and is not being used, you will get a different answer. Thus a mathematical system without zero is necessary for systems.

Reverse this using zero, base 5:

224 134 141 223 243 141 223 243 121 243 224 131 223 224
224 = 4 + 2*5 + 2*25 = 64
134 = 44
64 44 46 63 73 46 63 73 36 73 64 41 63 64
36 = a
64 = t
63 = s
t - a = 28
t - s = 1

If we were to reverse this with zero, but correct base 4 we would come up with the correct translation. However, if the coded message didn't use zero and was a mathematical equation, assuming that their 1 is equal to zero would be a miscalculation. Given a small set of data, it is important to use the correct base. Also using a proper assumption of zero or non-zero calculation is important to proper translation.

Zero

Why is zero necessary for math? A simple example of a line on a graph requires zero. A physics problem which determines the height of a ball at a time after being dropped requires a zero. If we use our base 4 mathematical set for the height of a ball over time, we see that at a certain time, we subtract all the height from the ball ending with zero and then negative numbers (assuming no ground at zero). Another use of zero is for power, for example for any number n, n^0 = 1. This is useful for many equations and many equations would not work without a zero. Yet it is still possible to calculate many powers without zero.

But without zero, we can still make many calculations. 4 * 4 = 34 (base 4).

(4^2) / (4^2) = 1.

Bibliography

A quick history of zero and the division by zero

An explanation of zero and the inspiration for the section Zero

Mod level: -1 0 1 2 3 4 5

Comments:

Post a comment
Your Name: Login

Subject:

Comment:

RSS Feed
Home | Login | Others