…the mathematical formulation of the physicist's often crude experience leads
in
an uncanny number of cases to an amazingly accurate description of a large class
of phenomena. This shows that the mathematical language has more to commend
it than being the only language which we can speak; it shows that it is, in a
very
real sense, the correct language.
– Eugene Wigner (1960)

Albert Einstein writing equations on a blackboard in
1931. He was a master of ex pressing the description of
physical phenomena in mathematical terms.

Claude Shannon of AT&T Bell Laboratories, who
founded the theory of information and introduced the
term bit in 1948. His mathematical work gave the basis
for digital data storage, data compression, and
communication.
HOW TO USE THIS CHAPTER: This chapter reviews all of the mathematics
concepts and
methods that will be used in the text. Readers may choose to study all of this
chapter before
continuing on to the rest of the text, or, instead, go directly to Chapter 3,
and refer back to the
relevant sections when needed. In particular, sections 2.2 through 2.6 are
necessary background
for the main physics Chapters 3, 4, 5, and 7 through 10. Sections 2.7 and 2.8
are helpful for
understanding the computer-science examples in those chapters and in Chapters 6,
8, 11, and 16.
Section 2.9 is helpful background for Chapter 14 on lasers.
2.1 The Utility of Mathematics in Science and Technology
An important part of learning about physics is to learn how to use the
language of
mathematics to describe physical phenomena. As the Hungarian physicist Eugene
Wigner said in
the quote above, mathematics is an extremely effective language for describing
nature and its
behavior. In our discussions of the inner workings of computers, lasers and
optical fibers, we will
encounter many situations that beg for a mathematical description. Such a
description allows us
to summarize a large number of possible phenomena by a single compact equation.
It also allows
us to predict the behavior of a physical device before we ever build and test
it. This allows
proper design of practical devices such as lasers, fibers, compact disk players,
etc. Throughout
this text, we will study examples in which we can describe physical phenomena
using
mathematics, but with a minimum amount of mathematical detail.
In this chapter, we will review several mathematical techniques and tools
that will be used in
the rest of the text. One indispensable mathematics technique is the use of
scientific notation for
representing very large or very small numbers. For example, it is easier to
write 106 than to write
1,000,000. A convenient tool for discussing physical phenomena is the method of
prefixes to
represent large or small quantities. For example, it is easier to say kilometer,
or km, than to say
one-thousand meters. Another common tool is the use of graphs to represent a set
of data or
numbers. In addition, the concepts of digital and ana log quantities are critical
to understanding
computers and the Internet.
Because this text integrates discussions of information technology with the
study of physics,
it is important to appreciate the way in which computers represent information
in terms of
numbers. In this chapter, we will study the concept of binary numbers, which is
the language that
computers use. In the binary number system, we use only two digits: 0 and 1.
Each digit is called
a bit, and eight bits make a byte. We then can talk about kilobytes and
megabytes as measures of
the amount of storage space, or memory, in a computer. An important question is
how much
information can we store in a particular-sized memory, say 80 megabytes? To
answer this, we
need to understand how to count or measure information. The mathematics behind
the theory of
information was discovered by Claude Shannon, pictured above, who was one of the
founders of
the Information Age. His theories guide scientists and engineers in
understanding and designing
information-handling systems such as the Internet.
2.2 Graphs
Graphs are used for representing data (numbers) that change as time
progresses. A simple
example is given by parents who record the height of their growing daughter by
marking her
height on a wall. Let’s say that they record her height once every January 1st.
Each time they
record it, she moves to the right by one step, so that the marks make a pattern
on the wall as
shown in Figure 2.1. The recorded heights, measured in inches (to the nearest
0.1 inch), are:
17.9, 23.4, 27.2, 30.4, 33.7, 37.3, 41.4, 45.8, 50.0, 53.8, 56.9, 59.2, 60.7,
61.7, 63.1.
The axis labeled time is called the horizontal axis, and the axis labeled
height is called the
vertical axis. We read the graph by “going up and to the left,” or by “going to
the right and
down.” The example shown by the dashed lines can be read as, “At age 3 years the
child
measured 27.2 inches in height.” To illustrated going to the right and down, we
could ask the
question. “At what age did she measure 50.0 inches?” Answer: 9 years.

Figure 2.1 A child’s height (measured in units of inches) graphed versus time
(measured in
units of years).
If instead the parents had recorded her height every six months, the data
might look like that
graphed in Figure 2.2, with twice as many points. If the parents recorded her
height every day,
there would thousands of data points, packed so closely together that they
nearly make a
continuous curve, as in Figure 2.3. This illustrates that height versus time is
a smooth curve—we
say that height is a continuous, or analog, variable. The girl’s height changes
continuously as
she gets older.

