Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural...

31
Numbers Dr Hammadi Nait-Charif Senior Lecturer Bournemouth University United Kingdom [email protected] http://nccastaff.bmth.ac.uk/hncharif/MathsCGs/maths.html Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 1 / 10

Transcript of Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural...

Page 1: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Numbers

Dr Hammadi Nait-Charif

Senior LecturerBournemouth University

United Kingdom

[email protected]://nccastaff.bmth.ac.uk/hncharif/MathsCGs/maths.html

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 1 / 10

Page 2: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Numbers

Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are usedfor counting, ordering and labelling. We often use natural numbersto subscript a quantity to distinguish one element from another,e.g. x1, x2, x3, x4, etc.

Integers:Integers embrace negative numbers .. 2,10, 1, 2, 3, ..Rational Numbers:Rational or fractional numbers are numbersthat can be represented as a fraction:For example

0.25 =1

4

√16 = 4 =

12

415 =

15

1=

30

2Some rational numbers can be stored accurately inside acomputer, whilst many others can only be stored approximately.For example, 4/3 = 1.3333... produces an infinite sequence ofthrees and has to be truncated when stored as a binary number.

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 2 / 10

Page 3: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Numbers

Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are usedfor counting, ordering and labelling. We often use natural numbersto subscript a quantity to distinguish one element from another,e.g. x1, x2, x3, x4, etc.Integers:Integers embrace negative numbers .. 2,10, 1, 2, 3, ..

Rational Numbers:Rational or fractional numbers are numbersthat can be represented as a fraction:For example

0.25 =1

4

√16 = 4 =

12

415 =

15

1=

30

2Some rational numbers can be stored accurately inside acomputer, whilst many others can only be stored approximately.For example, 4/3 = 1.3333... produces an infinite sequence ofthrees and has to be truncated when stored as a binary number.

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 2 / 10

Page 4: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Numbers

Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are usedfor counting, ordering and labelling. We often use natural numbersto subscript a quantity to distinguish one element from another,e.g. x1, x2, x3, x4, etc.Integers:Integers embrace negative numbers .. 2,10, 1, 2, 3, ..Rational Numbers:Rational or fractional numbers are numbersthat can be represented as a fraction:For example

0.25 =1

4

√16 = 4 =

12

415 =

15

1=

30

2Some rational numbers can be stored accurately inside acomputer, whilst many others can only be stored approximately.For example, 4/3 = 1.3333... produces an infinite sequence ofthrees and has to be truncated when stored as a binary number.

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 2 / 10

Page 5: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Irrational & Real Numbers

Irrational Numbers:Irrational numbers cannot be represented as fractions. Examplesbeing π = 3.1415926...and e = 2.71828182... Such numbers never terminate and arealways subject to a small error when stored within a computer.

Real Numbers:Real numbers embrace irrational and rationalnumbers.

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 3 / 10

Page 6: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Irrational & Real Numbers

Irrational Numbers:Irrational numbers cannot be represented as fractions. Examplesbeing π = 3.1415926...and e = 2.71828182... Such numbers never terminate and arealways subject to a small error when stored within a computer.

Real Numbers:Real numbers embrace irrational and rationalnumbers.

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 3 / 10

Page 7: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Repeating decimals

Is 1.212121... an rational number or irrational?

If x = 1.2121212121..

100x = 121.2121212121..

1x = 1.2121212121..

99x = 120 (1)Then

Therefore x = 120/99 = 1.2121212121... is rational.

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 4 / 10

Page 8: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Repeating decimals

Is 1.212121... an rational number or irrational?If x = 1.2121212121..

100x = 121.2121212121..

1x = 1.2121212121..

99x = 120 (1)Then

Therefore x = 120/99 = 1.2121212121... is rational.

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 4 / 10

Page 9: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Repeating decimals

Is 1.212121... an rational number or irrational?If x = 1.2121212121..

100x = 121.2121212121..

1x = 1.2121212121..

99x = 120 (1)Then

Therefore x = 120/99 = 1.2121212121... is rational.

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 4 / 10

Page 10: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Number Systems

In general, we can define any positive integer as

359 = 3× 102 + 5× 101 + 9× 100

Where 10 is the base of our decimal system.

In general, we can define any positive integer as

abcd = a× 103 + b× 102 + c× 101 + d× 100

where a, b, c, d are all ≤ 9

And any positive real number as

abcd.efg = a× 103 + b× 102 + c× 101 + d× 100 + e× 10−1 + f × 10−2 + g × 10−3

where a, b, c, d, e, f, g are all ≤ 9

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 5 / 10

