Araara b — Ashort

Share
Araara b — Ashort

This is the second in a series of expository blog posts on Araara. In the first, we assigned integer values to letters and used concatenation to add them. We will now look at some arithmetic, and at the information we can preserve in different representations of the same number.

O with slash (ø)

Hand-drawn uppercase Ø and lowercase ø, each with a diagonal slash rising from left to right, over soft pastel washes on ivory paper.
O with slash

It would be nice to also have a letter that indicates zero. For that, we will use a lowercase o with a slash:

ø

Fittingly, this is the letter that Bourbaki used as inspiration to denote the empty set by ‘∅’.

Sharp readers will notice that we are now not, strictly speaking, using the English alphabet anymore, as the ‘ø’ does not occur in the English alphabet. So let us denote the following alphabet as ø-English:

ø ab cd ef gh ij kl mn op qr st uv wx yz

Because this is a bit of a clumsy term, we will also simply call this English going forward in a slight abuse of language.

Permutations

In decimal notation, 12 and 21 differ. In Araara, each letter contributes a fixed value, so rearranging letters leaves their sum unchanged. For example:

qqon = qqno = onqq = … = 7291

One number, many representations

We can also change the letters themselves while preserving the sum. These representations are not all rearrangements of one another:

qqon = soprano = sonar = dropsonde = 7291

Throughout, equality means equality of numerical value. Different representations of the same number may preserve different information.

Sign flips

To multiply a number by minus one, just replace each letter with its dual—the inverse partner introduced in the first post: a with b, b with a, c with d, d with c, and so on.

rrpm = -qqon = -7291

Basic arithmetic

Charcoal plus, minus, multiplication, and division signs arranged in a two-by-two grid over green, peach, yellow, and blue pastel washes.
The familiar signs for addition, subtraction, multiplication, and division.

As we already saw, addition is just concatenation.

In ordinary arithmetic, subtraction is often defined as adding the additive inverse.

x - y := x + (-y)

So too in Araara. For example, ec − c = ecd = 5 + 2 − 2 = 5. We replaced the subtracted c with its additive inverse d, and then concatenated. The same rule applies to longer expressions:

hi - world = hi + xpqkc = hixpqkc

Multiplication by a nonnegative integer is repeated concatenation:

hi * 3 = hihihi

And multiplication by a negative integer is repeated concatenation of additive inverses:

hi * -3 = gjgjgj

The empty expression

If we are ever in need of empty expressions that act as an identity for concatenation, we can denote it with ε. Like ø, the numerical value of ε is zero, but unlike ø, concatenating it with an Ashort leaves the original Ashort unchanged, rather than followed by ø. We will return to this distinction later.

Tallying

Four upright charcoal tally strokes crossed by a fifth, terracotta diagonal stroke, against a soft pastel wash.
Five, recorded as a group of tally marks.

Tallying is pretty easy with Ashort. For example:

aaaaa = e = 5

A brown-skinned woman in a pale yellow tennis outfit, ivory visor, and trainers holds a racket on a softly painted court, with a ball near her feet.
A tennis game can be recorded one point at a time.

But we can tally with other increments too. In this tennis record, positive increments belong to the first player and negative ones to the second. ga and hb contribute ±15 for each player’s first two points (check this!); ee and ff contribute ±10 thereafter. Here is an example game:

ga hb ga hb ee ff ee ff ff ee ee ee

After ga, the score is 15–0; after ga hb, it is 15–15. The first eight groups bring us to deuce. The next ff records advantage to the second player; ee brings us back to deuce, and the final two ee groups give the first player the game. The full expression sums to 20, but its written form records how we got there.

Four detached houses in peach, green, yellow, and blue, arranged in two rows, with pitched roofs, front doors, windows, and small garden shrubs.
Houses can be counted by price band.

Or perhaps we want to count houses by price band. Here are some bands, labelled by their lower and upper bounds in euros. Include the lower bound and exclude the upper bound:

ø-y (0-266k)
y-yy (266k-531k)
yy-yyy (531k-797k)
yyy-yyyy (797k-1.063m)

Normal form

To choose one consistent representation, we can write each number in its normal form. This is an agreed representation, not necessarily the shortest one. The normal form of zero is ø.

Normal form is determined by the alphabet and its assigned values. For a positive number, repeatedly append the letter with the largest positive value that does not exceed the remainder, subtracting its value each time. For a negative number, apply the same procedure to its absolute value and flip every letter to its dual.

Here is an example. For thirteen, the largest positive letter we can use is e = 5. Taking two leaves 3; c = 2 leaves 1; a finishes the calculation. Thus thirteen has normal form eeca. Here are the normal forms of our earlier examples:

qqon = qqmkkiiggee (nf)
hixpqkc = vvttrrnnljjfb (nf)
hihihi = iggeec (nf)

Here are some useful properties of normal form:

  • To get the nf of -x, just replace each letter with its additive inverse
  • For positive normal forms, alphabetical order agrees with numerical order

ø normal form

ø normal form is normal form plus an additional ø appended. For example:

qqmkkiiggee = qqmkkiiggeeø (ønf)
vvttrrnnljjfb = vvttrrnnljjfbø (ønf)
iggeec = iggeecø (ønf)
ø = øø (ønf)

Appending ø preserves where a numeral ends without changing its value. Suppose we budget 20 euros for bananas (€2), bread (€3), chickpeas (€1), oat milk (€2), spinach (€2), tofu (€3), and tomatoes (€3). Start with gea = 20, then concatenate each negative cost, terminating every part with ø:

geaø dø dbø bø dø dø dbø dbø

The costs sum to 16, leaving four euros. In the expression above, geaø records the budget, dø subtracts two for bananas, and dbø subtracts three for bread. Each remaining part records another cost. Replacing the whole expression with cc would preserve four, but lose the breakdown.

To also preserve the item names, we could even theoretically write

budgetø geaø
bananasø dø
breadø dbø
...
avchfsø abmbmbtø aqfbcø ...

The item names themselves also have numerical values. The final line cancels their combined contribution, so this still sums to four. Without that cancellation, adding names would change the result.

Returning to our house prices, we can represent each band by its lower bound followed by its width, both in ø normal form. For example, yøyø records a lower bound of y and a width of y:

øøyø (0-266k)
yøyø (266k-531k)
yyøyø (531k-797k)
yyyøyø (797k-1.063m)

Perhaps from yyyy onwards, we would like 531k euro rating bands. That’s easy, just use

yyyyøyyø etc.

Exercise: a soccer match

Let’s also try recording a soccer match. For this exercise, we will borrow three letters from the alphabet introduced in the next post: a represents 1, e represents −1, and o represents zero. These differ from the English-letter values used above.

Write a for each goal by the home team and e for each goal by the away team, in the order scored. Write one o for the halfway break. For example:

aaeoeea

  1. What were the half-time and final scores? What is the numerical value of the full expression?
  2. Write another match with the same final score but a different half-time score.
  3. Can two matches with different final scores have the same numerical value? Give an example.
  4. What information would we lose by replacing the record with just its numerical value?

We have been using the English alphabet for its familiarity. In the next post, we will try another alphabet, and consider how to read these numerals aloud.