Figure 2.2 A child’s height graphed versus time, with one data point every
one-half year.
Time is also a continuous variable. Between any two points on the time axis,
for example,
between 8 and 10 years, there are an infinite number of points. By this, we mean
that any time
interval (say one year) can be divided into arbitrarily smaller intervals, with
no end to the
process. Years can be divided into months, months into days, hours, seconds,
milliseconds,
microseconds, nanoseconds, etc. In practice, it is not possible to measure a
continuous variable at
every possible time, but the concept of continuous variables is useful
nevertheless.

Figure 2.3 A child’s height graphed versus time, represented as a continuous
curve.
In the examples shown so far, the horizontal axis represents time and the
vertical axis
represents height. Of course, these can represent other quantities. For example,
say we want to
describe the temperature of the air in a room containing a fireplace in one
corner and an open
window in another corner. We could make a graph, with the horizontal axis
representing position
and the vertical axis representing temperature. The temperature is a
continuously changing
quantity, so a smooth curve would again be appropriate in a graph of temperature
versus
position.
2.3 Precision and Significant Digits
In the example in the previous section, the heights of the growing child were
measured and
given to the nearest 0.1 inch. The first few measurements were: 17.9, 23.4,
27.2, 30.4. Here we
say that 0.1 inch is the precision of the measurements. The precision of a
measurement refers to
the fineness with which the measuring process can distinguish between two nearly
equal values
of a continuous quantity.
Instead of measuring to a precision of one tenth of an inch, the parents
could have been less
careful and measured only to a precision of one inch. In that case, the first
four measurements
would have been recorded as: 18, 23, 27, 30. The original numbers have been
rounded off to the
nearest inch.
Or, if the parents wanted to be far more precise, they might have tried to
measure to a
precision of 0.01 inch (one hundredth of an inch). This would not be a very
useful effort, because
a person’s height is not meaningful at this level of precision. A person’s
height can change
depending on her posture, or even her hairstyle. It is important in any
measurement situation to
decide to what level of precision a number should be recorded.
Figure 2.4 shows several rulers, which are used for measuring distance. The
first one has a
mark at each 1-meter distance. (A meter is roughly the length of a six-foot-tall
person’s leg.)
Such a coarse ruler would not be very useful, unless it were hundreds of meters
long, in which
case it could be used for measuring, for example, a large distance between two
trees in a park.
The second ruler shown has each meter divided into ten equal parts, providing
higher precision.
The third ruler, shown up close, provides still higher precision, with each
meter divided into one
hundred equal parts, each having a length of one centimeter, or cm. The third
ruler allows you
measure distance with higher precision than you could using the other rulers.

Figure 2.4 Three rulers having different levels of precision: 1 meter, 1/10
meter, and 1/100 meter.
Relative precision describes the precision of a number compared to the
value of the number
itself. That is, it is the ratio of the precision and the number itself:

For example, if we are given the number 24.8, then the precision is 0.1 and
the relative precision
is 0.1÷24.8 = 0.004. We can state this relative precision as 4 parts in 1000.
Quick Question 2.1 (answer at chapter end)
Say that a long jumper clears a distance of 19.56 feet, and a second jumper
clears 8/9
of this distance. Calculate the value of the second distance, using the same
number of
significant digits as the first.
A digit is one of the symbols making up a number. For example, in the number
78.3, each
symbol 7, 8, and 3 is called a digit. Significant digits are those digits in a
number that actually
convey useful information. For example, if an item in a store regularly costs
$2.99, and it is
marked down by one-third, you could calculate its price as $2.99×(2/3) =
$1.9933333..., where
the digits repeat forever. Because we are talking about money, it makes sense to
round the
number to $1.99, a number having three significant digits.
For the purpose of counting the number of significant digits, it is
irrelevant where the
decimal point (.) is located. For example, the number 1.99 and the number 19.9
both contain
three significant digits.
Sometimes the zero digit 0 can be a significant digit. For example, the zero
in 705 is
significant. On the other hand, the zero in 450 may or may not be significant,
depending on the
intent of the person writing it. If he meant 450, and not 460 nor 430, then it
is not significant. But
if he meant to say “really” 450, and not 451 nor 449, then the zero is
significant. In this case, he
could indicate that the zero is significant by adding a decimal point, and write
“450.” to represent
the number.
Real-World Example 2.1 Precision of Display Pixels
Computer screens display images by lighting up many separate pixels
(picture elements),
which are small box-shaped regions arranged in a rectangular array. Each
possible color for a
pixel is represented by using a different number. For example, a 20-inch
monitor with 1680 ×
1050 resolution has 1680 × 1050 = 1,764,000 image pixels.

