Five for five fifty five.

I read about parsers all day. Not surprisingly as I was driving home the signs looked like something to parse. Example:

Fast Food Sign
Can't decide?
Mix and match 5 for $5.55

In an instant it hit me. If a person can't decide what they want, how are they going to deal with all the ways of mixing and matching 3 kinds of sandwiches in groups of five? Just how many sandwich orders are there?

You could let a sandwich represent itself until you ate it, but letting a letter represent it works now and later.

Let A represent a Beef sandwich.
Let B represent a Regular sandwich.
Let C represent a Bar-B-Que.

Sometimes starting to count is as good as counting, 'cause you see the pattern. Counting is called enumeration by computer scientists and countin' by hillbillies. Both like the word "fetch" since it is one word that means "go and get something". Only hillbillies "holler". So let’s start countin':

AAAAA This would be five Beef
AAAAB Five Beef and a Regular
AAABA Three Beef, a Regular and one more for the back seat.
AAABB etc.

But this just looks like countin' in base 3 (3 symbols, A, B, & C).

With 5 significant digits that is just 3^5 power or 243.

So fastFoodStore gives their mixed up customers 243 choices at the worst possible time, when they are hungry.

How many ways are there of hollerin' that order?

We are at the order window now:

Say, yeah, umm, whas up, yeah,

Yeah, umm, I'd lack umm lessee, umm yeah, gimme umm

Now according to page 15 of Parr1, this preamble belongs to a Chomsky class of grammars known as unrestricted grammars. The conversation quickly converges to a quick rat-a-tat exchange of letters which are more easily parsed:

3 A and 1 B and 1 C…

or perhaps

5 A

Only two symbols are necessary to represent the order we previously denoted by AAAAA. Great if you’re telegraphing your order over a noisy channel…

So now we must add to our 243 choices, those combinations which fit the following pattern:

X*A + Y*B + Z*C

where X + Y + Z = 5 sandwiches total.

How many X, Y and Z are there that sum to 5? If we look at this as unique digit patterns occupying columns X, Y and Z we have:

5,0,0
4,0,1
3,0,2
2,0,3
1,0,4
0,0,5

There are six ways of permuting the three columns:

xyz
xzy
zxy
yxz
yzx
zyx

So we have 6 * 6 = 36 additonal ways of ordering.

So barring any additional sauce, which our parser would ignore unless it got between the keys, there are at least 243 + 36 = 279 ways to order "five for five fifty five", which if you have a hard time making up your mind, is punishment for your indecision. There are a few other cases, like, "we don't say 0 Regular sandwiches".

But I didn’t sit at any drive through, I just passed that sign and thought of the mess that simple string of 23 characters made. And after that I thought how each make and model of car looks like a symbol spurting from a hose that some stationary observer could read and see. More symbols, more sentences in a language called traffic flow. Each car a letter in a a unique alphabet. Just read the sentence or play the music its all the same. Try that performance art. But my job is just to to remember that DNA sequences that are writing this message. Which is all a flashback to a book that sat on the shelf through my childhood entitled, “Symbols, Signals and Noise” by John Robinson Pierce. I opened this book just now. I think I will read it and remember with fondness my father’s quest to understand.

- Van Warren
sometime in 2002