0% found this document useful (0 votes)
34 views

Mathematics Sample Notes

This document appears to be a table of contents for a study guide on mathematics covering several topics: - Number bases, binary arithmetic, floating point representation, set notation, Boolean algebra, data structures, matrices, and transformations. The table of contents lists 12 chapters that cover concepts, examples, exercises and past exam questions on these various mathematical topics relevant to computing. It also includes contact information for the academic resource providing this study material.

Uploaded by

James
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Mathematics Sample Notes

This document appears to be a table of contents for a study guide on mathematics covering several topics: - Number bases, binary arithmetic, floating point representation, set notation, Boolean algebra, data structures, matrices, and transformations. The table of contents lists 12 chapters that cover concepts, examples, exercises and past exam questions on these various mathematical topics relevant to computing. It also includes contact information for the academic resource providing this study material.

Uploaded by

James
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

ACADEMICA E NOTES

&
PAST PAPERS

CERTIFICATE IN IT

MATHEMATICS
1920-104

[email protected]
www.kenyanexams.com
Table of Contents

CHAPTER 1: NUMBER BASES .................................................. 1-1


1.1 Introduction .............................................................................................. 1-2
1.2 Level of Precisions ................................................................................... 1-2
1.3 Number Base ............................................................................................ 1-3
1.4 Column System ........................................................................................ 1-3
1.5 Conversion from Other Bases to Denary ................................................. 1-4
1.6 Conversion from Denary to Other Bases ................................................. 1-4
1.7 Conversion Among Other Base ............................................................... 1-7
1.8 Real Number ............................................................................................ 1-8
1.9 Octal Arithmetic....................................................................................... 1-9
1.10 Hexadecimal Arithmetic ........................................................................ 1-10
1.11 Modular Arithmetic ............................................................................... 1-11
1.12 Past Years Questions.............................................................................. 1-13

CHAPTER 2: COMPUTER BASED ARITHMETIC ................. 2-1


2.1 Binary Addition ....................................................................................... 2-2
2.2 Binary Subtraction ................................................................................... 2-3
2.3 Binary Multiplication ............................................................................... 2-4
2.4 Binary Division ........................................................................................ 2-6
2.5 Number Storage in the Computer Word .................................................. 2-8
2.6 Storage of Numbers ................................................................................. 2-9
2.7 Storage of Fractions ............................................................................... 2-12
2.8 Storage of Mixed Numbers .................................................................... 2-12
2.9 Storage of Number Using 2's Complement Method .............................. 2-13
2.10 Ten's Complement ................................................................................. 2-14
2.11 Two's Complement ................................................................................ 2-14
2.12 Recomplementing Cases ........................................................................ 2-16
2.13 Shift Operations ..................................................................................... 2-16
2.14 Past Years Questions.............................................................................. 2-18

CHAPTER 3: FLOATING POINT REPRESENTATION ......... 3-1


3.1 Introduction .............................................................................................. 3-2
3.2 Fixed Point and Floating Point Binary..................................................... 3-2
3.3 Floating Point Storage.............................................................................. 3-2
3.4 Floating Point Storage.............................................................................. 3-3
3.5 Floating Point Notation ............................................................................ 3-4
3.6 Normalised Floating Point Form (Decimal) ............................................ 3-4
3.7 Normalised Exponent Exponent Form (Binary) ...................................... 3-4
3.8 Storing Negative Mantissa ....................................................................... 3-5
3.9 Storing Negative Exponent ...................................................................... 3-5

2
3.10 Exercises .................................................................................................. 3-6
3.11 Past Years Questions................................................................................ 3-9

CHAPTER 4: SET NOTATION REPRESENTATION AND


PROBABILITY ............................................................................... 4-1
4.1 Introduction .............................................................................................. 4-2
4.2 Definition of Set ....................................................................................... 4-2
4.3 Notation.................................................................................................... 4-2
4.4 Venn Diagrams ........................................................................................ 4-2
4.5 Relation Between Sets ............................................................................. 4-3
4.6 Properties ................................................................................................. 4-9
4.7 Applications ........................................................................................... 4-10
4.8 Other Logical Relation ........................................................................... 4-11
4.9 Past Years Questions (Set Theory and Venn Diagram) ......................... 4-13

