Representation vs. Value

Introduction

Someone places three oranges on a table, and asks you how many oranges you see. You say "3". There is an abstract idea of what 3 means. When someone asks you to make three marks or three noises, you understand what three is.

However, when you write three down, you use one mark, namely 3. This is knowng as a representation. This mark represents the abstract idea of 3.

Other languages use different representations. For example, in Roman numerals, you write it as III. In Chinese, it's written with three horizontal marks. Interesting, both these representations also accurately make the number of marks equivalent to the abstract idea.

However, that would get very cumbersome very quickly. In Roman numerals, you write X, which is a single symbol, and in Chinese, you don't use ten marks to write down the representation for 10.

Representations allow us to write ideas, preferably in a compact way. However, there are many different representations. For example, we've just seen a representation of 3 in three different languages.

However, representations don't necessarily involve new symbols. For example, what number is 10. Do you think of ten? What if I tell you that it's not in base 10. What if I say it's in base 2?

There's a joke that goes "There are 10 kinds of people in the world. Those that understand binary, and those that don't". The joke is that 10 is not in base 10, but in base 2. Thus 10, in base 2, is the number 2.

Notice we have the same symbols but they are in different representation systems. One is base 10, one is base 2. The meaning of that representation depends on the representation system you're in.

Arabic Numerals

Arabic numerals (also known as Hindi numerals---these are the conventional numbering system we use) have an intriguing property. You can do math with it.

Think about adding some number like 111 to 123. To do this addition, you add in columns. You add 1+3 to get 4, 1+2 to get 3, and 1+1 to get 2. So, the answer is 234.

You may not have thought much about addition. After all, you learned it when you were very young. However, this kind of addition is a shortcut.

True addition works like this. Imagine you have a bowl full of beads. Lots and lots of beads. To add two numbers, you count out the number of beads equal to the first number, then continue counting out another stack of beads. Thus, you count 111 beads one at a time.

Then, maintain 2 counts. Start a new pile, and count to 123. In the meanwhile, continue to count from 112. When you reach 123, the other count should end at 234, which is the sum.

Clearly, this kind of addition is very slow. The larger the number is, the more work it is.

Adding using Arabic numerals allows you to add two large numbers by adding the digits of the number (plus carrying values). This usually means about O(log n) small additions, which is much better than O(n) steps of counting.

Similar tricks can be used to compare numbers, multiply numbers, and so forth. Good representations allow to perform arithmetic quite conveniently.

This is an important observation. Just try doing math in Roman numerals, and you realize it's a mess. Add 21 to 29, and you have XXI added to XXIX. Doing the addition involves lots of fancy tricks. You're likely to go back to base 10 and perform the addition this way.

If doing arithmetic is so difficult in Roman numerals, how did people do arithmetic? The answer is probably the abacus. If you use an abacus, then doing arithmetic is not based on the representation of Roman numerals, but based on representation on the abacus itself.

The convenience of Arabic numerals, and perhaps the main reason it's used, is that you can perform math on the representation itself.

Summary

To conclude, a representation is a way for us to write down a concept. A representation of a value is some symbols we use to convey the abstract notion of a value. Thus, we write "3" but think of three things.

Occasionally, the representation of the value is as much sense as we can make of a value. For example, consider 1,000,000 which is a million. We can write it down. We know how to count to a million, though it would take a long, long time, but it's really hard to truly conceive of the concept. Put 1,000,000 oranges, and it doesn't seem that much different from 999,999 oranges.

A mathematician once said that 1,000,000 had no real meaning to him. 3 had a meaning, because he could visualize 3. He couldn't really visualize 1,000,000 of anything and that the only thing 1,000,000 meant was what the properties of math said it meant. That is, he could perform arithmetic on the representation and get correct answers in the representatin, but in the end, they were merely representations.

That's a very perceptive view about representations. If the numbers are suitably large, pretty soon all you understand about the number is how to manipulate it. Being able to visualize what the number means abtractly becomes nearly impossible.

Throughout the notes, I will try to keep the notion of representation and value distinct. A representation means something (i.e., it has semantics) only in some representation system. Thus, the same representation can map to different values depending on the representation system.

For example, we've already said that 10 might map to the idea of ten or two, depending on whether we have a base ten representation or a base two representation. This is an example of the same representation mapping to two different values. The meaning depends on the representation system.

(Notice that I had to resort to using words like "ten" and "two" to convey the idea of representation---I almost wrote base 10, in which case, it may have made you wonder, is that base ten or base two. "ten" and "two" are also representations, but you can't do much math with the representation).

Mostly, you're going to be very aware that we're talking about a representation. That's because most people don't feel nearly as comfortable in binary as they do in decimal (base ten). When you lack that intuition, you tend to be aware that what you see is a representation, instead of equating it with the value associated with the representation.

Keep the idea of representation, value, and representation systems in mind as you read about various representations of signed and unsigned ints.

Web Accessibility