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

Computational Mathematics

The document provides an overview of computational mathematics topics including matrices, number systems, binary arithmetic, logic gates, counting techniques, probability, and graphing functions. It covers basic concepts, definitions, operations, and applications across these mathematical domains in six chapters spanning over 199 pages.

Uploaded by

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

Computational Mathematics

The document provides an overview of computational mathematics topics including matrices, number systems, binary arithmetic, logic gates, counting techniques, probability, and graphing functions. It covers basic concepts, definitions, operations, and applications across these mathematical domains in six chapters spanning over 199 pages.

Uploaded by

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

MINISTRY OF EDUCATION

DIPLOMA IN
INFORMATION COMMUNICATION
TECHNOLOGY

KENYA INSTITUTE OF CURRICULUM DEVELOPMENT


STUDY NOTES

Computational Mathematics

MODULE I: SUBJECT NO 5

Page 1 of 199
Contents
CHAPTER 1: INTRODUCTION TO COMPUTATIONAL MATHEMATICS .................................. 6
Equations .................................................................................................................................................. 6
Algebraic equation .................................................................................................................................... 6
An introduction to MATRICES .............................................................................................................. 19
Definition of Matrix............................................................................................................................. 19
Types of Matrices ................................................................................................................................ 20
Operation of matrices ......................................................................................................................... 22
Determinant of a Matrix ..................................................................................................................... 28
Inverse of a Matrix .............................................................................................................................. 30
Algebraic Properties of Matrix Operations ......................................................................................... 38
Applications of Matrix Mathematics .................................................................................................. 42
CHAPTER 2: NUMBER SYSTEM AND BINARY ARITHMETIC................................................... 43
Introduction to Number System .............................................................................................................. 43
Bits & Bytes: ........................................................................................................................................... 43
Binary Number System: .......................................................................................................................... 43
Other Number System............................................................................................................................. 45
Conversion between Number System ..................................................................................................... 46
Introduction to Binary Arithmetic........................................................................................................... 49
Representation of negative numbers ....................................................................................................... 56
Computer data formats/coding ................................................................................................................ 58
CHAPTER 3: LOGIC GATES AND BOOLEAN ALGEBRA............................................................. 64
Introduction to Logic Mathematics ......................................................................................................... 64
Types of Sets ....................................................................................................................................... 64
Operation of a Set ............................................................................................................................... 70
Venn Diagrams ................................................................................................................................... 83
Boolean Algebra ..................................................................................................................................... 91
Terminologies in Boolean Algebra ..................................................................................................... 91
Logic Functions gates and circuitry .................................................................................................... 92
Theorems of Boolean Algebra ............................................................................................................ 95
Karnaugh maps (K-maps) ................................................................................................................... 98
CHAPTER 4: DISCRETE COUNTING .............................................................................................. 103

Page 2 of 199
The Basic Rules/Principles of Counting ............................................................................................... 103
The Rules of Sum and Product .......................................................................................................... 103
Pigeonhole Principle ......................................................................................................................... 103
Examples ........................................................................................................................................... 104
The Inclusion-Exclusion principle ...................................................................................................... 104
Counting Techniques ............................................................................................................................ 105
Permutations..................................................................................................................................... 105
Combinations .................................................................................................................................... 107
Pascal's Identity................................................................................................................................. 108
Binomial Theorem ................................................................................................................................ 108
Exponents.......................................................................................................................................... 109
The Pattern ....................................................................................................................................... 110
Coefficients ....................................................................................................................................... 111
Formula ............................................................................................................................................. 113
Geometry .......................................................................................................................................... 116
Pascal's Triangle ................................................................................................................................ 118
CHAPTER 5: PROBABILITY .............................................................................................................. 122
Introduction to probability .................................................................................................................... 122
Probability Models ................................................................................................................................ 122
Equally likely outcomes ........................................................................................................................ 123
The Sum Rule ....................................................................................................................................... 125
Random Variables................................................................................................................................. 126
The Mean (Expected Value) of a Probability model ............................................................................ 126
The Law of Large Numbers .................................................................................................................. 127
Probability of Single or Combined Events ........................................................................................... 127
Independent and Dependent Events ...................................................................................................... 127
Conditional Probability ......................................................................................................................... 128
Probability Tree Diagrams .................................................................................................................... 129
Set Theory in Probability ...................................................................................................................... 132
Probability Distribution ........................................................................................................................ 135
CHAPTER 6: GRAPHS OF FUNCTIONS .......................................................................................... 137
Defining the Graph of a Function ..................................................................................................... 137

Page 3 of 199
Vertical Line Test ................................................................................................................................. 138
Characteristics of Graphs ...................................................................................................................... 139
Continuous Functions ........................................................................................................................... 142
Interpolation and Extrapolation ............................................................................................................ 144
Area under a Curve ............................................................................................................................... 144
Inequality .............................................................................................................................................. 147
Common Graph Construction Errors .................................................................................................... 149
CHAPTER 7: DATA COLLECTION METHODS ............................................................................. 152
Introduction to Data Collection Methods.............................................................................................. 152
Data Edition: ......................................................................................................................................... 152
Types of Data Collection Methods ....................................................................................................... 152
Selecting Appropriate Data Collection Method .................................................................................... 153
Classification of Data ............................................................................................................................ 153
Data Tabulation and Presentation ......................................................................................................... 154
CHAPTER 8: MEASURES OF CENTRAL TENDENCY ................................................................. 162
Introduction to central tendency ........................................................................................................... 162
The significance property of measures of central tendency .................................................................. 162
Types and measures of central tendency............................................................................................... 162
Calculation in central tendency ............................................................................................................. 162
CHAPTER 9: MEASURES OF DISPERSION.................................................................................... 166
Introduction to measure of Dispersion .................................................................................................. 166
Properties of a good measure of Dispersion ......................................................................................... 166
Types of Dispersion .............................................................................................................................. 166
Methods of Dispersion and Calculations .............................................................................................. 167
Quartiles, deciles, percentiles and S.I.R. ............................................................................................... 167
Skewness and kurtosis in Dispersion interplatation .............................................................................. 170
CHAPTER 10: NUMERICAL ANALYSIS ......................................................................................... 172
Introduction to Numerical analysis ....................................................................................................... 172
General introduction ............................................................................................................................. 172
Approximation theory ........................................................................................................................... 172
Numerical methods ............................................................................................................................... 173
Direct and iterative methods ................................................................................................................. 173

Page 4 of 199
Discretization ........................................................................................................................................ 174
Generation and propagation of errors ................................................................................................... 175
Areas of study ....................................................................................................................................... 176
Computing values of functions ......................................................................................................... 176
Interpolation, extrapolation, and regression .................................................................................... 176
Solving equations and systems of equations .................................................................................... 177
Solving eigenvalue or singular value problems................................................................................. 177
Optimization ..................................................................................................................................... 177
Evaluating integrals ........................................................................................................................... 178
Differential equations ....................................................................................................................... 178
Software ................................................................................................................................................ 178
CHAPTER 11: INTRODUCTION TO MODELING ......................................................................... 179
Introduction to Mathematical modeling ................................................................................................ 179
Hypothesis, Model, Theory & Law ...................................................................................................... 179
General rules of mathematical modeling .............................................................................................. 180
Construct generalized models ............................................................................................................... 181
Computer Modeling .............................................................................................................................. 186
Meaning of mathematical Model pseudo-code ..................................................................................... 187
Logical models, Statistical models and Other Models .......................................................................... 187
Logic model ....................................................................................................................................... 187
Statistical models .............................................................................................................................. 189
Spatial Model .................................................................................................................................... 197
Symbolic Modelling ........................................................................................................................... 198

Page 5 of 199
CHAPTER 1: INTRODUCTION TO
COMPUTATIONAL MATHEMATICS
Equations
In mathematics an equation is an expression of the shape A = B, where A and B are expressions
containing one or several variables called unknowns.

An algebraic equation or polynomial equation is an equation in which both sides are polynomials

A system of polynomial equations is a set of simultaneous equations f1 = 0, ..., fh = 0 where the


fi are polynomials in several variables, say x1, ..., xn, over some field k.

Algebraic equation
Mathematical statement of equality between algebraic expressions. An expression is algebraic if
it involves a finite combination of numbers and variables and algebraic operations (addition,
subtraction, multiplication, division, raising to a power, and extracting a root). Two important
types of such equations are linear equations, in the form y = ax + b, and quadratic equations, in
the form y = ax2 + bx + c. A solution is a numerical value that makes the equation a true
statement when substituted for a variable. In some cases it may be found using a formula; in
others the equation may be rewritten in simpler form.

1. A linear equation is an algebraic equation in which each term is either a constant or the product
of a constant and (the first power of) a single variable.

A common form of a linear equation in the two variables x and y is

where m and b designate constants (parameters). The origin of the name "linear" comes from the
fact that the set of solutions of such an equation forms a straight line in the plane. In this
particular equation, the constant m determines the slope or gradient of that line, and the constant
term b determines the point at which the line crosses the y-axis, otherwise known as the y-
intercept.

General (or standard) form

In the general (or standard) form the linear equation is written as:

where A and B are not both equal to zero. The equation is usually written so that A ≥ 0, by convention.
The graph of the equation is a straight line, and every straight line can be represented by an equation in
the above form. If A is nonzero, then the x-intercept, that is, the x-coordinate of the point where the
graph crosses the x-axis (where, y is zero), is C/A. If B is nonzero, then the y-intercept, that is the y-

Page 6 of 199
coordinate of the point where the graph crosses the y-axis (where x is zero), is C/B, and the slope of the
line is −A/B. The general form is sometimes written as:

where a and b are not both equal to zero. The two versions can be converted from one to the other by
moving the constant term to the other side of the equal sign.

Slope–intercept form

where m is the slope of the line and b is the y-intercept, which is the y-coordinate of the location where
line crosses the y axis. This can be seen by letting x = 0, which immediately gives y = b. It may be helpful
to think about this in terms of y = b + mx; where the line passes through the point (0, b) and extends to
the left and right at a slope of m. Vertical lines, having undefined slope, cannot be represented by this
form.

Point–slope form

where m is the slope of the line and (x1,y1) is any point on the line.

The point-slope form expresses the fact that the difference in the y coordinate between two points on a
line (that is, y − y1) is proportional to the difference in the x coordinate (that is, x − x1). The
proportionality constant is m (the slope of the line).

Two-point form

where (x1, y1) and (x2, y2) are two points on the line with x2 ≠ x1. This is equivalent to the point-slope
form above, where the slope is explicitly given as (y2 − y1)/(x2 − x1).

Multiplying both sides of this equation by (x2 − x1) yields a form of the line generally referred to
as the symmetric form:

Intercept form

Page 7 of 199
Where a and b must be nonzero. The graph of the equation has x-intercept a and y-intercept b. The
intercept form is in standard form with A/C = 1/a and B/C = 1/b. Lines that pass through the origin or
which are horizontal or vertical violate the nonzero condition on a or b and cannot be represented in
this form.

Matrix form

Using the order of the standard form

one can rewrite the equation in matrix form:

Further, this representation extends to systems of linear equations.

becomes

Since this extends easily to higher dimensions, it is a common representation in linear algebra,
and in computer programming. There are named methods for solving system of linear equations,
like Gauss-Jordan which can be expressed as matrix elementary row operations.

2. A quadratic equation is a univariate polynomial equation of the second degree. A general


quadratic equation can be written in the form

where x represents a variable or an unknown, and a, b, and c are constants with a ≠ 0. (If a = 0,
the equation is a linear equation.). The constants a, b, and c are called respectively, the quadratic
coefficient, the linear coefficient and the constant term

A quadratic equation with real or complex coefficients has two solutions, called roots. These two
solutions may or may not be distinct, and they may or may not be real.

Page 8 of 199
Methods to Solve Quadratic Equations
Below are the four most commonly used methods to solve quadratic equations. Click on any link to learn
more about any of the methods.

 The Quadratic Formula (Quadratic formula in depth)


 Factoring
 Completing the Square
 Graph

Method 1 – Formula
The solution of a quadratic equation is the value of x when you set the equation equal to zero
i.e. When you solve the following general equation: 0 = ax² + bx + c
Given a quadratic equation: ax ² + bx + c
The quadratic formula below will solve the equation for zero
The quadratic formula is:

-b ± √b2-4ac
2a
Examples of the quadratic formula to solve an equation

 Example 1

Quadratic Equation: y = x² + 2x + 1

o a=1
o b=2
o c=1

Using the quadratic formula to solve this equation just substitutes a, b, and c into the general
formula:

Page 9 of 199
-2 ± √22-4(1)(1) -2 ± √4 - 4
2(1) 2

-2 ± √0 -2 -1
2 2

Method 2 – Graph - Below is a picture representing the graph of y = x² + 2x + 1 and its solution

Method 3 – Factoring
The solution of a quadratic equation is the value of x when you set the equation equal to zero
i.e. When you solve the following general equation: 0 = ax² + bx + c
Given a quadratic equation: ax ² + bx + c
One method to solve the equation for zero is to factor the equations.
General Steps to solve by factoring

 Step 1) Create a factor chart for all factor pairs of c


o A factor pair is just two numbers that multiply and give you 'c'
 Step 2) Out of all of the factor pairs from step 1, look for the pair (if it exists) that add up
to b

Page 10 of 199
o Note: if the pair does not exist, you must either complete the square or use the
quadratic formula .
 Step 3) Insert the pair you found in step 2 into two binomials
 Step 4) Solve each binomial for zero to get the solutions of the quadratic equation.
 Example of how to solve a quadratic equation by factoring
 Quadratic Equation: y = x² + 2x + 1

y=ax2+bx+c
y=x2+2x+1
1) Create a factor chart Factors of c Sum of factors
(as pairs) (must equal b)
1.1 1+1
2) Determine which of factor pair of “c”
1,1
has a sum of “b”
3) Insert that pair into binomial factors y=(x+1)( x+1)
4) Solve each binomial for zero 0 = x+ 1
-1 -1
-1 = x
Below is a picture representing the graph of y = x² + 2x + 1 as well as the solution we found by
factoring

Page 11 of 199
Method 4 – Completing the square

Formula for Completing the Square

First off, a little necessary vocabulary:


A perfect square trinomial is a polynomial that you get by squaring a binomial.(binomials are
things like 'x + 3' or 'x − 5')
Examples of perfect square trinomials (the red trinomials)

 (x+ 1)² = x² + 2x + 1
 (x+ 2)² = x² + 4x + 4
 (x+ 3)² = x² + 6x + 9

Examples of trinomials that are NOT perfect square trinomials

 (x+ 1)(x +2)= x² + 3x + 2


 (x+ 2)(x+5) = x² + 7x + 10
 (x+ 3)(x −3)= x² − 9

To best understand the formula and logic behind completing the square, look at each example
below and you should see the pattern that occurs whenever you square a binomial to produce a
perfect square trinomial.

(x+3)2 = x2+6x+9
= x2+2(3)x+32
(x+4)2 = x2+8x+16
= x2+2(4)x+42
(x+5)2 = x2+10x+25
= x2+2(5)x+52
(x+6)2 = x2+12x+36
= x2+2(6)x+62
(x+7)2 = x2+14x+49
= x2+2(7)x+72
(x+k)2 = x2+2(k)x+k2

Page 12 of 199
As the examples above show, the square of a binomial always follows the same pattern and
formula.
Given a quadratic equation x² + bx + c that is a SQUARE OF A BINOMIAL
c is always the square of ½(b)
i.e. c = ½(b)²

3. Simultaneous equations
The terms simultaneous equations and systems of equations refer to conditions where two or
more unknown variables are related to each other through an equal number of equations.

A set of two or more equations, each containing two or more variables whose values can
simultaneously satisfy both or all the equations in the set, the number of variables being equal to
or less than the number of equations in the set

There are Four methods to solve a system of equations:


1. Graphing
2. Substitution
3. Elimination or addition method
4. Matrices

For example

6x + 3y = 12

5x + y = 7

Method 1 – Graphing

To solve by graphing, the two lines must be graphed on the same rectangular co-ordinate
system. To graph each line, you need to find at least two points on each line. Set up an x and y
charts on each. The points on which the two graphs intersect is the solution.

Page 13 of 199
For 6x + 3y = 12 For 5x + y = 7
x y x y
0 4 0 7
2 0 1.4 0

Select a value for one variable and solve for the other
X
0,7

0,4
1,2

Y
1.4,0 2,0

Method 2 - Substitution

To solve by substitution, select one equation (it does not matter which of the equation) and
solve for one of the variables (it does not matter which of the variables). Then substitute that
expression into the other equation.

For 6x + 3y = 12 I am going to solve for Y (why?, because I want to)

6x + 3y = 12
(6x + 3y) -6x = 12 -6x therefore 3y=-6x+12
3y/3=-(6x+12)/3 hence y=-2x+4

Since I solved for y, I am going to use this to substitute into the y variable of the second
equation

For 5x + y = 7
5x + (-2x+4) = 7 now solve for X
5x-2x+4=7 =>3x+4=7 =>3x=3 =>x=1
Now that we know what x is, use this to solve for y by using one of the original equations (it
does no matter which of the equations)

Page 14 of 199
I’ll use 6x + 3y = 12(why?, because I want to)
6x + 3y = 12 => 6(1) + 3y = 12 => 6 + 3y = 12 =>3y = 12-6 => 3y = 6
therefore y = 6/3=2

Therefore, our answer is (1, 2) which is our point of intersection.

Method 3 – Elimination or Addition method


The objective of elimination method is to add the equations such that like terms add up to
zero. If no like terms add up to zero, the multiplication is used to alter the system of equations
such that like terms do add up to zero.
6x + 3y = 12
If the equation were added now, no like terms world add up to zero
5x + y = 7

11x+4y=19

Therefore multiplication is required to alter the equation. To do this legally, remember that
whatever you do on one side of the equation you must do the same on the other side of the
equation.

To eliminate a variable, do the following


1. Decide which variable to eliminate(it does not matter which of the equation)
6x + 3y = 12
I’ll pick the X term (why?, because I want to)
5x + y = 7

2. Looking at the variable from each equation, find the least common multiple of the
coefficients (X and Y)
6x + 3y = 12

5x + y = 7

The least common multiple of 5 and 6 is 30


3. Now multiply each equation by the number which will make the co-efficient on the x
variable 30
5[6x + 3y = 12] 30x + 15y = 60

6[5x + y = 7] 30x + 6y = 42

Page 15 of 199
Notice that if this equations were added, the X terms would still not add up to zero,
therefore one of the factors, 5 or 6, which was used to multiply with the equations must be
negative, I’ll chose 6 to be negative (why?, because I want to)

5[6x + 3y = 12] 30x + 15y = 60

-6[5x + y = 7] -30x - 6y = -42

9y=18

Y=2

4. Now substitute this value into one of the original equations(it does not matter which of the
equation) to solve for X
6x + 3y = 12(why? because I want to)

6x+3(2) =12 => 6x+6=12 => 6x=6 => x=1

Therefore our answer is (1,2) which happens to be the point of intersection.

Method 4: Matrices

Example 1

EQUATIONS

 x+y+z=6
 2y + 5z = -4
 2x + 5y - z = 27

A Matrix is an array of numbers, right?

A Matrix

Page 16 of 199
Well, think about the equations:

x + y + z = 6

2y + 5z = -4

2x + 5y - z = 27

They could be turned into a table of numbers like this:

1 1 1 = 6

0 2 5 = -4

2 5 -1 = 27

We could even separate the numbers before and after the "=" into:

1 1 1 6

0 2 5 and -4

2 5 -1 27

Now it looks like we have 2 Matrices.

In fact we have a third one, which is [x y z], and the way that matrices are ,we need to set it up
like this:

Page 17 of 199
And we know that x + y + z = 6, etc, so we can write the system of equations like this:

Pretty neat, hey?

The Matrix Solution

We can call the matrices "A", "X" and "B" and the equation becomes:

AX = B

Where A is the 3x3 matrix of x,y and z coefficients X is x, y and z, and B is 6, -4 and 27

Then (as shown on the Inverse of a Matrix page) the solution is this:

X = A-1B

(Assuming we can calculate the Inverse Matrix A-1)

Then multiply A-1 by B (you can use the Matrix Calculator again):

And we are done! The solution is:

x = 5, y = 3 and z = -2

Page 18 of 199
An introduction to MATRICES
Definition of Matrix
A matrix is a collection of numbers arranged into a fixed number of rows and columns. Usually
the numbers are real numbers. In general, matrices can contain complex numbers but we won't
see those here. Here is an example of a matrix with three rows and three columns:

Cols 1……..
1 -2 3
Rows 1……..
0 8 4.6
4 -1 0

The top row is row 1. The leftmost column is column 1. This matrix is a 3x3 matrix because
it has three rows and three columns. In describing matrices, the format is:

Rows X columns
Each number that makes up a matrix is called an element of the matrix. The elements in a
matrix have specific locations.

The upper left corner of the matrix is row 1 column 1. In the above matrix the element at row 1
col 1 is the value 1. The element at row 2 column 3 is the value 4.6.

Matrix Dimensions
The numbers of rows and columns of a matrix are called its dimensions. Here is a matrix
with three rows and two columns:

Sometimes the dimensions are written off to the side of the matrix, as in the above matrix. But
this is just a little reminder and not actually part of the matrix. Here is a matrix with different
dimensions. It has two rows and three columns. This is a different "data type" than the
previous matrix

Page 19 of 199
1 -2 3

0 8 4.6
4 -1 0 2×3

Types of Matrices
Square matrix
If a matrix A has n rows and n columns then we say it's a square matrix.

In a square matrix the elements ai,i , with i = 1,2,3,... , are called diagonal elements.
Remark. There is no difference between a 1 x 1 matrix and an ordinary number.

Diagonal matrix
A diagonal matrix is a square matrix with all de non-diagonal elements 0.
The diagonal matrix is completely defined by the diagonal elements.
Example.
7 0 0
0 5 0
0 0 6

The matrix is denoted by diag(7 , 5 , 6)

Row matrix
A matrix with one row is called a row matrix.

[2 5 -1 5]

Column matrix
A matrix with one column is called a column matrix.
[2]
[4]
[3]
[0]

Page 20 of 199
Matrices of the same kind
Matrix A and B are of the same kind if and only if
A has as many rows as B and A has as many columns as B

[7 1 2] [4 0 3]
[0 5 6] and [1 1 4]
[3 4 6] [8 6 2]
The transposed matrix of a matrix
The n x m matrix B is the transposed matrix of the m x n matrix A if and only if
The ith row of A = the ith column of B for (i = 1,2,3,..m)
So ai,j = bj,i
The transposed matrix of A is denoted T(A) or AT

T
[7 1 ] [7 0 3]
[0 5 ] = [1 5 4]
[3 4 ]

0-matrix
When all the elements of a matrix A are 0, we call A a 0-matrix.
We write shortly 0 for a 0-matrix.

An identity matrix I
An identity matrix I is a diagonal matrix with all the diagonal elements = 1.
[1]

[1 0]
[0 1]

[1 0 0]
[0 1 0]
[0 0 1]

...

A scalar matrix S
A scalar matrix S is a diagonal matrix whose diagonal elements all contain the same scalar value.
a1,1 = ai,i for (i = 1,2,3,..n)
[7 0 0]
[0 7 0]
[0 0 7]

The opposite matrix of a matrix


If we change the sign of all the elements of a matrix A, we have the opposite matrix -A.
If A' is the opposite of A then ai,j' = -ai,j, for all i and j.

Page 21 of 199
A symmetric matrix
A square matrix is called symmetric if it is equal to its transpose.
Then ai,j = aj,i , for all i and j.
[7 1 5]
[1 3 0]
[5 0 7]
A skew-symmetric matrix
A square matrix is called skew-symmetric if it is equal to the opposite of its transpose.
Then ai,j = -aj,i , for all i and j.
[ 0 1 -5]
[-1 0 0]
[ 5 0 0]

Operation of matrices
Addition of Matrices
Adding
To add two matrices: add the numbers in the matching positions:

These are the calculations:


3+4=7 8+0=8
4+1=5 6-9=-3
The two matrices must be the same size, i.e. the rows must match in size, and the columns
must match in size.

Example: a matrix with 3 rows and 5 columns can be added to another matrix of 3 rows and 5
columns.

But it could not be added to a matrix with 3 rows and 4 columns (the columns don't match
in size)

Denote the sum of two matrices A and B (of the same dimensions) by C = A + B.. The sum is
defined by adding entries with the same indices
Page 22 of 199
over all i and j.

Example:

Subtraction of Matrices
To subtract two matrices: subtract the numbers in the matching positions:

These are the calculations:


3-4=-1 8-0=8
4-1=3 6-(-9)=15
Note: subtracting is actually defined as the addition of a negative matrix: A + (-B)
Subtraction is performed in analogous way.
Example:

Page 23 of 199
How to Multiply Matrices
A Matrix is an array of numbers:

A Matrix

(This one has 2 Rows and 3 Columns)

To multiply a matrix by a single number is easy:

These are the calculations:

2×4=8 2×0=0 2×1=2

2×-9=-18

We call the number ("2" in this case) a scalar, so this is called "scalar multiplication".

Example: The local shop sells 3 types of pies.

  Beef pies cost $3 each

  Chicken pies cost $4 each


 Vegetable pies cost $2 each

Page 24 of 199
And this is how many they sold in 4 days:

Now think about this ... the value of sales for Monday is calculated this

way: Beef pie value + Chicken pie value + Vegetable pie value

$3×13 + $4×8 + $2×6 = $83


So it is, in fact, the "dot product" of prices and how many were sold:
($3, $4, $2) • (13, 8, 6) = $3×13 + $4×8 + $2×6 = $83

We match the price to how many sold, multiply each, then sum the result.

In other words:
 The sales for Monday were: Beef pies: $3×13=$39, Chicken pies: $4×8=$32,
 and Vegetable pies: $2×6=$12. Together that is $39 + $32 + $12 = $83

 And for Tuesday: $3×9 + $4×7 + $2×4 = $63


 And for Wednesday: $3×7 + $4×4 + $2×0 = $37
 And for Thursday: $3×15 + $4×6 + $2×3 = $75

So it is important to match each price to each quantity.


Now you know why we use the "dot product".
And here is the full result in Matrix form:

Page 25 of 199
They sold $83 worth of pies on Monday, $63 on Tuesday, etc.
(You can put those values into the Matrix Calculator to see if they work.)

Rows and Columns


To show how many rows and columns a matrix has we often write

rows×columns. Example: This matrix is 2×3 (2 rows by 3 columns):

When we do multiplication:
 The number of columns of the 1st matrix must equal the number of rows of the 2nd
 matrix.

 And the result will have the same number of rows as the 1st matrix, and the same
number of columns as the 2nd matrix.

Example:

Page 26 of 199
In that example we multiplied a 1×3 matrix by a 3×4 matrix (note the 3s are the same), and the
result was a 1×4 matrix.

In General:
To multiply an m×n matrix by an n×p matrix, the ns must be the
same, and the result is an m×p matrix.

Order of Multiplication
In arithmetic we are used to:
3×5=5×3
(The Commutative Law of Multiplication)
But this is not generally true for matrices (matrix multiplication is not commutative):
AB ≠ BA
When we change the order of multiplication, the answer is (usually) different.
Example:
See how changing the order affects this multiplication:

Identity Matrix
The "Identity Matrix" is the matrix equivalent of the number "1":

Page 27 of 199
A 3x3 Identity Matrix

 It is "square" (has same number of rows as columns),


 It has 1s on the diagonal and 0s everywhere else.
 Its symbol is the capital letter I.

It is a special matrix, because when we multiply by it, the original is unchanged:


A×I=A
I×A=A

Determinant of a Matrix
The determinant of a matrix is a special number that can be calculated from a square matrix.
A Matrix is an array of numbers:

A Matrix

(This one has 2 Rows and 2 Columns)

The determinant of that matrix is (calculations are explained later):


3×6 − 8×4 = 18 − 32 = −14

Page 28 of 199
What is it for?
The determinant tells us things about the matrix that are useful in systems of linear
equations, helps us find the inverse of a matrix, is useful in calculus and more.

Symbol
The symbol for determinant is two vertical lines either side.
Example:
|A| means the determinant of the matrix A
(Exactly the same symbol as absolute value.)

Calculating the Determinant


First of all the matrix must be square (i.e. have the same number of rows as columns). Then it is
just basic arithmetic. Here is how:

For a 2×2 Matrix


For a 2×2 matrix (2 rows and 2 columns):

The determinant is:


|A| = ad - bc

"The determinant of A equals a times d minus b times c"

It is easy to remember when you think of a cross:

  Blue means positive (+ad),

 Red means negative (-bc)

Page 29 of 199
Example:

|B| = 4×8 - 6×3


= 32-18
= 14

Cramer’s Rule
Cramer‟s Rule, is used to solve systems with matrices. Cramer‘s Rule was named after the
Swiss mathematician Gabriel Cramer, who also did a lot of other neat stuff with math.

Cramer‘s rule is all about getting determinants of the square matrices that are used to solve
systems.

Inverse of a Matrix
What is the Inverse of a Matrix?
This is the reciprocal of a Number:

Reciprocal of a Number

-1
The Inverse of a Matrix is the same idea but we write it A

Page 30 of 199
1 1 -1
Why not /A ? Because we don't divide by a Matrix! And anyway /8 can also be written 8

And there are other similarities:


When you multiply a number by its reciprocal you get 1
1
8 × ( /8) = 1

When you multiply a Matrix by its Inverse you get the Identity Matrix (which is like "1"
for Matrices):
-1
A×A =I

Same thing when the inverse comes first:


1
( /8) × 8 = 1
-1
A ×A=I

Identity Matrix
We just mentioned the "Identity Matrix". It is the matrix equivalent of the number "1":

A 3x3 Identity Matrix

  It is "square" (has same number of rows as columns),

  It has 1s on the diagonal and 0s everywhere else.

 It's symbol is the capital letter I.

The Identity Matrix can be 2×2 in size, or 3×3, 4×4, etc ...

Page 31 of 199
Definition
Here is the definition:
-1
The Inverse of A is A only when:
-1 -1
A×A =A ×A=I

Sometimes there is no Inverse at all.

2x2 Matrix
OK, how do we calculate the Inverse?

Well, for a 2x2 Matrix the Inverse is:

In other words: swap the positions of a and d, put negatives in front of b and c, and divide
everything by the determinant (ad-bc).

Let us try an example:

How do we know this is the right answer?


-1
Remember it must be true that: A × A = I

Page 32 of 199
So, let us check to see what happens when we multiply the matrix by its inverse:

And, hey!, we end up with the Identity Matrix! So it must be right.


-1
It should also be true that: A × A = I

Why don't you have a go at multiplying these? See if you also get the Identity Matrix:

Why Would We Want an Inverse?


Because with Matrices we don't divide! Seriously, there is no concept of dividing by a Matrix.
But we can multiply by an Inverse, which achieves the same thing.
Imagine you couldn't divide by numbers, and someone asked "How do I share 10 apples with
2 people?"

But you could take the reciprocal of 2 (which is 0.5), so you could answer:

10 × 0.5 = 5
They get 5 apples each
The same thing can be done with Matrices:
Say that you know Matrix A and B, and want to find Matrix X:

Page 33 of 199
XA = B

It would be nice to divide both sides by A (to get X=B/A), but remember we can't divide.
-1
But what if we multiply both sides by A ?
-1 -1
XAA = BA
-1
And we know that AA = I, so:
-1
XI = BA

We can remove I (for the same reason we could remove "1" from 1x = ab for numbers):
-1
X = BA
-1
And we have our answer (assuming we can calculate A )

In that example we were very careful to get the multiplications correct, because with Matrices
the order of multiplication matters. AB is almost never equal to BA.

A Real Life Example


A group took a trip on a bus, at $3 per child and $3.20 per adult for a total of $118.40.
They took the train back at $3.50 per child and $3.60 per adult for a total of $135.20.
How many children, and how many adults?
First, let us set up the matrices (be careful to get the rows and columns correct!):

This is just like the example above:


XA = B

Page 34 of 199
So to solve it we need the inverse of "A":

Now we have the inverse we can solve using:


-1
X = BA

There were 16 children and 22 adults!


The answer almost appears like magic. But it is based on good mathematics.
Calculations like that (but using much larger matrices) help Engineers design buildings, are used
in video games and computer animations to make things look 3-dimensional, and many other
places.

It is also a way to solve Systems of Linear Equations.


The calculations are done by computer, but the people must understand the formulas.

Order is Important
Say that you are trying to find "X" in this case:
AX = B
This is different to the example above! X is now after A.

Page 35 of 199
With Matrices the order of multiplication usually changes the answer. Do not assume that AB =
BA, it is almost never true.
-1
So how do we solve this one? Using the same method, but put A in front:
-1 -1
A AX = A B
-1
And we know that A A= I, so:
-1
IX = A B

We can remove I:
-1
X=A B
-1
And we have our answer (assuming we can calculate A )

Why don't we try our example from above, but with the data set up this way around. (Yes,
you can do this, just be careful how you set it up.)
This is what it looks like as AX = B:

It looks so neat! I think I prefer it like this.

Also note how the rows and columns are swapped over ("Transposed")
compared to the previous example.

To solve it we need the inverse of "A":

Page 36 of 199
It is like the Inverse we got before, but

Transposed (rows and columns swapped over).


Now we can solve using:
-1
X=A B

Same answer: 16 children and 22 adults.


So, Matrices are powerful things, but they do need to be set up correctly!

The Inverse May Not Exist


First of all, to have an Inverse the Matrix must be "Square" (same number of rows and columns).
But also the determinant cannot be zero (or you would end up dividing by zero). How
about this:

24-24? That equals 0, and 1/0 is undefined.

We cannot go any further! This Matrix has no Inverse.


Such a Matrix is called "Singular", which only happens when the determinant is zero.
And it makes sense ... look at the numbers: the second row is just double the first row, and does
not add any new information.

Page 37 of 199
Imagine in our example above that the prices on the train were exactly, say, 50% higher ...
we wouldn't be any closer to figuring out how many adults and children ... we need
something different.

And the determinant neatly works this out.


Conclusion
-1 -1 -1
  The Inverse of A is A only when A × A = A × A = I

 To find the Inverse of a 2x2 Matrix: swap the positions of a and d, put negatives in front
of b and c, and divide everything by the determinant (ad-bc).
 Sometimes there is no Inverse at all

Algebraic Properties of Matrix Operations


In this page, we give some general results about the three operations: addition, multiplication,
and multiplication with numbers, called scalar multiplication.

From now on, we will not write (mxn) but mxn.

Properties involving Addition. Let A, B, and C be mxn matrices. We have

1. A+B = B+A

2. (A+B)+C = A + (B+C)

Where is the mxn zero-matrix (all its entries are equal to 0);

4. if and only if B = -A.

Properties involving Multiplication.

1. Let A, B, and C be three matrices. If you can perform the products AB, (AB)C, BC, and A(BC), then we
have

(AB)C = A (BC)

Note, for example, that if A is 2x3, B is 3x3, and C is 3x1, then the above products are possible (in
this case, (AB)C is 2x1 matrix).

2. If and are numbers, and A is a matrix, then we have

Page 38 of 199
3. If is a number, and A and B are two matrices such that the product is possible, then we
have

4. If A is an nxm matrix and the mxk zero-matrix, then

Note that is the nxk zero-matrix. So if n is different from m, the two zero-matrices are
different.

Properties involving Addition and Multiplication.

1. Let A, B, and C be three matrices. If you can perform the appropriate products, then we have
(A+B)C = AC + BC and A(B+C) = AB + AC

2. If and are numbers, A and B are matrices, then we have

And

Example. Consider the matrices

Evaluate (AB)C and A(BC). Check that you get the same matrix.

Answer. We have

So

Page 39 of 199
On the other hand, we have

so

Example. Consider the matrices

It is easy to check that

and

These two formulas are called linear combinations. More on linear combinations will be discussed on a
different page.

We have seen that matrix multiplication is different from normal multiplication (between
numbers). Are there some similarities? For example, is there a matrix which plays a similar role
as the number 1? The answer is yes. Indeed, consider the nxn matrix

Page 40 of 199
In particular, we have

The matrix In has similar behavior as the number 1. Indeed, for any nxn matrix A, we have

A In = In A = A

The matrix In is called the Identity Matrix of order n.

Example. Consider the matrices

Then it is easy to check that

The identity matrix behaves like the number 1 not only among the matrices of the form nxn.
Indeed, for any nxm matrix A, we have

In particular, we have

Page 41 of 199
Applications of Matrix Mathematics
Matrix mathematics applies to several branches of science, as well as different mathematical
disciplines. Let‘s start with computer graphics, then touch on science, and return to mathematics.

We see the results of matrix mathematics in every computer-generated image that has a
reflection, or distortion effects such as light passing through rippling water.

Before computer graphics, the science of optics used matrix mathematics to account for
reflection and for refraction.

Matrix arithmetic helps us calculate the electrical properties of a circuit, with voltage, amperage,
resistance, etc.

In mathematics, one application of matrix notation supports graph theory. In an adjacency


matrix, the integer values of each element indicates how many connections a particular node has.

The field of probability and statistics may use matrix representations. A probability vector lists
the probabilities of different outcomes of one trial. A stochastic matrix is a square matrix whose
rows are probability vectors. Computers run Markov simulations based on stochastic matrices in
order to model events ranging from gambling through weather forecasting to quantum
mechanics.

Matrix mathematics simplifies linear algebra, at least in providing a more compact way to deal
with groups of equations in linear algebra.

Daily Matrix Applications


Matrix mathematics has many applications. Mathematicians, scientists and engineers represent
groups of equations as matrices; then they have a systematic way of doing the math. Computers
have embedded matrix arithmetic in graphic processing algorithms, especially to render
reflection and refraction. Some properties of matrix mathematics are important in math theory.

Page 42 of 199
CHAPTER 2: NUMBER SYSTEM AND BINARY
ARITHMETIC
Introduction to Number System
Definition: Number system is the way to represent a number in different forms.

Types of Number system:

1. Binary Number System: It is the number system with base value 2 means it has only two
digits to represent the data. The digits are (0, 1). E.g. 00,01,10,11,100….
2. Decimal Number System: It is the number system with base value 10 means it has 10-
digits to represent the data. The digits are(0-9). Eg. 0,1,2,3,4,5,6 ………
3. Octal Number System: It is the number system with base value 8 means it has 8 digits to
represent the data. The digits are ( 0-7).
4. Hexadecimal Number System : It is the number system with base value 16 means it has
16 digits to represent the data. The digits are (0-15). Eg. 0,1,2,3…….,9,A,B,C,D,E,F

Bits & Bytes:


1 bit(binary digit) = 1 digit. For example: 1

1 byte = 8-bits

1 kilo byte= 210 = 1024 bytes

1 mega byte = 210 * 210 = 220 = 1024 kilo bytes

1 giga byte= 230= 1024 mega bytes

1 tera byte= 240= 1024 giga bytes

Binary Number System:


In binary number system is made up of 2 digits- 0 and 1. We use these two digits to represent
data.

0 Start at 0
1 Then 1
??? Then no other symbol

Page 43 of 199
So we count in the same way as using decimal number system. For example:

Decimal number system start at 0 and then 1,2,3,4,5,6,7,8,9… now what after nine repeat the
no in combination such as start at 0 again the add 1 to the left of 0 resultant 10 , 11 ,12… so on.
100, 1000 etc.

The same method we follow in Binary number system:


So confused!
Decimal Binary Value Decimal Binary Value how we get this?
Number Number
0 0 6 110
1 1 7 111
2 10 8 1000
3 11 9 1001
4 100 10 1010
5 101 11 1011

Lets do a little Mathematics:

25 24 23 22 21 20 = Confuse again? Have a


32 16 8 4 2 1  look on the bold letter 2,
0= 0 0 0 0 0 0 1 is representing that 2
1= 0 0 0 0 0 1
2= 0 0 0 0 1 0
3= 0 0 0 0 1 1
4= 0 0 0 1 0 0
5= 0 0 0 1 0 1
6= 0 0 0 1 1 0 STOP? Are you able to
7= 0 0 0 1 1 1 create the binary
8= 0 0 1 0 0 0 counting
9= 0 0 1 0 0 1
10= 0 0 1 0 1 0

If no, Just look at the power values : 20, 21, 22, 23, 24…….2n

2 0= 1

2 1= 2

2 3= 8

Page 44 of 199
24=16 so on…..

Lets calculate 2, we have only two digits 0 and 1.

For 2 , I can write in front of 21 as its equal to 2.

Hmmm…..again what about 3? If I will add 2+1 =3 so there for 1 is assigned in front of the
power of 20 and 21.
Still not get : Ok read this,
Decimal
Well how do we count in Decimal? 0 Start at 0
... Count 1,2,3,4,5,6,7,8, and then...
9 This is the last digit in Decimal
10 So we start back at 0 again, but add 1 on the left

The same thing is done in binary ...

Binary
0 Start at 0
• 1 Then 1
•• 10 Now start back at 0 again, but add 1 on the left
••• 11 1 more
•••• ??? But NOW what ... ?

Other Number System


The octal system

In this system the base is eight. The allowed digits are 0 – 7 where as 8 is not allowed.

Typical number

N= (4526.23)8

In polynomial term may be represented as follow

(4×83)+(5×82)+(2×81)+(6×80)+(2×8-1)+(3×8-2) - POLYNOMIAL TERM

= (2390.296875)10 = (2390 19/64)10 - DECIMAL TERM

Page 45 of 199
The hexadecimal

The base here is 16 and the allowed digits are 0 – 9 and A – F

A typical number

N = (A1F.1C)16

In Polynomial may be represented as

(A×162)+ (1×161) + (F×160) + (1×16-1) + (C×16-2) =

(10×162) + (1×161)+(15×160) + (1×16-1) + (12×16-2) =

(2591 28/256)10 = 2591.10937510

Conversion between Number System


To convert a decimal number into binary number system. Follow the following Steps:-

Step-1: Divide the Number by 2 (as 2 is the base of the binary number system).

Step-2 : Collect the remainder.

Step-3: Divide the quotient again with 2.

Step-4: Repeat the step 2 & 3 until the quotient is 0.

Step-5: Start from bottom, read the sequence of remainders upwards to the top.

Hexadecimal Number system:

This number system has a base value 16. We can use (0-15) decimal numbers to represent
hexadecimal numbers. It uses 16 distinct numbers to represent the values.

Page 46 of 199
Decimal numbers Binary Number Hexadecimal Number
0 00 0
1 01 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

ASCII (American Standard Code Interchange Information) Code: ASCII is a character set that is
used to interchange information to binary and from binary to decimal. ASCII is a 8-bit character
containing 256 characters.

0-31 Control code


32-127 Standard, alphabet A-Z and a-z
128-255 Special Symbols, non standard
characters

Unicode: Unicode is a character set that is used to interchange information to binary language
and from binary to decimal language. The latest version of Unicode is Unicode 6.0. It is a
computing industry standard encoding scheme to represent a text.

To convert number from a non-decimal to decimal, we simply expand a given number as a


polynomial and evaluate the polynomial using arithmetic as in the examples above.

When a decimal number is converted to any other system, the integer and the fraction potions
of the number are handled differently. The radix divide technique is used to convert the integer
portion and the radix multiply technique is used for the fraction portion.

Page 47 of 199
Example

1. (245)10 to binary

2 245

2 122 1 LSB

2 61 0

2 30 1

2 15 0

2 7 1

2 3 1

2 1 1

0 1 MSB

N = 111101012

2. 0.62510 to binary

0.625×2= 1.250 0.100 MSB

0.250×2= 0.500 0.000

0.500×2= 1.000 0.001 LSB

N = 0.1012

3. 24510 to hexadecimal
16 245

16 5 15 MSB

2 0 5 LSB

Page 48 of 199
N = 5F16

4. 2AF16 to decimal
(2×162)+(A×161)+(F×160) = (2×162)+(10×161)+(15×160)

= (512+160+15)10 = 68710

To convert hexadecimal to binary umber, simply replace each hexadecimal bit with its 4 bit
equivalent binary bit

i.e. – 3716 = 00110111

- C416 = 11000100

To convert a binary number to its hexadecimal equivalent, simply group the binary bits at
groups of 4. if necessary, may have to add 0’s to complete the groups

Note

The leading zero that is added to complete the MSB assist us in making 4 bit binary group.

The grouping of a 4 bit binary number is referred as binary coded hexadecimal

Introduction to Binary Arithmetic


Arithmetic circuits form point of the CPU. Mathematical operations include

Subtraction, multiplication, division and addition

Addition
a) Binary addition
Binary addition takes in consideration of the following conditions

0+0=0, 0+1=1, 1+0=1,1+1=0

When adding larger numbers, the resulting ones are carried to other higher columns

Page 49 of 199
e.g.

b) hexadecimal addition
Let’s add

Alternatively ADD the binary equivalence of the hexadecimal numbers

1 5 F C

0001 0101 1111 1100

2 4 5 D

0010 0100 0101 1101

3 A 5 9

0011 1010 0101 1001

Page 50 of 199
Subtraction
a) Binary subtraction
In arithmetic subtraction, the initial numeric quotients that are combined by subtraction are
the minuend and the subtrahend.. the result of the subtraction is called the difference

To subtract from a larger binary number, subtract column by column borrowing from adjacent
columns when necessary.

Remember when borrowing from adjacent column, there are two digits

Example

1. subtract 1001 from 1101

2. subtract 0111 from 1011

The procedure for this calculation is identical to that of decimal numbers because the smaller
value is subtracted from the larger value and the negative sign placed in front of the results

Page 51 of 199
There are two other methods available for doing subtraction and representation of a negative
number.

i. ones’ compliment
The procedure for subtracting numbers using ones’ compliment is as follows

Step1-change the 0’s of subtra-end to 1’s and the 1’s of subtra-end to 0’s

step2-add the two numbers

Step3-remove the last carry and add it to the number

i.e. – end round carry

Example

When there is a carry in the end of the result, then we know the result is positive.

When there is no carry then we know the result is negative and we can now place a minus
sign in front of the answer.

Page 52 of 199
Example

01101 menuend

11011 subtraend

00100 1’s compliment of subtraend

01101

+ 00100

ii. two’s compliment


(0) 10001 no carry
The general rule is that the two’s complement subtra-end is added to menu-end.
= - 01110 1’s compliment
If the sign bit of the result is 0, then the result is the true difference and is assigned a
positive sign.

If the sign bit is 1, the result is a two’s complement of the difference.

Any over flow produced by the calculation is lost.

Example

Subtract 11011 from 01101

Page 53 of 199
b) Hexadecimal subtraction
Example

Subtract 15FCH from 245DH

Alternatively convert the decimal numbers to binary then subtract using the rules of binary
subtraction.

Multiplication
c) Binary multiplication
Binary numbers are multiplied in the same manner as decimal numbers.

Rules

- 0×0=0, 0×1=0, 1×0=0, 1×1=1

- To multiply number with more than one digit, you form partial products and add them
together.

Page 54 of 199
Computers cannot store partial products. The multiplication method used by the computer is
repeated additions.

To determine 7×55, the computer can add 7, 55 times

A faster method of micro-processor system is the add and shift method

Division
d) Binary division
There are several methods of performing binary division. In the partial method also known as
the restoring method, division is similar to decimal method

Example

Divide 14 by 2

Successive subtraction

Divisor is subtracted from the divided and from each successive remainder until a barrow is
realized. The desired quotient is one less the number of subtraction needed to produce a
borrow. This method is simple but slow for large numbers.

Page 55 of 199
Representation of negative numbers
The examples shown so far have been using positive numbers. In practice, a digital system must
represent all positive and negative numbers. To accommodate the sign of numbers, an additional
digit known as the sign digit is included in the representation along with the magnitude digit.
Thus to represent an n-digit number, we world need n+1 digit.

Typically, the sign of digit is the MSB

There are two ways to represent sign numbers

e) sign-magnitude system
in this representation, n+1 digit are used to represent a number where the MS digit is the sign
digit and the remaining n-digit are the magnitude digit. The value of the sign digit is 0 for a
positive number and r-1 for a negative number, where r is the radix of the number system.

Page 56 of 199
Sign Magnitude Decimal

0 1 1 1 +7

0 1 1 0 +6

0 1 0 1 +5

0 1 0 0 +4

0 0 1 1 +3

0 0 1 0 +2

0 0 0 1 +1

0 0 0 0 0

1 0 0 1 -1

1 0 1 0 -2

1 0 1 1 -3

1 1 0 0 -4

1 1 0 1 -5

1 1 1 0 -6

1 1 1 1 -7

The sign and magnitude portions are handled separately in arithmetic using sign magnitude
number

f) Compliment system
To compliment a binary number, change all 0‘s to 1‘s and all 1‘s to 0‘s. this is known as ones‘
compliment form of a binary number.

i.e. - 0110 = 1001 in compliment

The most common way to express a negative binary number is to show it as a two‘s compliment.
A two‘s compliment is a binary number that shows when one is added to the first compliment

Page 57 of 199
Signed Ones’ compliment Two’s compliment
Decimal

+7 0111 0111

+6 0110 0110

+5 0101 0101

+4 0100 0100

+3 0011 0011

+2 0010 0010

+1 0001 0001

0 0000 0000

1 1110 1111

2 1101 1110

3 1100 1101

4 1011 1100

5 1010 1101

6 1001 1010

7 1000 1001

Using the two‘s compliment makes its easier for digital system to perform digital operation. The
correct sign bit is generated by performing the two‘s compliment

Computer data formats/coding


Successful programming requires a precise data format.

Data appears in different forms as below

a) Alphanumeric codes
Codes have been developed to represent data as well as numbers and special symbols as ‗=‘, ‗&‘,
etc

The codes are called alphanumeric codes

Page 58 of 199
The American Standard Code for Information Interchange (ASCII) is a seven bit code that is
commonly used in computer systems.

Since ASCII is a seven bit code, there are 27 or 128 possible coding combinations which mean
that each letter of alphabet both upper and lower case as well as decimal digits 0 – 9 and special
characters are represented by a unique code.

i.e. – A – 100 001, 0 – 011 0000 and & - 010 1010

Many window based applications use the Unicode system to store alphanumeric data. This
systems store each character as 16 bit data

The code 0000H – 00FFH is the same as the standard ASCII code

b) Binary Coded Decimal (BCD)


The BCD system provides a convenient way of handling large numbers that need to be
input/output from a microcomputer system.

The BCD system provides a means of converting a code readily handled by human (decimal) to a
code readily handled by machine (binary).

LED displays are examples that may use BCD system.

BCD system uses four bits to represent each decimal digit. The four bits used are the binary
equivalent of the numbers 0 – 9

The binary representation of a decimal number is obtained by replacing each decimal digit by its
BCD equivalent

c) Float point numbers


Fixed point representation is convenient for representing numbers with bounded order s of
magnitude

i.e. – in a digital computer that uses 32 bits to represent numbers, the range of integers that can
be used is limited to ± (231-1) ≈ ± 1011

In scientific computing environment, a wide range of numbers may be needed. In such a case
float-point representation is used.

The general form of a float-point representation is given by

N = F× RE

Page 59 of 199
Where

N – Number

F – Fraction or mantissa

R – Radix

E – Exponent

Consider the number N=3560000, there are several ways of writing same number

N = 0.356×107 = 0.0356×108 = 3.56×106 etc

All these forms are valid float point representation.

We can remove the zeros in the first two forms and the integer will still be valid in which case
the resulting form requires the fewest integers to represent the mantissa since all significant zeros
have been eliminated from the mantissa. This is known as the normalized form of float point
representation.

Float point numbers are generally stored in the memory in the format shown below

Assumed radix point

0 1 8 9
0 31
+ +

EXPONENT MANTISSA
1bit 7 bits 1bit 23 bits
- -

Note

The MSB of the exponent is the exponent sign bit and the MSB of the mantissa is the mantissa
sign bit

Page 60 of 199
e) Other Binary Coding

Binary codes are codes which are represented in binary system with modification from the
original ones. Below we will be seeing the following:

 Weighted Binary Systems


 Non Weighted Codes

Weighted Binary Systems


Weighted binary codes are those which obey the positional weighting principles, each position of
the number represents a specific weight. The binary counting sequence is an example.
Decimal 8421 2421 5211 Excess-3
0 0000 0000 0000 0011
1 0001 0001 0001 0100
2 0010 0010 0011 0101
3 0011 0011 0101 0110
4 0100 0100 0111 0111
5 0101 1011 1000 1000
6 0110 1100 1010 1001
7 0111 1101 1100 1010
8 1000 1110 1110 1011
9 1001 1111 1111 1100

8421 Code/BCD Code: The BCD (Binary Coded Decimal) is a straight assignment of the binary
equivalent. It is possible to assign weights to the binary bits according to their positions. The weights in
the BCD code are 8,4,2,1.

Example: The bit assignment 1001, can be seen by its weights to represent the decimal 9
because:

1x8+0x4+0x2+1x1 = 9

2421 Code: This is a weighted code, its weights are 2, 4, 2 and 1. A decimal number is represented
in 4-bit form and the total four bits weight is 2 + 4 + 2 + 1 = 9. Hence the 2421 code represents the
decimal numbers from 0 to 9.

5211 Code : This is a weighted code, its weights are 5, 2, 1 and 1. A decimal number is represented
in 4-bit form and the total four bits weight is 5 + 2 + 1 + 1 = 9. Hence the 5211 code represents the
decimal numbers from 0 to 9.

Page 61 of 199
Reflective Code: A code is said to be reflective when code for 9 is complement for the code for 0,
and so is for 8 and 1 codes, 7 and 2, 6 and 3, 5 and 4. Codes 2421, 5211, and excess-3 are reflective,
whereas the 8421 code is not.

Sequential Codes: A code is said to be sequential when two subsequent codes, seen as numbers in
binary representation, differ by one. This greatly aids mathematical manipulation of data. The 8421 and
Excess-3 codes are sequential, whereas the 2421 and 5211 codes are not.

Non Weighted Codes

Non weighted codes are codes that are not positionally weighted. That is, each position within
the binary number is not assigned a fixed value.

Excess-3 Code: Excess-3 is a non-weighted code used to express decimal numbers. The code derives
its name from the fact that each binary code is the corresponding 8421 code plus 0011(3).

Example: 1000 of 8421 = 1011 in Excess-3