CHAPTER 5: BOOLEAN ALGEBRA I ....................................... 5-1


5.1 Introduction .............................................................................................. 5-2
5.2 Logic Programming ................................................................................. 5-2
5.3 Logic and Hardware ................................................................................. 5-3
5.4 Language and Symbols ............................................................................ 5-3
5.5 Truth Tables ............................................................................................. 5-3
5.6 Logical Equivalence................................................................................. 5-5
5.7 Switching Diagrams ................................................................................. 5-6
5.8 Combining Logic Gates ......................................................................... 5-15
5.9 The Algebra of Logic ............................................................................. 5-17

CHAPTER 6: BOOLEAN ALGEBRA (II)................................... 6-1


6.1 Introduction .............................................................................................. 6-2
6.2 The Laws of Boolean Algebra ................................................................. 6-2
6.3 Simplification of Expressions .................................................................. 6-4
6.4 De Morgan's Laws ................................................................................... 6-7
6.5 Past Years Questions................................................................................ 6-8

CHAPTER 7: DATA STRUCTURES (I) ...................................... 7-1


7.1 Introduction .............................................................................................. 7-2
7.2 The Concept of Unit Matrix ..................................................................... 7-2
7.3 Arrays and Spreadsheets .......................................................................... 7-6
7.4 Lists .......................................................................................................... 7-8
7.5 Linked List ............................................................................................. 7-10
7.6 Queues.................................................................................................... 7-12
7.7 Stacks ..................................................................................................... 7-13

3
CHAPTER 8: DATA STRUCTURES (II) .................................... 8-1
8.1 Introduction .............................................................................................. 8-2
8.2 Tree .......................................................................................................... 8-2
8.3 Tables ....................................................................................................... 8-4
8.4 Binary Trees ............................................................................................. 8-5
8.5 Traversing of Binary Trees ...................................................................... 8-6
8.6 Binary Search Tree .................................................................................. 8-7
8.7 Searching and Inserting in Binary Search Trees ...................................... 8-8
8.8 Past Years Questions.............................................................................. 8-10

CHAPTER 9: MATRIX AND TRANSFORMATION ................ 9-1


9.1 Introduction .............................................................................................. 9-2
9.2 Definitions................................................................................................ 9-2
9.3 Rules/Matrix Algebra............................................................................... 9-3
9.4 Equivalent Matrices ................................................................................. 9-7
9.5 Transformations ..................................................................................... 9-11

CHAPTER 10: REPRESENTATION OF INSTRUCTION ..... 10-1


10.1 Introduction ............................................................................................ 10-2
10.2 Construction of an Instruction Word ..................................................... 10-2
10.3 Instruction Word Formats ...................................................................... 10-4
10.4 Representation of Instruction and Data.................................................. 10-4
10.5 Addressing Techniques .......................................................................... 10-4
10.6 Instruction Types ................................................................................... 10-5
10.7 Exercises ................................................................................................ 10-8

CHAPTER 11: ERRORS AND ACCURACY ............................ 11-1


11.1 Introduction ............................................................................................ 11-2
11.2 Mistakes ................................................................................................. 11-2
11.3 Errors...................................................................................................... 11-6
11.4 Measurement of Error ............................................................................ 11-7
11.5 Error Propagation ................................................................................... 11-7
11.6 To Control Errors ................................................................................. 11-14
11.7 Past year Questions .............................................................................. 11-19

CHAPTER 12: STATISTICS ....................................................... 12-1


12.1 Introduction ............................................................................................ 12-2
12.2 Raw Data ................................................................................................ 12-2
12.3 Grouped data .......................................................................................... 12-3
12.4 Presentation of Statistical Data .............................................................. 12-4
12.5 Three Statistical quantities Of Central Tendency .................................. 12-8
12.6 Dispersion and Variation ..................................................................... 12-13
12.7 Past year Questions .............................................................................. 12-19

4
Chapter 1 : Number Bases

Chapter Objectives