Page 11: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Number Systems

In general, we can define any positive integer as

359 = 3× 102 + 5× 101 + 9× 100

Where 10 is the base of our decimal system.In general, we can define any positive integer as

abcd = a× 103 + b× 102 + c× 101 + d× 100

where a, b, c, d are all ≤ 9

And any positive real number as

abcd.efg = a× 103 + b× 102 + c× 101 + d× 100 + e× 10−1 + f × 10−2 + g × 10−3

where a, b, c, d, e, f, g are all ≤ 9

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 5 / 10

Page 12: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Number Systems

In general, we can define any positive integer as

359 = 3× 102 + 5× 101 + 9× 100

Where 10 is the base of our decimal system.In general, we can define any positive integer as

abcd = a× 103 + b× 102 + c× 101 + d× 100

where a, b, c, d are all ≤ 9

And any positive real number as

abcd.efg = a× 103 + b× 102 + c× 101 + d× 100 + e× 10−1 + f × 10−2 + g × 10−3

where a, b, c, d, e, f, g are all ≤ 9

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 5 / 10

Page 13: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Octal to Decimal

Ten is used only because we have ten fingers. If we had 8 fingerswe would define an octal positive integer as.

abcd = a× 83 + b× 82 + c× 81 + d× 80

here a, b, c, d are all ≤ 7

table:0 1 2 3 4 5 6 710 11 12 13 14 15 16 1720 21 22 23 24 25 26 27

108 = 810 128 = 1010 208 = 1610

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 6 / 10

Page 14: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Octal to Decimal

Ten is used only because we have ten fingers. If we had 8 fingerswe would define an octal positive integer as.

abcd = a× 83 + b× 82 + c× 81 + d× 80

here a, b, c, d are all ≤ 7

table:0 1 2 3 4 5 6 710 11 12 13 14 15 16 1720 21 22 23 24 25 26 27

108 = 810 128 = 1010 208 = 1610

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 6 / 10

Page 15: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Octal to Decimal

Ten is used only because we have ten fingers. If we had 8 fingerswe would define an octal positive integer as.

abcd = a× 83 + b× 82 + c× 81 + d× 80

here a, b, c, d are all ≤ 7

table:0 1 2 3 4 5 6 710 11 12 13 14 15 16 1720 21 22 23 24 25 26 27

108 = 810 128 = 1010 208 = 1610

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 6 / 10

Page 16: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Binary Numbers

Binary numbers have a base of 2

For a positive binary integer

abcd2 = a× 23 + b× 22 + c× 21 + d× 20

here a, b, c, d are all ≤ 1

e.g.

110102x = 1× 24 + 1× 23 + 0× 22 + 1× 21 + 0× 20

= 1× 16 + 1× 8 + 0× 4 + 1× 2 + 0× 1

= 2610 (2)

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 7 / 10

Page 17: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Binary Numbers

Binary numbers have a base of 2For a positive binary integer

abcd2 = a× 23 + b× 22 + c× 21 + d× 20

here a, b, c, d are all ≤ 1

e.g.

110102x = 1× 24 + 1× 23 + 0× 22 + 1× 21 + 0× 20

= 1× 16 + 1× 8 + 0× 4 + 1× 2 + 0× 1

= 2610 (2)

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 7 / 10

Page 18: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Binary Numbers

Binary numbers have a base of 2For a positive binary integer

abcd2 = a× 23 + b× 22 + c× 21 + d× 20

here a, b, c, d are all ≤ 1

e.g.

110102x = 1× 24 + 1× 23 + 0× 22 + 1× 21 + 0× 20

= 1× 16 + 1× 8 + 0× 4 + 1× 2 + 0× 1

= 2610 (2)

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 7 / 10

Page 19: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Decimal to Binary Conversion

To convert 20 into binary we do what’s called successive divisions

successive divisions:20

2= 10 Remainder 0

10

2= 5 Remainder 0

5

2= 2 Remainder 1

2

2= 1 Remainder 0

1

2= 0 Remainder 1

101002 = 2010

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 8 / 10

Page 20: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Decimal to Binary Conversion

To convert 20 into binary we do what’s called successive divisionssuccessive divisions:

20

2= 10 Remainder 0

10

2= 5 Remainder 0

5

2= 2 Remainder 1

2

2= 1 Remainder 0

1

2= 0 Remainder 1

101002 = 2010

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 8 / 10

Page 21: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Decimal to Binary Conversion

To convert 20 into binary we do what’s called successive divisionssuccessive divisions:

20

2= 10 Remainder 0

