STA 122 Notes Part II
STA 122 Notes Part II
2. Number systems
Number System is a method of representing Numbers on the Number Line with the help
of a set of Symbols and rules.
These symbols range from 0-9 and are termed as digits.
Number System is used to perform mathematical computations ranging from great
scientific calculations to calculations like counting the number of Toys for a Kid or
Number chocolates remaining in the box.
Number Systems comprise of multiple types based on the base value for its digits.
A number is a value created by the combination of digits with the help of certain rules.
These numbers are used to represent arithmetical quantities.
A digit is a symbol from a set 10 symbols ranging from 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Any
combination of digits represents a Number.
The size of a Number depends on the count of digits that are used for its creation.
Types of Numbers
Natural Numbers: Natural Numbers are the most basic type of Numbers that range
from 1 to infinity. These numbers are also called Positive Numbers or Counting
Numbers. Natural Numbers are represented by the symbol N.
Example: 1, 2, 3, 4, 5, 6, 7, and so on.
Whole Numbers: Whole Numbers are basically the Natural Numbers, but they also
include ‘zero’. Whole numbers are represented by the symbol W.
Example: 0, 1, 2, 3, 4, and so on.
Integers: Integers are the collection of Whole Numbers plus the negative values of the
Natural Numbers. Integers do not include fraction numbers i.e. they can’t be written in
a/b form. The range of Integers is from the Infinity at the Negative end and Infinity at
the Positive end, including zero. Integers are represented by the symbol Z.
Example: ...,-4, -3, -2, -1, 0, 1, 2, 3, 4,...
Fractions: Fractions are the numbers that are written in the form of a/b, where, a
belongs to Whole numbers and b belongs to Natural Numbers, i.e., b can never be 0. The
upper part of the fraction i.e. a is termed as a Numerator whereas the lower part i.e. b
is called Denominator.
Example: 1/2, 3/7, 8/3, etc.
Rational Numbers: Rational numbers are the numbers that can be represented in the
fraction form i.e. a/b. Here, a and b both are integers and b≠0. All the fractions are
rational numbers but not all the rational numbers are fractions.
Example: -2/5, 0.54, 1/5, 13/4, ...
Irrational Numbers: Irrational numbers are the numbers that can’t be represented in
the form of fractions i.e. they can not be written as a/b.
Example: √2, √3, √.434343, π...
Real and Imaginary Numbers: Real numbers are the numbers that can be represented
in the decimal form. These numbers include whole numbers, integers, fractions, etc. All
the integers belong to Real numbers but all the real numbers do not belong to the
integers. Imaginary Numbers are all those numbers that are not real numbers. These
numbers when squared will result in a negative number. The √-1 is represented as i.
These numbers are also called complex numbers.
Example: √-2, √-5,...
Prime Numbers and Composite Numbers: Numbers that do not have any factors
other than 1 and the number itself are termed as Prime Numbers.
All the numbers other than Prime Numbers are termed as Composite Numbers except
0.
Zero is neither prime nor a composite number.
Example: 2, 3, 5, 7,... are prime numbers and
4, 6, 8, 9, 12,... are composite numbers
10000 + 0 + 200 + 80 + 5
10285
Decimal Numbers 0-9 are represented in binary as: 0, 1, 10, 11, 100, 101, 110, 111,
1000, and 1001
Examples:
Example:
Examples:
(255)10 can be written as (FF)16
(1096)10 can be written as (448)16
Example: (131)10
(10000011)2
Binary Numbers are represented with digits 0 and 1 and with base 2. Conversion of a
number system means conversion from one base to another. Following are the
conversion of the Binary Number System to other Number Systems:
A. Binary to Decimal Conversion:
Binary numbers are represented in base 2 but the decimal numbers are of base 10.
Hence, to convert the binary number into a decimal number, the base of that number
is to be changed. Follow the steps given below:
Step 1: Multiply each digit of the Binary number with the place value of that digit,
starting from right to left i.e. from LSB to MSB.
Step 2: Add the result of this multiplication and the decimal number will be
formed.
Example: To convert (11101011)2 into a decimal number
Example: 1101001
Starting from the least significant bit from 20, then 21, till the nth most significant bit,
i.e., 2ⁿ.
1 = 2⁰ = 1
1 = 2³.1 = 8
0 = 2⁴ .0= 0
1 = 2⁵ = 32
1 = 2⁶ = 64
= 1 + 0 + 0 + 8 + 0 + 32 + 64 = (105)10
B. Binary to Octal Conversion:
Binary numbers are represented in base 2 but the octal numbers are of base 8. Hence,
to convert the binary number into octal number, the base of that number is to be
changed. Follow the steps given below:
Step 1: Divide the binary number into groups of three digits starting from right to
left i.e. from LSB to MSB.
Step 2: Convert these groups into equivalent octal digits.
Example: To convert (11101011)2 into an octal number
Example: 101010001
We know that hexadecimal means 16, so we will start from the least significant bit and
make groups of 4 bits:
First pair = 0001 = 1
Second pair = 0101 = 5
Third pair = 0001 = 1
Octal Numbers are represented with digits 0-7 and with base 8. Conversion of a
number system means conversion from one base to another. Following are the
conversions of the Octal Number System to other Number Systems:
A. Octal to Decimal Conversion:
Octal numbers are represented in base 8, but the decimal numbers are of base 10.
Hence, to convert an octal number to a decimal number, the base of that number is to
be changed. Follow the steps given below:
Step 1: Multiply each digit of the Octal number with the place value of that digit,
starting from right to left i.e. from LSB to MSB.
Step 2: Add the result of this multiplication and the decimal number will be
formed.
Example:
Hex Numbers are represented with digits 0-9 and with letters A-F and with base 16.
Conversion of a number system means conversion from one base to another.
Following are the conversions of the Hexadecimal Number System to other Number
Systems:
A. Hexadecimal to Decimal Conversion:
Hexadecimal numbers are represented in base 16 but the decimal numbers are of base
10. Hence, to convert a hexadecimal number to a decimal number, the base of that
number is to be changed. Follow the steps given below:
Step 1: Write the decimal values of the symbols used in the Hex number i.e. from
A-F
Step 2: Multiply each digit of the Hex number with its place value. starting from
right to left i.e. LSB to MSB.
Step 3: Add the result of multiplications and the final sum will be the decimal
number.
Example: To convert (8EB4)16 into a decimal value
Any measurement made with any measuring instrument gives a certain degree of
uncertainty. This uncertainty is referred to as an error. The difference between the real
value and the estimated value of a quantity is known as measurement error. An error
may be positive or may be negative.
The deviation of the measured quantity from the actual quantity or true value is called
an Error (E).
E = Am – At
where E is the error, Am is the measured quantity and A t is the true value.
Types of Errors
Systematic or Constant Errors:
The type of error which affects the results of the experiment always in the same
direction i.e., makes the obtained result always higher or always lower than the true
value is known as systematic error. If the graduations of a meter scale are faulty or if
the measurements are carried out with a scale at a temperature other than that at
which it was calibrated, a systematic error will be introduced.
So, the systematic errors are of the following types:
(i) Instrumental errors whose examples are zero error of screw gauge, vernier
caliper, end error in meter bridge, etc.
(ii) Personal errors which are due to the observer.
(iii) Error due to external causes, due to changes in temperature, pressure, velocity,
height, etc.
(iv) Error due to Imperfection.
Systematic errors are usually determinate. So they can be eliminated by taking proper
precautions or can be rectified. However, when the source of such errors cannot be
properly identified, the experiment is repeated by different methods.
3. Gross errors:
These are large errors and occur due to carelessness or undue haste of the observer
which are also termed as mistakes.
The wrong recording of some data may be cited as an example.
So mistakes obviously do not follow the law and can be avoided only by constant
vigilance and careful observation from the observer.
Degree of Accuracy
If the measured value of a quantity is x and the limits of error are ∆x then the
accurate measurement of that quantity should be written as x ± ∆x which means that
the value of the quantity lies between x+∆x and x-∆x.
Powers of Quantities:
When a quantity is raised to a power n, the proportional error in the final result is n
times the proportional error in that quantity.
If, z = xn
Then according to this rule
(Δz/z) = n(Δx/x)
And if, z = (xnyp/wq)
Then it can be proved that:
(Δz/z) = n (Δx/x)+p(Δy/y)+q(Δw/w)
Absolute Error
Absolute error is the difference between the actual value and the measured value of a
quantity.
∆x = x₀- x
= (35 - 34.13) mm
= 0.87 mm
Absolute accuracy error is the other name of absolute error. The formula for
absolute accuracy error is written as E= E exp – E true, where E is the absolute
accuracy error, E exp is the experimental value and E true is the actual value.
MAE or the mean absolute error is the mean or average of all absolute errors.
The formula for Mean Absolute Error is given as,
1 n
MAE = xi x
n i 1
3. Absolute Precision Error
= 0.87/35
= 0.02485
ActualError
RE Accuracy 100 %
Truevalue
Solution:
= 6.02 mm
= 0.0478
2. Find out the absolute and relative errors, where the actual and measured values are
252.14 mm and 249.02 mm.
Solution:
= 3.12 mm
= 0.0123
Answer is -0.0012645
Now for Relative error we’ve (absolute error)/(true value of quantity)
Hence ER = EA/X = (Absolute Error)/X, E A=(-0.0012645)/3.1415926 = -
0.000402ans.
Percentage Error,
EP= 100 × EA/X = 100 × (-0.000402) = - 0.0402ans.
4. Let the approximate values of a number 1/3 be 0.30, 0.33, 0.34. Find out the best
approximation.
Solution –
Our approach is that we first find the value of Absolute Error, and any value having
the least absolute will be best. So, we first calculate the absolute errors in all
approx values are given. <pre
|X-X1| = |1/3 – 0.30| = 1/30|1/3 – 0.33| = 1/300|1/3 – 0.34| = 0.02/3 = 1/500
Hence, we can say that 0.33 is the most precise value of 1/3;
5. Finding the difference—
√5.35 - √4.35
Solution –
√5.35 = 2.31300
√4.35 = 2.08566
Hence, √5.35 - √4.35 = 2.31300 – 2.08566 = 0.22734
Here our answer has 5 significant digits we can modify them as per our
requirements
4. Interpolation
Interpolation is a method of deriving a simple function from the given discrete data set
such that the function passes through the provided data points.
This helps to determine the data points in between the given data ones.
This method is always needed to compute the value of a function for an intermediate
value of the independent function.
Therefore, interpolation is a process of determining the unknown values that lie in
between the known data points.
It is mostly used to predict the unknown values for any geographical related data
points such as noise level, rainfall, elevation, and so on.
The unknown value on the data points can be found using the linear interpolation and
Lagrange’s interpolation formula
Interpolation Methods
There are different types of interpolation methods. They are:
Linear Interpolation Method – This method applies a distinct linear polynomial
between each pair of data points for curves, or within the sets of three points for
surfaces.
Nearest Neighbour Method – This method inserts the value of an interpolated point
to the value of the most adjacent data point. Therefore, this method does not produce
any new data points.
Cubic Spline Interpolation Method – This method fits a different cubic polynomial
between each pair of data points for curves, or between sets of three points for surfaces.
Shape-Preservation Method – This method is also known as Piecewise Cubic Hermite
Interpolation (PCHIP). It preserves the monotonicity and the shape of the data. It is for
curves only.
Thin-plate Spline Method – This method consists of smooth surfaces that also
extrapolate well. It is only for surfaces only
Biharmonic Interpolation Method – This method is applied to the surfaces only.
Quadratic Interpolation
As an example, let us consider the given value
x0 = 0
x1 = π/4
x2 = π/2
and
yi = cos xi
Where i = 0, 1, 2
This gives us the three points (0, 1), (π/4, 1/√2), and (π/2, 0)
Now finding a quadratic polynomial that will contain the points-
For which
p(xi) = yi
i = 0, 1, 2
The graph of this polynomial is shown on the accompanying figure. We later give an explicit
formula.
Uses of Interpolation
1. Replace a set of data points {(xi, yi)} with a function given analytically.
The data may be from a known class of functions. Interpolation is then used to find the
member of this class of functions that agrees with the given data. For example, data may
be generated from functions of the form
Then we need to find the coefficients {aj} based on the given data values.
We may want to take function values f(x) given in a table for selected values of x, often
equally spaced, and extend the function to values of x, not in the table. For example,
given numbers from a table of logarithms, estimate the logarithm of a number x not in
the table.
Given a set of data points {(xi,yi)}, find a curve passing thru these points that are
“pleasing to the eye”. In fact, this is what is done continually with computer graphics.
How do we connect a set of points to make a smooth curve? Connecting them with
straight line segments will often give a curve with many corners, whereas what was
intended was a smooth curve.
2. Approximate functions with simpler ones, usually polynomials or ‘piecewise
polynomials’.
Is to approximate functions f(x) by simpler functions p(x), perhaps to make it easier to
integrate or differentiate f(x). That will be the primary reason for studying
interpolation in this course.
As an example of why this is important, consider the problem of evaluating
Interpolation Extrapolation
It is the method of using our function It is the method of using our function to
to predict the value of the dependent predict the value of the dependent
variable for an independent variable variable for an independent variable that
that lies within the data set. lies outside the range of our data.
This works within the given data set. This works beyond the given data set.