Note
Excess-3 binary-coded decimal (XS-3), also called biased representation or Excess-N, is a
numeral system used on some older computers that uses a pre-specified number N as a biasing
value. It is a way to represent values with a balanced number of positive and negative numbers.
In XS-3, numbers are represented as decimal digits, and each digit is represented by four bits as
the BCD value plus 3 (the "excess" amount):

 The smallest binary number represents the smallest value. (i.e. 0 − Excess Value)
 The greatest binary number represents the largest value. (i.e. 2 N+1 − Excess Value − 1)

Decimal Binary Decimal Binary Decimal Binary Decimal Binary

−3 0000 1 0100 5 1000 9 1100

−2 0001 2 0101 6 1001 10 1101

−1 0010 3 0110 7 1010 11 1110

0 0011 4 0111 8 1011 12 1111

To encode a number such as 127, then, one simply encodes each of the decimal digits as above,
giving (0100, 0101, 1010).

Page 62 of 199
The primary advantage of XS-3 coding over BCD coding is that a decimal number can be nines'
complemented (for subtraction) as easily as a binary number can be ones' complemented; just
invert all bits.

Adding Excess-3 works on a different algorithm than BCD coding or regular binary numbers.
When you add two XS-3 numbers together, the result is not an XS-3 number. For instance,
when you add 1 and 0 in XS-3 the answer seems to be 4 / 3 instead of 1. In order to correct this
problem, when you are finished adding each digit, you have to subtract 3 (binary 11) if the digit
is less than decimal 10 and add three if the number is greater than or equal to decimal 10 (thus
causing the number to wrap).

Gray Code: The gray code belongs to a class of codes called minimum change codes, in which only
one bit in the code changes when moving from one code to the next. The Gray code is non-weighted
code, as the position of bit does not contain any weight. The gray code is a reflective digital code which
has the special property that any two subsequent numbers codes differ by only one bit. This is also
called a unit-distance code. In digital Gray code has got a special place.

Decimal Number Binary Code Gray Code


0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
Binary to Gray Conversion
 Gray Code MSB is binary code MSB.
 Gray Code MSB-1 is the XOR of binary code MSB and MSB-1.
 MSB-2 bit of gray code is XOR of MSB-1 and MSB-2 bit of binary code.
 MSB-N bit of gray code is XOR of MSB-N-1 and MSB-N bit of binary code.

Page 63 of 199
CHAPTER 3: LOGIC GATES AND BOOLEAN
ALGEBRA
Introduction to Logic Mathematics
Mathematical logic is a subfield of mathematics exploring the applications of formal logic to
mathematics. It bears close connections to meta-mathematics, the foundations of mathematics,
and theoretical computer science.

Set theory
A set can be defined as a collection of things that are brought together because they obey a
certain rule.
These 'things' may be anything you like: numbers, people, shapes, cities, bits of text ..., literally
anything.

The key fact about the 'rule' they all obey is that it must be well-defined. In other words, it
enables us to say for sure whether or not a given 'thing' belongs to the collection. If the 'things'
we're talking about are English words, for example, a well-defined rule might be:

'... has 5 or more letters'


A rule which is not well-defined (and therefore couldn't be used to define a set) might be:
'... is hard to spell'

Requirement of a set
1. A set must be well defined i.e. it must not leave any room for ambiguities e.g sets of all
students- which? Where? When?
A set must be defined in terms of space and time
2. The objective (elements or members) from a given set must be distinct i.e each object
must appear once and only once, Must appear but not more than once

3. The order of the presentation of elements of a given set is immaterial


e.g 1,2,3 = 1,3,2 = 3,2,1

Types of Sets
In set theory, there are different types of sets. All the operations in set theory could be based on
sets. Set should be a group of individual terms in domain. The universal set has each and every
element of domain. We are having different types of sets. We will see about the different types
of sets.

Page 64 of 199
Different Types of Sets
There are different types of sets in set theory. They are listed below:
 Universal Set
 Empty set
 Singleton set
 Finite and Infinite set
 Union of sets
 Intersection of sets
 Difference of sets
 Subset of a set
 Disjoint sets
 Equality of two sets

Universal Set
The set of all the 'things' currently under discussion is called the universal set (or sometimes,
simply the universe). It is denoted by U.
The universal set doesn‘t contain everything in the whole universe. On the contrary, it restricts us
to just those things that are relevant at a particular time. For example, if in a given situation
we‘re talking about numeric values – quantities, sizes, times, weights, or whatever – the
universal set will be a suitable set of numbers (see below). In another context, the universal set
may be {alphabetic characters} or {all living people}, etc.

Singleton Set:
A set which contains only one element is called a singleton set.
For example:
• A = {x : x is neither prime nor composite}
It is a singleton set containing one element, i.e., 1.
• B = {x : x is a whole number, x < 1}
This set contains only one element 0 and is a singleton set.
• Let A = {x : x ∈ N and x² = 4}

Here A is a singleton set because there is only one element 2 whose square is 4.
• Let B = {x : x is a even prime number}
Here B is a singleton set because there is only one prime number which is even, i.e., 2.

Finite Set:
A set which contains a definite number of elements is called a finite set. Empty set is also called
a finite set.
For example:
• The set of all colors in the rainbow.
• N = {x : x ∈ N, x < 7}
• P = {2, 3, 5, 7, 11, 13, 17, ...... 97}

Page 65 of 199
Infinite Set:
The set whose elements cannot be listed, i.e., set containing never-ending elements is called
an infinite set.
For example:
• Set of all points in a plane
• A = {x : x ∈ N, x > 1}
• Set of all prime numbers
• B = {x : x ∈ W, x = 2n}
Note:
All infinite sets cannot be expressed in roster form.
For example:
The set of real numbers since the elements of this set do not follow any particular pattern.

Cardinal Number of a Set:


The number of distinct elements in a given set A is called the cardinal number of A. It is
denoted by n(A).
For example:
• A {x : x ∈ N, x < 5} A = {1, 2, 3, 4}
Therefore, n(A) = 4
• B = set of letters in the word ALGEBRA

B = {A, L, G, E, B, R}
Therefore, n(B) = 6

Equivalent Sets:
Two sets A and B are said to be equivalent if their cardinal number is same, i.e., n(A) = n(B).
The symbol for denoting an equivalent set is ‗↔‘.
For example:
A = {1, 2, 3} Here n(A) = 3 B = {p, q, r} Here n(B) = 3 Therefore, A ↔ B

Equal sets:
Two sets A and B are said to be equal if they contain the same elements. Every element of A
is an element of B and every element of B is an element of A.
For example:
A = {p, q, r, s} B = {p, s, r, q}

Therefore, A = B

The various types of sets and their definitions are explained above with the help of
examples.

Page 66 of 199
Empty Set
In mathematics, empty set is a set theory related topic. A set without any elements is said to be
an empty set. This article helps you understand empty set by giving a clear idea about empty set
with some example problems.

Empty Set Definition


The other name of empty set is null set ϕ. Consider two sets X = {a, b, c, d} and Y = {1, 2, 3,
4, 5, 6}. Consider another set Z which represents the intersection of X and Y. There is no
common element for the set X and Y. So, intersection of X and Y is null.

Z={} The representation of empty set is { }.

Empty Set or Null Set:


 A set which does not contain any element is called an empty set, or the null set or the
void set and it is denoted by ∅ and is read as phi. In roster form, ∅ is denoted by {}. An
empty set is a finite set, since the number of elements in an empty set is finite, i.e., 0.

 For example: (a) The set of whole numbers less than 0.
(b) Clearly there is no whole number less than 0.
Therefore, it is an empty set.
(c) N = {x : x ∈ N, 3 < x < 4}
• Let A = {x : 2 < x < 3, x is a natural number}
Here A is an empty set because there is no natural number between 2 and 3.

• Let B = {x : x is a composite number less than 4}.


Here B is an empty set because there is no composite number less than 4.
Note:
∅ ≠ {0} ∴ has no element.
{0} is a set which has one element 0.
The cardinal number of an empty set, i.e., n(∅) = 0

Cardinality of Empty Set:


Since we know that the cardinal number represents the number of elements that are present in
the set and by the definition of an empty set, we know that there are no element in the empty set.
Hence, the cardinal number or cardinality of an empty is zero.

Page 67 of 199
Properties of Preparation for Empty Set:
1. Empty set is considered as subset of all sets. ϕ⊂X
2. Union of empty set ϕ with a set X is X. A∪ϕ=A
Intersection of an empty set with a set X is an empty set.

Solved Examples
Question 1: A is a set of alphabets and B is a set of numbers. What is the intersection of A and B?

Solution: A ∩ B = { }

Question 2: Write the set A which is a set of goats with 10 legs.


Solution: A = { }
Power Set of the Empty Set
A set is called the power set of any set, if it contains all subsets of that set. We can use the
notation P(S) for representing any power set of the set. Now, from the definition of an empty
set, it is clear that there is no element in it and hence, the power set of an empty set i.e.P(ϕ) is
the set which contain only one empty set, hence P(ϕ) = {ϕ}

Cartesian Product Empty Set


The Cartesian product of any two sets say A and B are denoted by A X B. There are some
conditions for Cartesian product of empty sets as follows:

If we have two sets A and B in such a way that both the sets are empty sets, then A X B = ϕ x ϕ =
ϕ. It is clear that, the cartesian product of two empty sets is again an empty set.

If A is an empty set and B = {1, 2, 3}, then the cartesian product of A and B is as
follows: A X B = {ϕ}. {1, 2, 3} = {ϕ X 1, ϕ X 2, ϕ x 3} = {ϕ, ϕ, ϕ} = {ϕ}

So, we say that if one of the set is an empty set from the given two sets, then again the
Cartesian product of these two sets is an empty set.

Examples of Empty Sets


Given below are some of the examples of empty sets.
Solved Examples
Question 1: Which of the following represents the empty set?

Page 68 of 199
1. A set of cats with 4 legs

2. A set of apples with red color

3. A set of positive numbers in which all are less than 1

4. A set of rectangles with 4 sides

Solution:
Option 1: A set of cats with 4 legs. This set is possible where cats are having 4 legs.
Option 2: A set of apples with red color. This set is possible where apple is in red color.
Option 3: A set of positive numbers in which all are less than 1.
This set is not possible because the positive numbers must be greater than 1. So, this set
is considered as empty set.

Answer: 3
Question 2: A is a set of numbers from 1 to 10 B is a set of negative numbers. What is the
intersection of A and B?

Solution:
Given:
A = set of number from 1 to 10. = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} B = set of negative numbers
= {-1, -2, -3, -4,….} Intersection of A and B = A ∩ B = { }

Answer: The intersection of given sets is an empty set.

Subset
Consider the sets, X = set of all students in your school and Y = set of all students in your class.
It is obvious that set of all students in your class will be in your school. So, every element of Y is
also an element of X. We say that Y is a subset of X. The fact that Y is a subset of X is
expressed in symbol as Y⊂X. The symbol ⊂ stands for "is a subset of" or "is contained in".If Y is
a subset of X, then X is known to be a superset of Y. The subset of a set will have elements
equal to or less than the elements in the given set.

Subset Definition
A set A is said to be a subset of a set B, if every element of A is also an element of B. In other
words, A⊂B if whenever a∈A, then a∈B. It is often convenient to use the symbol ⇒ which
means "implies". Suppose, for two sets A and B, A = {1, 2, 3} and B = {1} then B is the subset
of A.

Subset Symbol:
Using the symbol ⇒, we can write the definition of subset as follows:

Page 69 of 199
A⊂B if a∈A⇒ a∈B

We read it as "A is a subset of B if a is an element of A, which implies that a is also an element


of B". If A is not a subset of B, we write A is not a subset of B. If A = {1, 2, 3, 4, 5, 6} and B =
{4, 5, 6}, then we can draw a Venn diagram for this as follows:

Operation of a Set
Union of Sets
Set is an important part of the mathematics. It is applied in almost many branch of mathematics.
Set is the relation of some givenn data. There are many functions of set like union, intersection.
Here, we will discuss about union of sets.
We denote the union of A and B by A∪B. Thus, AUB=x|x∈Aorx∈Borx∈AandB. We write
AUB=x|x∈Aorx∈B where, it is unnderstood that the word 'or' is used in the inclusive sense. That
is, x∈A or x∈B stands for x∈A or x∈B or x∈AandB.

Union of Two Sets


Let we have two sets A and B, thhen the union of these two sets is the set of all elements of
each sets i.e. the set of those elements which are in either sets.

Page 70 of 199
If A = {1,2,3,4} and B = {3,4,5,66,7} then A∪B = {1, 2, 3, 4, 5, 6, 7}.
With the help of Venn diagram, we can prove it.

Union of Countable Sets


A set of natural numbers which is a subset of a set with the same number of elements is called the countable set. The union of
two countable sets is again a countable set. Let X and Y be two countable sets then X ∪ Y is countable. Clearly, if X ∪ Y is
countable, then X and Y are each countable, as they are subsets of a countable set.

Conversely, let us suppose that we have two countable sets X and Y. And, we can define two
surjection functions f: N → X and g : N → Y. Let Z = X ∪ Y. Then, we can define h : N → Z in
a way that h(2n + 1) = f(n) for n = 0, 1, .... and h(2n) = g(n), n = 1, 2,... Then, h is well defined
function for every value of i ∈ N is either odd or even, so h(i) is defined. Since h is onto
function for any z ∈ Z, then z ∈ X or z ∈ Y. If z ∈ X, then h(2q + 1) = z for some value of q and
if z ∈ Y then h(2p) = z for some value of p. Hence, Z is countable. So, we can say that the union
of two countable sets is again a countable set.

Union of Three Sets


If we have three sets say A, B and C, then the union of these three sets is the set that contains all
the elements or all contains that belongs to either A or B or C or to all three sets.
A = {1, 2, 3, 4}, B = { 2, 3, 5, 6} and C = { 2, 4, 5, 7}. Then, A∪B∪C = { 1, 2, 3, 4, 5, 6, 7}
We can show it in the Venn diagram as follows:

Page 71 of 199
Union of Sets Examples
Given below are some of the examples on union of sets.
Solved Examples
Question 1: Find the union of each of the following two sets:
1. X = {1, 3, 6} Y = {1, 2, 6}

2. X = {a, e, i, o, u} Y = {a, e, c}
3. X = {3 , 4 ,5} B = φ

Solution:
X∪Y = {1, 2, 3, 6}
X∪Y = {a, c, e, i, p, u}
X∪Y = {3, 4, 5}
Question 2:
If X = {1, 2, 5, 6}, Y = {3, 4, 6, 9}, Z = {3, 5, 6, 9} and W = {3, 6, 9, 11}. Find
1. X∪Y
2. X∪Z
3. Y∪Z
4. Y∪W
5. X∪Y∪Z
6. X∪Y∪W
7. Y∪Z∪W

Page 72 of 199
Solution:
1. X∪Y = {1, 2, 3, 4, 5, 6,9}
2. X∪Z = {1, 2, 3, 5, 6, 9}
3. Y∪Z = {3, 4, 5, 6, 9}
4. Y∪W = {3, 4, 5, 6, 9,11}
5. X∪Y∪Z = {1, 2, 3, 4, 5, 6, 9}
6. X∪Y∪W = {1, 2, 3, 4, 5, 6, 9, 11}
7. Y∪Z∪W = {3, 4, 5, 6, 9,11}

Find the Union of the Sets


Here, we will learn how to find the union of the sets with the help of the following examples.

Solved Examples
Question 1:
Two sets are given.
A = {5, 12, 13, 16, 19}
B = {5, 10, 13, 16, 19}
Find A∪B

Solution:
Given sets are:
A = {5, 12, 13, 16, 19}
B = {5, 10, 13, 16, 19}
A∪B = {5, 10, 12, 13, 16, 19}

Here, common elements in A, B are 5,13,16,19


So, it is taken only one times.

Question 2:
Find X∪Y for the following set.
X = {4, 6, 8, 9, 11}
Y = {3, 5, 6, 8, 11}

Page 73 of 199
Solution:
Given sets are
X = {4, 6, 8, 9, 11}
Y = {3, 5, 6, 8, 11}
So, X∪Y = {3, 4, 5, 6, 8, 9, 11}
Here, common element is taken only one time.

Intersection of Sets
Intersection is an operation on sets. It is just opposite to union. It is a very useful and
important concept in set theory. Before we learn about intersection, we need to understand
some basic concept like what is set.
A set is a well-defined collection of data. It's data is known as it's members or elements. We
represent the set by capital letters A, B, C, X, Y, Z, etc. We use the concept of set in daily life.
For example, a team has five members. So, this is a set.

Find the Intersection of the Sets


For finding the intersection of two sets, we usually select those elements which are common in
both the sets. If there are three sets, then we select those elements which are common in all three
sets. Hence, if there are n number of sets, then we select only those elements which are common
in all the n sets. In this way, we find the intersection of sets
Intersecting Set: Two sets A and B are said to be intersecting if A $\cap$ B $\neq$ $\phi$
Disjoint set: Two sets A and B are said to be disjoint if A $\cap$ B = $\phi$

Solved Examples
Question 1:
If A = {1, 3, 4, 6, 9} and B = {2, 4, 6, 8}, find A ∩ B. What do you conclude?

Solution:
We have given that A = {1, 3, 4, 6, 9} and B = {2, 4, 6, 8}
We have to find the intersection of A and B.
So, A ∩ B = {1, 3, 4, 6, 9} ∩ {2,4,6,8}
A ∩ B = {4, 6}

Question 2:
If A = {1, 3, 5, 7, 9} and B = {2,4,6,8}, find A ∩ B. What do you conclude?

Page 74 of 199
Solution:
We have A ∩ B = {1, 3, 5, 7, 9} ∩

{2,4,6,8} = $\phi$

If no data match in both the sets, both the sets are known as disjoint sets. Thus, A and B are
disjoint sets.
Question 3:
If A = {1, 2, 3, 4, 5, 6, 7}, B = {2, 4, 6, 8, 10} and C = {4, 6, 7, 8, 9, 10, 11}, then find A ∩
B and A ∩ B ∩ C.

Solution:
Given sets are
A = {1, 2, 3, 4, 5, 6, 7}
B = {2, 4, 6, 8, 10}
C = {4, 6, 7, 8, 9, 10, 11}
First, we have to find A ∩ B. Then, we have to treat A ∩ B as a single

set. For A ∩ B, we select those elements which are common in sets A and

B. So, A ∩ B = {2, 4, 6}

For (A ∩ B) ∩ C, we select those elements which are common in sets A ∩ B and C.

So, (A ∩ B) ∩ C = {4, 6}

So, A ∩ B ∩ C = {4, 6}

Question 4:
If A = {1,3,5,7,9}, B = {2,4,6,8} and C = {2,3,5,7,11}, find (A ∩ B) and (A ∩ C) What do
you conclude?

Solution:
We have given that
A = {1, 3, 5, 7, 9}
B = {2, 4, 6, 8}
C = {2, 3, 5, 7, 11}

Page 75 of 199
A ∩ B = {1, 3, 5, 7, 9} ∩ {2, 4, 6, 8} = $\phi$

Thus, A and B are disjoint sets


A ∩ C = {1,3,5,7,9} ∩ {2,3,5,7,11} = {3,5,7}

Thus, A and B are disjoint sets while A and C are intersecting sets.
Intersection of Two Sets
The intersection of two sets is the set of all the elements of two sets that are common in both of
them. If we have two sets A and B, then the intersection of them is denoted by A $\cap$ B and it
is read as A intersection B.
Let X = {2, 3, 8, 9} and Y = {5, 12, 9, 16} are two sets.
Now, we are going to understand the concept of Intersection of set. It is represented by the
symbol " $\cap$ ".

If we want to find the intersection of A and B, the common part of the sets A and B is the
intersection of A and B. It is represented as A $\cap$ B. That is, if an element is present in both
A and B, then that will be there in the intersection of A and B. It will be more clear with the
below figure.

Let A and B are two sets. Then, the intersection of A and B can be shown as below.

The intersection of A and B is denoted by A $\cap$ B.


Thus, A $\cap$ B = {x : x $\in$ A and x $\in$ B}.
Clearly, x $\in$ A $\cap$ B i.e., x $\in$ A and x $\in$ B
In the above figure, the shaded area represents A $\cap$ B.

Page 76 of 199
In the same way, if A1, A2, ........., An is a finite family of sets, then their intersection
is represented by A1$\cap$ A2 $\cap$......$\cap$ An.

Intersection of Convex Sets


In a Vector space, a set is called convex set if all the elements of the line joining two points of
that set also lies on that set. In other words, we can say that the set S is convex set if for any
points x, y $\in$ S, there are no points on the straight line joining points x and y are not in the
set S.
The intersection of two convex set is again a convex set. We can prove it with the help of
contradiction method. So, lets suppose that A and B are the two convex sets. And, let we have
two points x and y in such a way that x ∈ A $\cap$ B and y $\in$ A $\cap$ B, then x $\in$ A, x
$\in$ B, y $\in$ A and y $\in$ B and there exists a point z in such a way that z is not in A or B
or both. This is the contradiction of our assumption that A and B are the convex sets. So there is
no such point x, y and z can exists and A $\cap$ B is a convex set.
Intersection of Three Sets
If we have A, B and C, then the intersection of these three sets are the set of all elements A, B
and C that are common in these three sets.

Solved Example
Question:
If we have A = {1, 3, 5, 7, 6, 8}, B = {2, 4, 6, 8, 9} and C = {1, 3, 6, 8 }, then find the A ∩ B ∩ C.

Solution:
Given that A = {1, 3, 5, 7, 6, 8}, B = {2, 4, 6, 8, 9} and C = {1, 3, 6, 8 }.

Then, it is clear that the elements 6 and 8 are common in all the three given sets.
Hence, we get A ∩ B ∩ C = {6, 8}.

Page 77 of 199
Intersection of Open Sets
Every intersection of open sets is again an open set. Let us have two open sets A1 and A2. If
the intersection of both of them is empty and empty set is again an open set. Hence, the
intersection is an open set.
If A1 and A2 are open sets, then there exists some x $\in$ A1 $\cap$ A2. Since the given sets
are open, we have some r1 and r2 in such a way that $B_{r_{1}}(x)\subset A_{1}$ and
$B_{r_{2}}(x)\subset A_{2}$. So, we can choose a number $B_{r}(x)\subset A_{1}\cap
A_{2}$.
So, we can say that if the intersection is not empty, then by the use of definition of intersection
and non emptiness, there exists any x $\in$ Ai for all Ai's, where all Ai's are open sets. Then,
we have $B_{r_{i}}(x)\subset A_{i}$ for some ri > 0.

Complement of a Set
In set theory, complement set is one of the branch. Set of all elements in the universal set that are
not in the initial set are said to be complement set. The complement of a set is represented by the
symbol A‘. The set is a collection of the object. Set is denoted by the symbols {}. In this article,
we see in detail about the complement set.
Complement of a Set Definition
If we have a set A, then the set which is denoted by U - A, where U is the universal set is called
the complement of A. Thus, it is the set of everything that does not belong to A. So, the
complement of a set is the set of those elements which does not belong
c
to the given set but
belongs to the universal set U. Mathematically, we can show it as A = {x \ x ∉ A but x ∈ U}

Since we know that every set is the subset of the universal set U, then the complementary set is
also the subset of U. The total number of elements in the complementary set is equal to the
difference between the number of elements of the set U and the number of elements of the given
c
set (say A). If A is the given set, then the complement of A is denoted as A or A'.

For example, U = { 1, 2, 3, 4, 5, 6, 7, 8, 9} and a set A = { 2,3,4,5,6}. Then, the complement of


c
A is denoted by A or A'.
c
A = {1, 7, 8, 9}. We can show this with the help of Venn diagram

Page 78 of 199
Complement of a Set Example
Given below are some of the examples on complement of a set.

Solved Examples

Question 1: Value of set U = {2, 4, 6, 7, 8, 9, 10} and A = {7, 8, 9, 10} and B = {8, 9, 10}. Find
the complement of A, complement of B, complement of A union B.

Solution:
Step 1: Given
U = {2, 4, 6, 7, 8, 9, 10}
A = {7, 8, 9, 10}
B = {8, 9, 10}

Step 2: The element of set U is {2, 4, 6, 7, 8, 9, 10}. The element that does not belong to A is
{2, 4, 6}. Complement of A is {2, 4, 6}.

Step 3: Complement of B is {2, 4, 6, 7}


Step 4: Complement of AB is {2, 4, 6, 8, 9, 10}.

Page 79 of 199
Question 2: Values of set U = {3, 5, 7, 8, 9, 10, 12} and A = {8, 9, 10, 12}. Find the compliment
of A.

Solution:
Step 1: Given
U = {3, 5, 7, 8, 9, 10, 12}
A = {8, 9, 10, 12}

Step 2: The element of set U is {3, 5, 7, 8, 9, 10, 12}. Elements {3, 5, 7} does not belong to the
set A. So, A‘ = {3, 5, 7}

Step 3: Complement of A is {3, 5, 7}.


Question 3: Values of set U = {1, 4, 6, 7, 8, 10} and A = {6, 7, 8}. Find the complement of A

Solution:
Step 1: Given
U = {1, 4, 6, 7, 8, 10}
A = {6, 7, 8}
Step 2: The element of set U is {1, 4, 6, 7, 8, 10}. Elements {1, 4, 10} does not belong to the
set A. A‘ is {1, 4, 10}.

Step 3: Complement of A is {1, 4, 10}.

Set Difference
Here, we are going to learn about an operation on set called difference of sets. In mathematics, a
set can have a limited number of elements. Set is a collection of data. We can perform many
operations on set. The difference operation is one of them. The subtract(difference) symbol in the
function represents the removal of the values from the second set from the first set. The
operation of subtraction is a removing or taking away objects from group of object.

Difference of Two Sets


Difference of sets is defined as a method of rearranging sets by removing the elements which
belong to another set. Difference of sets is denoted by either by the symbols - or \. P minus Q can
be written either P - Q or P \ Q.

The differences of two sets P and Q, is written as P - Q, It contains elements of P which are
not present in elements of Q. Here, result P - Q is obtained. Take set P as usual and compare

Page 80 of 199
with set Q. Now, remove those element in set P which matches with set Q. If P = {a,b,c,d} and Q
= {d,e}, then P - Q = {a,b,c}.

Definition for difference of sets


The difference between two sets A and B are represented in the order as the set of all those
elements of A which are not in B. It is denoted by A - B.

In symbol, we write it as
A - B = {x: x $\in$ A and x $\notin$ B}
Similarly B - A = {x: x $\in$ B and $\notin$ A}.
By representing it in the Venn diagram,

Symmetric Difference of Sets


If we have two sets A and B, then the symmetric difference of these two sets A and B is the set
of all elements those are either in A or in B not in both sets. So, we can say that the symmetric
difference of two sets is the union without the intersection. We can use the symbol $\triangle$
for this and denoted as follows:

$A \triangle B = \left \{x \setminus x \in A \wedge x \notin B \right \} \vee \left \{ x \notin A
\wedge x\in B \right \}$

Page 81 of 199
The symmetric difference of sets is associative. So, if we have three sets A, B and C, then
$(A \triangle B) \triangle C = A \triangle(B \triangle C)$

The symmetric difference of two sets is commutative i.e. for all sets A and B, we have
$A \triangle B = B \triangle A$

Set Difference Examples


Given below are some of the problems based on difference of sets.

