1 of 15

CSC-105

Introduction to Computer Science

Lecture 2.1.

2 of 15

Symbols

Morse code:

Braille:

Our Number System?

. _

?

3 of 15

Number Systems

Roman Numerals

Unary number system

Our Number System

I, V, X, L, C, D, M

I stands for one

V stands for five

X stands for ten

L stands for fifty

C stands for hundred

D stands for five hundred

M stands for thousand

From Latin word mille. Thousand steps in about a mile

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

The number system we use today is called the Decimal System

Decimal is Latin for ten

4 of 15

Our Number system

  • From the time our species began counting, we’ve used our fingers to help.

  • Most civilizations have consequently based their number systems around ten.

  • There is nothing inherently special about our number system apart from its relationship to the physiology of the human hand

  • Had our species developed with eight or twelve fingers, our ways of counting would be different

  • It is no coincidence that the word digit can refer to fingers or toes as well as to numbers

5 of 15

Babylonian Number System

  • The only significant exceptions are a few number systems built around five, or 20 or 60, which are all closely related to 10

  • The Babylonian number system based on 60 persists in our reckoning of the time in seconds and minutes

6 of 15

Indo-Arabic Number System

  • The number system we used today is known as the Indo-Arabic

  • It is of Indian Origin but was brought to Europe by Arab mathematicians

  • Of particular renown is the Persian mathematician Muhammad ibn Musa al-Khwarzimi

    • The word Algorithm comes from his name

7 of 15

Indo-Arabic Number System

The Indo-Arabic number system differs from previous numbers in three ways:

  1. The Indo-Arabic number system is positional

    • A particular digit represents a different quantity depending on its position

    • The position is more significant than the digits themselves

    • 100 and 99 are very close to each other even though they don’t share a number

    • 100 and 10 are much further apart although they differ from each other by just one digit

8 of 15

Indo-Arabic Number System

2.

Virtually all earlier number systems had something that the Indian-Arabic system does not

    • Special symbol for ten

3.

Virtually all earlier number systems lacked something that the Indo-Arabic system has: zero

    • Lacking a zero made mathematical operations very difficult

      • Particularly multiplication and division

9 of 15

Indo-Arabic Number System

  • The whole structure of the Indo-Arabic number system is revealed in the way we pronounce them

  • Take 4825, for instance, we say

four thousand, eight hundred and twenty five

4825 = 4000

800

20

5

4825 = 4 * 1000 +

8 * 100 +

2 * 10 +

5 * 1

4825 = 4 * 103 +

8 * 102 +

2 * 101 +

5 * 100

10 of 15

Indo-Arabic Number System

  • Since each position corresponds to a power of ten, a special symbol for ten is not required

  • Because ten is represented by setting the 1 in a different position and using 0 as a placeholder

11 of 15

Elegance of Positional Systems

  • What’s also really nice is that fractional quantities shown as digits to the right of a decimal point follow this same pattern.

  • The number 42705.684 is:

4 x 10,000 +

2 x 1000 +

7 x 100 +

0 x 10 +

5 x 1 +

6 ÷ 10 +

8 ÷ 100 +

4 ÷ 1000 +

  • Notice that the last three lines use division rather than multiplication.

12 of 15

Elegance of Positional Systems

  • This number 42705.684 can also be written as shown below on the left

  • Using powers of 10, the number can be written as shown below on the right

  • Note how the exponents go down to zero then become negative

4 x 10,000 +

2 x 1000 +

7 x 100 +

0 x 10 +

5 x 1 +

6 x 0.1 +

8 x 0.01 +

4 x 0.001

4 x 104 +

2 x 103 +

7 x 102 +

0 x 101 +

5 x 100 +

6 x 10-1 +

8 x 10-2 +

4 x 10-3

13 of 15

Addition in a Positional System

  • When you add decimal numbers of any length, you follow a procedure that breaks down the problem into steps.

  • Each step involves nothing more complicated than adding pairs of single-digit numbers

  • Addition table for each digit in decimal system is given on the right

  • Find the two digits you wish to add in the top row and top column and follow down and across to get the sum

14 of 15

Alternative Number Systems

  • What if human beings had only four fingers on each hand?

  • Instead of basing our number system on ten, we would have probably had a number system based on eight

  • Such a number system is called octal or base eight

  • Just like in our decimal system (aka base 10) number system, we don’t have a symbol for ten, we would probably not have a symbol for eight or nine

15 of 15

Multiplication in a Positional System

  • Similarly, when you need to multiply two decimal numbers, you follow a somewhat more complicated procedure but still one that breaks down the problem so that you need do nothing more complex than adding or multiplying single-digit decimal numbers

  • Multiplication table for digits in decimal points is given on the right