At the completion of this chapter, you should be able to:

 identify the different types of numbers;

 convert between denary and other base;

 convert between binary, octal and hexadecimal;

 understand the column system and number bases;

 understand modular arithmetic;

 hexadecimal, octal addition.

1.1 Introduction
In this chapter, we start to explore various sets of numbers which are used to
represent data in real life problems. Namely, natural numbers, integers, rational,
irrational, real and complex numbers. Numbers are used to represent quantities,
measurement, and others in our surroundings. They are essential representations
of data that will be processed by computer systems to produce useful information.
The computer system, being a digital electronic device, has to handle data in
binary numbers.

In binary numbers, each binary digit has only two states rather than ten states in
decimal numbers. Therefore, binary, octal and hexadecimal number systems are
dealt with in subsequent parts of the chapter.

1.1.1 Number Sets

N Natural Positive integers Example: 3, 71

Z Integers Whole numbers Example: 3, -71

Rational Real numbers which can be expressed as the ratio


Q
of 2 integer Example: 1/2, 0.57, -3

Irrational Real numbers which are not rational Example:


F
2,

5
Real Can be represented by points a the straight
R
line Example: -2.31, 5 , 6

Complex No real number that can satisfy the equation X2


C
= -1 Example:  1 ,  5.75 ,  88

1.2 Level of Precisions


Some translator software have two levels of precisions in storing real numbers.
Namely single-precision and double precision.

6
1.2.1 Single Precision

The real number is calculated to 8 and displayed to 7 significant figures.

Example:  = 3.1415926 calculated


= 3.141593 displayed

1.2.2 Double Precision

The computer will need longer processing time to produce double precision
numbers. The real number is calculated to 16 and displayed on the screen to 15
significant figures.

Example:  = 3.141592653589793 calculated


= 3.14159265358979 displayed

1.3 Number Base


A fundamental counting group consists of a number of various symbols.

Counting Groups Symbols of the Group No. of Symbols


Binary 0, 1 2
Octal 0, 1, 2, 3, 4, 5, 6, 7 8
Hexadecimal 0, 1, 2, 3, ... 9, A, B, C, D, E, F 16
Denary 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 10

1.4 Column System


Enable us to represent any conceivable number by combining numerals and
zeros.

For e example, 423524 is derived from this column system:

Column No 6 5 4 3 2 1
100,00
Value 10,000 1,000 100 10 1
0
Power of
105 104 103 102 101 100
Magnification
Numerals 4 2 3 5 2 4

423524 = 4 x 105 + 2 x 104 + 3 x 103 + 5 x 102 + 2 x 101 + 4 x 100

The Power of Magnification for each individual column is derived as,


Power of Magnification = Base(Column no - 1)

7
1.5 Conversion from Other Bases to Denary
We can use this column system to convert a number in other bases to its
equivalence in Denary.

Example: Convert 1110012 to denary

Column No 6 5 4 3 2 1
Value 32 16 8 4 2 1
Power of
25 24 23 22 21 20
Magnification
Numerals 1 1 1 0 0 1

1110012 = 1 x 25 + 1 x 2 4 + 1 x 2 3 + 1 x 2 0
= 32 + 16 + 8 + 1
= 5710

Example: Convert 4BEEF816 to denary

Column No 6 5 4 3 2 1
104857 6553
Value 4096 256 16 1
6 6
Power of
165 164 163 162 161 160
Magnification
Numerals 4 B E E F 8

4BEEF816 = 4 x 165 + 11 x 164 + 14 x 163 + 14 x 162 + 15 x 161+ 8 x 160


= 497649610

1.6 Conversion from Denary to Other Bases


To convert a denary number to other bases, we do a repeated division by the
desired base until a quotient 0 is obtained.

Example: Convert 47510 to octal

8 475
8 59 remainder
3
8 7 remainder

8
3
0 remainder
7

The octal number is obtained by reading the last integer 7 and upwards to include
all remainders; 47510 = 7338

Example: Convert 47510 to binary