Solved Examples
Question 1: Consider the two sets A = {11,12, 13, 14, 15, 16}, B = {12, 14, 16, 18}. Find the
difference between the two sets?

Solution:
Given A = {11,12, 13, 14, 15, 16}
B = {12, 14, 16, 18}
A - B = {11, 13, 15}
B - A = {18}

The set of all elements are present in A or in B. But, not in both is called the symmetric
difference set.

Question 2: A = {2,3,4,1,8,9} and B = {2,3,4,1,8,,12}. What is A - B and B - A?


Solution:
Given A = {2,3,4,1,8,9}
B = {2,3,4,1,8,12}

Page 82 of 199
Here, all elements of A is available in B except 9.
So, the difference A - B = {9}.
Here, all elements of B are available in A except 12.
So, the difference B - A = {12 }.

Question 3: Consider two sets A = {a, b, f, g, h}, B = {f, g, a, k}. Find A - B and B - A?
Solution:
Given A = {a, b , f , g , h}
B = {f, g, a, k} So, A - B = {b, h} and B - A = {k}
Question 4: Consider given sets P = {19, 38, 57, 76, 95} and Q = {7, 19, 57, 75, 94}. Find P -
Q and Q - P.

Solution:
Given P = {19, 38, 57, 76, 95}
Q = {7, 19, 57, 75, 94} So, P - Q = {38,76,95} and Q - P = {7,75,94}

Venn Diagrams
In mathematics, we can use the graphs and diagrams to solve some problems in geometry as well
as in algebra. To follow this procedure, we can show some relations in set theory with the help
of diagram, which is called as the Venn diagram. It is also known as set diagram. Venn
diagrams are named so in the name of its founder John Venn in around 1880.
In set theory, Venn diagrams are studied. A set is defined as a collection of the same types of
things. Venn diagram is an important and unique way of representing sets and various
operations on them. It is a pictorial representation of sets. It is an easy way to understand about
set theory. Venn diagrams are everywhere in set theory. With the help of Venn diagrams, we are
able to show the operations of union, intersection, difference, complement etc. on the given sets.

In this page, we can discuss about these things with the help of a Venn diagram. In this process,
the sets are represented by circles. Venn diagrams are generally used to represent operations on
two or three sets. In order to learn about set theory in detail, one needs to command on Venn
diagrams. In this article, students will learn about different types of Venn diagrams. So, go
ahead with us and understand about Venn diagrams in detail.

Page 83 of 199
What is a Venn Diagram?
A Venn diagram is a pictorial representation of sets by set of points in the plane. The universal
set U is represented pictorially by interior of a rectangle and the other sets are represented by
closed figures viz circles or ellipses or small rectangles or some curved figures lying within the
rectangle.

Venn diagram is a graphical tool in which we use overlapping circles to visually presentation
among some given sets information. In Venn diagram, we can use two or more than two circles
to show sets.

Make a Venn Diagram


To make a Venn diagram, first we draw a rectangle to show the universal set U and mark U
inside the rectangle. After that, we will make circles for given sets and name them as A, B, C
etc. Then, according to the given relation of the sets, we can make a diagram for these sets in the
rectangle to show the relationship of the sets. Sometimes, we have some elements for the
individual sets, then fill all the elements in their respective sets and as per the given relation of
the sets.

For example, if A and B are any two arbitrary sets, elements such that, some elements are in A
but not in B, some are in B but not in A, some are in both A and B, and some are in neither A
nor B, we represent A and B in the pictorial form as in shown in the Venn diagram.

A is a subset of B and is represented as shown in the Venn diagram.

Page 84 of 199
Disjoint Sets
A and B are disjoint sets as shown in the Venn diagram.

Triple Venn Diagram


For the triple Venn diagram, we need three sets as A, B and C. In the triple Venn diagram, we
have to show some relationship between these three sets.

For example, let A = {a, b, c, d, e}, B = {a, b, f, g, h} and C = {a, c, e, f, g, j, k}. Here, we can
find A ∩ B, B ∩ C, A ∩ C and A ∩ B ∩ C with the help of triple Venn diagram.

Given A = {a, b, c, d, e}, B = {a, b, f, g, h} and C = {a, c, f, g, j, k}. Now, A ∩ B = {b}, B ∩ C


= {f, g}, A ∩ C = {c} and A ∩ B ∩ C = {a}

Page 85 of 199
4 Circle Venn Diagram
Some times, we have four sets in a given problem and we want to show their relationship with
the help of Venn diagram. For this, we can draw four circles in a rectangle box, each circle
represents a unique set. Then, according to sets relation fill all the elements at their place.

Venn Diagram With Lines


In mathematics, sometimes we use the lines in the Venn diagram to show the union, intersection,
difference etc. for the given sets. If we have sets A and B, then with the line Venn diagram we
can show as:

Page 86 of 199
Picture of a Venn Diagram
If we have two sets A and B, then A ∪ B i.e. A union B:

A ∩ B i.e. A intersection B:

Page 87 of 199
A and B are disjoint sets:

A subset B:

Venn Diagram Union


If we have two sets A and B, then A ∪ B is the set of all elements that are in set A and in the set B. If
any element common in these two set, then we will take that one only one time. So, we can say that the
union of the set A and B is everything which are either in set A or in the set B.

Let A = {1,2,3,4,5} and B = {2,6,7,8} then A ∪ B = {1,2,3,4,5,6,7,8}. To show this union, we


can use the Venn diagram also as

Venn diagram Word Problems


Given below are some of the word problems on Venn diagram.

Solved Example
Question: There are 40 players participated in tournament match. In that, 20 players play in
volley ball match and 20 players play in football match and 5 players play in both volley ball and

Page 88 of 199
football match. Solve this problem by using Venn diagram. How many of the players are either
in match and how many are in neither match?

Solution:
There are two categories, one is volleyball and other one is football.
Step 1:
Draw Venn diagram depending up on the classification given in the problem.

Step 2:
Note that 5 players play both volleyball and football match

Step 3:
Here, we accounted for 5 of the 20 players in volleyball match, leaving 15 players taking
volleyball match but not football match. So, I will put "15" in the "volleyball only" part of the
"volley ball" circle.

Page 89 of 199
Step 4:
Here, we accounted for 5 of the 20 players in football match, leaving 15 players taking
football match but not volleyball match. So, I will put "15" in the "football only" part of the
"football" circle.

Step 5:
The total of 5 + 15 + 15 = 35 players are in either volley ball match or football match (or
both). The total numbers of players are 40 and participating players are 35 only.

40 - 35 = 5 players

Page 90 of 199
Boolean Algebra
In 1850, George Boole, an English mathematician developed rules and theorems that became
Boolean algebra.

Boole’s work was an outcrop of work in physiology called LOGIC.

Logic can be used to break down complex problems to simple and understandable problems.

The binary nature of logic problems was studied by Cloude Shannon of MTI in 1938. Shannon
applied Boolean algebra to relay logic switching circuits as means of realizing electric circuits.

Electric circuits used for digital computers are designed to generate only two voltage levels

Eg – high level (≈ 5V ) and low level (≈ 0V)

The binary number system requires two symbols hence its logical to identify a binary symbol
with each voltage level. If we interpolate the high level as a binary 1and low level as a binary 0,
then we are using a positive logic system.

Terminologies in Boolean Algebra


logic function and logic gates
Logic circuit - A computer switching/electronic circuit that consists of a number of logic gates
and performs logical operations on data
A logic gate is an idealized or physical device implementing a Boolean function; that is, it
performs a logical operation on one or more binary inputs, and produces a single binary output.
A logic gate is a small transistor circuit, basically a type of amplifier, which is implemented in
different forms within an integrated circuit. Each type of gate has one or more (most often two)
inputs and one output.

Boolean operation is any logical operation in which each of the operands and the result take
one of two values, as “true” and “false” or “circuit on” and “circuit off.”

A Boolean Function is a description of operation (logic operation) on algebraic expression called


Boolean expression which consists of binary variables, the constants 0 and 1, carried out in
digital/electronic circuits and the logic outputting there off. The logic operation is well expressed in
truth tables.

Truth tables
A truth table is a breakdown of a logic function by listing all possible values the function can
attain. Such a table typically contains several rows and columns, with the top row representing
the logical variables and combinations, in increasing complexity leading up to the final function.

Page 91 of 199
Logic Functions gates and circuitry
From Boolean algebra, we get three basic logic factions that form the basis of all digital
computer functions. These basic functions are: AND, OR and NOT

These functions can be expressed mathematically using Boolean algebra as given.

NOTE – The input and output variables are usually represented by letters as ABC or XYZ

- The logic state of this variables is represented by binary numbers 0 and 1

AND function
The AND function can be thought of as a series circuit containing two or more switches

A B

Circuit diagram

The logic indicator L will be ON only when logic switches A and B are both crossed. Switches A
and B have two possible logic states, open and crossed. This can be represented in binary form
as 0 – open and 1 – crossed.

Logic indicator L also have two possible states 0 and 1

Truth table
A B L(x.y)
0 0 0
0 1 0
1 0 0
1 1 1

The truth table is used to illustrate all the possible combinations of input and output conditions
that can exist in a logic circuit. The Boolean expression used to represent an AND function is as
follows

A.B=L

Page 92 of 199
And is symbolized as

A
L
B

OR function
The function can be thought of as a parallel circuit containing two or more logic switches

L
B

Circuit Diagram

Here, the logic indicator L will be ON whenever logic switch A and B are crossed. The truth
table, Expression and Symbol of OR function is as follows

Truth table
A B L(x+y) A
0 0 0 A+B=L L
0 1 1 B
1 0 1
Symbol diagram
1 1 1

NOT function
It can be thought of as an inverter or negative circuit.

Page 93 of 199
L
A

Circuit diagram

The logic indicator L will be ON whenever logic switch A is open.

The truth table, Expression and Symbol of NOT function is as follows

Truth table
A L(x)‘
0 1 A =A’ A A’
1 0

Symbol diagram

NAND
If an AND gate is followed by an NOT gate then the combination is called an NAND gate and has
following truth table and Boolean expression.

Truth table
A B L (x.y)‘ A
(A.B)’=L
0 0 1 L
0 1 0 B
1 0 0
1 1 0 B Symbol diagram

NOR
If an OR gate is followed by an NOT gate then the combination is called an NOR gate and has
following truth table and Boolean expression.

Page 94 of 199
Truth table
A B L (x+y)‘
0 0 1 A
(A+B)’=L L
0 1 1
1 0 1 B
1 1 0
B Symbol diagram

B
XOR
This output strictly on condition that input is either high but not 2 highs

Truth table
A B L (x±y) A
0 0 0 A + B =L L
0 1 1 B
1 0 1
1 1 0 B Symbol diagram

B
XNOR
This output strictly on condition that input is either high but not 2 highs

Truth table
A B L (x±y)‘ A
A B=L L
0
0
0
1
1
0
* B
1 0 0 B
1 1 1

. B

Theorems of Boolean Algebra


Boolean algebra deals with algebraic .expressions between Boolean variables. Boolean algebra
is a mathematical style dealing in logic. A fundamental rule relating to Boolean variables is
called Boolean theorems.

Boolean theorems

1. Cumulative laws
i. A+B=B+A ii. AB=BA

2. Associative laws
i. (A+B)+C=A(B+C)=A+B+C ii. A(BC)=A(BC)=ABC

Page 95 of 199
3. Distributive laws
i. A(B+C)=AB+AC ii. A+BC=(A+B)(A+C)

- This state that an expression can be expanded by multiplying term by term just like
ordinary algebra. It indicates thus we can factor an expression

i.e – AB’C+A’B’C’=B’(AC+A’C’) – Common factor is B’

- Simplifying by distributive law

Y=AB’C+AB’D’=AB’(D+D’)=AB’ – since D+D’=1+0=1 by distributive law

4. Identity law
i. A+A=A ii. AA=A

5. Negative law
i. A’=A’ ii. A’’=A

6. Redundancy laws
i. A+AB=A(1+B)=A(1)=1 N/b 1+n=1 where n=any num/char
ii. A(A+B)=AA+AB=A+AB=A
iii. 0+A=A
iv. 0A=0
v. 1+A=1
vi. 1A=A
vii. A’+A=1
viii. A’A=0
ix. A+AB’=A+B
x. A(A’+B)=AB
EXAMPLE

Z=(A’+B)(A+B)=AA’+A’B+AB+BB=0+A’B+AB+B=B(A’+A+1)=B(1+1)=B

Proves

i. AC+ABC=AC
Let y=AC+ABC

=AC(1+B)=AC since 1+n=1

ii. (A+B)(A+C)=A+BC
Let y= (A+B)(A+C)

=A(A+C)+B(A+C)=AA+AC+AB+CB=A+AC+AB+CB

Page 96 of 199
= A(1+B)+AC+BC=A+AC+BC=A(1+C)+CB=A+BC

iii. A+A’B=A+B
Let y= A+A’B

= A.1+A’B=A(1+B)+A’B=A.1+AB+A’B=A+AB+A’B

= A+B(A+A’)=A+B

iv. (A+B)(A+B’)(A’+C)=AC
Let y=(A+B)(A+B’)(A’+C)

= (AA+AB’+BA+BB’)A’+C=(A+AB+AB’)(A’+C)

= *A(1+B)+AB’+(A’+C)

= (A+AB’)(A’+C)=A(1+B’)(A’+C)=A.1(A’+C)=A(A’+C)=AA’+AC=AC

v. Simplify the expression and show minimum gate implementation


y=ABC’D’+A’BC’D’+BC’D

Since A+A’=1 and A.1=A

=BC’D’ (A+A’) +BC’D=BC’D’.1+BC’D

= BC’D’+BC’D=BC’ (D+D’) =BC’.1=BC’

B
Y
C

7. Dedmorgans theorems
The theorems are useful in simplifying expressions in which a product or sum of
variables is complimented or inverted.

The two theorems are

a) (A+B)’=A’B’
When the OR sum of two variables (A+B) is complimented, this is same as if the 2
variable’s compliments were ANDed.

i.e. – compliment of an OR sum is AND product of the compliment.

b) (AB)’=A’+B’

Page 97 of 199
Compliment of an AND product is equal to OR sum of its compliment

Karnaugh maps (K-maps)


K-maps/ vetch diagram is a method to simplify Boolean expressions. The maps reduce the need
for extensive calculations by taking advantage of human pattern-recognition capability.

In K—map, the Boolean variables are transferred (generally from a truth table) and ordered
according to the principles of gray code in which only one variable changes in between squares.

Once the table is generated and the output possibilities transcribed, the data is arranged into
the largest possible groups containing 2n cells (n=0, 1, 2, 3...) and the minterms generated
through the axiom laws of Boolean algebra

Note
A minterm is a product (AND) of all variables in the function, in directs or complemented form.
A minterm has the property that it is equal to 1 on exactly one row of the truth table.

A maxterm is a sum (OR) of all the variables in the function, in direct or complemented form. A
maxterm has the property that it is equal to 0 on exactly one row of the truth table.

Don't care conditions are represented by X in the K-Map table. A don't-care term for a function is an
input-sequence (a series of bits) for which the function output does not matter (0,1).

AB 00 01 11 10
(A’B’) (A’B) (AB) (AB’)
CD

00 M0 M4 M12 M8
(C’D’)

01 M1 M5 M13 M9
(C’D)

11 M3 M7 M15 M11
(CD)

10 M2 M6 M14 M10
(CD’)

Procedure
K-map method may theoretically be applied to simplify any Boolean expression through works
well with <=6 variable.

Page 98 of 199
- Each variable contributes two possibilities. The initial value and its inverse.

The variables are arranged in gray code in which only one variable changes between two
adjacent grid boxes.

- Once the variables have been defined, the output possibilities are transcribed according to the
grid location provided by the variables. Thus for every possibility of a Boolean input or variable
the output possibility is defined.

When the K-map has been completed, to derive a minimized function the one’s or desired
outputs are grouped into the largest possible rectangular groups in which the num of grid boxes
(output possibilities) in the groups must be equal to power of two.

- Don’t care(s) possibilities (generally represented by X) are grouped only if the group created is
larger than the group with minterms.

The boxes can be used more than once if they produce the least number of groups and each
desired output must be contained within at least one grouping.

- The groups generated are then converted to a Boolean expression by locating and transcribing
the variable possibility attributed to the box, and by the axiom laws of Boolean algebra – in
which, if the initial variable possibility and its inverse are contained within the same group the
variable term is removed.

Note
Each group provides a “product” to create a “SOP” in the Boolean expression. To determine the
inverse of the K-map, the 0’s are grouped instead of the 1’s. the two expressions are non-
complementary.
Each square in a K-map corresponds to a minterm and maxterm in the venn diagram.

Example
Following is an unspecified Boolean algebra function with Boolean variables ABC and D and
their inverses
They can be represented in two different ways

- F(A,B,C,D)=∑(6,8,9,10,11,12,13,14,15)
- F(A,B,C,D)=A’BCD’+ AB’C’D’+ AB’C’D+ AB’CD’+ AB’CD+ ABC’D’+ ABCD’

Page 99 of 199
Truth table
Using the defined minterms the table can be created as follow.
M# ABCD(bin) ABCD(gray) F

0 0000 0000 0

1 0001 0001 0

2 0010 0011 0

3 0011 0010 0

4 0100 0110 0

5 0101 0111 0

6 0110 0101 1

7 0111 0100 0

8 1000 1100 1

9 1001 1101 1

10 1010 1111 1

11 1011 1110 1

12 1100 1010 1

13 1101 1011 1

14 1110 1001 1

15 1111 1000 1

K-MAP

The input variable can be combined in 16 different ways, so the K-map has 16 positions and
thus is arranged in a 4×4grid.

Page 100 of 199


AB AB

CD 00 01 11 10 CD 00 01 11 10

00 M0 M4 M12 M8 00 0 0 1 1

01 M1 M5 M13 M9 01 0 0 1 1

11 M3 M7 M15 M11 11 0 0 1 1

10 M3 M6 M14 M10 10 0 1 1 1

The bin digits in the map rep the function output for any given combination of inputs.

After K-map is constructed, now find the minimal terms to use in the final expression.

AB 00 01 11 10

CD

00 0 0 1 1

01 0 0 1 1

11 0 0 1 1

10 0 1 1 1

Therefore the expression is: F(A,B,C,D)=A+CD’B

Note

- Encircled groups may overlap.


- The grid is toroidally connected which means the grouping may wrap around edges.

Page 101 of 199


A
F(A,B,C,D)
B
C
D

Sum of products (SOP) – Summation of the minterm multiplicities

- It uses the minterms or variables that are high

F(A,B,C,D)=ABC+CD’B

Products of Sums (POS) – Multiplication of the maxterm summations

- It uses the maxterms or variables that are low

F(A,B,C,D)= (A+B)(A+C)(B’+C’+D’)

DON’T CARES

The variables with a don’t care may assume minterms or maxterms so long as they produce the
most simple circuit.

F(W,X,Y,Z)=YZ+XY+XZ - SOP

F(W,X,Y,Z)=(X+Z)(X+Y)(X+Z) – POS

WX 00 01 11 10

YZ

00 0 0 X 0

01 0 1 X 0

11 1 1 X X

10 0 1 x X

Page 102 of 199


CHAPTER 4: DISCRETE COUNTING
The Basic Rules/Principles of Counting
The Inclusion-Exclusion and the Pigeonhole Principles are the most fundamental combinatorial
techniques. There are two additional rules which are basic to most elementary counting. One is
known as the Sum Rule (or Disjunctive Rule), the other is called Product Rule (or Sequential
Rule.)

The Rules of Sum and Product


The Rule of Sum and Rule of Product are used to decompose difficult counting problems into
simple problems.

 The Rule of Sum − If a sequence of tasks T1,T2,…,Tm can be done in w1,w2,…wm ways
respectively (the condition is that no tasks can be performed simultaneously), then the
number of ways to do one of these tasks is w1+w2+⋯+wm. If we consider two tasks A and
B which are disjoint (i.e. A∩B=∅), then mathematically |A∪B|=|A|+|B|
 The Rule of Product − If a sequence of tasks T1,T2,…,Tm can be done in w1,w2,…wm
ways respectively and every task arrives after the occurrence of the previous task, then there
are w1×w2×⋯×wm ways to perform the tasks. Mathematically, if a task B arrives after a
task A, then |A×B|=|A|×|B|

Example
Question − A boy lives at X and wants to go to School at Z. From his home X he has to first
reach Y and then Y to Z. He may go X to Y by either 3 bus routes or 2 train routes. From there,
he can either choose 4 bus routes or 5 train routes to reach Z. How many ways are there to go
from X to Z?
Solution − From X to Y, he can go in 3+2=5 ways (Rule of Sum). Thereafter, he can go Y to Z in
4+5=9 ways (Rule of Sum). Hence from X to Z he can go in 5×9=45 ways (Rule of Product).

Pigeonhole Principle
In 1834, German mathematician, Peter Gustav Lejeune Dirichlet, stated a principle which he
called the drawer principle. Now, it is known as the pigeonhole principle.

Pigeonhole Principle states that if there are fewer pigeon holes than total number of pigeons and
each pigeon is put in a pigeon hole, then there must be at least one pigeon hole with more than
one pigeon. If n pigeons are put into m pigeonholes where n > m, there's a hole with more than
one pigeon.

Page 103 of 199


Examples
 Ten men are in a room and they are taking part in handshakes. If each person shakes
hands at least once and no man shakes the same man‘s hand more than once then two
men took part in the same number of handshakes.
 There must be at least two people in a class of 30 whose names start with the same
alphabet.

The Inclusion-Exclusion principle


The Inclusion-exclusion principle computes the cardinal number of the union of multiple non-
disjoint sets. For two sets A and B, the principle states −

|A∪B|=|A|+|B|−|A∩B|
For three sets A, B and C, the principle states −

|A∪B∪C|=|A|+|B|+|C|−|A∩B|−|A∩C|−|B∩C|+|A∩B∩C|
The generalized formula -

|⋃ni=1Ai|=∑1≤i<j<k≤n|Ai∩Aj|+∑1≤i<j<k≤n|Ai∩Aj∩Ak|−⋯+(−1)π−1|A1∩⋯∩A2|
Problem 1
How many integers from 1 to 50 are multiples of 2 or 3 but not both?

Solution
From 1 to 100, there are 50/2=25 numbers which are multiples of 2.

There are 50/3=16 numbers which are multiples of 3.

There are 50/6=8 numbers which are multiples of both 2 and 3.

So, |A|=25, |B|=16 and |A∩B|=8.

|A∪B|=|A|+|B|−|A∩B|=25+16−8=33
Problem 2
In a group of 50 students 24 like cold drinks and 36 like hot drinks and each student likes at least
one of the two drinks. How many like both coffee and tea?
Solution
Let X be the set of students who like cold drinks and Y be the set of people who like hot drinks.

So, |X∪Y|=50, |X|=24, |Y|=36

Page 104 of 199


|X∩Y|=|X|+|Y|−|X∪Y|=24+36−50=60−50=10

Counting Techniques

Permutations
A permutation is an arrangement of some elements in which order matters. In other words a
Permutation is an ordered Combination of elements.

Examples
 From a set S ={x, y, z} by taking two at a time, all permutations are − xy,yx,xz,zx,yz,zy

 We have to form a permutation of three digit numbers from a set of numbers S={1,2,3}.
Different three digit numbers will be formed when we arrange the digits. The permutation
will be = 123, 132, 213, 231, 312, 321

Number of Permutations
The number of permutations of ‗n‘ different things taken ‗r‘ at a time is denoted by nPr
nPr=n!(n−r)!

where n!=1.2.3.…(n−1).n

Proof − Let there be ‗n‘ different elements.

There are n numbers of ways to fill up the first place. After filling the first place (n-1) number of
elements is left. Hence, there are (n-1) ways to fill up the second place. After filling the first and
second place, (n-2) number of elements is left. Hence, there are (n-2) ways to fill up the third
place. We can now generalize the number of ways to fill up r-th place as [n – (r–1)] = n–r+1

So, the total no. of ways to fill up from first place up to r-th-place −

nPr =n(n−1)(n−2).....(n−r+1)

=[n(n−1)(n−2)...(n−r+1)][(n−r)(n−r−1)…3.2.1]/[(n−r)(n−r−1)…3.2.1]
Hence,

nPr=n!/(n−r)!

Page 105 of 199


Some important formulas of permutation
 If there are n elements of which a1 are alike of some kind, a2 are alike of another kind; a3
are alike of third kind and so on and ar are of rth kind, where (a1+a2+...ar)=n.