Figure 2.5 Each image pixel can show a different color. This is done
by subdividing each
image pixel into three colored subpixels, and varying their relative
brightness. For example, a
computer might use a different whole number between 1 and 4,096 to
represent each of 4,096
distinct colors. The precision in this case is 1, while the relative
precision is 1 in 4,096. A screen
with higher color resolution might use 524,288 distinct colors, each
represented by a different
whole number. The relative precision in this case is 1 part in 524,288. |
2.4 Large and Small Numbers and Scientific Notation
When working with numbers that are very large or very small, it is not
convenient to write
them out in long hand. For example, the distance from the Earth to the Sun is
about
150,000,000,000 meters. Instead of writing all these zeros, we could say that
the number equals
150 followed by nine zeros. This means 150 × 1,000,000,000, or 150 times one
billion. A shorthand
way to write one billion is 109, or ten raised to the ninth power. This means
10×10×10×10×10×10×10×10×10. The following table summarizes the powers of ten.
The
powers (numbers in superscript) are called exponents.
|
Powers-of-ten notation |
| 1 = 100 |
one |
one |
| 10 = 101 |
ten |
ten |
| 100 = 102 |
ten-squared |
hundred |
| 1,000 = 103 |
ten-cubed |
thousand |
| 10,000 = 104 |
ten to the 4-th power |
ten thousand |
| 1,000,000 = 105 |
ten to the 5-th power |
hundred thousand |
| 10,000,000 = 106 |
ten to the 6-th power |
million |
| 1,000,000,000 = 109 |
ten to the 9-th power |
billion |
| 1(and n zeros) = 10n |
ten to the n-th power |
|
In scientific notation, we write a number with one digit to the left of the
decimal and one or
more digits to the right, depending on what level of precision is wanted. For
example, the Sun-
Earth distance is written 1.5×1011 meters. To determine that the
correct power of ten equals 11 in
this case, we can write 150 as 1.5×100 or 1.5×102, and then write

The form for writing a number in scientific notation is shown schematically
by:

Each empty box indicates a place where a whole number goes. More or fewer
than two boxes
can be used to the right of the decimal point.
The previous calculation illustrates a general rule. To multiply two numbers
containing
exponents, add the exponents. For example,

To divide two numbers, subtract the exponents. For examples:


Next, consider the example:

How did we know that
? It is a rule that
for any exponent n, we have
.
This rule is a result of the subtracting-exponents-for-division rule. For
example:

The following table summarizes the negative powers of ten.
|
Negative Powers-of-ten notation |
| 0.1 = 10-1 |
tenth |
| 0.01 = 10-2 |
hundredth |
| 0.001 = 10-3 |
thousandth |
| 0.0001 = 10-4 |
ten to the minus 4 power |
| 0.00001 = 10-5 |
ten to the minus 5 power |
| 0.(n-1 zeros)1 = 10-n |
ten to the minus n power |
To multiply two numbers, break up the numbers, multiply, and recombine them.
For
example,

To write this in scientific notation, with one digit to the left of the
decimal point, write:

To divide two numbers, break up the numbers, divide, and recombine them. For
example,

Example 2.1
Say the budget deficit of the U.S. in a certain year is 300 billion dollars.
How many dollars is
that per citizen? Assuming the population is 297,000,000, divide:

Example 2.2
How many data pits are on the surface on a compact disk? A CD has an area of
about 100
square centimeters. Each pit, representing digital data, on the surface occupies
an area of about
10-8 square centimeters. The ratio of these areas gives the number of
pits:

Example 2.3
How many toothpicks can you get from one giant tree? Say one toothpick has a
volume 30
cubic millimeters (that is, 1mm×1mm×30mm) and a giant tree has volume 1011
cubic millimeters
(that is, 1000mm×1000mm×100000mm). The ratio of these volumes gives the number
of
toothpicks:

(The symbol
means approximately equal
to.) That is over 3 billion toothpicks. Notice that
the answer has been rounded to two digits, since a more precise answer would not
be
meaningful, given the rough nature of this estimate.
Think Again—If you are not told how many decimal places (digits) to
include in an
answer to a calculation, how can you decide this? Usually, the information given
in
the statement of the problem will guide you. If you are not sure, a good rule of
thumb
is to write the answer in scientific notation using three digits, one before the
decimal
and two after.
2.5 Units for Physical Quantities
When dealing with quantities, or amounts, of a certain substance, such as
water, or something
more abstract such as wealth, it is helpful to have shorthand names for various
amounts of the
thing of interest. For example: a ton of bricks, a gallon of water, six
kilometers of distance, two
kilowatts of power, five amps of current, four dollars of money. The terms ton,
gallon, kilometer,
kilowatt, amp, and dollar are examples of units.
A unit is a name given to a specific amount of something that is measurable.
Often there are many ways to express the same quantity by using different
units – four
dollars is the same as four hundred cents, and six kilometers is the same as six
thousand meters.
To explain the distance between Seattle and Boston, you could say 3,045 miles;
or 4,901 km, or
4,901,000 meters.1 The numbers used are different, but the distance is the same
in each case.
2.5.1 Metric-System Units
The units used throughout this book are metric units (meters for length,
kilograms for mass,
seconds for time, newtons for force, etc.). They are part of a standardized
system called the
Système International, or SI for short, which was adopted by the international
science and
engineering community in 1960.
Instead of always writing or saying the powers-of-ten notations for large or
small numbers,
people like to use prefixes to represent these. You are probably familiar with
some of these
terms, such as kilo in kilometer, and mega in megabyte, megawatt, or megabuck.
You might
have heard the term nanotechnology. This refers to technology constructed at the
nanometer
(10-9 meter) scale. The following table gives the prefixes, along
with their values and their
abbreviations.