2 475 remainder
1
2 237 remainder
1
2 118 remainder
0
2 59 remainder
1
2 29 remainder
1
2 14 remainder
0
2 7 remainder
1
2 3 remainder
1
2 1 remainder
1
0

47510 = 1110110112

1.7 Conversion Among Other Base


We have illustrated the conversions between denary and other bases. How about
converting a binary number to an octal number? Or, an octal number to a
hexadecimal one?

1.7.1 Binary to Octal

We know that 910 = 10012 and 910 = 118 so, we can conclude that 10012 = 118. To
convert a binary number to an octal number in this case will involve a lot of
calculations.

Is there a better way to convert these numbers?

Yes. How many binary bits do we need to represent an octal digit?

Binary Octal
000 0

9
001 1
010 2
011 3
100 4
101 5
110 6
111 7

No. of symbols in octal = 2 no. of binary bits

We need three binary bits to represent symbols in octal! Likewise, one octal
number will produce three binary bits.

To prove it, try whether 3748 = 011 111 1002?

1.7.2 Binary to Hexadecimal

Following the same argument, it is not so difficult to see why we need to have
four binary bits to represent one hexadecimal number.

No. of symbols in Hexadecimal = 2 no. of binary bits

Now can you see why 1101011002 = 1AC16?

0001 1010 1100


1 A C

1.7.3 Conversion Between Octal and Hexadecimal

Since every octal number will produce three binary bits, and every four binary
bits will produce one hexadecimal number. We can make use of the binary base
as the “conversion medium” to convert a hexadecimal number to an octal number
or vice versa.

Example: Convert 7338 to a hex no.

Step 1. Convert 7338 to a binary number.


111 011 011

Step 2. Rearrange this binary number into 4-bit groups.


0001 1101 1011

Step 3. Convert this binary number to a hex.


1DB
Hence, 7338 = 1DB16

1.8 Real Number


In real numbers, e.g. (4.75)10, the 4 is an integer part while 0.75 is a fractional
part. What is the way to convert 0.75 to a binary fraction? The method is to

10
multiply 0.75 by 2 continuously until the fraction becomes zero or the degree of
accuracy is satisfied.

4.75 = 4 + 0.75 = (100)2 + (0.11)2 = (100.11)2

2 4 0
2 2 0 0.75 * 2
1 1 1.5 * 2
1.0

0.11

Let's look at another example.

(6.1)10 to be converted to binary places.

6.1 = 6 + 0.1 = (110)2 + (0.000110)2


= (110.000110)2 correct to 6 binary places.

2 6 0
2 3 1
1 1 0.1 * 2
0.2 * 2
0.4 * 2
0.8 * 2
1.6 * 2
1.2 * 2
0.4

0 . 0 0 0 1 1 0

On the other hand, how can we convert (110.000110)2 to denary real numbers?

Method:

i. Write down the value of each bit (binary digit).


ii. Multiply the value by every bit.
iii. Take the sum of products.

4 2 1 2-1 2-2 2-3 2-4 2-5 2-6


1 1 0 .0 0 0 1 1 0

4*1 + 2*1 + 0*1 + 0*0.5 + 0*0.25 + 0*0.12 5 + 1*0.0625 + 1*0.03125 +


0*0.015625

= 6.09375

1.9 Octal Arithmetic

11
We only cover octal addition. The sum of two octal numbers can be reduced by
the usual addition algorithm to the repeated addition of two digits (with possibly a
carry of 1). The following table shows the addition of Octal number.

++ 0 1 2 3 4 5 6 7
0 0 1 2 3 4 5 6 7
1 1 2 3 4 5 6 7 10
2 2 3 4 5 6 7 10 11
3 3 4 5 6 7 10 11 12
4 4 5 6 7 10 11 12 13
5 5 6 7 10 11 12 13 14
6 6 7 10 11 12 13 14 15
7 7 10 11 12 13 14 15 16

The sum of two octal digits, or the sum of two octal digits plus 1, can be obtained
by:

i. Finding their decimal sum; and


ii. Modifying the decimal, if it exceeds 7, by subtracting 8 and carrying 1 to the
next column.

Example: 58 + 68 + 28 = 158

58
+ 68
28