Then, number of permutations of these n objects is = n!/[(a1!(a2!)…(ar!)].

 Number of permutations of n distinct elements taking n elements at a time = nPn=n!


 The number of permutations of n dissimilar elements taking r elements at a time, when x
particular things always occupy definite places = n−xpr−x
 The number of permutations of n dissimilar elements when r specified things always
come together is − r!(n−r+1)!
 The number of permutations of n dissimilar elements when r specified things never come
together is − n!–[r!(n−r+1)!]
 The number of circular permutations of n different elements taken x elements at time =
npx/x
 The number of circular permutations of n different things = npn/n

Some Problems

Problem 1 − From a bunch of 6 different cards, how many ways we can permute it?

Solution − As we are taking 6 cards at a time from a deck of 6 cards, the permutation will be
6P6=6!=720

Problem 2 − In how many ways can the letters of the word 'READER' be arranged?

Solution − There are 6 letters word (2 E, 1 A, 1D and 2R.) in the word 'READER'.

The permutation will be =6!/[(2!)(1!)(1!)(2!)]=180.

Problem 3 − In how ways can the letters of the word 'ORANGE' be arranged so that the
consonants occupy only the even positions?

Solution − There are 3 vowels and 3 consonants in the word 'ORANGE'. Number of ways of
arranging the consonants among themselves =3P3=3!=6. The remaining 3 vacant places will
be filled up by 3 vowels in 3P3=3!=6 ways. Hence, the total number of permutation is
6×6=36

Page 106 of 199


Combinations
A combination is selection of some given elements in which order does not matter.

The number of all combinations of n things, taken r at a time is −

nCr=n!r!(n−r)!

Problem 1

Find the number of subsets of the set {1,2,3,4,5,6}having 3 elements.

Solution

The cardinality of the set is 6 and we have to choose 3 elements from the set. Here, the ordering
does not matter. Hence, the number of subsets will be 6C3=20.

Problem 2

There are 6 men and 5 women in a room. In how many ways we can choose 3 men and 2 women
from the room?

Solution

The number of ways to choose 3 men from 6 men is 6C3 and the number of ways to choose 2
women from 5 women is 5C2

Hence, the total number of ways is − 6C3×5C2=20×10=200

Problem 3

How many ways can you choose 3 distinct groups of 3 students from total 9 students?

Solution

Let us number the groups as 1, 2 and 3

For choosing 3 students for 1st group, the number of ways − 9C3

The number of ways for choosing 3 students for 2nd group after choosing 1st group − 6C3

The number of ways for choosing 3 students for 3rd group after choosing 1st and 2nd group − 3C3

Page 107 of 199


Hence, the total number of ways =9C3×6C3×3C3=84×20×1=1680

Pascal's Identity
Pascal's identity, first derived by Blaise Pascal in 19th century, states that the number of ways to
choose k elements from n elements is equal to the summation of number of ways to choose (k-1)
elements from (n-1) elements and the number of ways to choose elements from n-1 elements.

Mathematically, for any positive integers k and n: nCk=n−1Ck−1+n−1Ck

Proof −

n−1Ck−1+n−1Ck

=(n−1)!(k−1)!(n−k)!+(n−1)!k!(n−k−1)!

=(n−1)!(kk!(n−k)!+n−kk!(n−k)!)

=(n−1)!nk!(n−k)!

=n!k!(n−k)!

=nCk

Binomial Theorem

A binomial is a polynomial with two terms

What happens when we multiply a binomial by itself ... many times?

Example: a+b

Page 108 of 199


a+b is a binomial (the two terms are a and b)

Let us multiply a+b by itself using Polynomial Multiplication :

(a+b)(a+b) = a2 + 2ab + b2

Now take that result and multiply by a+b again:

(a2 + 2ab + b2)(a+b) = a3 + 3a2b + 3ab2 + b3

And again:

(a3 + 3a2b + 3ab2 + b3)(a+b) = a4 + 4a3b + 6a2b2 + 4ab3 + b4

The calculations get longer and longer as we go, but there is some kind of pattern developing.

That pattern is summed up by the Binomial Theorem:

The Binomial Theorem

Don't worry ... it will all be explained!

And you will learn lots of cool math symbols along the way.

Exponents
First, a quick summary of Exponents.

An exponent says how many times to use something in a


multiplication.

Example: 82 = 8 × 8 = 64

An exponent of 1 means just to have it appear once, so we get the original value:

Example: 81 = 8

An exponent of 0 means not to use it at all, and we have only 1:

Example: 80 = 1

Page 109 of 199


Exponents of (a+b)
Now on to the binomial.

We will use the simple binomial a+b, but it could be any binomial.

Let us start with an exponent of 0 and build upwards.

Exponent of 0: When an exponent is 0, we get 1:

(a+b)0 = 1

Exponent of 1: When the exponent is 1, we get the original value, unchanged:

(a+b)1 = a+b

Exponent of 2: An exponent of 2 means to multiply by itself.

(a+b)2 = (a+b)(a+b) = a2 + 2ab + b2

Exponent of 3: For an exponent of 3 just multiply again:

(a+b)3 = (a2 + 2ab + b2)(a+b) = a3 + 3a2b + 3ab2 + b3

We have enough now to start talking about the pattern.

The Pattern

In the last result we got:

a3 + 3a2b + 3ab2 + b3

Now, notice the exponents of a. They start at 3 and go down: 3, 2, 1, 0:

Likewise the exponents of b go upwards: 0, 1, 2, 3:

If we number the terms 0 to n, we get this:


Page 110 of 199
k=0 k=1 k=2 k=3

a3 a2 a 1

1 b b2 b3

Which can be brought together into this:

an-kbk

How about an example to see how it works:

Example: When the exponent, n, is 3.

The terms are:

k=0: k=1: k=2: k=3:

an-kbk an-kbk an-kbk an-kbk


= a3-0b0 = a3-1b1 = a3-2b2 = a3-3b3
= a3 = a2b = ab2 = b3

It works like magic!

Coefficients

So far we have: a3 + a2b + ab2 + b3

But we really need: a3 + 3a2b + 3ab2 + b3

We are missing the numbers (which are called coefficients).

Let's look at all the results we got before, from (a+b)0 up to (a+b)3:

Page 111 of 199


And now look at just the coefficients (with a "1" where a coefficient wasn't shown):

They actually make Pascal's Triangle!

Each number is just the two numbers above it added together


(except for the edges, which are all "1")

(Here I have highlighted that 1+3 = 4)

Armed with this information let us try something new ... an exponent of 4:

a exponents go 4,3,2,1,0: a4 + a3 + a2 + a + 1

b exponents go 0,1,2,3,4: a4 + a3b + a2b2 + ab3 + b4

coefficients go 1,4,6,4,1: a4 + 4a3b + 6a2b2 + 4ab3 + b4

And that is the correct answer (compare to the top of the page).

We have success!

Page 112 of 199


We can now use that pattern for exponents of 5, 6, 7, ... 50, ... 112, ... you name it!

That pattern is the essence of the Binomial Theorem.

Now you can take a break.

When you come back see if you can work out (a+b)5 yourself.

Answer (hover over): a5 + 5a4b + 10a3b2 + 10a2b3 + 5ab4 + b5

Formula

Our last step is to write it all as a formula.

But hang on, how do we write a formula for "find the coefficient from Pascal's Triangle" ... ?

Well, there is such a formula:

It is commonly called "n choose k" because it is how many ways to


choose k elements from a set of n.

You can read more at Combinations and Permutations

The "!" means "factorial", for example 4! = 4×3×2×1 = 24

And it matches to Pascal's Triangle like


this:

(Note how the top row is row zero


and also the leftmost column is zero!)

Example: Row 4, term 2 in Pascal's Triangle is "6".

Let's see if the formula works:

Page 113 of 199


Yes, it works! Try another value for yourself.

Putting It All Together

The last step is to put all the terms together into one formula.

But we are adding lots of terms together ... can that be done using one formula?

Yes! The handy Sigma Notation allows us to sum up as many terms as we want:

Sigma Notation

Now it can all go into one formula:

The Binomial Theorem

Use It

OK ... it won't make much sense without an example.

So let's try using it for n = 3 :

Page 114 of 199


BUT ... it is usually much easier just to remember the patterns:

 The first term's exponents start at n and go down


 The second term's exponents start at 0 and go up
 Coefficients are from Pascal's Triangle, or by calculation using n!/(k!(n-k)!)

Like this:

Example: What is (y+5)4

Start with exponents: y450 y351 y252 y153 y054

Include Coefficients: 1y450 4y351 6y252 4y153 1y054

Then write down the answer (including all calculations, such as 4×5, 6×52, etc):

(y+5)4 = y4 + 20y3 + 150y2 + 500y + 625

We may also want to calculate just one term:

Example: What is the coefficient for x3 in (2x+4)8

Page 115 of 199


Geometry

Want to see the Binomial Theorem using Geometry?

In 2 dimensions, (a+b)2 = a2 + 2ab + b2

In 3 dimensions, (a+b)3 = a3 + 3a2b + 3ab2 + b3

In 4 dimensions, (a+b)4 = a4 + 4a3b + 6a2b2 + 4ab3 + b4

(Sorry, I am not good at drawing in 4 dimensions!)

Advanced Example

And one last, most amazing example:

Example: A formula for e (Euler's Number)

We can use the Binomial Theorem to calculate e (Euler's number).

e = 2.718281828459045... (the digits go on forever without repeating)

It can be calculated using:

(1 + 1/n)n

(It gets more accurate the higher the value of n)

Page 116 of 199


That formula is a binomial, right? So let's use the Binomial Theorem:

First, we can drop 1n-k as it is always equal to 1:

And, quite magically, most of what is left goes to 1 as n goes to infinity:

Which just leaves:

With just those first few terms we get e ≈ 2.7083...

Try calculating more terms for a better approximation!

Page 117 of 199


Pascal's Triangle
One of the most interesting Number Patterns is
Pascal's Triangle (named after Blaise Pascal, a
famous French Mathematician and Philosopher).

To build the triangle, start with "1" at the top, then


continue placing numbers below it in a triangular
pattern.

Each number is the numbers directly above it added


together.

(Here I have highlighted that 1+3 = 4)

Patterns Within the Triangle

Diagonals

The first diagonal is, of course, just "1"s

The next diagonal has the Counting Numbers


(1,2,3, etc).

The third diagonal has the triangular numbers

(The fourth diagonal, not highlighted, has the


tetrahedral numbers.)

Symmetrical

The triangle is also symmetrical. The numbers on the left side have
identical matching numbers on the right side, like a mirror image.

Page 118 of 199


Horizontal Sums

What do you notice about the horizontal sums?

Is there a pattern?

They double each time (powers of 2).

Exponents of 11

Each line is also the powers (exponents) of 11:

 110=1 (the first line is just a "1")


 111=11 (the second line is "1" and "1")
 112=121 (the third line is "1", "2", "1")
 etc!

But what happens with 115 ? Simple! The digits just overlap, like this:

Page 119 of 199


The same thing happens with 116 etc.

Squares

For the second diagonal, the square of a


number is equal to the sum of the numbers next
to it and below both of those.

Examples:

 32 = 3 + 6 = 9,
 42 = 6 + 10 = 16,
 52 = 10 + 15 = 25,
 ...

There is a good reason, too ... can you think of it? (Hint: 42=6+10, 6=3+2+1, and 10=4+3+2+1)

Fibonacci Sequence

Try this: make a pattern by going up and


then along, then add up the values

(The Fibonacci Sequence starts "0, 1" and


then continues by adding the two previous
numbers, for example 3+5=8, then
5+8=13, etc)

The Fibonacci Sequence is the series of


numbers:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...

The next number is found by adding up the two numbers before it.

 The 2 is found by adding the two numbers before it (1+1)


 The 3 is found by adding the two numbers before it (1+2),
 And the 5 is (2+3),
 and so on!

Page 120 of 199


Example: the next number in the sequence above is 21+34 = 55

Odds and Evens

If you color the Odd and Even numbers, you end up with a
pattern the same as the Sierpinski Triangle

Here is how you can create one:

1. Start with a triangle.


2. Shrink the triangle to half height, and put a copy in each of the three
corners
3. Repeat step 2 for the smaller triangles, again and again, for ever!

Page 121 of 199


CHAPTER 5: PROBABILITY
Introduction to probability
Probability is the science of studying the outcomes of random phenomena.

A phenomenon is called random if individual outcomes are uncertain but the long-term pattern
of many outcomes is predictable.

To determine the probability of a specific outcome of a probability experiment (random


phenomenon) the experiment is repeated a large number of times and we look at the ratio of
times that the outcome occurred.

 Example: The outcome of the experiment of tossing a coin is a random phenomenon. The
probability that the outcome is ―Heads‖ can be found by tossing the coin a large number
of times.

Probability Models

A probability model is a mathematical representation of a random phenomenon. It is defined


by its sample space, events within the sample space, and probabilities associated with each
event. The sample space S for a probability model is the set of all possible outcomes.

Terminology:

For any probability experiment (or a random phenomenon)

 The collection of all the possible outcomes of the experiment is called the Sample Space.
 An event is any sub-collection of outcomes in the sample space.
 A simple event is any single outcome.
 The complement of an event A, denoted , is the set of all outcomes not in A.
 A probability model (or a probability distribution) is a process of assigning to the
outcomes and events in a sample space a value that represents the probability for that
outcome to occur. If x is an outcome, the probability of x will be denoted by P(x). If E is
an event, the probability of E will be denoted by P(E).
 The assignment in a probability model must satisfy the following rules:
- For any event or outcome, the probability is a number between 0 and 1.
- The probability of the sample space is 1.
- If two events A and B do are disjoint, i.e. have no outcome in common, then the
probability P(A or B) that one or the other occurs is the sum P(A) + P(B) of the
individual probabilities of the events.
- The probability of an impossible (empty) event is 0.

For a finite (discrete) probability space, these rules guarantee that the probabilities of the
individual events must add up to 1.

Page 122 of 199


Example:

Suppose we have the following proportions for the marital status of a people in this country
between the ages of 30 and 40.

marital status Never married Married Widowed Divorced


probability .273 .603 .004

A random experiment is drawing a person aged 30 to 40 at random. What is the sample space
for this experiment?

1) What is the event: ―The person is not currently married‖

2) What is the complement of this event?

3) If you draw a person aged 30 to 40 at random, what is the probability that:

a) the person is divorced?

b) The person is not currently married?

c) The person has never married, or is widowed?

Equally likely outcomes


If a probability experiment has N outcomes, and all are equally likely to occur, the probability of
an individual outcome is 1/N.

The probability of an event A is

P(A) = (The number of outcomes that satisfy A) ) / (Total number of outcomes)

Examples:

1) The experiment of rolling a fair die has six equally likely outcomes (1, 2, 3, 4, 5, or 6).

The probability of each of them to occur is 1/6.

a) Let A be the event ―The outcome is a multiple of 3‖. List the elements in A.

b) List the elements in .

c) What is P(A)?

2) Now consider the experiment of rolling two dice, and recording the number of dots on top,

Page 123 of 199


where the order is important.

a) How many outcomes are there? What is the sample space?

b) What is the probability of rolling a six?

c) In the board game MONOPOLY you need to ―doubles‖ to get out of jail. What is the
probability of getting out in a single roll?

d) Let A be the event that the sum of the number is a multiple of 3. What is A?

e) What is P(A)?

f) Let E be the event ― The sum of the two dice is 4". What is P(E)?

g) What is ? What is ?

The last two examples illustrate the following rule involving the complement of an event.

 The Complement Rule

Examples:

1) A statistics student who takes the bus to school every day uses relative frequency to find the
probabilities that the bus will arrive before a given time. The probability that the bus will come
before 8:15 is estimated to be .43. What is the probability that the bus will not come before 8:15?

20 a) A computer assigns a you a PIN at random by assigning 4 symbols, the first is a letter of

Page 124 of 199


the alphabet, the other three are digits from 0 - 9 (with repetition allowed) . Your favorite
number is 6. What is the probability of getting a pin with at least one 6?

b) What is the probability of getting a 6 if repeated digits are not allowed?

The Sum Rule


If two events have no elements in common, they follow the rule:

Definition: If two events have no elements in common, they are called disjoint

Example

In the example of rolling two die and recording the pair of numbers, let A be the event ―the sum
of the two numbers is a 3‖, and let B be the event ―the sum of the two numbers is a 5‖. List the
elements in A; list the elements in B; and list all the elements in the event ― the sum of the two
numbers is a 3 or a 5‖. Find P(A), P(B), and the probability that the sum is a 3 or a 5.

But if the events have elements in common this doesn‘t work.

Example:

In the example of rolling two die and recording the pair of numbers, let C be the event ―one of
the two numbers is a 3‖, and let B be the event ―the sum of the two numbers is a 5‖. List the
elements in C; list the elements in B; and list all the elements in the event ― one of the two
numbers is a 3 or the sum of the two numbers is a 5‖. Find P(C), P(B), and the probability that
one of the numbers is a 3 or the sum is a 5.

This illustrates the sum rule: , where is the


probability that both A and B will happen.

Examples

1) A card is drawn at random from a standard deck of cards. What is the probability it
will be a king or a heart?

2) The data for a group of women from a survey is given below:

Status age 20-34 age 35-49 total


never married 152 51 203
married 226 312 538
widowed 18 69 87
divorced 76 96 172
Total 472 528 1000

If you select a woman at random, what is the probability that she is either married, or over 35?

Page 125 of 199


Random Variables
A random variable gives a value to each outcome in a sample space. A probability model for a
random variable assigns a probability value to each variable value.

Examples:

1) In the dice rolling experiment: If we are only interested in the sum of the die, the random
variable would be the sum of the two numbers.

2) In the experiment of rolling one die, the random variable could be the number of dots that
lands on top.

3) In an experiment of tossing a coin, a random variable could assign the number 1 to heads and
0 to tails.

A probability model (or probability distribution) satisfies the rules:

 For any variable, the probability is a number between 0 and 1.


 The probability of the sum of all the variables is 1.

The Mean (Expected Value) of a Probability model


Suppose that the possible values for the random variables are s1, s2, s3, ... , sk; and suppose that
the probability of the variable sj is pj . Then

the mean (also called expected value) F of the probability distribution is

F = s1 p1 + s2 p2 + ... + sk pk

Example: The following represents a table of grades given to a class for a term paper. An
experiment consists of drawing a student at random and recording that student‘s grade. The
random variable is the value of the grade. The probability distribution is given in the table.

Grade 0 1 2 3 4
Probability 0.10 0.15 0.30 0.30 0.15

Find the mean of the distribution.

Example:

In a gambling game, the player is paid $3 if s/he draws a queen, $5 if s/he draws a king, and $10
if s/he draws an ace. Otherwise, the player will pay the casino the bet amount of $3.00.

Page 126 of 199


1. Find the probability model representing the amount of money the player wins (negative
number for loss!)

x
P(x)

2. Find the mean of this model. Does the game favor the casino or the player?

3. What should the amount of the bet be so that the game is fair?

The Law of Large Numbers


As a random phenomenon is repeated a large number of times

< The proportion of trials on which an outcome occurs gets closer and closer to the probability
of that outcome.

< The average of the observed values gets closer and closer to F.

An American roulette wheel has 38 slots numbered 0, 00, and 1 to 36. The ball is equally likely
to rest in any of these slots when the wheel is spun. One way to place a bet is to bet that the ball
will rest on an odd number. Sam places a $10 bet that pays out $20 if an odd number comes up.

a. What is expected value for one play, taking into account the $10 cost of each play? On any

individual play, will he make the expected value?

b. Sam plays roulette every day for 10 years. What does the law of large numbers tell us about

his results?

Probability of Single or Combined Events


SINGLE EVENT PROBABILITY. The chance of some event happening; such as flipping a coin and having it
land with the head side up, or rolling a "four" on a single die, is called probability. Probability is
expressed as a fraction. ... Therefore, the probability of a "four" showing on the die after one throw is
1/6.

Multiple Probabilities. The probability of 2 things happening: The probability of 2 independent things
happening either one after the other or together is the probability of the first thing happening
multiplied by the probability of the second thing happening.

Independent and Dependent Events


Events can be placed into two major categories dependent or Independent events.

Page 127 of 199


Independent - When two events are said to be independent of each other, what this means is that
the probability that one event occurs in no way affects the probability of the other event
occurring. An example of two independent events is as follows; say you rolled a die and flipped
a coin. The probability of getting any number face on the die in no way influences the probability
of getting a head or a tail on the coin.

Dependent - When two events are said to be dependent, the probability of one event occurring
influences the likelihood of the other event.

For example, if you were to draw a two cards from a deck of 52 cards. If on your first draw you
had an ace and you put that aside, the probability of drawing an ace on the second draw is greatly
changed because you drew an ace the first time. Let's calculate these different probabilities to see
what's going on.

There are 4 Aces in a deck of 52 cards

On your first draw, the probability of getting an ace is given by:

If we don't return this card into the deck, the probability of drawing an ace on the second pick is
given by

As you can clearly see, the above two probabilities are different, so we say that the two events
are dependent. The likelihood of the second event depends on what happens in the first event.

Conditional Probability
Conditional probability deals with further defining dependence of events by looking at
probability of an event given that some other event first occurs.

Conditional probability is denoted by the following:

Page 128 of 199


The above is read as the probability that B occurs given that A has already occurred.

The above is mathematically defined as:

Probability Tree Diagrams


Calculating probabilities can be hard, sometimes we add them, sometimes we multiply them, and
often it is hard to figure out what to do ... tree diagrams to the rescue!

Here is a tree diagram for the toss of a coin:

There are two "branches" (Heads and Tails)

 The probability of each branch is written on the branch


 The outcome is written at the end of the branch

We can extend the tree diagram to two tosses of a coin:

How do we calculate the overall probabilities?

 We multiply probabilities along the branches

Page 129 of 199


 We add probabilities down columns

Now we can see such things as:

 The probability of "Head, Head" is 0.5×0.5 = 0.25


 All probabilities add to 1.0 (which is always a good check)
 The probability of getting at least one Head from two tosses is 0.25+0.25+0.25 = 0.75
 ... and more

That was a simple example using independent events (each toss of a coin is independent of the
previous toss), but tree diagrams are really wonderful for figuring out dependent events (where
an event depends on what happens in the previous event) like this example:

Example: Soccer Game

You are off to soccer, and love being the Goalkeeper, but that depends who is the Coach today:

 with Coach Sam the probability of being Goalkeeper is 0.5


 with Coach Alex the probability of being Goalkeeper is 0.3

Sam is Coach more often ... about 6 out of every 10 games (a probability of 0.6).

So, what is the probability you will be a Goalkeeper today?

Let's build the tree diagram. First we show the two possible coaches: Sam or Alex:

Page 130 of 199


The probability of getting Sam is 0.6, so the probability of Alex must be 0.4 (together the
probability is 1)

Now, if you get Sam, there is 0.5 probability of being Goalie (and 0.5 of not being Goalie):

If you get Alex, there is 0.3 probability of being Goalie (and 0.7 not):

The tree diagram is complete, now let's calculate the overall probabilities. This is done by
multiplying each probability along the "branches" of the tree.

Here is how to do it for the "Sam, Yes" branch:

(When we take the 0.6 chance of Sam being coach and include the 0.5 chance that Sam will let
you be Goalkeeper we end up with an 0.3 chance.)

But we are not done yet! We haven't included Alex as Coach:

Page 131 of 199


An 0.4 chance of Alex as Coach, followed by an 0.3 chance gives 0.12.

Now we add the column:

0.3 + 0.12 = 0.42 probability of being a Goalkeeper today

(That is a 42% chance)

Check
One final step: complete the calculations and make sure they add to 1:

Yes, it all adds up.

Conclusion
So there you go, when in doubt draw a tree diagram, multiply along the branches and add the
columns. Make sure all probabilities add to 1 and you are good to go.

Set Theory in Probability

A sample space is defined as a universal set of all possible outcomes from a given experiment.

Given two events A and B and given that these events are part of a sample space S. This sample
space is represented as a set as in the diagram below.

Page 132 of 199


The entire sample space of S is given by:

Remember the following from set theory:

The different regions of the set S can be explained as using the rules of probability.

Rules of Probability
When dealing with more than one event, there are certain rules that we must follow when
studying probability of these events. These rules depend greatly on whether the events we are
looking at are Independent or dependent on each other.

First acknowledge that

Multiplication Rule (A∩B)


This region is referred to as 'A intersection B' and in probability; this region refers to the event
that both A and B happen. When we use the word and we are referring to multiplication, thus A
and B can be thought of as AxB or (using dot notation which is more popular in probability)
A•B
If A and B are dependent events, the probability of this event happening can be calculated as
shown below:

If A and B are independent events, the probability of this event happening can be calculated as
shown below:

Conditional probability for two independent events can be redefined using the relationship above
to become:

Page 133 of 199


The above is consistent with the definition of independent events, the occurrence of event A in
no way influences the occurrence of event B, and so the probability that event B occurs given
that event A has occurred is the same as the probability of event B.

Additive Rule (A∪ B)


In probability we refer to the addition operator (+) as or. Thus when we want to we want to
define some event such that the event can be A or B, to find the probability of that event:

Thus it follows that:

But remember from set theory that and from the way we defined our sample space above:

and that:

So we can now redefine out event as

The above is sometimes referred to as the subtraction rule.

Mutual Exclusivity
Certain special pairs of events have a unique relationship referred to as mutual exclusivity.
Two events are said to be mutually exclusive if they can't occur at the same time. For a given
sample space, its either one or the other but not both. As a consequence, mutually exclusive
events have their probability defined as follows:

An example of mutually exclusive events are the outcomes of a fair coin flip. When you flip a
fair coin, you either get a head or a tail but not both, we can prove that these events are mutually
exclusive by adding their probabilities:

For any given pair of events, if the sum of their probabilities is equal to one, then those two
events are mutually exclusive.

Rules of Probability for Mutually Exclusive Events


 Multiplication Rule: From the definition of mutually exclusive events, we should quickly
conclude the following:

Page 134 of 199


 Addition Rule: As we defined above, the addition rule applies to mutually exclusive
events as follows:

 Subtraction Rule: From the addition rule above, we can conclude that the subtraction rule
for mutually exclusive events takes the form;

Conditional Probability for Mutually Exclusive Events


We have defined conditional probability with the following equation:

We can redefine the above using the multiplication rule

hence

Below is a venn diagram of a set containing two mutually exclusive events A and B.

Probability Distribution
The Poisson random variable satisfies the following conditions:

1. The number of successes in two disjoint time intervals is independent.


2. The probability of a success during a small time interval is proportional to the entire
length of the time interval.

Apart from disjoint time intervals, the Poisson random variable also applies to disjoint regions
of space.

Applications
 the number of deaths by horse kicking in the Prussian army (first application)
 birth defects and genetic mutations
 rare diseases (like Leukemia, but not AIDS because it is infectious and so not
independent) - especially in legal cases
 car accidents
 traffic flow and ideal gap distance
 number of typing errors on a page

Page 135 of 199


 hairs found in McDonald's hamburgers
 spread of an endangered animal in Africa
 failure of a machine in one month

The probability distribution of a Poisson random variable X representing the number of


successes occurring in a given time interval or a specified region of space is given by the
formula:

P(X)=e−μμxx!

where

x=0,1,2,3...