We measure length, position, or distance in the metric units of millimeters
(mm), meters (m),
or kilometers (km). Of course, we could also use inches, feet and miles, but
these are harder to
calculate with than metric units.
|
LENGTH |
| 1 kilometer |
= 1 km |
= 103 m = 0.621 mile |
| 1 meter |
= 1 m |
= 39.37 inch (about 1 yard) |
| 1 centimeter |
= 1 cm |
= 0.01 m = (1/100) m = 10-2 m = 0.394 inch |
| 1 millimeter |
= 1 mm |
= 0.001 m = 10-3 m (thickness of a dime) |
| 1 micrometer |
= 1 μm |
= 10-6 m (size of bacterium) |
| 1 nanometer |
= 1 nm |
= 10-9 m (size of large molecule) |
We measure volume in the metric units of cubic meters (m3), or
more commonly, liters 
which is the volume of a cube whose edges are 10 cm long.
We measure time in units of seconds, abbreviated sec or simply s.
|
TIME |
| 1 second |
= 1 sec |
(about one heartbeat) |
| 1 millisecond |
= 1 msec |
= 0.001 sec = 10-3 sec (flap of housefly wing) |
| 1 microsecond |
= 1 μsec |
= 10-6 sec (high-speed strobe light flash) |
| 1 nanosecond |
= 1 nsec |
= 10-9 sec (time for light to travel one foot) |
| 1 picosecond |
= 1 psec |
= 10-12 sec (time for one vibration of a molecule) |
Units will be introduced for other quantities throughout the book as needed.
An important part of learning about science and technology is learning how to
calculate
physical quantities in real-life situations. This is useful in everything from
estimating your home
heating bill to understanding how computer circuits work. Here we will study a
systematic
method for calculating quantities involving units.
Consider a car traveling with speed equal to S. The formula for the distance
(D) traveled in a
certain time (t) by the car is: D = S⋅t . Common sense tells us that if the
car’s speed is one
hundred kilometers per hour (100 km/hr), and the car travels for 2 hours, the
distance it covers is
200 km. That is,
D = (100 km/hr) • (2 hr) = 200 km
There are several equivalent ways to write one hundred kilometers per hour:

The word “per” acts like division (÷) for the units.
Let’s analyze the distance calculation in more detail:

The hr unit appears both in the numerator and the denominator and it
therefore cancels, just as in
ordinary fractions involving numbers or variables; for example,

Notice also that we must use values of the speed and time that are
compatible, in the sense
that the unit of time (hours) will cancel properly, as in the above example. If
instead we were to
give the time in minutes (120 min) and put this into the formula we would get

Written this way, the minutes and hours units do not cancel, and we get a
result that is hard to
interpret. To remedy this, we need to use the method of conversion factors.
2.5.2 The Method of Conversion Factors
In the preceding example, we were left with the awkward units min/hr, which
we want to
eliminate . We know that there are 60 minutes per hour; this means that there are
(1/60) hour per
minute. Another way to say this is that 60 minutes equals one hour, 60 min = 1
hr. This means
that 60 min divided by 1 hr equals 1,

In this equation, the “1” on the right-hand side has no units. This is called
a conversion factor,
and we write “CF” near the bottom of the bracket to remind us. It is also true
that 1 hr divided by
60 minutes equals 1:

We can multiply any quantity by either of these conversion factors without
changing the
quantity’s value. Consider a simple example: What does three hours equal in
minutes?

The numerical value (3) has been changed (to 180), but the value of the
quantity of time has not
changed. We can also illustrate this method in the opposite direction:

When doing such a calculation on paper, it is most efficient not to write
every step shown
above. First write “180 min”, then next to it write the conversion factor, then
cancel units, then
evaluate the numerical part, and write the answer. The final product looks like:

It is good to always put brackets around conversion factors, to remind you of
the method.
Quick Question 2.2
Use a conversion factor method to convert 3,700 meters into kilometers.
Recall there
are 1,000 meters in a km.
Now we can apply the conversion factor method to the above example for the
distance traveled
in 120 minutes by a car moving with speed 100 km/hr:

We multiplied by the conversion factor (1 hr/60 min), and canceled the min
units with each
other, and then canceled the hr units with each other, leaving km.
There is another way to do such a calculation, which some people find easier
to understand,
although it takes more steps. The speed S is given as 100 km/hr, and the time t
traveled is 120
min. The formula for distance is D = S⋅t . The problem here is that the units
are not consistently
given in the speed and in the time. First, convert the time from minutes to
units of hours before
inserting it into the formula. This is done by multiplying 120 min by the proper
conversion
factor, to give

