Docsity

Computational maths for beginners full notes, Study Guides, Projects, Research of Computational Methods

Toggle sidebar
bg1
Computer - Number System
When we type some letters or words, the computer translates them in numbers as
computers can understand only numbers. A computer can understand the positional
number system where there are only a few symbols called digits and these symbols
represent different values depending on the position they occupy in the number.
The value of each digit in a number can be determined using āˆ’
ļ‚·The digit
ļ‚·The position of the digit in the number
ļ‚·The base of the number system (where the base is defined as the total number
of digits available in the number system)
Decimal Number System
The number system that we use in our day-to-day life is the decimal number system.
Decimal number system has base 10 as it uses 10 digits from 0 to 9. In decimal
number system, the successive positions to the left of the decimal point represent
units, tens, hundreds, thousands, and so on.
Each position represents a specific power of the base (10). For example, the decimal
number 1234 consists of the digit 4 in the units position, 3 in the tens position, 2 in
the hundreds position, and 1 in the thousands position. Its value can be written as
(1 x 1000)+ (2 x 100)+ (3 x 10)+ (4 x l)
(1 x 103)+ (2 x 102)+ (3 x 101)+ (4 x l00)
1000 + 200 + 30 + 4
1234
As a computer programmer or an IT professional, you should understand the
following number systems which are frequently used in computers.
S.No. Number System and Description
1
Binary Number System
Base 2. Digits used : 0, 1
2
Octal Number System
Base 8. Digits used : 0 to 7
QUANTITATIVE TECHNIQUES
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Computational maths for beginners full notes and more Study Guides, Projects, Research Computational Methods in PDF only on Docsity!

Computer - Number System

When we type some letters or words, the computer translates them in numbers as

computers can understand only numbers. A computer can understand the positional

number system where there are only a few symbols called digits and these symbols

represent different values depending on the position they occupy in the number.

The value of each digit in a number can be determined using āˆ’

ļ‚· The digit

ļ‚· The position of the digit in the number

ļ‚· The base of the number system (where the base is defined as the total number

of digits available in the number system)

Decimal Number System

The number system that we use in our day-to-day life is the decimal number system.

Decimal number system has base 10 as it uses 10 digits from 0 to 9. In decimal

number system, the successive positions to the left of the decimal point represent

units, tens, hundreds, thousands, and so on.

Each position represents a specific power of the base (10). For example, the decimal

number 1234 consists of the digit 4 in the units position, 3 in the tens position, 2 in

the hundreds position, and 1 in the thousands position. Its value can be written as

(1 x 1000)+ (2 x 100)+ (3 x 10)+ (4 x l)

(1 x 10

3

)+ (2 x 10

2

)+ (3 x 10

1

)+ (4 x l

0

)

1000 + 200 + 30 + 4

1234

As a computer programmer or an IT professional, you should understand the

following number systems which are frequently used in computers.

S.No. Number System and Description

Binary Number System

Base 2. Digits used : 0, 1

Octal Number System

Base 8. Digits used : 0 to 7

Hexa Decimal Number System

Base 16. Digits used: 0 to 9, Letters used : A- F

Binary Number System

Characteristics of the binary number system are as follows āˆ’

ļ‚· Uses two digits, 0 and 1

ļ‚· Also called as base 2 number system

ļ‚· Each position in a binary number represents a 0 power of the base (2).

Example 2

0

ļ‚· Last position in a binary number represents a x power of the base (2).

Example 2

x

where x represents the last position - 1.

Example

Binary Number: 10101 2

Calculating Decimal Equivalent āˆ’

Step Binary Number Decimal Number

Step 1 10101

2