e=2.71828 (but use your calculator's e button)

μ= mean number of successes in the given time interval or region of space

The normal (or Gaussian) distribution is a very commonly occurring continuous probability
distribution—a function that tells the probability of a number in some context falling between
any two real numbers. a theoretical frequency distribution represented by a normal curve.

Figure 4.1: A Normal Distribution

The normal distribution is

The parameter μ in this formula is the mean or expectation of the distribution (and also its
median and mode). The parameter σ is its standard deviation; its variance is therefore σ 2. A
random variable with a Gaussian distribution is said to be normally distributed and is called a
normal deviate.

If μ = 0 and σ = 1, the distribution is called the standard normal distribution or the unit
normal distribution, and a random variable with that distribution is a standard normal
deviate.

Page 136 of 199


CHAPTER 6: GRAPHS OF FUNCTIONS
Defining the Graph of a Function
The graph of a function f is the set of all points in the plane of the form (x, f(x)). We could also
define the graph of f to be the graph of the equation y = f(x). So, the graph of a function if a
special case of the graph of an equation.

Example 1.

Let f(x) = x2 - 3.

Recall that when we introduced graphs of equations we noted that if we can solve the equation
for y, then it is easy to find points that are on the graph. We simply choose a number for x, then
compute the corresponding value of y. Graphs of functions are graphs of equations that have
been solved for y!

The graph of f(x) in this example is the graph of y = x2 - 3. It is easy to generate points on the
graph. Choose a value for the first coordinate, then evaluate f at that number to find the second
coordinate. The following table shows several values for x and the function f evaluated at those
numbers.

x -2 -1 0 1 2
f(x) 1 -2 -3 -2 1

Each column of numbers in the table holds the coordinates of a point on the graph of f.

Exercise 1:

(a) Plot the five points on the graph of f from the table above, and based on these points, sketch
the graph of f.

Example 2.

Let f be the piecewise-defined function

The graph of f is shown below.

Page 137 of 199


Exercise 2:

Graph the piecewise-defined function

We have seen that some equations in x and y do not describe y as a function of x. The algebraic
way see if an equation determines y as a function of x is to solve for y. If there is not a unique
solution, then y is not a function of x.

Suppose that we are given the graph of the equation. There is an easy way to see if this equation
describes y as a function of x.

Vertical Line Test


A set of points in the plane is the graph of a function if and only if no vertical line intersects the
graph in more than one point.

Example 3.

The graph of the equation y2 = x + 5 is shown below.

Page 138 of 199


By the vertical line test, this graph is not the graph of a function, because there are many vertical
lines that hit it more than once.

Think of the vertical line test this way. The points on the graph of a function f have the form (x,
f(x)), so once you know the first coordinate, the second is determined. Therefore, there cannot be
two points on the graph of a function with the same first coordinate.

All the points on a vertical line have the same first coordinate, so if a vertical line hits a graph
twice, then there are two points on the graph with the same first coordinate. If that happens, the
graph is not the graph of a function

Characteristics of Graphs
Consider the function f(x) = 2 x + 1. We recognize the equation y = 2 x + 1 as the Slope-
Intercept form of the equation of a line with slope 2 and y-intercept (0,1).

Think of a point moving on the graph of f. As the point moves toward the right it rises. This is
what it means for a function to be increasing. Your text has a more precise definition, but this is
the basic idea.

Page 139 of 199


The function f above is increasing everywhere. In general, there are intervals where a function is
increasing and intervals where it is decreasing.

The function graphed above is decreasing for x between -3 and 2. It is increasing for x less than -
3 and for x greater than 2.

Using interval notation, we say that the function is decreasing on the interval (-3, 2) increasing
on (-infinity, -3) and (2, infinity)

Exercise 3:

Graph the function f(x) = x2 - 6x + 7 and find the intervals where it is increasing and where it is
decreasing.

Answer

 decreasing on (-infinity, 3)
 increasing on (3, infinity)

Some of the most characteristics of a function are its Relative Extreme Values. Points on the
functions graph corresponding to relative extreme values are turning points, or points where the
function changes from decreasing to increasing or vice versa. Let f be the function whose graph
is drawn below.

Page 140 of 199


f is decreasing on (-infinity, a) and increasing on (a, b), so the point (a, f(a)) is a turning point of
the graph. f(a) is called a relative minimum of f. Note that f(a) is not the smallest function
value, f(c) is. However, if we consider only the portion of the graph in the circle above a, then
f(a) is the smallest second coordinate. Look at the circle on the graph above b. While f(b) is not
the largest function value (this function does not have a largest value), if we look only at the
portion of the graph in the circle, then the point (b, f(b)) is above all the other points. So, f(b) is a
relative maximum of f. f(c) is another relative minimum of f. Indeed, f(c) is the absolute
minimum of f, but it is also one of the relative minima.

Here again we are giving definitions that appeal to your geometric intuition. The precise
definitions are given in your text.

Approximating Relative Extrema


Suppose a is a number such that f(a) is a relative minimum. In applications, it is often more
important to know where the function attains its relative minimum than it is to know what the
relative minimum is.

For example, f(x) = x3 - 4x2 + 4x has a relative minimum of 0. It attains this relative minimum at
x = 2, so (2,0) is a turning point of the graph of f. We will call the point (2,0) a relative minimum
point. In general, a relative extreme point is a point on the graph of f whose second coordinate
is a relative extreme value of f.

Page 141 of 199


Even and Odd Functions
A function f is even if its graph is symmetric with respect to the y-axis. This criterion can be
stated algebraically as follows: f is even if f(-x) = f(x) for all x in the domain of f. For example, if
you evaluate f at 3 and at -3, then you will get the same value if f is even.

A function f is odd if its graph is symmetric with respect to the origin. This criterion can be
stated algebraically as follows: f is odd if f(-x) = -f(x) for all x in the domain of f. For example, if
you evaluate f at 3, you get the negative of f(-3) when f is odd.

Continuous Functions
Introduction and Definition of Continuous Functions
We first start with graphs of several continuous functions. The functions whose graphs are
shown below are said to be continuous since these graphs have no "breaks", "gaps" or "holes".

We now present examples of dicontinuous functions. These graphs have: breaks, gaps or points
at which they are undefined.

In the graphs below, the function is undefined at x = 2. The graph has a hole at x = 2 and the
function is said to be discontinuous.

Page 142 of 199


In the graphs below, the limits of the function to the left and to the right are not equal and
therefore the limit at x = 3 does not exist. The function is said to be discontinuous.

The limits of the function at x = 2 exists but it is not equal to the value of the function at x = 2.
This function is also discontinuous.

Page 143 of 199


The limits of the function at x = 3 does does not exist since to the left and to the right of 3 the
function either increases or decreases undefinitely. This function is also discontinuous.

Taking into consideration all the information gathered from the examples of continuous and
discontinuous functions shown above, we define a continuous functions as follows:

Function f is continuous at a point a if the following conditions are satisfied.

1. f(a) is defined

2. limx→ a f(x) exists

3. limx→ a f(x) = f(a)

Interpolation and Extrapolation


Definitions
 Interpolation is the process of obtaining a value from a graph or table that is
located between major points given, or between data points plotted. A ratio
process is usually used to obtain the value. Interpolation allows you to add new data
points between pairs of existing data points
 Extrapolation is the process of obtaining a value from a chart or graph that
extends beyond the given data. The "trend" of the data is extended past the last point
given and an estimate made of the value. Extrapolation allows you to add data points
that extend beyond the beginning or ending values of your data range.

Area under a Curve


The area between the graph of y = f(x) and the x-axis is given by the definite integral below. This
formula gives a positive result for a graph above the x-axis, and a negative result for a graph
below the x-axis.

Page 144 of 199


Note: If the graph of y = f(x) is partly above and partly below the x-axis, the formula given below
generates the net area. That is, the area above the axis minus the area below the axis.

Formula:

Example 1: Find the area between y = 7 – x2 and the x-axis between the
values x = –1 and x = 2.

Find the net area between y = sin x and the x-axis between
the values x = 0 and x = 2π.
Example 2:

Page 145 of 199


Area between Curves

The area between curves is given by the formulas below.

Formula 1:

for a region bounded above and below by y = f(x) and y = g(x), and on the left
and right by x = a and x = b.

Formula 2:

for a region bounded left and right by x = f(y) and x = g(y), and above and
below by y = c and y = d.

Example 1:1 Find the area between y = x and y = x2 from x = 1 to x = 2.

Example 2:1 Find the area between x = y + 3 and x = y2 from y = –1 to y = 1.

Page 146 of 199


Inequality
In mathematics, an inequality is a relation that holds between two values when they are different
(see also: equality).

 The notation a ≠ b means that a is not equal to b.

It does not say that one is greater than the other, or even that they can be compared in size.

If the values in question are elements of an ordered set, such as the integers or the real numbers,
they can be compared in size.

 The notation a < b means that a is less than b.


 The notation a > b means that a is greater than b.

In either case, a is not equal to b. These relations are known as strict inequalities. The notation
a < b may also be read as "a is strictly less than b".

In contrast to strict inequalities, there are two types of inequality relations that are not strict:

 The notation a ≤ b means that a is less than or equal to b (or, equivalently, not greater
than b, or at most b).
 The notation a ≥ b means that a is greater than or equal to b (or, equivalently, not less
than b, or at least b)

Page 147 of 199


An additional use of the notation is to show that one quantity is much greater than another,
normally by several orders of magnitude.

 The notation a ≪ b means that a is much less than b. (In measure theory, however, this
notation is used for absolute continuity, an unrelated concept.)
 The notation a ≫ b means that a is much greater than b.

Solving Inequalities

Sometimes we need to solve Inequalities like these:

Symbol Words Example

> greater than x+3>2

< less than 7x < 28

≥ greater than or equal to 5≥x-1

≤ less than or equal to 2y + 1 ≤ 7

Solving
Our aim is to have x (or whatever the variable is) on its own on the left of the inequality sign:
Something like: x<5

or: y ≥ 11

We call that "solved".

These are things you can do without affecting the direction of the inequality:

 Add (or subtract) a number from both sides


 Multiply (or divide) both sides by a positive number
 Simplify a side

Example: 3x < 7+3

You can simplify 7+3 without affecting the inequality:

3x < 10

But these things will change the direction of the inequality ("<" becomes ">" for example):
Page 148 of 199
 Multiply (or divide) both sides by a negative number
 Swapping left and right hand sides

Example: 2y+7 < 12

When you swap the left and right hand sides, you must also change the direction of the
inequality:

12 > 2y+7

Common Graph Construction Errors


Confusing independent and dependent variables. The Independent variable is what I change.‖ The size
of the Dependent variable Depends on the value of the independent variable.

Putting wrong variables on axes. For a matter of convenience, it is common practice to put the
independent variable on the horizontal x-axis (bottom) rather than the vertical y-axis (side) when
seeking a relationship to define the dependent variable.

For instance, if one wants to arrive at a relationship describing F as a function of a, then F (the
dependent variable) should be plotted on the y-axis. The slope becomes the proportionality
constant, F = ma.

Failure to understand the significance of “linearizing” data. When data are non-linear (not in
a straight line when graphed), it is best to ―linearize‖ the data. This does not mean to fit the
curved data points with a straight line. Rather, it means to modify one of the variables in some
manner such that when the data are graphed using this new data set, the resulting data points will
appear to lie in a straight line. For instance, say the data appear to be an inverse function – as x is
doubled, y is halved. To linearize the data for such a function plot x versus 1/y. If this is indeed
an inverse function, then the plot of x versus 1/y date will be linear.

Failure to properly relate y = mx + b to the linearized data. When plotting, say, distance (on
the y-axis) versus time (on the x-axis), the correct relationship between distance and time can be
found by relating y to distance, x to time, m to the slope, and b to the y-intercept. For instance,
data have been linearized for the function resulting in a straight-line graph when distance is
plotted versus time-squared. The slope is 2m/s2 and the y-intercept is 1 m. The correct form of
the relationship between all the variables will be distance = (2m/s2)*time2 + 1 m.

Failure to apply appropriate labeling. Each graph should be appropriately labeled; each axis
should be similarly labeled with its variable and units (in parentheses). For instance, time
(seconds) or distance (meters).

Page 149 of 199


Confusing variables with units. Don‘t confuse variables (time, resistance, distance) with their
units (seconds, ohms, meters).

Connecting data points with straight lines. Never connect even linearized data point-to-point
with straight lines. Linearized data sometimes appears not to fit the best-fit line precisely. This is
frequently due to errors in the data.

Scaling errors. In physics it is often best to show the origin (0,0) in each graph. While this is not
an error, it frequently leads to misinterpretations of relationships. Another problem to avoid is
not sticking with a consistent scale on an axis. Values should be equally spaced on graphs. For
instance, the distances between 1, 2, 3, and 4 should be the same. To be avoided are situations
where the spacing between such numbers is irregular or inconsistent.

Failing to properly interpret horizontal and vertical slopes. When the slope of a line is zero
degrees (horizontal), then there is no relationship between the plotted variables. When the slope
of a line is 90 degrees (vertical), there is no relationship between the plotted variables. In both
these cases, the so-called ―dependent‖ variable does not actually depend upon the independent
variable.

Failing to properly interpret a negative slope. A negative slope does NOT imply an inverse
relationship. What it does imply is that when x gets larger, y becomes larger but in the negative
direction. y = -mx is a negative slope. xy = m or x = m/y is an inverse relationship. Additionally,
a negative acceleration does not necessary imply a slowing down of an object. An object moving
in the –x direction will, in fact, be increasing in speed.

Failing to properly interpret the y-intercept. The value of the y-intercept represents the value
of the dependent variable when the independent variable is zero. Sometimes when lines or curve
representing relationships clearly should pass through the origin (0, 0), they do not. The value of
the y-intercept is then small but not zero. This is usually the result of data collection errors.
Linearized data can be ―forced through the origin‖ by conducting a proportional fit of the data (y
= mx) rather than a linear fit (y = mx + b).

Finding slope using two data points NOT on best-fit line. Finding the slope of the best-fit line
from two data points rather than two points on the best-fit line is a common error. This can result
in a substantial error in the slope. Use two points on the best-fit line for this process, not data
points to find the slope of a line.

Improperly finding the slope using elements of a single coordinate point. When finding the
slope of a tangent line, students sometimes will mistakenly take the coordinate point nearest
where the tangent line is drawn and from those coordinates attempt to determine the slope. For
instance, at (x, y) = (5s, 25m) the data point values are mistakenly used to find a slope of 25m/5s
= 5m/s.

Page 150 of 199


Failing to recognize trends. Graphs must be properly interpreted through the use of
generalizations (e.g., double the mass, and the period increases by 4)

Improperly interpreting the physical meaning of the slope. The units of a slope are a
giveaway as far as interpreting the physical meaning of a slope is concerned. The slope is
defined as the change in the y value divided by a corresponding change in the x value. Hence, the
units are those of the y-axis divided by those of the x-axis. If distance (m) is on the y-axis, and
time(s) on the x-axis, then the slope‘s units will be m/s which is the unit for speed. Similarly, if
velocity (m/s) is on the y-axis and time (s) is on the x-axis, then (m/s)/s = m/s2, the unit of
acceleration. Slopes can be either positive or negative.

Misinterpreting the area under a best-fit line or curve. To more easily determine what the
area under the curve represents, examine the product of the units on the x- and y-axes. For
instance, if velocity or speed (m/s) is on the y-axis and time (s) is on the x-axis, the product of
the units will be meters that is the unit of displacement or distance. Hence, the area under the
curve of a v-t graph is displacement. Similarly, the area under the curve of an a-t graph is
velocity.

Not recognizing errors in data. When one graphs data, large errors in measurement usually
stand out. They become noticeable when they deviate from the trend of the data. Such data points
should not only be questioned, but the data collection process for this datum repeated to see if
there is a readily explainable error. Suspect data should be struck through rather than erased in
the written record. Update the data file appropriately.

Not understanding the meaning of the best-fit line. A best-fit line is a line which, when
drawn, minimizes the sum of the squares of the deviations from the line usually in the y
direction. It is the line that most closely approximates the trend of the data.

Statistics is the study of the collection, organization, analysis, interpretation and presentation of data. It
deals with all aspects of data, including the planning of data collection in terms of the design of surveys
and experiments.

Page 151 of 199


CHAPTER 7: DATA COLLECTION METHODS
Data collection is a process of collecting data using different methodologies. It is a very
important topic of statistics as well as mathematics. The data collections are known as, any
information collected from some person or some other ways to get news. Data collection can be
defined as a term which is used to explain the process of preparing and collecting data, such as, a
part of a process improvement. The purpose of data collection is to collect important information
to keep on record for further use, to make important decisions about different issues, and to pass
vital information on to others.

Introduction to Data Collection Methods


The data collection is to collect important information to keep on record for further use, to
make important decisions about different issues, and to pass vital information on to others.
In terms of the method of data collection that will be used for the study, there are mainly two
types of data:

 Primary data
 Secondary data

Primary Data
They are collected afresh and for the first time, and thus happens to be original in character.
They are the most original data and mostly have not undergone any sort of statistical test.
Secondary Data
They are those that has already been collected by someone else and which has been already been
passed through the statistical process. They are not pure and have undergone some treatment at
least once.

Data Edition:
After collecting the required data, either from primary or secondary means, the next step leads to
edition. Editing is a process by which the data collected is examined to discover any error and
mistake before it is presented. It has to be understood beforehand itself to what degree the
accuracy is needed and to what extent the errors can be tolerated in the inquiry. The editing of
secondary data is much simpler than that of primary data.

Types of Data Collection Methods


Data collection simply defines that, how the information was gathered? It is known as data
collection. The getting data is may be given us to particular information related to that data.

There are two different methods of data’s are collected in data collection.

 Primary data
 Secondary data.

Page 152 of 199


And these two data collection methods are having some important tools used for collecting
data. Such a data collection tools used for the two methods are given below:

Primary data tools are interviews, surveys, direct observations, focusing groups.

Secondary data tools are telephone, mobile phones, e - mails, post cards, etc.

Selecting Appropriate Data Collection Method


As there are many method to collect the data it important that we choose the most appropriate
according to the situation provided. So the following factors has to be kept in mind while
selecting a particular method:

1. The nature, the scope as well as the object of the enquiry is very important as it will
affect the choice of the method.
2. When a method is chosen it’s important to check whether there is adequate amount of
funds to make it work. If the method is too expensive, it will be very hard to do the
experiment.
3. Time is an important factor as decided when the experiment has to end.
4. Precision is also another important factor.

But it must be always remembered theta each method of data collection has its use and none is
superior in all situations.

After data collection, the method can be broadly divided into two types

 Ungrouped data: They are those data’s that are not arranged in any systematic order. It
can be arranged only in ascending or descending order. They are also termed as raw
data.
 Grouped data: They are data’s that are presented in the form of frequency distribution.

Classification of Data
The process of arranging data into homogenous group or classes according to some common
characteristics present in the data is called classification.
For Example: The process of sorting letters in a post office, the letters are classified according
to the cities and further arranged according to streets.

Bases of Classification:
There are four important bases of classification:
Classifications of data
A. According to Nature
1. Quantitative data- information obtained from numeral variables(e.g. age, bills, etc)

Page 153 of 199


2.Qualitative Data- information obtained from variables in the form of categories,
characteristics names or labels or alphanumeric variables (e.g. birthdays, gender etc.)

B. According to Source
1. Primary data- first- hand information (e.g. autobiography, financial statement)
2. Secondary data- second-hand information (e.g. biography, weather forecast from news
papers)

C. According to Measurement
1. Discrete data- countable numerical observation.
-Whole numbers only
- has an equal whole number interval
- obtained through counting(e.g. corporate stocks, etc.)
2. Continuous data-measurable observations.
-decimals or fractions
-obtained through measuring(e.g. bank deposits, volume of liquid etc.)

D. According to Arrangement
1. Ungrouped data- raw data
- no specific arrangement
2. Grouped Data - organized set of data
- at least 2 groups involved
-arranged

Data Tabulation and Presentation


The process of placing classified data into tabular form is known as tabulation. A table is a
symmetric arrangement of statistical data in rows and columns. Rows are horizontal
arrangements whereas columns are vertical arrangements. It may be simple, double or complex
depending upon the type of classification.

one of the most important aspect in any statistical investigation is the manner by which the
researcher presents the data

various modes of data presentation are:


a) Textual-data are presented in the form of texts, phrases or paragraphs. Common among
newspapers and reports
b) tabular – a more reliable and effective way of showing relationships or comparisons of
data
c) graphical-the most effective way of presenting data through the use of statistical graph

Page 154 of 199


Tables are used to present numerical data in a wide variety of publications from newspapers,
journals and textbooks to the sides of grocery packets. They are the format in which most
numerical data are initially stored and analysed and are likely to be the means you use to
organise data collected during experiments and dissertation research. However, when writing up
your work you will have to make a decision about whether a table is the best way of presenting
the data, or if it would be easier to understand if you were to use a graph or chart.

This section of the guide identifies the appropriate uses of tables, and discusses some design
issues for constructing clear tables which are easy to interpret. The points covered in this guide
apply equally to primary data that you have collected yourself, and to data that you have found in
secondary sources and which you wish to include in your work. The latter may already be
presented as a table in the original work but you do not have to reproduce it exactly. It may be
that you only require an extract from the table to support your argument, or that the design of the
table could be improved, or that you wish to merge information from two different publications.
There is no problem in doing any of these as long as you ensure that you reference the original
source of the data in your table.

When to use tables


Tables are an effective way of presenting data:
 when you wish to show how a single category of information varies when measured at
different points (in time or space). For example, a table would be an appropriate way of
showing how the category unemployment rate varies between different countries in the EU
(different points in space);
 When the dataset contains relatively few numbers. This is because it is very hard for a
reader to assimilate and interpret many numbers in a table . In particular, avoid the use of
complex tables in talks and presentations when the audience will have a relatively short
time to take in the information and little or no opportunity to review it at a later stage;
 When the precise value is crucial to your argument and a graph would not convey the same
level of precision. For example, when it is important that the reader knows that the result
was 2.48 and not 2.45;
 When you don‘t wish the presence of one or two very high or low numbers to detract from
the message contained in the rest of the dataset. For example if you are presenting
information about the annual profits of an organisation and don‘t want the underlying
variability from one year to the next to be swamped by a large loss in a particular year.

Table design
In order to ensure that your table is clear and easy to interpret there are a number of design issues
that need to be considered. These are listed below:
 Since tables consist of rows and columns of information it is important to consider how the
data are arranged between the two. Most people find it easier to identify patterns in
numerical data by reading down a column rather than across a row. This means that you
should plan your row and column categories to ensure that the patterns you wish to
highlight are revealed in the columns. It is also easier to interpret the data if they arranged
according to their magnitude so there is numerical progression down the columns, although
this may not always be possible.
 If there are several columns or categories of information a table can appear complex and

Page 155 of 199


become hard to read. It also becomes more difficult to list the data by magnitude since the
order that applies to one column may not be the same for others. In such cases you need to
decide which column contains the most important trend and this should be used to structure
the table. If the columns are equally important it is often better to include two or more
simple tables rather than using a single more complex one.
 Numbers in tables should be presented in their most simple format. This may mean
rounding up values to avoid the use of decimal places, stating the units (e.g. £4.6 million
rather than £4,600,000) or using scientific notation (e.g. 6.315 x 10-2 rather than 0.06315).
 All tables should be presented with a title that contains enough detail that a reader can
understand the content without needing to consult the accompanying text. There should
also be information about the source of the data being used; this may be a reference to a
book or journal, or could indicate that the data are results from an experiment carried out
on a particular date.
 Where more than one table is being presented it is standard practice to give each one a
unique reference number, and in larger pieces of work, such as dissertations, a list of tables
with their page number is usually provided in addition to the contents page.
 The formatting of the table should not resemble a spreadsheet where each entry is bounded
by a box since this makes it difficult to read across rows or down columns. However, the
design of the table should help the reader interpret the data and so the use of lines and/or
bold text to separate headings from the body of data, or highlighting/shading specific rows
or may be effective. Avoid large gaps between columns since this also makes it difficult to
read along a row.

Graphs are a good means of describing, exploring or summarising numerical data because the
use of a visual image can simplify complex information and help to highlight patterns and trends
in the data. They are a particularly effective way of presenting a large amount of data but can
also be used instead of a table to present smaller datasets. There are many different graph types
to choose from and a critical issue is to ensure that the graph type selected is the most
appropriate for the data. Having done this, it is then essential to ensure that the design and
presentation of the graph help the reader or audience interpret the data.

A summary of the types of data that can be presented in the most common types of graphs is
provided below and this is followed by some general guidelines for designing readily
understandable graphs. There is more detailed information on the uses and good design of
particular types of graph in the companion study guides covering bar charts, histograms, pie
charts, line graphs and scatter plots available from the Student Learning Centre.

Types of Graph
Bar charts are one of the most commonly used types of graph and are used to display and
compare the number, frequency or other measure (e.g. mean) for different discrete categories or
groups. The graph is constructed such that the heights or lengths of the different bars are
proportional to the size of the category they represent. Since the x-axis (the horizontal axis)
represents the different categories it has no scale. The y-axis (the vertical axis) does have a scale
and this indicates the units of measurement. The bars can be drawn either vertically or
horizontally depending upon the number of categories and length or complexity of the category
labels. There are various ways in which bar charts can be constructed and this makes them a very

Page 156 of 199


flexible chart type. For example, if there is more than one set of values for each category then
grouped or component bar charts can be used to display the data. Further details about each of
these different types of bar chart can be found in the associated study guide Bar Charts.

Histograms are a special form of bar chart where the data represent continuous rather than
discrete categories. For example a histogram could be used to present details of the average
number of hours exercise carried out by people of different ages because age is a continuous
rather than a discrete category. However, because a continuous category may have a large
number of possible values the data are often grouped to reduce the number of data points. For
example, instead of drawing a bar for each individual age between 0 and 65, the data could be
grouped into a series of continuous age ranges such as 16-24, 25-34, 35-44 etc. Unlike a bar
chart, in a histogram both the x- and y-axes have a scale. This means that it is the area of the bar
that is proportional to the size of the category represented and not just its height Further
information on constructing histograms is available in the associated study guide Histograms.

Pie charts are a visual way of displaying how the total data are distributed between different
categories. The example here shows the proportional distribution of visitors between different
types of tourist attractions. Similar uses of a pie chart would be to show the percentage of the
total votes received by each party in an election. Pie charts should only be used for displaying

Page 157 of 199


nominal data (i.e. data that are classed into different categories). They are generally best for
showing information grouped into a small number of categories and are a graphical way of
displaying data that might otherwise be presented as a simple table. The study guide Pie Charts
gives more details about designing pie charts and using them to compare data.

Line graphs are usually used to show time series data – that is how one or more variables vary
over a continuous period of time. Typical examples of the types of data that can be presented
using line graphs are monthly rainfall and annual unemployment rates. Line graphs are
particularly useful for identifying patterns and trends in the data such as seasonal effects, large
changes and turning points. As well as time series data, line graphs can also be appropriate for
displaying data that are measured over other continuous variables such as distance. For example,
a line graph could be used to show how pollution levels vary with increasing distance from a
source, or how the level of a chemical varies with depth of soil. However, it is important to
consider whether the data have been collected at sufficiently regular intervals so that estimates
made for a point lying half-way along the line between two successive measurements would be
reasonable. In a line graph the x-axis represents the continuous variable (for example year or
distance from the initial measurement) whilst the y-axis has a scale and indicates the
measurement. Several data series can be plotted on the same line chart and this is particularly
useful for analysing and comparing the trends in different datasets.

Scatter plots are used to show the relationship between pairs of quantitative measurements made
for the same object or individual. For example, a scatter plot could be used to present

Page 158 of 199


information about the examination and coursework marks for each of the students in a class. In
the example here, the paired measurements are the age and height of children in 1837. In a
scatter plot a dot represents each individual or object (child in this case) and is located with
reference to the x-axis and y-axis, each of which represent one of the two measurements. By
analysing the pattern of dots that make up a scatter plot it is possible to identify whether there is
any systematic or causal relationship between the two measurements. For example, in this case it
is clear from the upward trending pattern of dots that children‘s height increases with age.
Regression lines can also be added to the graph and used to decide whether the relationship
between the two sets of measurements can be explained or if it is due to chance.

Good graph design


Although there are many different types of graph, there are a number of elements that are
common to the majority of them such as axes. This section provides some general guidelines to
help you design your graph and ensure that you apply these elements in a way that will help the
reader or audience interpret the data you are presenting.

Components of a graph
The different components of a graph are identified in the diagram on the next page and this is
followed by a description that highlights some of the specific design and presentation issues
related to each component.

Page 159 of 199


The chart area defines the boundary of all the elements related to the graph including the plot
itself and any headings and explanatory text. It emphasises that these elements need to be
considered together and that they are separate from the surrounding text. The boundary of the
chart area can be imaginary rather than defined by a frame.

The plot area is the region containing the data. It is bounded by the x- and y-axes to the bottom
and left side. The frame can be completed by drawing around the top and right sides too, but this
is not essential.

The x-axis is the horizontal line that defines the base of the plot area. Depending upon which
type of graph is being considered different locations on the x -axis represent either different
categories (such as years) or different positions along a numerical scale (such as temperature or
income). Details are placed just below the x-axis and an axis label is usually provided to clarify
the units of measurement. However, if the category details are mentioned somewhere else such
as in the title of the graph, or are very obvious (such as years) then it is not necessary to include
an axis label.

The y-axis is the vertical line that usually defines the left side of the plot area, but if more than
one variable is being plotted on the graph then the vertical lines on both the left and right sides of
the plot area may be used as y-axes. The y-axis always has a numerical scale and is used to show
values such as counts, frequencies or percentages. Intervals on the scale are marked by numbers
and tick marks, indicating the major divisions, to the left of the y-axis. Like the x-axis, the y-axis
usually has a label that provides details of the units of measurement. The label is often written
vertically to follow the line of the y-axis but can instead be placed just above the top of the y-
axis.
In order to best highlight a trend in the data, it may be necessary to start the y-axis scale at a
point other than zero. In such cases the starting value on the y-axis should be clearly labelled and
the readers‘ attention drawn to the non-zero start by breaking the y-axis just below the first value
as shown in the example opposite.