After converting the time into units of hr, insert it into the distance
formula:

Finally, note that you can also divide by conversion factors, instead of
multiplying by them.
Because a conversion factor equals 1, either multiplication or division by one
will leave the
original quantity unchanged, except for its units. For example,

Here we used the property of fractions that

That is, when a fraction appears in the denominator, it can be moved into the
numerator, as long
as it is also inverted. For example,

| In-Depth Look 2.1 Using Conversion Factors
We can make up a
general example of using conversion factors by using arbitrary names for
the units. For fun, I will call these whatnots and whosis. Let’s say we
begin with a value of 125
whatnots. How many whosis does this equal? To answer, we need to know
how many whosis
make up a single whatnot, or vice versa. Let’s use an example in which
one whosis is equivalent
to 25 whatnots. So, we can write
1 whosis = 25 whatnot, or 1 whatnot = (1/25) whosis,
that is, one whatnot equals one twenty-fifth of a whosis. Because
1/25 = 0.04, we could also
write this as 1 whatnot = 0.04 whosis. We can now create a conversion
factor, by noting that

We can use this conversion factor to convert our starting number:

We can also have an example that goes in the opposite direction. If
we start out with 3
whosis, how many whatnots is this? We multiply by the other conversion
factor:

Notice that when giving the answer, it is not important whether we
use the “s” in the words
whatnots. The word whatnot can refer either to the singular or the
plural. (An example of this
type of situation in the English language is the word deer, which can
mean one animal or twelve
animals.)
Now that you have struggled through this example using the silly
terms whatnot and whosis,
go back and reread it, substituting cents for whatnot, and quarters for
whosis. You will see that it
makes a lot of sense. What we have argued is that 25 cents is the same
amount of money as one
quarter, and therefore (1 quarter/ 25 cents) = 1. |
Guidelines for Calculating with Units
The following set of guidelines helps when calculating with units.
• Guideline 1. Before inserting a number into a formula, convert it to a
number having
the proper units, so the units will cancel.
For example, use t = D / S to calculate time from distance and speed, where
speed is equal to
0.4 km/sec. If you are given that the distance is 800 meters (800 m), you must
convert this
distance into km before inserting it into the formula. This is done by:

• Guideline 2. After inserting numbers into a formula, the unit
symbols may be
cancelled as if they were ordinary numbers.
To continue the example, then

• Guideline 3. Always write the units explicitly at every step of the
calculation,
including in the final answer, to avoid making mistakes or giving meaningless
numbers as answers.
For example, if someone asks you how far is it from your hometown to
Antarctica, it is
meaningless to say “six thousand,” unless you also say what units this is being
expressed in.
• Guideline 4. After calculating (by hand or using a calculator) a
final number, you
need to decide how many significant digits to write when giving your answer to a
problem. This determines what precision you will use in stating your answer.
For example, the answer 2.0 sec in the above problem is given using two
digits: 2 and 0. This
means that you believe the answer is not as large as 2.1 sec, but is not as
small as 1.9 sec.
Strictly speaking, it means that the answer is somewhere between 1.95 sec and
2.05 sec. If
the data you used to calculate your answer is not actually known to this high a
precision, you
should perhaps report your answer using only one digit. This implies a lower
precision of
your answer. For example, the answer 2.0 sec could be reported instead as 2 sec,
which
means that the answer is somewhere between 1.5 sec and 2.5 sec.
Quick Question 2.3
Use the following conversion factors to calculate the number of days in one
century: 1
century = 100 years ; 1 year = 52 weeks; 1 week = 7 days. Now repeat, using 1
year =
12 months; 1 month = 4 weeks; 1 week = 7 days. Again repeat, using 1 year = 365
days. Explain why each answer is different, though “correct,” given the
precision that
each calculation is using.
2.6 Proportionality
The simplest relation between two mathematical quantities is that of direct
proportionality,
meaning that if one quantity increases by a certain multiplying factor, the
other increases by the
same multiplying factor. For example, if you have a telephone billing plan that
charges strictly
by the amount time you spend on the phone, then the cost of a call is
proportional to the time
connected. If the cost rate is 0.1 cents per second, then we can express the
total cost by the
equation
total cost = (0.1 cents per second) × (time connected)
We say that the total cost is proportional to the time connected, and
symbolize this by
total cost ∝ (time connected)
Say that you talk for 100 seconds. This would cost 10 cents. If you double
the time connected,
the cost would double to 20 cents, etc.
Another kind of proportionality is inverse proportionality, meaning that if
one quantity is
increased by multiplying with a certain factor, the other decreases by dividing
by the same
factor. For example, in a long concert hall, the loudness of the music from the
stage might be
inversely proportional to your distance from the stage. If you double your
distance, the loudness
would be cut in half. As an equation,