((1 x 2

4

) + (0 x 2

3

) + (1 x 2

2

) + (0 x 2

1

) + (1 x 2

0

10

Step 2 10101 2

10

Step 3 10101 2

10

Note āˆ’ 10101 2

is normally written as 10101.

Octal Number System

Characteristics of the octal number system are as follows āˆ’

ļ‚· Uses eight digits, 0,1,2,3,4,5,6,

ļ‚· Also called as base 8 number system

ļ‚· Each position in an octal number represents a 0 power of the base (8).

Example 8

0

ļ‚· Last position in an octal number represents a x power of the base (8).

Example 8

x

where x represents the last position - 1

Computer - Number Conversion

There are many methods or techniques which can be used to convert numbers from

one base to another. In this chapter, we'll demonstrate the following āˆ’

ļ‚· Decimal to Other Base System

ļ‚· Other Base System to Decimal

ļ‚· Other Base System to Non-Decimal

ļ‚· Shortcut method - Binary to Octal

ļ‚· Shortcut method - Octal to Binary

ļ‚· Shortcut method - Binary to Hexadecimal

ļ‚· Shortcut method - Hexadecimal to Binary

Decimal to Other Base System

Step 1 āˆ’ Divide the decimal number to be converted by the value of the new base.

Step 2 āˆ’ Get the remainder from Step 1 as the rightmost digit (least significant digit)

of the new base number.

Step 3 āˆ’ Divide the quotient of the previous divide by the new base.

Step 4 āˆ’ Record the remainder from Step 3 as the next digit (to the left) of the new

base number.

Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes

zero in Step 3.

The last remainder thus obtained will be the Most Significant Digit (MSD) of the

new base number.

Example

Decimal Number: 29 10

Calculating Binary Equivalent āˆ’

Step Operation Result Remainder

Step 1 29 / 2 14 1

Step 2 14 / 2 7 0

Step 3 7 / 2 3 1

Step 4 3 / 2 1 1

Step 5 1 / 2 0 1

As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse

order so that the first remainder becomes the Least Significant Digit (LSD) and the

last remainder becomes the Most Significant Digit (MSD).

Decimal Number : 29 10

= Binary Number : 11101

Other Base System to Decimal System

Step 1 āˆ’ Determine the column (positional) value of each digit (this depends on the

position of the digit and the base of the number system).

Step 2 āˆ’ Multiply the obtained column values (in Step 1) by the digits in the

corresponding columns.

Step 3 āˆ’ Sum the products calculated in Step 2. The total is the equivalent value in

decimal.

Example

Binary Number: 11101 2

Calculating Decimal Equivalent āˆ’

Step Binary Number Decimal Number

Step 1 11101 2

((1 x 2

4

) + (1 x 2

3

) + (1 x 2

2

) + (0 x 2

1

) + (1 x 2

0

10

Step 2 11101 2

10

Step 3 11101 2

10

Binary Number : 11101 2

= Decimal Number : 29 10

Other Base System to Non-Decimal System

Step 1 āˆ’ Convert the original number to a decimal number (base 10).

Step 2 āˆ’ Convert the decimal number so obtained to the new base number.

Example

Octal Number : 25 8

Calculating Binary Equivalent āˆ’

Step 1 - Convert to Decimal

Step Octal Number Decimal Number

Step 1 25 8

((2 x 8

1

) + (5 x 8

0

10

Step 2 25 8

10

Calculating Binary Equivalent āˆ’

Step Octal Number Binary Number

Step 1 25 8

10

10

Step 2 25 8

2

2

Step 3 25 8

2

Octal Number : 25 8

= Binary Number : 10101 2

Shortcut Method ─ Binary to Hexadecimal

Step 1 āˆ’ Divide the binary digits into groups of four (starting from the right).

Step 2 āˆ’ Convert each group of four binary digits to one hexadecimal symbol.

Example

Binary Number : 10101 2

Calculating hexadecimal Equivalent āˆ’

Step Binary Number Hexadecimal Number

Step 1 10101 2

Step 2 10101

2

10

10

Step 3 10101 2

16

Binary Number : 10101 2

= Hexadecimal Number : 15 16

Shortcut Method - Hexadecimal to Binary

Step 1 āˆ’ Convert each hexadecimal digit to a 4-digit binary number (the hexadecimal

digits may be treated as decimal for this conversion).

Step 2 āˆ’ Combine all the resulting binary groups (of 4 digits each) into a single

binary number.

Example

Hexadecimal Number : 15 16

Calculating Binary Equivalent āˆ’

Step Hexadecimal Number Binary Number

Step 1 15 16

10

10

Step 2 15

16

2

2

Step 3 15 16

2

Hexadecimal Number : 15 16

= Binary Number : 10101 2

Basic Gates and Functions

Introduction

Boolean functions may be practically implemented by using electronic gates. The

following points are important to understand.

ļ‚· Electronic gates require a power supply.

ļ‚· Gate INPUTS are driven by voltages having two nominal values, e.g. 0V and

5V representing logic 0 and logic 1 respectively.

ļ‚· The OUTPUT of a gate provides two nominal values of voltage only, e.g. 0V

and 5V representing logic 0 and logic 1 respectively. In general, there is only

one output to a logic gate except in some special cases.

ļ‚· There is always a time delay between an input being applied and the output

responding.

Truth Tables

Truth tables are used to help show the function of a logic gate. If you are unsure

about truth tables and need guidence on how go about drawning them for individual

gates or logic circuits then use the truth table section link.

Truth Tables

This is a NOT-AND gate which is equal to an AND gate followed by a NOT

gate. The outputs of all NAND gates are high if any of the inputs are low.

The symbol is an AND gate with a small circle on the output. The small circle

represents inversion.

NOR gate

This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate.

The outputs of all NOR gates are low if any of the inputs are high.

The symbol is an OR gate with a small circle on the output. The small circle

represents inversion.

EXOR gate

The ' Exclusive-OR ' gate is a circuit which will give a high output if either,

but not both , of its two inputs are high. An encircled plus sign ( ) is used to

show the EOR operation.

EXNOR gate

The ' Exclusive-NOR' gate circuit does the opposite to the EOR gate. It will give a

low output if either, but not both , of its two inputs are high. The symbol is an

EXOR gate with a small circle on the output. The small circle represents inversion.

The NAND and NOR gates are called universal functions since with either one the

AND and OR functions and NOT can be generated.

Note:

A function in sum of products form can be implemented using NAND gates by

replacing all AND and OR gates by NAND gates.

A function in product of sums form can be implemented using NOR gates by

replacing all AND and OR gates by NOR gates.

Table 1: Logic gate symbols

Table 2 is a summary truth table of the input/output combinations for the NOT gate

together with all possible input/output combinations for the other gate functions. Also

note that a truth table with 'n' inputs has 2

n

rows. You can compare the outputs of

different gates.

Table 2: Logic gates representation using the Truth table

Commutative law

Any binary operation which satisfies the following expression is referred to as

commutative operation.

Commutative law states that changing the sequence of the variables does not have

any effect on the output of a logic circuit.

Associative law

This law states that the order in which the logic operations are performed is irrelevant

as their effect is the same.

Distributive law

Distributive law states the following condition.

AND law

These laws use the AND operation. Therefore they are called as AND laws.

OR law

These laws use the OR operation. Therefore they are called as OR laws.

INVERSION law

This law uses the NOT operation. The inversion law states that double inversion of a

variable results in the original variable itself.

Important Boolean Theorems

Following are few important boolean Theorems.

Boolean function/theorems Description

Boolean Functions

Boolean Functions and Expressions, K-Map and

NAND Gates realization

De Morgan's Theorems De Morgan's Theorem 1 and Theorem 2

LESSON

Linear Algebra and Matrices

Contents

  • Functions and graphs
  • Linear equations, higher order equations, inequalities and

simultaneous equations

  • Matrix algebra
  • Application of matrix algebra to input-output analysis and

elementary Markovian process.

1.1 Functions and graphs

A function is a mathematical relationship in which the value of a single

dependent variable are determined from the values of one or more

independent variables. The following is an example of a function in which

y is said to be a function of x.

y = a + bx

In the above example, both x and y are variables this is because they may

assume different values throughout the analysis of the function. On the

other hand, a and b are referred to as constants because they assume

fixed values.

5x

2

  • 3x + 7 = 0 (quadratic equation)

2x

3

  • 4x

2

  • 3x + 8 = 0 (cubic equation)

The solution of equations or the values of the variables for which the

equations hold is called the roots of the equation or the solution set.

Solution of Linear Equation

Supposing M, N, and P are expressions that may or may not involve

variables, then the following constitute some rules which will be useful in

the solution of linear equations

Rule 1: Additional rule

If M = N then M + P = N + P

Rule 2: Subtraction rule

If M = N, Then M – P = N – P

Rule 3: multiplication rule

If M = N and P ≠ O then M x P = N x P

Rule 4: Division rule

If P x M = N and P ≠ O

And N/P = Q Q being a raterial number then

M = N/P

Example

i. Solve 3x + 4 = -

ii. Solve

y

= -

Solutions

i. 3x + 4 = –

3x + 4 – 4 = – 8 – 4 (by subtraction rule)

3x = – 12 (simplifying)

x

(by division rule)

x = –4 (simplifying)

ii.

4 3

3

y

3 ļ‚“  ļ‚“

y = –12 (simplifying)

Solution of quadratic equations

Suppose that we have an equation given as follows

ax

2

  • bx + c = 0

Where a, b and c are constants, and a≠ 0. such an equation is referred to

as the general quadratic equation in x. if b = 0, then we have

ax

2

  • c = 0

Which is a pure quadratic equation

There are 3 general methods for solving quadratic equations; solution by

factorization , solution by completing the square and solution by the

quadratic formula.

Solution by Factorization

The following are the general steps commonly used in solving quadratic

equations by factorization

(i) Set the given quadratic equation to zero

(ii) Transform it into the product of two linear

factors

(iii) Set each of the two linear factors equal to

zero

(iv) Find the roots of the resulting two linear

equations

Example

Solve the following equation by factorization

i. 6x

2

= 18x

ii. 15x

2

  • 16x = 15

Solutions

i. 6x

2

= 18x

6x

2

  • 18x = 0...................................(step 1)

6x(x – 3) = 0....................................(step 2)

6x = 0..............................................(step 3)

and x – 3 = 0

∓ x = 0 or x = 3 ..............................(by step 4)

ii. 15x

2

  • 16x = 15

15x

2

  • 16x – 15 = 0......................... (step 1)

(5x – 3) (3x +5) = 0.........................(step 2)

(5x – 3) = 0} Step 3

{3x + 5 = 0}

or

(= 3 or 0)

ii. 2x

2

  • 3x + 1 = 0 or (2x

2

  • 3x = -1)

2

3x 1

x + = -

…………………...…..(Step 1)

2 2

2

x

X

……… (Step 2)

2

x + =

…………………….. (Step 3)

3 1

4 16

x + = ±

3 1

4 4

x =  = ±

3 1 3 1

4 4 4 4

 + or - -

1

2

x  or x  1

Solution by Quadratic Formula

Consider the general quadratic equation

2

ax + bx + c = 0 where a  0

The roots of the equation are obtained by the following formula:

a

b b ac

x

2

Example

Solve for x by formula

5x

2

  • 2x – 3 = 0

Solution

a = 5, b = 2, c = - 3

a

b b ac

x

2

2

x 

x  or 

Inequalities

An inequality or inequation is an expression involving an inequality sign

(i.e. >,<, ≤, ≄, i.e. greater than, less than, less or equal to, greater or

equal to) The following are some examples of inequations in variable x.

3x + 3 > 5

x

2

  • 2x – 12 < 0

The first is an example of linear inequation and the second is an example

of a quadratic in equation.

Solutions of inequations

The solutions sets of inequations frequently contain many elements. In a

number of cases they contain infinite elements.

Example

Solve and graph the following inequation

x – 2 > 2 ;

x  w

(where x is a subset of w)

Solution

x – 2 > 2 so x – 2 + 2 > 2 + 2

Thus, x>

The solution set is infinite, being all the elements in w greater than 4

0 1 2 3 4 5 6 7 8 9 10 11

Example

Solve and graph

3x – 7 < - 13;

Solution