Gridlines are the vertical and horizontal lines placed within the plot area to help read values
from the graph. The gridlines should be subtle and not detract from the data. In the case of
simple graphs it is not always necessary to include them. Gridlines are usually drawn at regular
intervals based on the major divisions of the y-axis scale.

Page 160 of 199


Title - All graphs should include a title that summarises what the graph shows. The title should identify
what is being described (e.g. speeding offences detected by automatic cameras) and the units of
measurements (e.g. percentages, total number, frequency). The title may be placed within the chart area,
as in the example above, or above or below the chart.

Page 161 of 199


CHAPTER 8: MEASURES OF CENTRAL
TENDENCY
Introduction to central tendency
A central tendency (or, more commonly, a measure of central tendency) is a central value or a
typical value for a probability distribution. It is occasionally called an average or just the center of
the distribution. The most common measures of central tendency are the arithmetic mean, the
median and the mode.

The significance property of measures of central tendency


 It represents a single score around which the center of the entire distribution tends to be located.
 It conveys us the shape and nature of the distribution of data.
 It condenses the data to a single value.
 It enhances the comparison between data.

Types and measures of central tendency


The most commonly used measures of central tendency are:
 Mean
 Median
 Mode

Mean: Average.
The sum of a set of data divided by the number of data.
(Do not round your answer unless directed to do so.)
Median: The middle value, or the mean of the middle two values, when the
data is arranged in numerical order. Think of a "median" being in the
middle of a highway.

Mode: The value ( number) that appears the most.


It is possible to have more than one mode, and it is possible to have no
mode. If there is no mode-write "no mode", do not write zero (0) .

Calculation in central tendency


Example #1
Find the mean, median and mode for the following data: 5, 15, 10, 15, 5, 10, 10, 20,
25, 15.
(You will need to organize the data.)
5, 5, 10, 10, 10, 15, 15, 15, 20, 25
Page 162 of 199
Mean:
Median: 5, 5, 10, 10, 10, 15, 15, 15, 20, 25

Listing the data in order is the easiest way to find the median.
The numbers 10 and 15 both fall in the middle.
Average these two numbers to get the median. 10 + 15 = 12.5
2

Mode: Two numbers appear most often: 10 and 15.


There are three 10's and three 15's.
In this example there are two answers for the mode.
Dispersion (also called variability, scatter, or spread) denotes how stretched or squeezed a distribution is

Measures of dispersion measure how spread out a set of data is.

Variance and Standard Deviation


The formulae for the variance and standard deviation are given below.  means the mean of the
data.
Variance = 2 =  (xr -)2
n

The standard deviation, , is the square root of the variance.

What the formula means:


(1) xr -  means take each value in turn and subtract the mean from each value.
(2) (xr - )2 means square each of the results obtained from step (1). This is to get rid of any
minus signs.
(3) (xr - )2 means add up all of the results obtained from step (2).
(4) Divide step (3) by n, which is the number of numbers
(5) For the standard deviation, square root the answer to step (4).

Example

Find the variance and standard deviation of the following numbers: 1, 3, 5, 5, 6, 7, 9, 10 .

The mean = 46/ 8 = 5.75

Page 163 of 199


(Step 1): (1 - 5.75), (3 - 5.75), (5 - 5.75), (5 - 5.75), (6 - 5.75), (7 - 5.75), (9 - 5.75), (10 - 5.75)
= -4.75, -2.75, -0.75, -0.75, 0.25, 1.25, 3.25, 4.25

(Step 2): 22.563, 7.563, 0.563, 0.563, 0.063, 1.563, 10.563, 18.063

(Step 3): 22.563 + 7.563 + 0.563 + 0.563 + 0.063 + 1.563 + 10.563 + 18.063 = 61.504

(Step 4): n = 8, therefore variance = 61.504/ 8 = 7.69 (3sf)

(Step 5): standard deviation = 2.77 (3sf)

Grouped Data
There are many ways of writing the formula for the standard deviation. The one above is for a
basic list of numbers. The formula for the variance when the data is grouped is as follows. The
standard deviation can be found by taking the square root of this value.

Example

The table shows marks (out of 10) obtained by 20 people in a test

Mark (x) Frequency (f)


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

Page 164 of 199


Work out the variance of this data.

In such questions, it is often easiest to set your working out in a table:

fx fx2
0 0
2 4
3 9
12 48
10 50
30 180
35 245
16 128
0 0
10 100

f = 20
fx = 118
Sfx2 = 764

variance = fx2 - (fx )2


f ( f )2
= 764 - (118)2
20 ( 20 )2
= 38.2 - 34.81 = 3.39

Page 165 of 199


CHAPTER 9: MEASURES OF DISPERSION
Introduction to measure of Dispersion
The Absolute Measure of dispersion is basically the measure of variation from the mean such as
standard deviation. On the other hand the relative measure of dispersion is basically the position of a
certain variable with reference to or as compared with the other variables. Such as the percentiles or
the z-score.

Absolute measures of Dispersion are expressed in same units in which original data is presented
but these measures cannot be used to compare the variations between the two series. Relative
measures are not expressed in units but it is a pure number. It is the ratios of absolute dispersion
to an appropriate average such as co-efficient of Standard Deviation or Co-efficient of Mean
Deviation.

What is Dispersion? Simplest meaning that can be attached to the word ‗dispersion‘ is a lack of
uniformity in the sizes or quantities of the items of a group or series. According to Reiglemen,
―Dispersion is the extent to which the magnitudes or quantities of the items differ, the degree of
diversity.‖ The word dispersion may also be used to indicate the spread of the data.
In all these definitions, we can find the basic property of dispersion as a value that indicates the
extent to which all other values are dispersed about the central value in a particular distribution.
Properties of a good measure of Dispersion
There are certain pre-requisites for a good measure of dispersion:
1. It should be simple to understand.
2. It should be easy to compute.
3. It should be rigidly defined.
4. It should be based on each individual item of the distribution.
5. It should be capable of further algebraic treatment.
6. It should have sampling stability.
7. It should not be unduly affected by the extreme items.

Types of Dispersion
The measures of dispersion can be either ‗absolute‘ or ―relative‖.
Absolute measures of dispersion are expressed in the same units in which the original data are
expressed. For example, if the series is expressed as Marks of the students in a particular subject;
the absolute dispersion will provide the value in Marks. The only difficulty is that if two or more
series are expressed in different units, the series cannot be compared on the basis of dispersion.
„Relative‟ or „Coefficient‟ of dispersion is the ratio or the percentage of a measure of absolute
dispersion to an appropriate average. The basic advantage of this measure is that two or more
series can be compared with each other despite the fact they are expressed in different units.
Theoretically, ‗Absolute measure‘ of dispersion is better. But from a practical point of view,

Page 166 of 199


relative or coefficient of dispersion is considered better as it is used to make comparison between
series.
Absolute Measures
 Range
 quartile Deviation
 Mean Deviation
 Standard Deviation
 Lorenz Curve

Relative Measure
 Co-efficient of Range
 Co-efficient of Quartile Deviation
 Co-efficient of mean Deviation
 Co-efficient of Variation.

Methods of Dispersion and Calculations


Methods of studying dispersion are divided into two types :
(i) Mathematical Methods: We can study the ‗degree‘ and ‗extent‘ of variation by these
methods. In this category, commonly used measures of dispersion are :
(a) Range
(b) Quartile Deviation
(c) Average Deviation
(d) Standard deviation and coefficient of variation.
(ii) Graphic Methods: Where we want to study only the extent of variation, whether it is higher
or lesser a Lorenz-curve is used.

Quartiles, deciles, percentiles and S.I.R.


The mean and median both describe the 'center' of a distribution. This is usually what you want
to summarize about a set of marks, but occasionally a different part of the distribution is of more
interest.

For example, you might want to describe a typical mark for a 'good' or 'weak' student.

Quartiles
The median of a distribution splits the data into two equally-sized groups. In the same way, the
quartiles are the three values that split a data set into four equal parts. Note that the 'middle'
quartile is the median.

The upper quartile describes a 'typical' mark for the top half of a class and the lower quartile is a
'typical' mark for the bottom half of the class.

The quartiles are closely related to the histogram of a data set. Since area equals the proportion
of values in a histogram, the quartiles split the histogram into four approximately equal areas.

Page 167 of 199


(The relationship is only approximate if the quartiles do not coincide with histogram bin
boundaries.)

Deciles
In a similar way, the deciles of a distribution are the nine values that split the data set into ten
equal parts.

You should not try to calculate deciles from small data sets -- a single class of marks is too small
to get useful values since the extreme deciles are very variable. However the deciles can be
useful descriptions for larger data sets such as national distributions for marks from standard
tests.

Deciles for the distribution and for individual students


The term 'decile' is used in two different contexts. It is confusing that the same word is used in
both ways, so be careful!

When applied to a distribution (a large group of marks), there are nine deciles, each of which is a
mark.

A student whose mark is below the first decile is said to be in decile 1. Similarly, a student
whose marks is between the first and second deciles is in decile 2, ... and a student whose marks
is above the ninth decile is in decile 10. When applied to individual students, the term 'decile' is
therefore a number between 1 and 10.

For example, the histogram below shows the distribution of marks in a test (out of 60) that was
attempted by 600 students. Each student's mark is represented by a square in the histogram.

Page 168 of 199


The nine deciles split the students into 10 groups of 60.

The first decile is 17.5 so the weakest tenth of the students in the class had a mark below this.
This decile therefore summarises the performance of the weakest students.

Students with marks below 17.5 are said to be in decile 1. Those with marks between 17.5 and
26.5 are in decile 2, and so on, up to students with marks higher than 54.5 who are in decile 10.

Details
Unfortunately there is no commonly accepted precise definition for the lower and upper quartiles
-- different software (and indeed different statisticians!) use slightly different values. One simple
definition is that the lower quartile is the median of the lower half of the data (excluding the
middle value if there is an even number of values) with a similar definition for the upper quartile.

In practice, the precise definition is of little practical importance, especially for large data sets.
The main thing to remember is to be consistent with your definition if you are comparing several
data sets.

There are similar problems with precisely defining deciles but again the precise definition used
should not affect your interpretation of the data.

In practice, you are advised to use the functions built into Excel to evaluate quartiles and deciles.

Percentiles
In a similar way, the percentiles of a distribution are the 99 values that split the data set into a
hundred equal parts. These percentiles can be used to categorise the individuals into percentile
1, ..., percentile 100.

A very large data set is required before the extreme percentiles can be estimated with any
accuracy. (The 'random' variability in marks is especially noticeable in the extremes of a data
set.)

Page 169 of 199


Quartiles, etc. in Excel

Excel has a built-in function to evaluate the quartiles of a column of marks. If the marks are
contained in the cells A1 to A25 of a spreadsheet, the formula "=QUARTILE(A1:A25, 1)" will
calculate the lower quartile of the distribution of marks. If the second parameter to the function is
2 or 3, the median or upper quartile will be shown.

In a similar way, the function "=PERCENTILE (A1:A25, 5)" will evaluate the 5th percentile of
the distribution, etc.

Skewness and kurtosis in Dispersion interplatation


Skewness is a measure of symmetry, or more precisely, the lack of symmetry. A distribution, or data set,
is symmetric if it looks the same to the left and right of the center point. Kurtosis is a measure of
whether the data are heavy-tailed or light-tailed relative to a normal distribution.

Skew, or skewness, can be mathematically defined as the averaged cubed deviation from the mean
divided by the standard deviation cubed. If the result of the computation is greater than zero, the
distribution is positively skewed. If it's less than zero, it's negatively skewed and equal to zero means it's
symmetric. Negatively skewed distributions have what statisticians call a long left tail, which for
investors can mean a greater chance of extremely negative outcomes. Positive skew would mean
frequent small negative outcomes, and extremely bad scenarios are not as likely.

A nonsymmetrical or skewed distribution occurs when one side of the distribution does not
mirror the other. Applied to investment returns, nonsymmetrical distributions are generally
described as being either positively skewed (meaning frequent small losses and a few extreme
gains) or negatively skewed (meaning frequent small gains and a few extreme losses).

Positive Skew Negative Skew

Figure 2.4

For positively skewed distributions, the mode (point at the top of the curve) is less than the
median (the point where 50% are above/50% below), which is less than the arithmetic mean
(sum of observations/number of observations). The opposite rules apply to negatively skewed
distribution: mode is greater than median, which is greater than arithmetic mean.

Positive: Mean > Median > Mode Negative: Mean < Median < Mode

Page 170 of 199


Notice that by alphabetical listing, it's mean à median à mode. For positive skew, they are
separated with a greater than sign, for negative, less than.

Kurtosis refers to the degree of peak in a distribution. More peak than normal (leptokurtic)
means that a distribution also has fatter tails and that there are more chances of extreme
outcomes compared to a normal distribution.

The kurtosis formula measures the degree of peak. Kurtosis equals three for a normal
distribution; excess kurtosis calculates and expresses kurtosis above or below 3.

In figure below, the solid line is the normal distribution; the dashed line is leptokurtic
distribution.

Figure: Kurtosis

Sample Skew and Kurtosis


For a calculated skew number (average cubed deviations divided by the cubed standard
deviation), look at the sign to evaluate whether a return is positively skewed (skew > 0),
negatively skewed (skew < 0) or symmetric (skew = 0). A kurtosis number (average deviations
to the fourth power divided by the standard deviation to the fourth power) is evaluated in relation
to the normal distribution, on which kurtosis = 3. Since excess kurtosis = kurtosis - 3, any
positive number for excess kurtosis would mean the distribution is leptokurtic (meaning fatter
tails and lesser risk of extreme outcomes).

Page 171 of 199


CHAPTER 10: NUMERICAL ANALYSIS
Introduction to Numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation (as opposed to
general symbolic manipulations) for the problems of mathematical analysis (as distinguished
from discrete mathematics).

Numerical analysis naturally finds applications in all fields of engineering and the physical
sciences, but in the 21st century also the life sciences and even the arts have adopted elements of
scientific computations. Ordinary differential equations appear in celestial mechanics (planets,
stars and galaxies); numerical linear algebra is important for data analysis; stochastic differential
equations and Markov chains are essential in simulating living cells for medicine and biology.

Before the advent of modern computers numerical methods often depended on hand interpolation
in large printed tables. Since the mid 20th century, computers calculate the required functions
instead. These same interpolation formulas nevertheless continue to be used as part of the
software algorithms for solving differential equations.

General introduction
The overall goal of the field of numerical analysis is the design and analysis of techniques to
give approximate but accurate solutions to hard problems, the variety of which is suggested by
the following:

 Advanced numerical methods are essential in making numerical weather prediction feasible.
 Computing the trajectory of a spacecraft requires the accurate numerical solution of a system of
ordinary differential equations.
 Car companies can improve the crash safety of their vehicles by using computer simulations of car
crashes. Such simulations essentially consist of solving partial differential equations numerically.
 Hedge funds (private investment funds) use tools from all fields of numerical analysis to attempt to
calculate the value of stocks and derivatives more precisely than other market participants.
 Airlines use sophisticated optimization algorithms to decide ticket prices, airplane and crew
assignments and fuel needs. Historically, such algorithms were developed within the overlapping
field of operations research.
 Insurance companies use numerical programs for actuarial analysis.

Approximation theory
Use computable functions p(x) to approximate the values of functions f(x) that are not easily
computable or use approximations to simplify dealing with such functions. The most popular
types of computable functions p(x) are polynomials, rational functions, and piecewise versions
of them, for example spline functions. Trigonometric polynomials are also a very useful choice.

 Best approximations. Here a given function f(x) is approximated within a given finite-dimensional
family of computable functions. The quality of the approximation is expressed by a functional,

Page 172 of 199


usually the maximum absolute value of the approximation error or an integral involving the error.
Least squares approximations and minimax approximations are the most popular choices.
 Interpolation. A computable function p(x) is to be chosen to agree with a given f(x) at a given finite
set of points x . The study of determining and analyzing such interpolation functions is still an active
area of research, particularly when p(x) is a multivariate polynomial.
 Fourier series. A function f(x) is decomposed into orthogonal components based on a given
orthogonal basis {φ1,φ2,…} , and then f(x) is approximated by using only the largest of such
components. The convergence of Fourier series is a classical area of mathematics, and it is very
important in many fields of application. The development of the Fast Fourier Transform in 1965
spawned a rapid progress in digital technology. In the 1990s wavelets became an important tool in
this area.
 Numerical integration and differentiation. Most integrals cannot be evaluated directly in terms of
elementary functions, and instead they must be approximated numerically. Most functions can be
differentiated analytically, but there is still a need for numerical differentiation, both to approximate
the derivative of numerical data and to obtain approximations for discretizing differential equations.

Numerical methods
Mathematical techniques for solving practical problems. They are called numerical methods
because they produce the solution as real numbers such as " 3.1768 ", rather than as algebraic
expressions (such as " x ² + c ") or surds (such as " 2 ± sqrt(11) " where sqrt means the square
root function).
Numerical methods are, some might say, a lot easier to use than the algebraic methods.

Numerical methods to solve three types of problem:

 Find a solution to a nonlinear equation F( x ) = 0


 Find an interpolated value from a table of data
 Find the numerical solution of a differential equation

Direct and iterative methods


Direct methods compute the solution to a problem in a finite number of steps. These methods
would give the precise answer if they were performed in infinite precision arithmetic. Examples
include Gaussian elimination, the QR factorization method for solving systems of linear
equations, and the simplex method of linear programming. In practice, finite precision is used
and the result is an approximation of the true solution (assuming stability).

In contrast to direct methods, iterative methods are not expected to terminate in a finite number
of steps. Starting from an initial guess, iterative methods form successive approximations that
converge to the exact solution only in the limit. A convergence test, often involving the residual,
is specified in order to decide when a sufficiently accurate solution has (hopefully) been found.
Even using infinite precision arithmetic these methods would not reach the solution within a
finite number of steps (in general). Examples include Newton's method, the bisection method,
and Jacobi iteration. In computational matrix algebra, iterative methods are generally needed for
large problems.

Page 173 of 199


Iterative methods are more common than direct methods in numerical analysis. Some methods
are direct in principle but are usually used as though they were not, e.g. GMRES and the
conjugate gradient method. For these methods the number of steps needed to obtain the exact
solution is so large that an approximation is accepted in the same manner as for an iterative
method.

Direct vs iterative methods

Consider the problem of solving


3x3 + 4 = 28
for the unknown quantity x.
Direct method
3x3 + 4 = 28.
Subtract 4 3x3 = 24.
Divide by 3 x3 = 8.
Take cube roots x = 2.

For the iterative method, apply the bisection method to f(x) = 3x3 − 24. The initial values are a =
0, b = 3, f(a) = −24, f(b) = 57.

Iterative method
a b mid f(mid)
0 3 1.5 −13.875
1.5 3 2.25 10.17...
1.5 2.25 1.875 −4.22...
1.875 2.25 2.0625 2.32...

We conclude from this table that the solution is between 1.875 and 2.0625. The algorithm might
return any number in that range with an error less than 0.2.

Discretization
Furthermore, continuous problems must sometimes be replaced by a discrete problem whose
solution is known to approximate that of the continuous problem; this process is called
discretization. For example, the solution of a differential equation is a function. This function
must be represented by a finite amount of data, for instance by its value at a finite number of
points at its domain, even though this domain is a continuum.

Discretization and numerical integration


In a two-hour race, we have measured the speed of the car at three instants and recorded
them in the following table.

Page 174 of 199


Time 0:20 1:00 1:40
km/h 140 150 180

A discretization would be to say that the speed of the car was constant from 0:00 to
0:40, then from 0:40 to 1:20 and finally from 1:20 to 2:00. For instance, the total distance
traveled in the first 40 minutes is approximately (2/3 h × 140 km/h) = 93.3 km. This
would allow us to estimate the total distance traveled as 93.3 km + 100 km + 120 km =
313.3 km, which is an example of numerical integration (see below) using a Riemann
sum, because displacement is the integral of velocity.

Ill-conditioned problem: Take the function f(x) = 1/(x − 1). Note that f(1.1) = 10 and
f(1.001) = 1000: a change in x of less than 0.1 turns into a change in f(x) of nearly 1000.
Evaluating f(x) near x = 1 is an ill-conditioned problem.

Well-conditioned problem: By contrast, evaluating the same function f(x) = 1/(x − 1)


near x = 10 is a well-conditioned problem. For instance, f(10) = 1/9 ≈ 0.111 and f(11) =
0.1: a modest change in x leads to a modest change in f(x).

Generation and propagation of errors


The study of errors forms an important part of numerical analysis. There are several ways in
which error can be introduced in the solution of the problem.

Round-off
Round-off errors arise because it is impossible to represent all real numbers exactly on a machine
with finite memory (which is what all practical digital computers are).

Truncation and discretization error


Truncation errors are committed when an iterative method is terminated or a mathematical
procedure is approximated, and the approximate solution differs from the exact solution.
Similarly, discretization induces a discretization error because the solution of the discrete
problem does not coincide with the solution of the continuous problem. For instance, in the
iteration in the sidebar to compute the solution of 3x3+4=28, after 10 or so iterations, we
conclude that the root is roughly 1.99 (for example). We therefore have a truncation error of
0.01.

Once an error is generated, it will generally propagate through the calculation. For instance, we
have already noted that the operation + on a calculator (or a computer) is inexact. It follows that
a calculation of the type a+b+c+d+e is even more inexact.

What does it mean when we say that the truncation error is created when we approximate a
mathematical procedure? We know that to integrate a function exactly requires one to find the
sum of infinite trapezoids. But numerically one can find the sum of only finite trapezoids, and
hence the approximation of the mathematical procedure. Similarly, to differentiate a function, the

Page 175 of 199


differential element approaches zero but numerically we can only choose a finite value of the
differential element.

Areas of study
The field of numerical analysis includes many sub-disciplines. Some of the major ones are:

Computing values of functions


One of the simplest problems is the evaluation of a function at a given point. The most
straightforward approach, of just plugging in the number in the formula is sometimes not very
efficient. For polynomials, a better approach is using the Horner scheme, since it reduces the
necessary number of multiplications and additions. Generally, it is important to estimate and
control round-off errors arising from the use of floating point arithmetic.

Interpolation, extrapolation, and regression


Interpolation solves the following problem: given the value of some unknown function at a
number of points, what value does that function have at some other point between the given
points?

Extrapolation is very similar to interpolation, except that now we want to find the value of the
unknown function at a point which is outside the given points.

Regression is also similar, but it takes into account that the data is imprecise. Given some points,
and a measurement of the value of some function at these points (with an error), we want to
determine the unknown function. The least squares-method is one popular way to achieve this.

Interpolation: We have observed the temperature to vary from 20 degrees Celsius at 1:00 to 14
degrees at 3:00. A linear interpolation of this data would conclude that it was 17 degrees at 2:00
and 18.5 degrees at 1:30pm.

Extrapolation: If the gross domestic product of a country has been growing an average of 5%
per year and was 100 billion dollars last year, we might extrapolate that it will be 105 billion
dollars this year.

Regression: In linear regression, given n points, we compute a line that passes as close as
possible to those n points.

Page 176 of 199


Optimization: Say you sell lemonade at a lemonade stand, and notice that at $1, you can sell
197 glasses of lemonade per day, and that for each increase of $0.01, you will sell one glass of
lemonade less per day. If you could charge $1.485, you would maximize your profit, but due to
the constraint of having to charge a whole cent amount, charging $1.48 or $1.49 per glass will
both yield the maximum income of $220.52 per day.

Differential equation: If you set up 100 fans to blow air from one end of the room to the other
and then you drop a feather into the wind, what happens? The feather will follow the air currents,
which may be very complex. One approximation is to measure the speed at which the air is
blowing near the feather every second, and advance the simulated feather as if it were moving in
a straight line at that same speed for one second, before measuring the wind speed again. This is
called the Euler method for solving an ordinary differential equation.

Solving equations and systems of equations


Another fundamental problem is computing the solution of some given equation. Two cases are
commonly distinguished, depending on whether the equation is linear or not. For instance, the
equation 2X+5=3 is linear while 2X2+5=3 is not.

Much effort has been put in the development of methods for solving systems of linear equations.
Standard direct methods, i.e., methods that use some matrix decomposition are Gaussian
elimination, LU decomposition, Cholesky decomposition for symmetric (or hermitian) and
positive-definite matrix, and QR decomposition for non-square matrices. Iterative methods such
as the Jacobi method, Gauss–Seidel method, successive over-relaxation and conjugate gradient
method are usually preferred for large systems. General iterative methods can be developed
using a matrix splitting.

Root-finding algorithms are used to solve nonlinear equations (they are so named since a root of
a function is an argument for which the function yields zero). If the function is differentiable and
the derivative is known, then Newton's method is a popular choice. Linearization is another
technique for solving nonlinear equations.

Solving eigenvalue or singular value problems


Several important problems can be phrased in terms of eigenvalue decompositions or singular
value decompositions. For instance, the spectral image compression algorithm is based on the
singular value decomposition. The corresponding tool in statistics is called principal component
analysis.

Optimization
Optimization problems ask for the point at which a given function is maximized (or minimized).
Often, the point also has to satisfy some constraints.

The field of optimization is further split in several subfields, depending on the form of the
objective function and the constraint. For instance, linear programming deals with the case that

Page 177 of 199


both the objective function and the constraints are linear. A famous method in linear
programming is the simplex method.

The method of Lagrange multipliers can be used to reduce optimization problems with
constraints to unconstrained optimization problems.