2.7 Binary Numbers
If the base 2 is used, the resulting units may be called
binary digits, or more briefly bits.
–Claude Shannon (The Bell System Technical Journal, 1948)
Computers use a system of numbers, called binary, which is different than the
common
decimal system that people usually use. You have probably heard the term bit
used to specify, for
example, the speed of downloading data from the Internet. Using a DSL cable, you
can achieve
(in 2007) a speed of around 10 megabits per second, or 10 Mbps. In this section,
we will discuss
how computers use bits to represent numbers.
The concept of numbers comes from counting. How do you count? You can count
to 10 on
your fingers. (In fact, the word digit means finger, and digital means “of, or
like, a finger.”) To
keep track of the fact that you have passed 10 once, you could make a mark in
the dirt with your
right foot. Each time you pass 10 again, make another mark with your right foot.
(You are
counting the tens.) When you pass 100 (ten tens), you could make a mark with
your left foot.
(You are counting the hundreds.) For counting the tens we write a number to the
left of the
number we use for counting the ones. For example, 23 means “two tens and three
ones”
(2 ×10+3 ×1), and 385 means “three hundreds and eight tens and five ones” (3
×100+8 ×10+5 ×1).
The numbers 0 through 9 are called digits. We call this the decimal system
because there are ten
distinct symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). The origin of the word decimal
is the Latin “deci,”
which means ten.
We call the values 1, 10, 100, 1000, etc., the place values. These are the
values
corresponding to each place or position in the number. They can also be
represented equivalently
as 100, 101, 102, 103, etc. In this system, the number 10 is called the base, and
the decimal
system is also called the base-ten system.
For example, the decimal number 2,385 can be broken down as shown in the
following:
Computers use a different number system than the familiar decimal system that
we normally
use. Computers use the binary number system. Instead of using as the place
values 1, 10, 100,
1000, etc., as we do in the decimal system, in the binary system we use as place
values 1, 2, 4, 8,
16, etc. This is also called the base-two system. This is how you would have to
count if you had
only two fingers in total. You could count only to two before having to resort
to making marks
with your feet to keep track of how many times you counted to two. An equivalent
way to write
the binary place values 1, 2, 4, 8, 16, etc., is 20, 21, 22,
23, 24, etc., as summarized in Table 2.1.

Because we use the numbers one and zero so often in this discussion, it helps
to have a name
for them:
A binary digit (0 or 1) is called a bit.
For example, the decimal number 14 requires four bits for its representation.
The first time the
word bit was used in this sense was in Claude Shannon’s landmark paper, quoted
at the
beginning of this chapter. A group of eight bits is called a byte.
2.7.1 Converting from Decimal to Binary
Table 2.2 gives the binary versions for the decimal numbers between 1 and 16.
Table 2.2 List of decimal numbers 0 through 16 and their binary
equivalents. This illustrates
counting to decimal 16, which in binary is 10000. This means

Try filling in the empty cells. |
 |
A method for converting a decimal number to binary is to work from left to
right (from
largest place to smallest place). For example, let’s convert the decimal number
327 (three
hundred twenty seven) into its equivalent binary form. The calculation is
summarized in the
following table:

The first step is to find the largest power of 2 that the number (327)
contains. As the table
reminds us, 28 equals 256 (decimal). This is the largest power of two
contained in the decimal
number 327. We record this fact by placing a 1 in the far left column of the
table. Then subtract
256 from the starting number, and see what is remaining: 327 - 256 = 71. The
remainder, 71,
contains zero 128s, so place a 0 below the 128 in the table. The remainder is
still 71, which
contains one 64, so place a 1 under the 64, and subtract 64: 71 – 64 = 7. This
remainder, 7,
contains zero 32s, zero 16s, and zero 8s, so put 0s in those places. The
remainder, 7, contains one
4, one 2, and one 1, so place 1s in those places. The binary representation of
the decimal number
327 is therefore 101000111. This contains nine bits, so we say it is a 9-bit
number.
Notice that zeros to the left of the left-most 1 do not carry any
significance. For example, in
binary, 0011 is the same as 011, which is the same as 11. This is also true for
the decimal
system; for example, 0513 is the same as 513.
2.7.2 Converting from Binary to Decimal
It is easy to convert a binary number into decimal. Just note which places
contain ones, and
add these place values together. For example, the binary number 101101 equals in
decimal:

Quick Question 2.4
Convert the decimal number 211 into binary.
Quick Question 2.5
Convert the binary number 1110101 into decimal.
Quick Question 2.6
What is the largest decimal number that can be represented using one byte?
What is the decimal equivalent of the binary number 100000000 (1, followed by
eight 0s)?
Real-World Example 2.2 Analog and Digital Variables
Continuous variables are called analog, while discrete variables,
including binary numbers,
are called digital. Physicists and engineers typically use analog
variables. This is because physics
deals with physical quantities such as time and distance, which are
continuous. Physicists have
developed the mathematics of continuous variables for this purpose. Even
though in practice we
cannot measure any variable with infinitely high precision, there is no
theoretical limit to how
high the precision could be.In contrast, computers operate on a set
of principles and rules that require them to treat
numbers in digital form. Each cell in a computer’s memory can store only
one of two possible
numbers: zero or one—that is, one binary digit, or bit. The only way to
represent and store
numbers with higher precision is to allocate more memory cells to each
number location. For
example, if a memory uses three cells to store each number, as shown in
Figure 2.6, it could
store one of eight different binary numbers in each location: 000
through 111 (which equals 7 in
decimal). But, if the memory used four cells to store each number, then
each location could store
one of sixteen different binary numbers: 0000 through 1111 (which equals
15 in decimal). This
would allow higher relative precision, since a measurement range could
be divided into finer
intervals. When we write a number in a computer, it always has a finite
(that is, limited) number
of digits, or binary place values, thereby limiting the precision.

Figure 2.6 Two computer memories, each having space to store only
four numbers. Each
small square box is a memory cell, and can hold one bit. The memory on
the left uses three cells
as binary place-value holders (each holding a bit) to store each number.
The memory on the right
uses four cells as binary place-value holder to store each number. The
memory on the right can
store a larger range of possible numbers. |
2.8 The Concept of Information
“Information is what you don’t already know”
—Neil Gershenfeld
When you send an email to a friend, you are sending information. A one-page
message
contains a certain amount of information, while a two-page message contains
roughly twice that
amount. In the 1940s, long before the advent of the Internet, Claude Shannon, an
engineer at
AT&T Bell Laboratories, asked himself the question, “How can the amount of
information in a
message be quantified?” By quantify we mean assign a numerical value to the
amount of
information. Or, to turn it around–how much information can be transmitted in a
message of a
given length? The answer to this question has far-reaching consequences for
information
technology. In 1948, Shannon published the landmark paper, “A mathematical
theory of
communication,” that revolutionized scientists’ understanding of the concept of
information,
especially in the context of communication systems.
A gain of information decreases your uncertainty. If you are uncertain about
the outcome of
an event, then you lack some information. If someone tells you the outcome, then
you gain
information. In the case of two equally likely outcomes–say the result of
flipping a coin–then the
amount of information that is gained is one bit. This meaning of bit is slightly
different from the
usage in the previous sections, where bit meant simply a binary digit (0 or 1).
However, these
two meanings are closely related.
A bit is the smallest amount, or quantity, of information.
How can we quantify the amount of information in more complex situations ? Say
that
someone has three coins, each with equal likelihood for heads or tails when
tossed. If you don’t
know the outcomes of one toss for each coin, then it seems intuitively clear
that you lack three
bits of information–heads (H) or tails (T) for each. It is interesting that
there are eight possible
combinations of outcomes: HHH, HHT, HTH, HTT, THH, THT, TTH, TTT. This is the
same as
the number of different numbers that can be represented by using just three
binary digits: 000,
001, 010, 011, 100, 101, 110, 111. Clearly, a strong connection exists between
information and
binary counting. A quantitative definition for information content can now be
stated:
The amount of information, or information content, in a message (or
any other set of
data) equals the minimum number of binary digits needed to represent faithfully
the
message (without having any knowledge in advance, and without just getting
lucky).
Note that this definition does not say anything about the meaning of the
message or data.
Scientists have not learned how to quantify meaning. For example, the result of
a coin toss could
have no meaning whatsoever (if, for example, it is used only to illustrate the
equal likelihood of
heads and tails). On the other hand, it could have an important meaning (if, for
example, it
determines which football team gets to possess the ball first). In either case,
the amount of
information equals one bit.
To quote from Shannon’s 1948 paper,
“The fundamental problem of communication is that of reproducing at one point
either
exactly or approximately a message selected at another point. Frequently the
messages
have meaning; that is they refer to … some system with certain physical or
conceptual
entities. These semantic aspects of communication are irrelevant to the
engineering
problem. The significant aspect is that the actual message is one selected from
a set of
possible messages.”
A simple way to picture Shannon’s definition of information is by imagining
you are playing
the game “Twenty Questions.” Let’s say that at a party a friend tells you that
she is thinking of
some object, and you must try to figure out what that object is by asking yes or
no questions. “Is
it larger than a bread basket? Is it made of plant material?” After answers are
given to 20 such
questions, you have gained 20 bits of information, which is usually sufficient
for you to correctly
infer (make an informed guess about) the object’s identity.
How many different combinations of yes/no answers could be given to 20
questions? For
each question, there are two possible answers, so the total number of
combinations of answers
equals the number 2 multiplied by itself 20 times, or 220 = 1,048,576. This equals
over one
million possible combinations, so it is not surprising that 20 answers is
usually sufficient to
determine the identity of the object.
In a more general case–if we ask a question that has a number (N) of possible
answers, then
the amount of information (I) that we gain from its answer is equal to the
exponent of 2 that is
needed to produce the number N. That is, 2I = N. For example, if we play the game
“Three
questions,” we could combine our three questions into one combined question.
Perhaps we ask,
“Tell me if it is larger than an elephant, and tell me if it is an animal, and
tell me if it would sink
in water.” There are eight possible combined answers: “no, no, no,” or “no, no,
yes,” or “no, yes,
yes,” etc. Therefore, N = 8, so the amount of information is I = 3.
An example of a question that has many possible answers (only one of which is
correct) is
illustrated in Figure 2.7. Say there are 128 identical stones lying in a field.
One of the stones has
a diamond under it that you would like to find. Your friend Bob knows which
stone the diamond
is under, but he refuses to tell you directly which one to turn over. How many
answers to yes/no
questions would it take you to find the diamond? You might try one of two
strategies: the first
would be to try to get lucky and guess directly which stone covers the diamond.
If you guess
correctly, then you obtain the diamond after only one answer, or one bit of
information.
However, your chances of success are very small (one in 128). You would probably
have to
guess many individual stones before guessing the correct one. If this experiment
were repeated
many times, then on average you would need to make 128 ÷ 2 = 64 guesses, or gain
64 bits of
information, in order to find the diamond.