10

2= 5 Remainder 0

5

2= 2 Remainder 1

2

2= 1 Remainder 0

1

2= 0 Remainder 1

101002 = 2010

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 8 / 10

Page 22: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Decimal to Binary Conversion

To convert 20 into binary we do what’s called successive divisionssuccessive divisions:

20

2= 10 Remainder 0

10

2= 5 Remainder 0

5

2= 2 Remainder 1

2

2= 1 Remainder 0

1

2= 0 Remainder 1

101002 = 2010

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 8 / 10

Page 23: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Decimal to Binary Conversion

To convert 20 into binary we do what’s called successive divisionssuccessive divisions:

20

2= 10 Remainder 0

10

2= 5 Remainder 0

5

2= 2 Remainder 1

2

2= 1 Remainder 0

1

2= 0 Remainder 1

101002 = 2010

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 8 / 10

Page 24: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Decimal to Binary Conversion

To convert 20 into binary we do what’s called successive divisionssuccessive divisions:

20

2= 10 Remainder 0

10

2= 5 Remainder 0

5

2= 2 Remainder 1

2

2= 1 Remainder 0

1

2= 0 Remainder 1

101002 = 2010

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 8 / 10

Page 25: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Other Number Systems

Any base can be used to represent positional numbers

abcdx = a× x3 + b× x2 + c× x1 + d× x0

30214 = 3× 43 + 0× 42 + 2× 41 + 1× 40 = 20110

5167 = 5× 72 + 10× 71 + 6× 40 = 25810

120213 = 1× 34 + 2× 33 + 0× 32 + 2× 31 + 1× 30 = 14210

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 9 / 10

Page 26: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Other Number Systems

Any base can be used to represent positional numbers

abcdx = a× x3 + b× x2 + c× x1 + d× x0

30214 = 3× 43 + 0× 42 + 2× 41 + 1× 40 = 20110

5167 = 5× 72 + 10× 71 + 6× 40 = 25810

120213 = 1× 34 + 2× 33 + 0× 32 + 2× 31 + 1× 30 = 14210

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 9 / 10

Page 27: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Other Number Systems

Any base can be used to represent positional numbers

abcdx = a× x3 + b× x2 + c× x1 + d× x0

30214 = 3× 43 + 0× 42 + 2× 41 + 1× 40 = 20110

5167 = 5× 72 + 10× 71 + 6× 40 = 25810

120213 = 1× 34 + 2× 33 + 0× 32 + 2× 31 + 1× 30 = 14210

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 9 / 10

Page 28: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Other Number Systems

Any base can be used to represent positional numbers

abcdx = a× x3 + b× x2 + c× x1 + d× x0

30214 = 3× 43 + 0× 42 + 2× 41 + 1× 40 = 20110

5167 = 5× 72 + 10× 71 + 6× 40 = 25810

120213 = 1× 34 + 2× 33 + 0× 32 + 2× 31 + 1× 30 = 14210

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 9 / 10

Page 29: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Hexadecimal Numbers (base 16)

Hexadecimal positive Integer can be represented

abcd16 = a× 163 + b× 162 + c× 161 + d× 160

where a, b, c, d are all ≤ 16

but this means we require some extra symbols such as0123456789ABCDEF

2E616 = 2× 162 + E × 161 + 6× 160

= 2× 162 + 14× 161 + 6× 160

= 74210

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 10 / 10

Page 30: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Hexadecimal Numbers (base 16)

Hexadecimal positive Integer can be represented

abcd16 = a× 163 + b× 162 + c× 161 + d× 160

where a, b, c, d are all ≤ 16

but this means we require some extra symbols such as0123456789ABCDEF

2E616 = 2× 162 + E × 161 + 6× 160

= 2× 162 + 14× 161 + 6× 160

= 74210

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 10 / 10

Page 31: Dr Hammadi Nait-Charifnccastaff.bmth.ac.uk/hncharif/MathsCGs/Numbers.pdf · Numbers Natural Numbers: The natural numbers 0, 1, 2, 3, 4, . are used for counting, ordering and labelling.

Hexadecimal Numbers (base 16)

Hexadecimal positive Integer can be represented

abcd16 = a× 163 + b× 162 + c× 161 + d× 160

where a, b, c, d are all ≤ 16

but this means we require some extra symbols such as0123456789ABCDEF

2E616 = 2× 162 + E × 161 + 6× 160

= 2× 162 + 14× 161 + 6× 160

= 74210

Dr Hammadi Nait-Charif (BU, UK) Numbers NCCA-2011/12 10 / 10