Computational Mathematics
Computational Mathematics
DIPLOMA IN
INFORMATION COMMUNICATION
TECHNOLOGY
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
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.
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.
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
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.
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.
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
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
(x+ 1)² = x² + 2x + 1
(x+ 2)² = x² + 4x + 4
(x+ 3)² = x² + 6x + 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
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.
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
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.
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
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)
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)
Method 4: Matrices
Example 1
EQUATIONS
x+y+z=6
2y + 5z = -4
2x + 5y - z = 27
A Matrix
Page 16 of 199
Well, think about the equations:
x + y + z = 6
2y + 5z = -4
2x + 5y - z = 27
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
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:
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
Then multiply A-1 by B (you can use the Matrix Calculator again):
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
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]
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:
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:
Page 23 of 199
How to Multiply Matrices
A Matrix is an array of numbers:
A Matrix
2×-9=-18
We call the number ("2" in this case) a scalar, so this is called "scalar multiplication".
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
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
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.)
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
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
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.)
Page 29 of 199
Example:
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
When you multiply a Matrix by its Inverse you get the Identity Matrix (which is like "1"
for Matrices):
-1
A×A =I
Identity Matrix
We just mentioned the "Identity Matrix". It is the matrix equivalent of the number "1":
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
2x2 Matrix
OK, how do we calculate the Inverse?
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).
Page 32 of 199
So, let us check to see what happens when we multiply the matrix by its inverse:
Why don't you have a go at multiplying these? See if you also get the Identity Matrix:
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.
Page 34 of 199
So to solve it we need the inverse of "A":
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:
Also note how the rows and columns are swapped over ("Transposed")
compared to the previous example.
Page 36 of 199
It is like the Inverse we got before, but
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.
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
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);
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).
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
Note that is the nxk zero-matrix. So if n is different from m, the two zero-matrices are
different.
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
And
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
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 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.
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.
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.
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
1 byte = 8-bits
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.
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…..
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
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 ... ?
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
Page 45 of 199
The hexadecimal
A typical number
N = (A1F.1C)16
Step-1: Divide the Number by 2 (as 2 is the base of the binary number system).
Step-5: Start from bottom, read the sequence of remainders upwards to the top.
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.
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.
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
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
- 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.
Addition
a) Binary addition
Binary addition takes in consideration of the following conditions
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
1 5 F C
2 4 5 D
3 A 5 9
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
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
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
01101
+ 00100
Example
Page 53 of 199
b) Hexadecimal subtraction
Example
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
- 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.
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.
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.
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
a) Alphanumeric codes
Codes have been developed to represent data as well as numbers and special symbols as ‗=‘, ‗&‘,
etc
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.
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
The BCD system provides a means of converting a code readily handled by human (decimal) to a
code readily handled by machine (binary).
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
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.
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
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
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:
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 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).
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)
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.
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:
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
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.
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.
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 = { }
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.
Page 68 of 199
1. A set of cats with 4 legs
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 = { }
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
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.
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.
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.
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}
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}
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.
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}
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 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.
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.
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'.
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}.
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}
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}.
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.
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}.
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,
$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$
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.
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.
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.
Page 84 of 199
Disjoint Sets
A and B are disjoint sets as shown in the Venn diagram.
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.
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.
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:
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.
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
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.
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.”
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
NOTE – The input and output variables are usually represented by letters as ABC or XYZ
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.
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
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
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
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
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
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.
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.
b) (AB)’=A’+B’
Page 97 of 199
Compliment of an AND product is equal to OR sum of its compliment
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.
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
Note
F(A,B,C,D)=ABC+CD’B
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
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.
|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.
|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.
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
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)!
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'.
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
nCr=n!r!(n−r)!
Problem 1
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
Problem 3
How many ways can you choose 3 distinct groups of 3 students from total 9 students?
Solution
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
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.
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
Example: a+b
(a+b)(a+b) = a2 + 2ab + b2
And again:
The calculations get longer and longer as we go, but there is some kind of pattern developing.
And you will learn lots of cool math symbols along the way.
Exponents
First, a quick summary of Exponents.
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
Example: 80 = 1
We will use the simple binomial a+b, but it could be any binomial.
(a+b)0 = 1
(a+b)1 = a+b
The Pattern
a3 + 3a2b + 3ab2 + b3
a3 a2 a 1
1 b b2 b3
an-kbk
Coefficients
Let's look at all the results we got before, from (a+b)0 up to (a+b)3:
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
And that is the correct answer (compare to the top of the page).
We have success!
When you come back see if you can work out (a+b)5 yourself.
Formula
But hang on, how do we write a formula for "find the coefficient from Pascal's Triangle" ... ?
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
Use It
Like this:
Then write down the answer (including all calculations, such as 4×5, 6×52, etc):
Advanced Example
(1 + 1/n)n
Diagonals
Symmetrical
The triangle is also symmetrical. The numbers on the left side have
identical matching numbers on the right side, like a mirror image.
Is there a pattern?
Exponents of 11
But what happens with 115 ? Simple! The digits just overlap, like this:
Squares
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
The next number is found by adding up the two numbers before it.
If you color the Odd and Even numbers, you end up with a
pattern the same as the Sierpinski Triangle
A phenomenon is called random if individual outcomes are uncertain but the long-term pattern
of many outcomes is predictable.
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
Terminology:
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.
Suppose we have the following proportions for the marital status of a people in this country
between the ages of 30 and 40.
A random experiment is drawing a person aged 30 to 40 at random. What is the sample space
for this experiment?
Examples:
1) The experiment of rolling a fair die has six equally likely outcomes (1, 2, 3, 4, 5, or 6).
a) Let A be the event ―The outcome is a multiple of 3‖. List the elements in A.
c) What is P(A)?
2) Now consider the experiment of rolling two dice, and recording the number of dots on top,
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.
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
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.
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.
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?
If you select a woman at random, what is the probability that she is either married, or over 35?
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.
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
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.
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 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
b. Sam plays roulette every day for 10 years. What does the law of large numbers tell us about
his results?
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.
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.
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.
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:
You are off to soccer, and love being the Goalkeeper, but that depends who is the Coach today:
Sam is Coach more often ... about 6 out of every 10 games (a probability of 0.6).
Let's build the tree diagram. First we show the two possible coaches: Sam or Alex:
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.
(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.)
Check
One final step: complete the calculations and make sure they add to 1:
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.
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.
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.
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:
But remember from set theory that and from the way we defined our sample space above:
and that:
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.
Subtraction Rule: From the addition rule above, we can conclude that the subtraction rule
for mutually exclusive events takes the form;
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:
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
P(X)=e−μμxx!
where
x=0,1,2,3...
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.
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.
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.
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.
Example 3.
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.
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.
Here again we are giving definitions that appeal to your geometric intuition. The precise
definitions are given in your text.
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.
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.
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.
Taking into consideration all the information gathered from the examples of continuous and
discontinuous functions shown above, we define a continuous functions as follows:
1. f(a) is defined
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:
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.
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.
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)
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
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
These are things you can do without affecting the direction of 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
When you swap the left and right hand sides, you must also change the direction of the
inequality:
12 > 2y+7
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).
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.
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.
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.
There are two different methods of data’s are collected in data collection.
Primary data
Secondary data.
Primary data tools are interviews, surveys, direct observations, focusing groups.
Secondary data tools are telephone, mobile phones, e - mails, post cards, etc.
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)
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
one of the most important aspect in any statistical investigation is the manner by which the
researcher presents the data
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.
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
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
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
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
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.
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.
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.
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
Example
(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
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
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
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,
Relative Measure
Co-efficient of Range
Co-efficient of Quartile Deviation
Co-efficient of mean Deviation
Co-efficient of Variation.
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.
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.
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.
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.)
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.
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).
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
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
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,
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.
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.
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.
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.
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).
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
Areas of study
The field of numerical analysis includes many sub-disciplines. Some of the major ones are:
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.
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.
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.
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
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.
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.
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.
l (length),
w (width), and
h (height),
Volume = l × w × h
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.
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.
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?
Now we have a better model. Still not perfect (did we consider wasted space because we could
not pack things neatly, etc ...), but better.
Example: Your company uses 200x300x400 mm size boxes, and the cardboard is 5mm thick.
Someone suggests using 4mm cardboard ... how much better is that?
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?
(2D = C is a common mistake, as the question is written "twice ... dogs ... cats")
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!
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.
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.
The base is square, so we will just use "w" for both lengths
The box shape could be cut out like this (but is probably more complicated):
Volume = w × w × h = w2h
w2h = 0.02
Areas:
That could be hard to work with ... a function with two variables.
h = 0.02/w2
... and that can be put into the cost formula ...
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:
In fact, looking at the graph, the width could be anywhere between 0.20 and 0.24 without
affecting the minimum cost very much.
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
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!
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
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
University Cooperative Extension Programs have developed a more elaborate logic model, called
the Program Action Logic Model, which includes six steps:
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.
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:
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".
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.
There are three purposes for a statistical model, according to Konishi & Kitagawa.
Predictions
Extraction of information
Description of stochastic structures
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.
In the dot plot, every dot denotes a specific number of observations belonging to a data set. One dot
usually represents one observation.
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.
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.
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.
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
Examples
Number of Students 9 7 5 3 2 1 3
Solution:
The line graph for the following data is given below:
Students A B C D
Marks 8 14 9 5
Solution:
The following bar graph is obtained:
Frequency 5 6 8 5 10 4
Solution:
We drew the following histogram:
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.
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.
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."
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).
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.