Figure 2.7 Searching through a collection of 128 stones requires asking seven
yes/no questions.
There is a more efficient strategy, illustrated in Figure 2.7(b). Divide the
field into left and
right areas, each containing one-half of the stones, and ask Bob, “Is the
correct stone in the left
half?” After hearing the answer, discard the side of the field that you now know
does not contain
the stone. Next, divide the remaining stones into two equal groups, ask the same
question again,
and discard the group of stones not hiding the diamond. Repeat this seven times,
and you will be
left with just one stone, under which will be the diamond. Mathematicians can
prove that for this
example there is no better strategy than the one that requires seven questions.
For this reason, we
say that the amount of information that must be gained in this case equals 7
bits. The reason that
seven such yes/no questions are needed is that the total number of possible
answers to the
question, “Which stone hides the diamond?” is 128, which equals 27.
Another way to understand this diamond-finding example is to think about what
type of
message Bob could write on a piece of paper to convey to you where the diamond
is hidden. A
straightforward way to do this is to agree beforehand on a method of labeling
each stone by a
whole number between, and including, 0 and 127. There are 128 such numbers. Then
Bob just
has to write the number identifying the special stone on the paper and hand it
to you. If you and
Bob agree that he will write the number in binary, then the number will be
between (and
including) 0000000 and 1111111. For example, the special stone might be the one
identified as
1100101. Clearly, Bob will need to specify the value (0 or 1) of each of seven
bits in order to
convey the needed information.
What if the number of possible outcomes or answers does not equal exactly a
power of two,
that is, does not equal 2n for some value of n? In this case, we can
specify the amount of
information to be within a range somewhere between two whole numbers. For
example, if there
are 135 stones in the field containing the diamond, then it will take, on
average slightly more
than seven questions to unearth the proper location. Sometimes it will take
seven questions, and
sometimes eight questions. But, it will not take more than eight questions,
which would be
enough to sort through 256 stones. For this case, we can say that the amount of
information is
between 7 and 8 bits.
How much information can be transmitted in a message of a given length? If we
can assume
that the message is written in the most efficient way, then the answer is
simple. Write the
message as a single list of binary digits, that is, ones and zeros. Then the
amount of information
equals the number of binary digits or bits, in the list. The question of how to
ensure that the
message is written in the most efficient way is subtle, and will be discussed in
a later chapter.
2.8.1 Bits, Bytes, and Other Units
The basic unit of information is the bit. One byte is defined as eight bits,
and is abbreviated
as B. For example, you might ask a salesperson how much memory a particular
memory device
has, and the response might be “one thousand bytes.” This is the same as eight
thousand bits.
When the number of bits is much larger, we use other units—the kilobyte (kB),
megabyte (MB),
gigabyte (GB), and terabyte (TB). Recall that according to the standard
metric-system
definitions,3 the prefix k means 103, M means 106, G means
109, and T means 1012. In common
computer-science usage, however, these symbols are often “misused” to mean 210,
220, 230, and
240, respectively. This usage arose out of the desire to have slang
names for these quantities, and
because of the near correspondence between the values: 103 = 1,000
whereas 210 = 1024; 106 =
1,000,000 whereas 220 = 1,048,576; 109 = 1,000,000,000
whereas 230 = 1,073,741,824; etc.
Throughout this text, we will use the standard base-ten definitions of k, M, G,
and T, except
where otherwise noted. For example, when we write GB, we mean 109
B or 109
bytes.
| Table 2.3 Information Units |
| Unit |
Abbreviation |
Physical Science |
Computer
|
|