Evaluating integrals
Numerical integration, in some instances also known as numerical quadrature, asks for the value
of a definite integral. Popular methods use one of the Newton–Cotes formulas (like the midpoint
rule or Simpson's rule) or Gaussian quadrature. These methods rely on a "divide and conquer"
strategy, whereby an integral on a relatively large set is broken down into integrals on smaller
sets. In higher dimensions, where these methods become prohibitively expensive in terms of
computational effort, one may use Monte Carlo or quasi-Monte Carlo methods , or in modestly
large dimensions, the method of sparse grids.

Differential equations
Numerical analysis is also concerned with computing (in an approximate way) the solution of
differential equations, both ordinary differential equations and partial differential equations.

Partial differential equations are solved by first discretizing the equation, bringing it into a finite-
dimensional subspace. This can be done by a finite element method, a finite difference method,
or (particularly in engineering) a finite volume method. The theoretical justification of these
methods often involves theorems from functional analysis. This reduces the problem to the
solution of an algebraic equation.

Software
Since the late twentieth century, most algorithms are implemented in a variety of programming
languages. The Netlib repository contains various collections of software routines for numerical
problems, mostly in Fortran and C. Commercial products implementing many different
numerical algorithms include the IMSL and NAG libraries; a free-software alternative is the
GNU Scientific Library.

There are several popular numerical computing applications such as MATLAB, TK Solver, S-
PLUS, and IDL as well as free and open source alternatives such as FreeMat, Scilab, GNU
Octave (similar to Matlab), and IT++ (a C++ library). There are also programming languages
such as R (similar to S-PLUS) and Python with libraries such as NumPy, SciPy and SymPy.
Performance varies widely: while vector and matrix operations are usually fast, scalar loops may
vary in speed by more than an order of magnitude.

Many computer algebra systems such as Mathematica also benefit from the availability of
arbitrary precision arithmetic which can provide more accurate results.

Also, any spreadsheet software can be used to solve simple problems relating to numerical
analysis.

Page 178 of 199


CHAPTER 11: INTRODUCTION TO MODELING
Introduction to Mathematical modeling
A mathematical model is a description of a system using mathematical concepts and language.
The process of developing a mathematical model is termed mathematical modeling.
Mathematical models are used in the natural sciences (such as physics, biology, earth science,
meteorology) and engineering disciplines (such as computer science, artificial intelligence), as
well as in the social sciences (such as economics, psychology, sociology, political science).
A model may help to explain a system and to study the effects of different components, and to
make predictions about behavior.

Hypothesis, Model, Theory & Law


In common usage, the words hypothesis, model, theory, and law have different interpretations
and are at times used without precision, but in science they have very exact meanings.

Hypothesis
It is a limited statement regarding the cause and effect in a specific situation, which can be
tested by experimentation and observation or by statistical analysis of the probabilities from the
data obtained. The outcome of the test hypothesis should be currently unknown, so that the
results can provide useful data regarding the validity of the hypothesis.

Sometimes a hypothesis is developed that must wait for new knowledge or technology to be
testable. The concept of atoms was proposed by the ancient Greeks, who had no means of testing
it. Centuries later, when more knowledge became available, the hypothesis gained support and
was eventually accepted by the scientific community, though it has had to be amended many
times over the year. Atoms are not indivisible, as the Greeks supposed.

Model
A model is used for situations when it is known that the hypothesis has a limitation on its
validity.

Several classes of models


Three classes appear :
 Models which come from laws of physics: this is the case for gravitation laws, Maxwell equations
(waves), Navier-Stokes equations (fluid dynamics), and so on;
 Model which come from empirical laws, such as air resistance for a movement: this laws are of
empirical nature;
 Models which use statistical laws, for instance that fit a line between several points and assume
the response to be linear.

Theory & Law


A scientific theory or law represents a hypothesis (or group of related hypotheses) which has
been confirmed through repeated testing, almost always conducted over a span of many years.

Page 179 of 199


Generally, a theory is an explanation for a set of related phenomena, like the theory of evolution
or the big bang theory.

The word "law" is often invoked in reference to a specific mathematical equation that relates the
different elements within a theory. Pascal's Law refers an equation that describes differences in
pressure based on height. In the overall theory of universal gravitation developed by Sir Isaac
Newton, the key equation that describes the gravitational attraction between two objects is called
the law of gravity.

These days, physicists rarely apply the word "law" to their ideas. In part, this is because so many
of the previous "laws of nature" were found to be not so much laws as guidelines, that work well
within certain parameters but not within others.

General rules of mathematical modeling


 Look at how others model similar situations; adapt their models to the present situation.
 Collect/ask for background information needed to understand the problem.
 Start with simple models; add details as they become known and useful or necessary.
 Find all relevant quantities and make them precise.
 Find all relevant relationships between quantities ([differential] equations, inequalities, case
distinctions).
 Locate/collect/select the data needed to specify these relationships.
 Find all restrictions that the quantities must obey (sign, limits, forbidden overlaps, etc.). Which
restrictions are hard, which soft? How soft?
 Try to incorporate qualitative constraints that rule out otherwise feasible results (usually from
inadequate previous versions).
 Find all goals (including conflicting ones)
 Play the devil's advocate to find out and formulate the weak spots of your model.
 Sort available information by the degree of impact expected/hoped for.
 Create a hierarchy of models: from coarse, highly simplifying models to models with all known
details. Are there useful toy models with simpler data? Are there limiting cases where the model
simplifies? Are there interesting extreme cases that help discover difficulties?
 First solve the coarser models (cheap but inaccurate) to get good starting points for the finer models
(expensive to solve but realistic)
 Try to have a simple working model (with report) after 1/3 of the total time planned for the task.
Use the remaining time for improving or expanding the model based on your experience, for making
the programs more versatile and speeding them up, for polishing documentation, etc.
 Good communication is essential for good applied work.
 The responsibility for understanding, for asking the questions that lead to it, for recognizing
misunderstanding (mismatch between answers expected and answers received), and for
overcoming them lies with the mathematician. You cannot usually assume your customer to
understand your scientific jargon.
 Be not discouraged. Failures inform you about important missing details in your understanding of
the problem (or the customer/boss) - utilize this information!
 There are rarely perfect solutions. Modeling is the art of finding a satisfying compromise. Start with
the highest standards, and lower them as the deadline approaches. If you have results early, raise
your standards again.
 Finish your work in time.

Page 180 of 199


Construct generalized models
Mathematics can be used to "model", or represent, how the real world works.

Example: how much space is inside this cardboard box?

We know three measurements:

 l (length),
 w (width), and
 h (height),

and the formula for the volume of a cuboid is:

Volume = l × w × h

So we have a (very simple) mathematical model of the space in that box.

Accurate?
The model is not the same as the real thing.

In our example we did not think about the thickness of the cardboard, or many other "real world"
things.

But hopefully it is good enough to be useful.

If we are charged by the volume of the box we send, we can take a few measurements and
know how much to pay.

It can also be useful when deciding which box to buy when we need to pack things.

So the model is useful!

But maybe we need more accuracy, we might need to send hundreds of boxes every day, and the
thickness of the cardboard matters. So let's see if we can improve the model:

The cardboard is "t" thick, and all measurements are outside the box ... how much space is
inside?

Page 181 of 199


The inside measurements need to be reduced by the thickness of each side:

 The inside length is l-2t


 The inside width is w-2t,
 The inside height is h-2t

and now the formula is:

Inside Volume = (l-2t) × (w-2t) × (h-2t)

Now we have a better model. Still not perfect (did we consider wasted space because we could
not pack things neatly, etc ...), but better.

So a model is not reality, but should be good enough to be useful.

Playing With The Model

Now we have a model, we can use it in different ways:

Example: Your company uses 200x300x400 mm size boxes, and the cardboard is 5mm thick.

Someone suggests using 4mm cardboard ... how much better is that?

Let us compare the two volumes:

 Current Volume = (200-2×5) × (300-2×5) × (400-2×5) = 21,489,000 mm3


 New Volume = (200-2×4) × (300-2×4) × (400-2×4) = 21,977,088 mm3

That is a change of:

(21,977,088-21,489,000)/21,489,000 ≈ 2% more volume

So the model is useful. It lets us know we will get 2% more space inside the box (for the same
outside measurements).

But there are still "real world" things to think about, such as "will it be strong enough?"

Thinking Clearly
To set up a mathematical model we also need to think clearly about the facts!
Example: on our street there are twice as many dogs as cats. How do we write this as an
equation?

Page 182 of 199


 Let D = number of dogs
 Let C = number of cats

Now ... is that: 2D = C or should it be: D = 2C

Think carefully now!

The correct answer is D = 2C

(2D = C is a common mistake, as the question is written "twice ... dogs ... cats")

Here is another one:

Example: You are the supervisor of 8-hour shift workers. They recently had their break times
reduced by 10 minutes but total production did not improve.

At first glance there is nothing to model, because there was no change in production.

But wait a minute ... they are working 10 minutes more, but producing the same amount, so
production per hour must have dropped!

Let us assume they used to work 7 hours (420 minutes):

Change in production per hour = 410/420 = 0.976...

Which is a reduction of more than 2%

But even worse: the first few hours of the shift are not be affected by the shorter break time, so it
could be a 4 or 5% reduction later in the shift.

You could recommend:

 looking at production rates for every hour of the shift


 trying different break times to see how they affect production

Steps into Model Building


A Bigger Example: Most Economical Size, OK, let us have a go at building and using a
mathematical model to solve a real world question.

Your company is going to make its own boxes!

It has been decided the box should hold 0.02m3 (0.02 cubic meters which is equal to 20 liters)
of nuts and bolts.

The box should have a square base, and double thickness top and bottom.

Page 183 of 199


Cardboard costs $0.30 per square meter.

It is up to you to decide the most economical size.

Step One: Draw a sketch!


It helps to sketch out what we are trying to solve!

The base is square, so we will just use "w" for both lengths

The box has 4 sides, and double tops and bottoms.

The box shape could be cut out like this (but is probably more complicated):

Step Two: Make Formulas.


Ignoring thickness for this model:

Volume = w × w × h = w2h

And we are told that the volume should be 0.02m3:

w2h = 0.02

Areas:

Area of the 4 Sides = 4 × w × h = 4wh

Area of Double Tops and Bases = 4 × w × w = 4w2

Total cardboard needed:

Area of Cardboard = 4wh + 4w2

Step Three: Make a Single Formula For Cost


We want a single formula for cost:

Cost = $0.30 × Area of Cardboard

= $0.30 × (4wh + 4w2)

And that is the cost when we know width and height.

That could be hard to work with ... a function with two variables.

Page 184 of 199


But we can make it simpler! Because width and height are already related by the volume:

Volume = w2h = 0.02

... which can be rearranged to ...

h = 0.02/w2

... and that can be put into the cost formula ...

Cost= $0.30 × (4w×0.02/w2 + 4w2)

And now the cost is related directly to width only.

With a little simplification we get:

Cost= $0.30 × (0.08/w+ 4w2)

Step Four: Plot it and find minimum cost


What to plot? Well, the formula only makes sense for widths greater than zero, and I also found
that for widths above 0.5 the cost just gets bigger and bigger.

So here is a plot of that cost formula for widths between 0.0 m and 0.55 m:

Plot of y= 0.3(0.08/x+4x2)
x is width, and y is cost

Just by eye, I see the cost reaches a minimum at about (0.22, 0.17). In other words:

 when the width is about 0.22 m (x-value),


 the minimum cost is about $0.17 per box (y-value).

In fact, looking at the graph, the width could be anywhere between 0.20 and 0.24 without
affecting the minimum cost very much.

Page 185 of 199


Step Five: Recommendations
Using this mathematical model you can now recommend:

 Width = 0.22 m
 Height = 0.02/w2 = 0.02/0.222 = 0.413 m
 Cost = $0.30 × (0.08/w+ 4w2) = $0.30 × (0.08/0.22+ 4×0.222) = $0.167

Or about 16.7 cents per box

But any width between 0.20 m and 0.24 m is fine.

You might also like to suggest improvements to this model:

 Include cost of glue/staples and assembly


 Include wastage when cutting box shape from cardboard.
 Is this box a good shape for packing, handling and storing?
 Any other ideas you may have!

Predicting the Future


Mathematical models can also be used to forecast future behavior.

Example: An ice cream company keeps track of how many ice creams get sold on different days.

By comparing this to the weather on each day they can make a mathematical model of
sales versus weather.

They can then predict future sales based on the weather forecast, and decide how many ice
creams they need to make ... ahead of time!

Computer Modeling
Mathematical models can get very complex, and so the mathematical rules are often written into
computer programs, to make a computer model.

Examples include:

 Weather prediction
 Economic Models (predicting interest rates, unemployment, etc)
 Models of how large structures behave under stress (bridges, skyscrapers, etc)
 Many more ...

If you become an expert in any of those you will have a job for life!

Page 186 of 199


Meaning of mathematical Model pseudo-code
Pseudo-code is an informal way of programming description that does not require any strict
programming language syntax or underlying technology considerations. It is used for creating an outline
or a rough draft of a program. Pseudo-code summarizes a program's flow, but excludes underlying
details. System designers write pseudo-code to ensure that programmers understand a software
project's requirements and align code accordingly. Pseudo-code is an informal high-level description of
the operating principle of a computer program or other algorithm.

An algorithm is a procedure for solving a problem in terms of the steps to be executed and
the order in which those steps are to be executed. An algorithm is merely the sequence of
steps taken to solve a mathematical problem and may be Regarded as a pseudo-code

Logical models, Statistical models and Other Models


Logic model
A logic model (also known as a logical framework, theory of change, or program matrix) is a tool used by
funders, managers, and evaluators of programs to evaluate the effectiveness of a program. They can
also be used during planning and implementation. Logic models are usually a graphical depiction of the
logical relationships between the resources, activities, outputs and outcomes of a program. While there
are many ways in which logic models can be presented, the underlying purpose of constructing a logic
model is to assess the "if-then" (causal) relationships between the elements of the program.

In its simplest form, a logic model has four components:

Inputs Activities Outputs Outcomes/impacts


what resources what activities the what is produced
the changes or benefits that
go into a program through those
result from the program
program undertakes activities
e.g. number of e.g. increased skills/
e.g. development
e.g. money, booklets produced, knowledge/ confidence,
of materials,
staff, equipment workshops held, leading in longer-term to
training programs
people trained promotion, new job, etc.

Following the early development of the logic model in the 1970s by Carol Weiss, Joseph Wholey
and others, many refinements and variations have been added to the basic concept. Many
versions of logic models set out a series of outcomes/impacts, explaining in more detail the logic
of how an intervention contributes to intended or observed results. This will often include
distinguishing between short-term, medium-term and long-term results, and between direct and
indirect results.

Some logic models also include assumptions, which are beliefs the prospective grantees have
about the program, the people involved, and the context and the way the prospective grantees
think the program will work, and external factors, consisting of the environment in which the

Page 187 of 199


program exists, including a variety of external factors that interact with and influence the
program action.

University Cooperative Extension Programs have developed a more elaborate logic model, called
the Program Action Logic Model, which includes six steps:

 Inputs (what we invest)


 Outputs:
o Activities (the actual tasks we do)
o Participation (who we serve; customers & stakeholders)
o Engagement (how those we serve engage with the activities)
 Outcomes/Impacts:
o Short Term (learning: awareness, knowledge, skills, motivations)
o Medium Term (action: behavior, practice, decisions, policies)
o Long Term (consequences: social, economic, environmental etc.)

Advantages
By describing work in this way, managers have an easier way to define the work and measure it.
Performance measures can be drawn from any of the steps. One of the key insights of the logic
model is the importance of measuring final outcomes or results, because it is quite possible to
waste time and money (inputs), "spin the wheels" on work activities, or produce outputs without
achieving desired outcomes. It is these outcomes (impacts, long-term results) that are the only
justification for doing the work in the first place. For commercial organizations, outcomes relate
to profit. For not-for-profit or governmental organizations, outcomes relate to successful
achievement of mission or program goals.

Uses of the logic model


Program planning - helps managers to 'plan with the end in’, rather than just consider inputs (e.g.
budgets, employees) or just the tasks that must be done.
Performance evaluation - used in government or not-for-profit organizations, where the mission and
vision are not aimed at achieving a financial benefit. In such situations, where profit is not the intended
result, it may be difficult to monitor progress toward outcomes. A program logic model provides such
indicators, in terms of output and outcome measures of performance.

The logic model and other management frameworks


There are numerous other popular management frameworks that have been developed in recent
decades. This often causes confusion, because the various frameworks have different functions. It is
important to select the right tool for the job. The following list of popular management tools is
suggested to indicate where they are most appropriate (this list is by no means complete).

Organizational assessment tools: Fact-gathering tools for a comprehensive view of the as-is
situation in an organization, but without prescribing how to change it:

Page 188 of 199


Strategic planning tools: For identifying and prioritizing major long-term desired results in an
organization, and strategies to achieve those results:

Program planning and evaluation tools: For developing details of individual programs (what
to do and what to measure) once overall strategies have been defined:

Performance measurement tools: For measuring, monitoring and reporting the quality,
efficiency, speed, cost and other aspects of projects, programs and/or processes:

Process improvement tools: For monitoring and improving the quality or efficiency of work
processes:

Process standardization tools: For maintaining and documenting processes or resources to keep
them repeatable and stable:

Statistical models
A statistical model is a class of mathematical model, which embodies a set of assumptions
concerning the generation of some sample data, and similar data from a larger population. A
statistical model represents, often in considerably idealized form, the data-generating process.

The assumptions embodied by a statistical model describe a set of probability distributions, some
of which are assumed to adequately approximate the distribution from which a particular data set
is sampled. The probability distributions inherent in statistical models are what distinguishes
statistical models from other, non-statistical, mathematical models.

A statistical model is usually specified by mathematical equations that relate one or more random
variables and possibly other non-random variables. As such, "a model is a formal representation
of a theory" (Herman Adèr quoting Kenneth Bollen).

All statistical hypothesis tests and all statistical estimators are derived from statistical models.
More generally, statistical models are part of the foundation of statistical inference.

Formal definition
In mathematical terms, a statistical model is usually thought of as a pair (S,P), where S is the set
of possible observations, i.e. the sample space, and P is a set of probability distributions on S.

The intuition behind this definition is as follows. It is assumed that there is a "true" probability

distribution induced by the process that generates the observed data. We choose to represent
a set (of distributions) which contains a distribution that adequately approximates the true

distribution. Note that we do not require that contains the true distribution, and in practice
that is rarely the case. Indeed, as Burnham & Anderson state, "A model is a simplification or
approximation of reality and hence will not reflect all of reality"—whence the saying "all models
are wrong".

Page 189 of 199


The set P is almost always parameterized: P = {Pϴ: ϴ ϵ Θ}. The set Θ defines the parameters
of the model. A parameterization is generally required to have distinct parameter values give rise
to distinct distributions, i.e.Pϴ1= Pϴ2 => Θ1= Θ2. Must hold (in other words, it must be
injective). A parameterization that meets the condition is said to be identifiable.

An example
Height and age are each probabilistically distributed over humans. They are stochastically
related: when we know that a person is of age 10, this influences the chance of the person being
5 feet tall. We could formalize that relationship in a linear regression model with the following
form: heighti = b0 + b1agei + εi, where b0 is the intercept, b1 is a parameter that age is multiplied
by to get a prediction of height, ε is the error term, and i identifies the person. This implies that
height is predicted by age, with some error.

An admissible model must be consistent with all the data points. Thus, the straight line (heighti =
b0 + b1agei) is not a model of the data. The line cannot be a model, unless it exactly fits all the
data points—i.e. all the data points lie perfectly on a straight line. The error term, εi, must be
included in the model, so that the model is consistent with all the data points.

To do statistical inference, we would first need to assume some probability distributions for the
εi. For instance, we might assume that the εi distributions are i.i.d. Gaussian, with zero mean. In
this instance, the model would have 3 parameters: b0, b1, and the variance of the Gaussian
distribution.

We can formally specify the model in the form (S, P) as follows. The sample space, S, of our
model comprises the set of all possible pairs (age, height). Each possible value of ϴ = (b0, b1, σ2)
determines a distribution on S; denote that distribution by Pϴ. If Θ is the set of all possible
values of ϴ, then P = {Pϴ: ϴ ϵ Θ}.. (The parameterization is identifiable, and this is easy to
check.)

In this example, the model is determined by (1) specifying S and (2) making some assumptions
relevant to P. There are two assumptions: that height can be approximated by a linear function of
age; that errors in the approximation are distributed as i.i.d. Gaussian. The assumptions are
sufficient to specify P —as they are required to do.

General remarks
A statistical model is a special class of mathematical model. What distinguishes a statistical
model from other mathematical models is that a statistical model is non-deterministic. Thus, in a
statistical model specified via mathematical equations, some of the variables do not have specific
values, but instead have probability distributions; i.e. some of the variables are stochastic. In the
example above, ε is a stochastic variable; without that variable, the model would be
deterministic.

Page 190 of 199


Statistical models are often used even when the physical process being modeled is deterministic.
For instance, coin tossing is, in principle, a deterministic process; yet it is commonly modeled as
stochastic (via a Bernoulli process).

There are three purposes for a statistical model, according to Konishi & Kitagawa.

 Predictions
 Extraction of information
 Description of stochastic structures

Graphical Representation of statistical Data


Statistics is a special subject that deals with large (usually) numerical data. The statistical data
can be represented graphically. In fact, the graphical representation of statistical data is an
essential step during statistical analysis.
Statistical surveys and experiments provides valuable information about numerical scores. For
better understanding and making conclusions and interpretations, the data should be managed
and organized in a systematic form. A graph is the representation of data by using graphical
symbols such as lines, bars, pie slices, dots etc. A graph does represent a numerical data in the
form of a qualitative structure and provides important information.

Let us go ahead and study about various types of graphical representations of the data.

Dot Plots
The dot plot is one of the most simplest ways of graphical representation of the statistical data. As the
name itself suggests, a dot plot uses the dots. It is a graphic display which usually compares frequency
within different categories.

The dot plot is composed of dots that are to be plotted on a graph paper.

A dot plot may look like:

In the dot plot, every dot denotes a specific number of observations belonging to a data set. One dot
usually represents one observation.

Page 191 of 199


These dots are to be marked in the form of a column for each category. In this way, the height of each
column shows the corresponding frequency of some category.
The dot plots are quite useful when there are small amount of data is given within the small number of
categories.
Bar Graph
A bar graph is a very frequently used graph in statistics as well as in media. A bar graph is a type of graph
which contains rectangles or rectangular bars. The lengths of these bars should be proportional to the
numerical values represented by them. In bar graph, the bars may be plotted either horizontally or
vertically. But a vertical bar graph (also known as column bar graph) is used more than a horizontal one.

A vertical bar graph is shown below:

Number of students went to different states for study:

The rectangular bars are separated by some distance in order to distinguish them from one another. The
bar graph shows comparison among the given categories.

Mostly, horizontal axis of the graph represents specific categories and vertical axis shows the discrete
numerical values.

Line Graph
A line graph is a kind of graph which represents data in a way that a series of points are to be connected
by segments of straight lines. In a line graph, the data points are plotted on a graph and they are joined
together with straight line.

Page 192 of 199


A sample line graph is illustrated in the following diagram:

The line graphs are used in the science, statistics and media. Line graphs are very easy to create. These
are quite popular in comparison with other graphs since they visualize characteristics revealing data
trends very clearly. A line graph gives a clear visual comparison between two variables which are
represented on X-axis and Y-axis.

Circle Graph
A circle graph is also known as a pie graph or pie chart. It is called so since it is similar to slice of a "pie".
A pie graph is defined as a graph which contains a circle which is divided into sectors. These
sectors illustrate the numerical proportion of the data.

A pie chart are shown in the following diagram:

The arc lengths of the sectors, in pie chart, are proportional to the numerical value they represent. Circle
graphs are quite commonly seen in mass media as well as in business world.

Histogram and Frequency Polygon

Page 193 of 199


The histograms and frequency polygons are very common graphs in statistics. A histogram is defined as
a graphical representation of the mutually exclusive events. A histogram is quite similar to the bar
graph. Both are made up of rectangular bars. The difference is that there is no gap between any two
bars in the histogram. The histogram is used to represent the continuous data.

A histogram may look like the following graph:

The frequency polygon is a type of graphical representation which gives us better understanding of the
shape of given distribution. Frequency polygons serve almost the similar purpose as histograms do.
But the frequency polygon is quite helpful for the purpose of comparing two or more sets of data. The
frequency polygons are said to be the extension of the histogram. When the midpoints of tops of the
rectangular bars are joined together, the frequency polygon is made. Let us have a look at a sample of

Page 194 of 199


frequency polygon:

Examples

Few examples of graphical representation of statistical data are given below:

Example 1: Draw a dot plot for the following data.

Favorite Colors Red Blue Green Yellow Orange Indigo Violet

Number of Students 9 7 5 3 2 1 3

Solution:
The line graph for the following data is given below:

Page 195 of 199


Example 2: Plot a bar graph from the data given below.

Students A B C D

Marks 8 14 9 5

Solution:
The following bar graph is obtained:

Example 3: Draw a histogram from the given data.

Test Score 24-30 30-36 36-42 42-48 48-54 54-60

Frequency 5 6 8 5 10 4

Solution:
We drew the following histogram:

Page 196 of 199


Example 4: The percentages of students who use the different methods of transportation are as follows:
40% go by school bus
25% go by walk
20% go by bicycle
and rest 15% go by car. Draw a pie chart.

Solution: The pie graph of the above data is:

Spatial Model
Spatial modeling is an analytical process conducted in conjunction with a geographical
information system (GIS) in order to describe basic processes and properties for a given set of
spatial features.

Page 197 of 199


The objective of spatial modeling is to be able to study and simulate spatial objects or
phenomena that occur in the real world and facilitate problem solving and planning.

Spatial modeling is an essential process of spatial analysis. With the use of models or special
rules and procedures for analyzing spatial data, it is used in conjunction with a GIS to properly
analyze and visually lay out data for better understanding by human readers. Its visual nature
helps researchers more quickly understand the data and reach conclusions that are difficult to
formulate with simple numerical and textual data.

Spatial analysis or spatial statistics includes any of the formal techniques which study entities
using their topological, geometric, or geographic properties. Spatial analysis includes a variety of
techniques, many still in their early development, using different analytic approaches and applied
in fields as diverse as astronomy, with its studies of the placement of galaxies in the cosmos, to
chip fabrication engineering, with its use of "place and route" algorithms to build complex
wiring structures. In a more restricted sense, spatial analysis is the technique applied to structures
at the human scale, most notably in the analysis of geographic data.

Manipulation of information occurs in multiple steps, each representing a stage in a complex


analysis procedure. Spatial modeling is object-oriented with coverage and concerned with how
the physical world works or looks. The resulting model represents either a set of objects or real-
world process.

For example, spatial modeling can be used to analyze the projected path of tornadoes by layering
a map with different spatial data, like roads, houses, the path of the tornado and even its intensity
at different points. This allows researchers to determine a tornado's real path of destruction.
When juxtaposed with other models from tornadoes that have affected the area, this model can
be used to show path correlations and geographical factors.

Symbolic Modelling
"We define Symbolic Modelling as a process, which uses Clean Language to facilitate people's discovery
of how their metaphors express their way of being in the world."

Features of a Symbolic Model

 It contains a set of representations (or symbols) of something.


 It processes and manipulates those representations based on a set of rules programmed
into the model.
 The rules operate on the representations according to their 'shape' or syntax, not
according to what they represent (their semantics).

Let us take an example. The symbol '1' is character. In normal text, it represents the number one.
When you read this text, you probably read it as a one. But this is a matter of interpretation, not a
property of the symbol itself. For example, we could use the same symbol to represent the state
of being 'on'. In fact, we do use it in this way on certain appliances — switches often have '0' and
'1' marked on them to represent that the appliance is 'off' and 'on' respectively. The interpretation
of the symbol (its semantics) is independent of the shape of the symbol (its syntax).

Page 198 of 199


Here's another example: the string '11' represents, in normal English, the number eleven. But in
binary, it represents the number three. In hexidecimal (a base 16 number system often used in
different Internet protocols), it represents the number seventeen. None of these differences in
interpretation affect the fact that it looks like two vertical strokes placed side by side. The rules
that govern the processes of a symbolic model operate on how the symbol 'looks', not what it is
interpreted to mean.

Symbolic Modelling proceeds through five defined stages, as follows:

 Stage 1: Entering the Symbolic Domain


 Stage 2: Developing Symbolic Perceptions
 Stage 3: Modelling Symbolic Patterns
 Stage 4: Encouraging Transformation
 Stage 5: Maturing the Evolved Landscape

Clean Language techniques are used throughout, to avoid contaminating or distorting the
developing metaphor landscape through the form, content or presentation of the therapist's
questions.

Page 199 of 199

You might also like