Decimal sum 13
Modification - 8
Octal sum 158

1.10 Hexadecimal Arithmetic


As with the octal system, we cover only hexadecimal addition.

The sum of two hexadecimal digits, or the sum of two hexadecimal digits plus 1,
can be obtained by:
i. Finding their decimal sum; and
ii. Modifying the decimal, if it exceeds 15, by subtracting 16 and carrying 1 to
the next column.

If the base exceeds ten, we need mentally to change each hexadecimal letter digit
to its decimal form when finding the decimal sum, and each decimal difference
greater than nine to its hexadecimal form when modifying the decimal sum.

1. A = 10 B = 11 C = 12 D = 13 E = 14 F = 15

Example: A16 + 916

12
A16
+ 916

Decimal sum 19
Modification - 16
Octal sum 1316

1.11 Modular Arithmetic


In our daily life, there are many counting/measuring systems around us. We know
that 100cm is not the same as 100 inches. It's because the measuring units are
different, however, we do not intend to cover the conversions of this kind.

To demonstrate how modular arithmetic works is to give a test first:

“If Peter starts work at 8 o'clock in the morning and works for 8 hours, at what
time will Peter finish work?”

4 o'clock in the afternoon, right? But how you worked that one out? Because the
clock only has 12 hours, once the shorthand reaches 12, it will restart from 0. The
numbers we see on the clock-face must be less than or equal to 12. This is a finite
set or finite arithmetics.

To show it mathematically, we add 8 hours to 8 o'clock, and divide 16 by the


modules number 12, the remainder 4 will be the answer we want.

8 + 8 = 16
(16) mod 12 = 4

Example: (11 + 3 + 7 + 9)mod 12

30/12 = 2 remainder 6
30 mod12 = 6

Points to Remember

The various sets of numbers include:


 Natural numbers
 Integers
 Rational numbers
 Irrational numbers
 Real numbers
 Complex numbers

The higher the precision required the longer the processing time in computer
systems.

13
4 number systems
 Decimal (Denary)
 Binary
 Octal
 Hexadecimal

Additional of Octal and Hexadecimal


Convert from other base to decimal integer
Step 1. Write down the weight of each digit;
Step 2. Multiply each weight and each digit;
Step 3. Take the sum of the product.

Convert from decimal integer to other bases


Step 1. Divide the decimal integer by the desired base;
Step 2. Write down the remainder;
Step 3. Repeat dividing until a quotient 0;
Step 4. Read the remainders from bottom upwards.

Octal and hexadecimal numbers are used as a shorthand for binary numbers.
Each octal digit can be expressed as 3 binary digits
Each hexadecimal digit can be expressed as 4 binary digits.

Use modular arithmetic when the data is finite.

1.12 Past Year Questions


Express the number 7478 in:
a. Binary [1]
b. Denary [1]
c. Hexadecimal [1]

Convert showing all working;


d. 21.625 denary to binary [1]
e. 2AE hexadecimal to denary [1]
f. 16.62 octal to binary [1]
g. 567 octal to binary [1]
h. 684 denary to hexadecimal [1]

Convert the following:


i. 157 denary to binary [1]

14
j. 1100110101 binary to octal [1]
k. ACD hexadecimal to denary [1]
l. 2464 octal to hexadecimal [1]

Convert the following:


m. 101 101 101 Binary to Octal [1]
n. DAB Hexadecimal to Denary [1]
o. 2839 Denary to Hexadecimal [1]
p. 7453 Octal to Hexadecimal [1]
Express the denary number 567:
q. in binary [1]
r. in hexadecimal [1]

Express the number 1038:


s. in binary [1]
t. hexadecimal [1]

Convert:
u. 274 Octal to DENARY [1]
v. DA3 Hexadecimal to OCTAL [1]

1. Convert:
w. ABC Hexadecimal to OCTAL [1]
x. 3974 Denary to HEXADECIMAL [1]

2. Convert:
y. 7456 Octal to HEXADECIMAL [1]
z. 9E7 Hexadecimal to DENARY [1]

3. Convert:
aa. 8543 Denary to OCTAL [1]
bb. 9AD Hexadecimal to OCTAL [1]

