Representation of Numbers (Part
1)
ONE
FOR ONE TICK MARK REPRESENTATION
Numbers can be expressed with tick marks like so:
| | |
= |
one |
| || |
= |
two |
| ||| |
= |
three |
| |||| |
= |
four |
| ||||| |
= |
five |
Here, each tick mark represents one. Large numbers are
difficult to represent this way.
TERMINOLOGY
The following are terms and their definitions as used in
these tutorials.
- Alphabet: any collection of symbols called
letters
- Strings: series of letters from an alphabet
- Words: certain strings
- Language: an alphabet with words
Example: With this definition, English when
stripped of its meanings is a specific case of a language.
An example of a strings is gibberish such as 'asdfghj', and
an example of a word is one that means something such as
'cab'. However, the actual interpretation of a cab as a
vehicle is not necessary for a language according to the
above definitions.
Example: The language, which will be called
L is defined below.
- Alphabet (letters separated by spaces): a b
c (LOWERCASE ONLY)
- Words: anything with a as the rightmost letter
We can't possibly list out all strings and words of this
language, L, as they can be arbitrarly long, but
below are some examples (using the alphabet and words
defined above):
- Strings AND Words of L (strings separated by
spaces): a ba caaaa baacaa cba aaaacaaabaaa aaaaaaaaa
- Strings BUT NOT Words of L (strings separated
by spaces): c cab bbaaac caaac aaaaab ab abc
- NEITHER Strings nor Words in L (separated by
spaces): bAc Cab xylophone aqua abc.a aged ale
Note that Cab, aqua, xylophone, aged, and ale are all
strings and words in the English language but NOT in
L because of the restriction of the alphabet (no
capital A or C, no period, and in general no letters other
than a,b, or c). Also cab is not a word in this language,
L, because of the requirement that all words have an
'a' as their rightmost letter.
WHOLE
NUMBERS IN A TWO-LETTER ALPHABET
We now consider a language that will be called WHOLE
BINARY defined below:
- Alphabet (letters separated by spaces): 0
1
- Words: 0 AND any string whose leftmost letter is
1
The computer stores all information using WHOLE
BINARY. For the purpose of these tutorials, we'll only
be using this language to express whole numbers (zero, one,
two, three, etc.). However, giving meanings to words is a
topic covered in the next section. This tutorial is
concluded with exercises meant to exhibit the power of such
a representation and test your understanding of definitions.
Exercise 1.1.1: How many different one-letter,
two-letter, three-letter, and four-letter STRINGS are there
in WHOLE BINARY?
Exercise 1.1.2: How many different one-letter,
two-letter, three-letter, and four-letter WORDS are there in
WHOLE BINARY?
Representation of Numbers (Part
2)
Back to the Tutorial Index
©2006 Jason Schanker