4. Convert:
cc. A25 HEXADECIMAL to BINARY [1]
dd. 549 DENARY to OCTAL [1]
ee. 3527 OCTAL to HEXADECIMAL [1]

Convert:

15
ff. 5391 Denary to HEXADECIMAL [1]
gg. 6A5 Hexadecimal to OCTAL [1]

Convert:
hh. 5743 Denary to HEXADECIMAL [1]
ii. ABC Hexadecimal to OCTAL [1]

Convert the following: (You MUST show all workings.)


jj. 110100102 to Hexadecimal [2]
kk. 54A16 to Denary [2]
ll. 10178 to Binary [2]
mm. 16710 to Binary [2]

Convert the following:


nn. 1752648 to base 16 [1]
oo. 110110 to base 16 [1]
pp. 728  28 to base 10 [2]
qq. B0016 + 1F16 to base 2 [2]

a. Express the number 2310 in binary [1]


b. Express the number 4610 in binary [1]
c. Express the number 9210 in binary [1]
d. Express in binary the result of multiplying 1001101112 by 410 [2]

Convert the following:


e. 3578 to base 16 [2]
f. 101110 to base 16 [2]
g. 5048  28 to base 10 [2]
h. 6A16 + D0016 to base 2 [2]

What is the BASE of the number system where 36 + 27 = 65? [2]

By converting to BINARY, evaluate the


HEXADECIMAL expression: 7B + EA.
Give your answer in HEXADECIMAL. [2]

a. Evaluate (7 * 4 + 6 * 5) mod 11 [1]


i. Solve (3 * p = 8) mod 11 [2]

16
a. Evaluate (7 * 3 + 5 * 2 + 2 * 1) mod 11 [1]
j. Evaluate (3 * p) mod 5 for p = 0, 2 and 4 [2]

a. Evaluate (8 * 5 + 7 * 6) mod 11 [1]


k. Solve (3p = 7) mod 11 [2]

Evaluate ((4 * 6) + (35 DIV 4)) MOD 11 [3]

17
Chapter 2 : Computer Based Arithmetic

Chapter Objectives

At the completion of this chapter, you should understand how to:

 perform binary calculation;

 store numbers into computer words;

 integer
 fraction
 mixed number;

 store numbers into computer words using;

 sign modulus method


 2‟s complement method;

 perform 2‟s complement subtraction;

 shift operations.

18
2.1 Binary Addition
Binary addition for fixed point numbers is done as follows:

The numbers to be added are aligned by their binary points.


Starting from the least significant (rightmost) digit, a corresponding pair of digits
(in the same column) are added according to the rules of binary addition.
If a column has a carry from the previous column, the carry digit has to be added
also.
Repeat steps (ii) and (iii) for each column until the most significant (leftmost)
digit has been added.

2.1.1 Rules for Binary Addition

1+1 = 0  and carry over 1 to add to next column


1+0 = 1 (i.e. 1+1 = 10)
0+1 = 1
0+0 = 0

2.1.2 Examples of Binary Addition

Example:
Binary
Decimal equivalent
1010 10
+ 0111 + 7
10001 17

Example:
Binary
Decimal equivalent
1010.01 10.25
+ 0111.11 + 6.75
10001.00 17.00

Example:
Binary
Decimal equivalent
111 carry over 1 carry over

101100 44
+ 011101 + 29
1001001 73

19
Example:
Binary
Decimal equivalent
11 carry over

0.11 0.75
+ 0.01 + 0.25
1.00 1.00

2.2 Binary Subtraction

2.2.1 Rules for Binary Subtraction

0-0 = 0
1-1 = 0
1-0 = 1
0-1 = 1  with borrow “1” from the column to the left of
the number subtracted from

2.2.2 Examples of Binary Subtraction

Example:
Binary
Decimal equivalent
11010 26
- 01001 - 9
10001 17

Example:
Binary
Decimal equivalent
1010.00 10.00
- 1000.11 - 8.75
00001.01 17

The subtraction process can be more clearly illustrated in the following example.

Example:

20

You might also like