QUICK REFRESHER GUIDE
For
Computer Science
&
Information Technology
By
C
C
O
O
N
N
T
T
E
E
N
N
T
T
S
S
Topic
Page No.
#1.Mathemathics
1 – 30
1.1Linear Algebra
1 – 8
1.2Probability and Distribution
9 – 14
1.3Numerical Methods
15 – 19
1.4Calculus
20 – 30
#2.Discrete Mathematics and Graph Theory
31 – 70
2.1Mathematical Logic
31 – 36
2.2Combinatorics
37 – 42
2.3Sets and Relations
43 – 56
2.4Graph Theory
57 – 70
#3.Data Structures and Algorithms
71 – 105
3.1Data Structure and Algorithm Analysis
71 – 75
3.2Elements of Discrete Mathematics for Data Structure
76 – 77
3.3Abstract Data Type (ADT)
78
3.4Stacks
79
3.5Queue
80
3.6Trees
81 - 85
3.7 Height Balanced Trees (AVL Trees, B and B
+)
86 – 94
3.8Hashing
95 – 97
3.9Graph Algorithms
98 – 100
3.10Sorting Algorithms
101 – 105
#4. Operating System
106 – 157
4.1Introduction to Operating System
106 – 108
4.2Process Management
109 – 123
4.3Threads
124 – 125
4.4CPU Scheduling
126 – 128
4.5Deadlocks
129 – 133
4.6Memory Management & Virtual Memory
134 – 144
4.7File System
145 – 149
4.8I/O Systems
150 – 153
4.9Protection and Security
154 – 157
#5.Data Base Management Systems
158 – 193
5.1ER Diagrams
158 – 163
5.2Functional Dependencies & Normalization
164 – 170
5.3Relational Algebra & Relational Calculus
171 – 174
5.4SQL
175 - 180
5.5Transactions and Concurrency Control
181 – 188
5.6File Structures (Sequential files, indexing B & B
+trees)
189 – 193
#6.Theory of Computation
194 – 238
6.1Introudction
194
6.2Finite Automata
195 – 198
6.3Regular Expression
199 – 208
6.4Context free grammar
209 – 218
6.5Turing Machines
219 – 238
#7.Computer Organization
239 – 278
7.1Introduction of Computer Organization
239 – 244
7.2Memory Hierarchy
245 –252
7.3Pipelining
253 – 258
7.4Instruction Types
259 – 263
7.5Addressing Modes
264 – 266
7.6I/O Data Transfer
267 – 278
#8.Digital Logic
279 – 292
8.1Number Systems & Code Conversions
279 – 280
8.2Boolean Algebra &Karnaugh Maps
281 – 282
8.3Logic Gates
283 – 286
8.4Combinational Digital Circuits
287 – 291
8.5Semiconductor Memory
292
#9. Compiler Design
293 – 349
9.1 Introduction
293 – 300
9.2Syntax Analysis
301 – 325
9.3Syntax Directed Translation
326 – 334
9.4Run Time Environment
335 – 336
9.5Intermediate Code Generation
337 – 342
9.6Code Optimization
343 – 344
9.7Code Generation
345 – 349
#10. Computer Networks
350 – 381
10.1 Introduction to Computer Networks
350 – 357
10.2Multiple Access Protocols
358 – 360
10.3The Data Link Layer
361 – 365
10.4Routing & Congestion Control
366 – 369
10.5TCP/IP, UDP and Stocks, IP(V4)
370 – 376
10.6Application Layer
377 – 378
#11. Software Engineering and Web Technology
382 – 417
11.1Introduction
382 – 389
11.2Process Models and Software Estimation
11.3 Validation and Verification
11.4 HTML
11.5 XML & DTDs
390 – 401
402 – 407
408 – 413
414 – 417
# Reference Book
418 – 419
Part - 1: Mathematics
1.1 Linear Algebra
1.1.1 Matrix
Definition: A system of “m n” numbers arranged along m rows and n columns. Conventionally, single capital letter is used to denote a matrix.
Thus, A = [ a a a a a a a a a a a a a ] a ith row, jth column 1.1.1.1 Types of Matrices
1.1.1.2 Row and Column Matrices
Row Matrix [ 2, 7, 8, 9] single row ( or row vector)
Column Matrix [
] single column (or column vector)
1.1.1.3 Square Matrix
Same number of rows and columns.
Order of Square matrix no. of rows or columns
Principle Diagonal (or Main diagonal or Leading diagonal): The diagonal of a square matrix (from the top left to the bottom right) is called as principal diagonal.
Trace of the Matrix: The sum of the diagonal elements of a square matrix.
- tr (λ A) = λ tr(A) [ λ is scalar] - tr ( A+B) = tr (A) + tr (B) - tr (AB) = tr (BA)
1.1.1.4 Rectangular Matrix
Number of rows Number of columns 1.1.1.5 Diagonal Matrix
A Square matrix in which all the elements except those in leading diagonal are zero. e.g.[
]
Symmetric Matrix
= A
Skew Symmetric Matrix
= - A
1.1.1.6 Unit Matrix (or Identity Matrix)
A Diagonal matrix in which all the leading diagonal elements are ‘ ’. e.g. = [
]
1.1.1.7 Null Matrix (or Zero Matrix)
A matrix is said to be Null Matrix if all the elements are zero. e.g.[ ]
1.1.1.8 Symmetric and Skew Symmetric Matrices:
Symmetric, when a = +a for all i and j. In other words = A Skew symmetric, when a = - a In other words = - A
Note: All the diagonal elements of skew symmetric matrix must be zero.
Symmetric Skew symmetric
[ a h g h b g c] [ h g h g ] 1.1.1.9 Triangular Matrix
A matrix is said to be “upper triangular” i all the elements below its principal diagonal are zeros.
A matrix is said to be “lower triangular” i all the elements above its principal diagonal are zeros. [a h g b c ] [a g b h c ]
Upper Triangular Matrix Lower Triangular Matrix
1.1.1.10 Orthogonal Matrix: If A.A = , then matrix A is said to be Orthogonal matrix. 1.1.1.11 Singular Matrix: If |A| = 0, then A is called a singular matrix.
1.1.1.12 Unitary Matrix: If we define, A = (A̅) = transpose of a conjugate of matrix A Then the matrix is unitary if A . A =
1.1.1.13 Hermitian Matrix: It is a square matrix with complex entries which is equal to its own conjugate transpose.
A = A or a = a̅̅̅
1.1.1.14 Note: In Hermitian matrix, diagonal elements always real
1.1.1.15 Skew Hermitian matrix:
It is a square matrix with complex entries which is equal to the negative of conjugate transpose. A = A ora = a̅̅̅
Note: In Skew-Hermitianmatrix , diagonal elements either zero or Pure Imaginary 1.1.1.16 Idempotent Matrix
If A = A, then the matrix A is called idempotent matrix. 1.1.1.17 Multiplication of Matrix by a Scalar:
Every element of the matrix gets multiplied by that scalar. Multiplication of Matrices:
Two matrices can be multiplied only when number of columns of the first matrix is equal to the number of rows of the second matrix. Multiplication of (m n)
and(n p) matrices results in matrix o (m p)dimension [ ] [ ] = [ ] .
1.1.1.18 Determinant:
An n order determinant is an expression associated with n n square matrix.
If A = [a ] , Element a with ith row, jth column.
For n = 2 , D = det A = |aa a a | = a a - a a Determinant o “order n” D = |A| = det A = || a a a a a a a a a | |
1.1.1.19 Minors & Co-Factors:
The minor of an element in a determinant is the determinant obtained by deleting the row and the column which intersect that element.
Co actor is the minor with “proper sign”. The sign is given by (-1) (where the element
belongs to ith row, jth column).
1.1.1.20 Properties of Determinants:
1. A determinant remains unaltered by changing its rows into columns and columns into rows.
2. If two parallel lines of a determinant are inter-changed, the determinant retains its numerical values but changes its sign. (In a general manner, a row or a column is referred as line).
3. Determinant vanishes if two parallel lines are identical.
4. If each element of a line be multiplied by the same factor, the whole determinant is multiplied by that factor. [Note the difference with matrix].
5. If each element of a line consists of the m terms, then determinant can be expressed as sum of the m determinants.
6. If each element of a line be added equi-multiple of the corresponding elements of one or more parallel lines, determinant is unaffected.
e.g.by the operation, + p +q , determinant is unaffected.
7. Determinant of an upper triangular/ lower triangular/diagonal/scalar matrix is equal to the product of the leading diagonal elements of the matrix.
8. If A & B are square matrix of the same order, then |AB|=|BA|=|A||B|. 9. If A is non singular matrix, then |A |=
| | (as a result of previous).
10. Determinant of a skew symmetric matrix (i.e. A =-A) of odd order is zero. 11. If A is a unitary matrix or orthogonal matrix (i.e. A = A ) then |A|= ±1.
12. If A is a square matrix of order n, then |k A| = |A|. 13. | | = 1 ( is the identity matrix of order n).
1.1.1.21 Inverse of a Matrix A =
| |
|A| must be non-zero (i.e. A must be non-singular). Inverse of a matrix, if exists, is always unique.
If it is a 2x2 matrix [a bc d] , its inverse will be [ d c ba ]
Important Points:
1. A = A = A, (Here A is square matrix of the same order as that of ) 2. 0 A = A 0 = 0, (Here 0 is null matrix)
3. AB = , then it is not necessarily that A or B is null matrix. Also it doesn’t mean BA = . 4. If the product of two non-zero square matrices A & B is a zero matrix, then A & B are
singular matrices.
5. If A is non-singular matrix and A.B=0, then B is null matrix. 6. AB BA (in general) Commutative property does not hold 7. A(BC) = (AB)C Associative property holds
8. A(B+C) = AB AC Distributive property holds 9. AC = AD , doesn’t imply C = D [even when A ].
11. (A+B)T = A + B
12. (AB)T = B . A
13. (AB)-1 = B . A
14. A A = A A =
15. (kA)T = k.A (k is scalar, A is vector)
16. (kA)-1 = . A (k is scalar , A is vector)
17. (A ) = (A )
18. (A̅̅̅̅) = (A̅) (Conjugate of a transpose of matrix= Transpose of conjugate of matrix) 19. If a non-singular matrix A is symmetric, then A is also symmetric.
20. If A is a orthogonal matrix , then A and A are also orthogonal.
21. If A is a square matrix of order n then (i) |adj A|=|A|
(ii) |adj (adj A)|=|A|( )
(iii) adj (adj A) =|A| A
1.1.1.22 Elementary Transformation of a Matrix: 1. Interchange of any 2 lines
2. Multiplication of a line by a constant (e.g. k )
3. Addition of constant multiplication of any line to the another line (e. g. + p ) Note:
Elementary trans ormations don’t change the ran o the matrix. However it changes the Eigen value of the matrix.
1.1.1.23 Rank of Matrix
If we select any r rows and r columns from any matrix A,deleting all other rows and columns, then the determinant formed by these r r elements is called minor of A of order r.
Definition: A matrix is said to be of rank r when, i) It has at least one non-zero minor of order r. ii) Every minor of order higher than r vanishes.
Other definition: The rank is also defined as maximum number of linearly independent row vectors.
Special case: Rank of Square matrix
Rank = Number of non-zero row in upper triangular matrix using elementary transformation. Note:
1. r(A.B) min { r(A), r (B)} 2. r(A+B) r(A) + r (B) 3. r(A-B) r(A) - r (B)
4. The rank of a diagonal matrix is simply the number of non-zero elements in principal diagonal.
5. A system of homogeneous equations such that the number of unknown variable exceeds the number of equations, necessarily has non-zero solutions.
8. r(A)=0 iff (if and only if) A is a null matrix.
9. If two matrices A and B have the same size and the same rank then A, B are equivalent matrices.
10. Every non-singular matrix is row matrix and it is equivalent to identity matrix.
1.1.1.24 Solution of linear System of Equations: For the following system of equations A X = B
Where, A = [ a a a a a a a a ] , = [ x x x ] , B = [ ] A= Coefficient Matrix, C = (A, B) = Augmented Matrix
r = rank (A), r = rank (C), n = Number of unknown variables (x , x , - - - x ) Consistency of a System of Equations:
For Non-Homogenous Equations (A X = B)
i) If r r , the equations are inconsistent i.e. there is no solution.
ii) If r = r = n, the equations are consistent and there is a unique solution.
iii) If r = r < n, the equations are consistent and there are infinite number of solutions. For Homogenous Equations (A X = 0)
i) If r = n, the equations have only a trivial zero solution ( i.e. x = x = - - -x = 0). ii) If r < n, then (n-r) linearly independent solution (i.e. infinite non-trivial solutions). Note:
Consistent means: one or more solution (i.e. unique or infinite solution) Inconsistent means: No solution
Cramer’s ule
Let the following two equations be there
a x +a x = b ---(i) a x +a x = b ---(ii) D = |ab a b | D = |bb aa |
D = |aa b
b |
Solution using Cramer’s rule:
x = and x =
In the above method, it is assumed that 1. No of equations = No of unknowns 2. D 0
In general, for Non-Homogenous Equations D 0 single solution (non trivial) D = 0 infinite solution
For Homogenous Equations
D 0 trivial solutions ( x = x =………x = 0) D = 0 non- trivial solution (or infinite solution)
Eigen Values & Eigen Vectors
1.1.1.25 Characteristic Equation and Eigen Values:
Characteristic equation: | A λ |= 0, The roots of this equation are called the characteristic roots /latent roots / Eigen values of the matrix A.
Eigen vectors: [ ] X = 0
For each Eigen value λ, solving for X gives the corresponding Eigen vector.
Note: For a given Eigen value, there can be different Eigen vectors, but for same Eigen vector, there can’t be di erent Eigen values.
Properties of Eigen values
1. The sum of the Eigen values of a matrix is equal to the sum of its principal diagonal. 2. The product of the Eigen values of a matrix is equal to its determinant.
3. The largest Eigen values of a matrix is always greater than or equal to any of the diagonal elements of the matrix.
4. If λ is an Eigen value of orthogonal matrix, then 1/ λ is also its Eigen value. 5. If A is real, then its Eigen value is real or complex conjugate pair.
6. Matrix A and its transpose A has same characteristic root (Eigen values).
7. The Eigen values of triangular matrix are just the diagonal elements of the matrix. 8. Zero is the Eigen value of the matrix if and only if the matrix is singular.
9. Eigen values o a unitary matrix or orthogonal matrix has absolute value ‘ ’. 10. Eigen values of Hermitian or symmetric matrix are purely real.
11. Eigen values of skew Hermitian or skew symmetric matrix is zero or pure imaginary. 12. | |is an Eigen value of adj A (because adj A = |A|. A ).
13. If λ is an Eigen value of the matrix then , i) Eigen value of A is 1/λ
ii) Eigen value of A is λ
iii) Eigen value of kA are λ (k is scalar) iv) Eigen value of A are λ + k v) Eigen value of (A )2 are ( )
Properties of Eigen Vectors
1) Eigen vector X of matrix A is not unique.
Let is Eigen vector, then C is also Eigen vector (C = scalar constant). 2) If λ , λ , λ . . . . . λ are distinct, then , . . . are linearly independent .
3) If two or more Eigen values are equal, it may or may not be possible to get linearly independent Eigen vectors corresponding to equal roots.
4) Two Eigen vectors are called orthogonal vectors if T∙ = 0.
( , are column vector)
(Note: For a single vector to be orthogonal , A = A or, A. A = A. A = )
5) Eigen vectors of a symmetric matrix corresponding to different Eigen values are orthogonal.
Cayley Hamilton Theorem: Every square matrix satisfies its own characteristic equation. 1.1.1.26 Vector:
Any quantity having n components is called a vector of order n. Linear Dependence of Vectors
If one vector can be written as linear combination of others, the vector is linearly dependent.
Linearly Independent Vectors
If no vectors can be written as a linear combination of others, then they are linearly independent.
Suppose the vectors are x x x x
Its linear combination is λ x + λ x + λ x + λ x = 0 Ifλ , λ , λ , λ are not “all zero” they are linearly dependent. If all λ are zero they are linearly independent.
1.2 Probability and Distribution
1.2.1 Probability
Event: Outcome of an experiment is called event.
Mutually Exclusive Events (Disjoint Events): Two events are called mutually exclusive, if the occurrence o one excludes the occurrence o others i.e. both can’t occur simultaneously.
A B =φ, P(A B) =0
Equally Likely Events: If one of the events cannot happen in preference to other, then such events are said to be equally likely.
Odds in Favour of an Event =
Where m no. o ways avourable to A n no. o ways not avourable to A Odds Against the Event =
Probability: P(A)= = .
.
P(A)+ P(A’)= Important points:
P(A B) Probability of happening of “at least one” event o A & B P(A B) ) Probability of happening of “both” events o A & B If the events are certain to happen, then the probability is unity. If the events are impossible to happen, then the probability is zero. Addition Law ofProbability:
a. For every events A, B and C not mutually exclusive
P(A B C)= P(A)+ P(B)+ P(C)- P(A B)- P(B C)- P(C A)+ P(A B C) b. For the event A, B and C which are mutually exclusive
P(A B C)= P(A)+ P(B)+ P(C)
Independent Events: Two events are said to be independent, if the occurrence of one does not affect the occurrence of the other.
If P(A B)= P(A) P(B) Independent events A & B
Conditional Probability: If A and B are dependent events, then P( ) denotes the probability of occurrence of B when A has already occurred. This is known as conditional probability.
P(B/A)= ( )
For independent events A & B P(B/A) = P(B)
Theorem of Combined Probability: If the probability of an event A happening as a result of trial is P(A). Probability of an event B happening as a result of trial after A has happened is P(B/A) then the probability of both the events A and B happening is
P(A B)= P(A). P(B/A), [ P(A) 0] = P(B). P(A/B), [ P(B) 0]
This is also known as Multiplication Theorem.
For independent events A&B P(B/A) = P(B), P(A/B )= P(A) Hence P(A B) = P(A) P(B)
Important Points:
If P &P are probabilities of two independent events then
1. P(1-P) probability o irst event happens and second ails (i.e only irst happens) 2. (1-P)(1-P) probability o both event ails
3. 1-(1-P)(1-P) probability o at least one event occur 4. PP probability o both event occurs
Baye’s theorem:
An event A corresponds to a number of exhaustive events B ,B ,..,B . If P(B) and P(A/B) are given then,
P( )= ( ). ( )
( ). (
)
This is also known as theorem of Inverse Probability.
Random variable: Real variable associated with the outcome of a random experiment is called a random variable.
1.2.2 Distribution
Probability Density Function (PDF) or Probability Mass Function:
The set of values Xi with their probabilities P constitute a probability distribution or probability
density function of the variable X. If f(x) is the PDF, then f(x ) = P( = x ) , PDF has the following properties:
Probability density function is always positive i.e. f(x) ∫ (x)dx= (Continuous)
Discrete Cumulative Distribution Function (CDF) or Distribution Function
The Cumulative Distribution Function F(x) of the discrete variable x is defined by, (x) = (x)= P(X x) = P(x)= (x)
Continuous Cumulative Distribution function (CDF) or Distribution Function:
If (x) = P(X x) =∫ (x)dx , then F(x) is defined as the cumulative distribution function or simply the distribution function of the continuous variable.
CDF has the following properties: i) ( ) = (x) =f(x) 0 ii) 1 (x) 0
iii) If x x then (x ) (x ) , i.e. CDF is monotone (non-decreasing function) iv) ( ) = 0
v) ( ) = 1
vi) P(a x b) =∫ (x)dx =∫ (x)dx - ∫ (x)dx = (b) (a) Expectation [E(x)]:
1. E(X) = x (x ) (Discrete case) 2. E(X) =∫ x (x)dx (Continuous case) Properties of Expectation
1. E(constant) = constant
2. E(CX) = C . E(X) [C is constant]
3. E(AX+BY) = A E(X)+B E(Y) [A& B are constants] 4. E(XY)= E(X) E(Y/X)= E(Y) E(X/Y)
E(XY) E(X) E(Y) in general
But E(XY) = E(X) E(Y) , if X & Y are independent Variance (Var(X))
Var(X) =E[(x ) ]
Var(X)= (xx ) (xx) (Discrete case) Var(X)=∫ (xx ) f(x)dx (Continuous case) Var(X) =E( )-[E(x)]
Properties of Variance 1. Var(constant) = 0
3. Var(Cx D)=C Var(x) -Variance is translational invariant [C & D are constants] 4. Var(x-k) = Var(x) [k is constant]
5. Var(ax+by) =a Var(x) +b Var(y) 2ab cov(x,y) (if not independent) [A & B are constants]
= a Var(x) +b Var(y) (if independent) Covariance
Cov (x,y)=E(xy)-E(x) E(y)
If independent covariance=0, E(xy) = E(x) . E(y)
(if covariance = 0, then the events are not necessarily independent) Properties of Covariance
1. Cov(x,y) = Cov(y,x) (i.e. symmetric) 2. Cov(x,x) = Var(x)
3. |Cov(x,y)|
Standard Distribution Function (Discrete r.v. case): 1. Binomial Distribution : P(r) = C p
Mean = np, Variance = npq, S.D. =√np 2. Poisson Distribution: Probability of k success is P (k) =
no. o success trials ,n no. o trials , P success case probability mean o the distribution
For Poisson distribution: Mean = , variance = , and =np Standard Distribution Function (Continuous r.v. case):
1. Normal Distribution (Gaussian Distribution): f(x) =
√ e ( )
Where and are the mean and standard deviation respectively P( < x < ) = 68%
P( < x < ) = 95.5% P( < x < ) = 99.7%
Total area under the curve is is unity i.e. ∫ (x)dx= P(x1< x < x2) =∫ √ e
( )
dx = Area under the curve from x1 to x2 2. Exponential distribution : f(x) = λe , x , here λ
= , x
3. Uniform distribution: f(x)= , b f(x) a = , otherwise
4. Cauchy distribution : f(x)=
.( )
5. Rayleigh distribution function : f(x) = e , x
Mean:
The arithmetic mean, ̅=
For a grouped data if x , x , … . . , x are mid values of the class intervals having frequencies , ,….., ,then, ̅=
If ̅ is mean for n data; ̅ is mean for n data; then combined mean of n +n data is ̅= ̅ ̅
If ̅̅̅ , be mean and SD of a sample size n and m , be those for a sample of size n then SD of combined sample of size n +n is given by,
(n n ) = n +n +n D +n D
D= m-m (m , = mean, SD of combined sample) ( n) = (n ) (nD )
Median: When the values in a data sample are arranged in descending order or ascending order of magnitude the median is the middle term if the no. of sample is odd and is the mean of two middle terms if the number is even.
Mode: It is defined as the value in the sampled data that occurs most frequently. Important Points:
Mean is best measurement ( all observations taken into consideration). Mode is worst measurement ( only maximum frequency is taken). In median, 50 % observation is taken.
Sum o the deviation about “mean” is zero.
Sum o the absolute deviations about “median” is minimum. Sum o the s uare o the deviations about “mean” is minimum. Co-efficient of variation =̅ 100
Correlation coefficient =(x,y) = ( , ) -1 (x, y) 1
(x,y) = (y,x)
|(x,y)| = 1 when P(x=0)=1; or P(x=ay)=1 [ for some a]
If the correlation coefficient is -ve, then two events are negatively correlated. If the correlation coefficient is zero, then two events are uncorrelated.
If the correlation coefficient is +ve, then two events are positively correlated. Line of Regression:
The equation of the line of regression of y on x is y y = ̅̅̅̅ (x x)
The equation of the line of Regression of x on y is (x x) = ̅̅̅̅ (y y)
̅̅̅̅is called the regression coefficient of x on y and is denoted by bxy.
Joint Probability Distribution: If X & Y are two random variables then Joint distribution is defined as, Fxy(x,y) = P(X x ; Y y)
Properties of Joint Distribution Function/ Cumulative Distribution Function: 1. ( , ) =
2. ( , ) =
3. ( , ) = { ( , ) = P( y) = 0 x 1 = 0 } 4. (x, ) = P( x ) = (x) . = (x)
5. ( , y) = (y)
Joint Probability Density Function:
Defined as (x, y) =
(x, y)
Property: ∫ ∫ (x, y) dx dy =
Note: X and Y are said to be independent random variable If fxy(x,y) = fx(x) . fy(y)
1.3 Numerical Methods
1.3.1 Solution of Algebraic and Transcendental Equation / Root Finding : Consider an equation f(x) = 0
1. Bisection method
This method inds the root between points “a” and “b”.
If f(x) is continuous between a and b and f (a) and f (b) are of opposite sign then there is a root between a & b (Intermediate Value Theorem).
First approximation to the root is x1 = .
If f(x1) = 0, then x1 is the root of f(x) = 0, otherwise root lies between a and x1 or x1 and
b.
Similarly x2 and x3 . . . are determined.
Simplest iterative method
Bisection method always converge, but often slowly. This method can’t be used or inding the complex roots. Rate of convergence is linear
2. Newton RaphsonMethod (or Successive Substitution Method or Tangent Method) xn+1 = xn – ( ( ))
This method is commonly used for its simplicity and greater speed. Here (x) is assumed to have continuous derivative ’(x).
This method ails i ’(x) = .
It has second order of convergence or quadratic convergence, i.e. the subsequent error at each step is proportional to the square of the error at previous step.
Sensitive to starting value, i.e. The Newton’s method converges provided the initial approximation is chosen sufficiently close to the root.
Rate of convergence is quadratic. 3. Secant Method
x =x
( ) – ( ) (x ) Convergence is not guaranteed.
If converges, convergence super linear (more rapid than linear, almost quadratic like Newton Raphson, around 1.62).
4. RegulaFalsiMethod or (Method of False Position) Regulafalsi method always converges. However, it converges slowly.
It is superior to Bisection method. Given f(x) = 0
Select x0 and x1 such that f(x0) f(x1) < 0 (i.e. opposite sign)
x = x - – ( ) ( ), (x ) = ( ) – ( ) ( ) ( ) Check if f(x0) f(x2) <0 or f(x1) f(x2) < 0 Compute x ………
which is an approximation to the root.
1.3.2 Solution of Linear System of Equations 1. Gauss Elimination Method
Here e uations are converted into “upper triangular matrix” orm, then solved by “bac substitution” method.
Consider a1x + b1x + c1z = d1
a2x + b2x + c2z = d2
a3x + b3x + c3z = d3
Step 1: To eliminate x from second and third equation (we do this by subtracting suitable multiple of first equation from second and third equation)
a1x + b1y + c1z = d ’ (pivotal equation, a1 pivot point.)
b ’y + c ’ z = d ’
b ’y + c ’ z = d ’
Step 2: Eliminate y from third equation a1x + b1y + c1z = d ’
b ’y + c2z = d ’ (pivotal equation, b ’ is pivot point.)
c ’’z = d ”
Step 3: The value of x , y and z can be found by back substitution.
Note: Number of operations:N = + n -
2. Gauss Jordon Method
Used to find inverse of the matrix and solving linear equations.
Here back substitution is avoided by additional computations that reduce the matrix to “diagonal rom”, instead to triangular orm in Gauss elimination method.
Number of operations is more than Gauss elimination as the effort of back substitution is saved at the cost of additional computation.
Step 2: Eliminate y from 1st and 3rd
Step 3: Eliminate z from 1st and 2nd
3. L U Decomposition
It is modification of the Gauss eliminiation method. Also Used for finding the inverse of the matrix. [A]n x n = [ L ] n x n [U] n x n
a11 a12 a13 1 0 0 U11 U12 U13
a21 b22 c23 = L21 1 0 0 U22 U23
a31 b32 c33 L31 L32 1 0 0 U31
Ax = LUX = b can be written as a)LY=b and b) UX=Y
Solve for rom a) then solve or rom b). This method is nown as Doolittle’s method. Similar methods are Crout’s method and Choles y methods.
4. Iterative Method
(i) Jacobi Iteration Method a1x + b1y + c1z = d1 a2x + b2y + c2z = d2 a3x + b3y + c3z = d3
If a1, b2 , c3 are large compared to other coefficients, then solving these for x, y, z
respectively
x = k1 – l1y – m1z
y = k2 – l2x – m2z
z = k3 – l3x – m3y
Let us start with initial approximation x0 , y0 , z0
x1= k1 – l1y0 – m1z0
y1= k2 – l2y0 – m2z0
z1= k3 – l3y0 – m3z0
Note: No component of x(k) is used in computation unless y(k) and z(k)are computed.
The process is repeated till the difference between two consecutive approximations is negligible.
In generalized form: x(k+1) = k1 – l1 y(k) – m1z(k)
y(k+1) = k2 – l2 x(k) – m2z(k)
z(k+1) = k3 – l3 x(k) – m3y(k)
(ii) Gauss-Siedel Iteration Method
Modi ication o the Jacobi’s Iteration Method
In first equation, put y = y0 z = z0 which will give x1
In second equation, put x = x1 and z = z0 which will give y1
In third equation, put x = x1and y = y1 which will give z1
Note: To compute any variable, use the latest available value. In generalized form:
x(k+1) = k1 – l1y(k) – m1z(k)
y(k+1) = k2 – l2x(k+1) – m2z(k)
z(k+1) = k3 – l3x(k+1) – m3y(k+1)
1.3.3 Numerical Integration
Trapezoidal Formula:Step size h =
∫ (x)dx =h
{( irst term last term) (remaining terms)}
Error = Exact - approximate
The error in approximating an integral using Trapezoidal rule is bounded by h
(b a) max [ , ]| ( )|
Simpson’s One Third Rule (Simpson’s Rule): ∫ (x)dx =
h
{( irst term last term) (all odd terms) (all even terms)} The error in approximating an integral using Simpson’s one third rule is
h
(b a) max [ , ]| ( )( )|
Simpson’s Three Eighth Rule:
∫ (x)dx = h{( irst term last term) (all multiple o terms) (all remaining terms) }
The error in approximating an integral using Simpson’s / rule is
(b a)
[ , ]max | ( )( )|
1.3.4 Solving Differential Equations
(i) Euler method (for first order differential equation ) Given equation is y = f(x, y); y(x0) = y0
(ii) Runge Kutta Method
Used for finding the y at a particular x without solving the 1st order differential equation = (x, y) K1 = h f(x0, y0) K2 = h f(x0 + , y0 + ) K3 = h f(x0 + , y0 + ) K4 = h f(x0 +h, y0 + k3) K = (k1 + 2k2 + 2k3 + k4) Y(x0+h) = y0 + k
1.4 Calculus
1.4.1 Limit of a Function Let y = f(x)
Then lim (x)= i.e, “ (x) as x a” implies or any (>0), (>0) such that whenever 0<|x a|< ,| (x) |<
Some Standard Expansions
( x) = nx ( ) n(n )(n ) x . . . x x a x a = x x a x a . . . a e = 1 + x + + . . . log( x) = x + . . . log( x) = x . . . Sin x = x . . . Cos x = 1 + . . . Sinh x = x . . . Cosh x = 1 + . . . Some Important Limits
lim sinx x = lim ( x) = lim ( x) = lim a x = log a lim e x =
lim log( x) x = lim x a x a = a lim log|x| = L – Hospital’s ule
When function is of or form, differentiate numerator &denominator and then apply limit.
Existence of Limits and Continuity: 1. f(x) is defined at a, i.e, f(a) exists. 2. If lim
f(x) = lim f(x) = L ,then the lim f(x) exists and equal to L.
3. lim (x) = lim (x)= f(a) then the function f(x) is said to be continuous. Properties of Continuity
If f and g are two continuous functions at a; then a. (f+g), (f.g), (f-g) are continuous at a b. is continuous at a, provided g(a) 0 c. | | or |g| is continuous at a
olle’s theorem
If (i) f(x) is continuous in closed interval [a,b]
(ii) ’(x) exists or every value o x in open interval (a,b) (iii) f(a) = f(b)
Then there exists at least one point c between (a, b) such that ( ) = 0
Geometrically: There exists at least one point c between (a, b) such that tangent at c is parallel to x axis C1 a C C 2 b
Lagrange’sMean Value Theorem
If (i) f(x) is continuous in the closed interval [a,b] and
(ii) ’(x) exists in the open interval (a,b), then atleast one value c o x exist in (a,b) such that
( ) ( )
= (c).
Geometrically, it means that at point c, tangent is parallel to the chord line.
Cauchy’sMean Value Theorem
If (i) f(x) is continuous in the closed interval [a,a+h] and
(ii) (x) exists in the open interval (a,a+h), then there is at least one number (0< <1) such that
f(a+h) = f(a) + h f(a+ h) Let f1 and f2 be two functions:
i) f1,f2 both are continuous in [a,b]
ii) f1, f2 both are differentiable in (a,b)
iii) f2’ 0 in (a,b) then, for a ( ) ( ) ( ) ( ) = ( ) ( ) 1.4.2 Derivative: ’( ) =lim ( ) ( )
Provided the limit exists ’( ) is called the rate of change of f at x. Algebra of derivative:-
i. ( g) = g ii. ( g) = – g iii. ( . g) = . g . g iv. ( /g) = . .
Homogenous Function
Any function f(x, y) which can be expressed in from xn ( ) is called homogenous function of
order n in x and y. (Every term is of nth degree.)
f(x,y) = a0xn + a1xn-1y + a2xn-2y2 ………… an yn
f(x,y) = xn ( )
Euler’s Theorem on Homogenous Function
If u be a homogenous function of order n in x and y then, x +y = nu x + 2xy + y = n(n )u 1.4.3 Total Derivative u= (x,y) ,x=φ(t), y=Ψ(t) = . + . u = x + y Monotonicity of a Function f(x)
1. f(x) is increasing function if for , ( ) ( ) Necessary and su icient condition, ’ (x) 2. f(x) is decreasing functionif for , , ( ) ( )
Necessary and sufficient condition, (x)
Note: is a monotonic unction on a domain ‘D’ then is one-one on D.
Maxima-Minima
a) Global b) Local
Rule for finding maxima & minima:
If maximum or minimum value of f(x) is to be found, let y = f(x)
Find dy/dx and equate it to zero and from this ind the values o x, say x is , β, …(called the critical points).
Find
at x = ,
If , y has a minimum value If ,y has a maximum value
If = , proceed urther and ind at x = .
If , y has neither maximum nor minimum value at x = But If
= , proceed further and find at x = .
If
, y has minimum value
If , y has maximum value If = , proceed further
Note: Greatest / least value exists either at critical point or at the end point of interval. Point of Inflexion
If at a point, the following conditions are met, then such point is called point of inflexion
i) = , ii)
= 0 ,
iii)
Neither minima nor maxima exists
Taylor Series: (a h)= (a) h ’(a) ”(a) . . . Maclaurian Series: (x) = ( ) x ’( ) ( ) h ( )
Maxima &Minima (Two variables)
r =
, s = , t =
1. = 0, = solve these e uations. Let the solution be (a, b), (c, d)… 2. (i) if rt s and r maximum at (a, b)
(ii) ifrt s and r minimum at (a, b)
(iii) ifrt s < 0 at (a, b), f(a,b) is not an extreme value i.e, f(a, b) is saddle point. (iv) ifrt s > 0 at (a, b), It is doubtful, need further investigation.
Point of inflexion
1.4.4 Standard Integral Results 1. ∫ x dx = , n 2. ∫ dx = log x 3. ∫ e dx = e 4. ∫ a dx = (prove it ) 5. ∫ cos x dx = sin x 6. ∫ sin x dx = cos x 7. ∫ sec x dx = tan x 8. ∫ cosec x dx = cot x 9. ∫ sec x tan x dx = sec x
10. ∫ cosec x cot x dx = cosec x 11. ∫ √ dx = sin 12. ∫ √ dx = sec 13. ∫ √ dx = sec x 14. ∫ cosh x dx = sinh x 15. ∫ sinh x dx = cosh x 16. ∫ sech x dx = tanh x 17. ∫ cosech x dx = coth x 18. ∫ sech x tanh x dx = sech x 19. ∫ cosec h x cot h x dx = cosech x 20. ∫ tan x dx = log sec x
21. ∫ cot x dx = log sin x
22. ∫ sec x dx = log( sec x tan x) = log tan( ⁄ x ⁄ ) 23. ∫ cosec x dx = log(cosec x cot x) = log tan
24. ∫ √ dx = log(x √x a ) = cosh ( ) 25. ∫ √ dx = log(x √x a ) = sinh ( ) 26. ∫ √a x dx = sin √ 27. ∫ √a x dx = √x a log(x √x a ) 28. ∫ √x a dx = √x a log(x √x a ) 29. ∫ dx = tan 30. ∫ dx = log ( ) where x <a 31. ∫ dx = log ( ) where x > a 32. ∫ sin x dx = sin x 33. ∫ cos x dx = sin x 34. ∫ tan x dx = tan x x 35. ∫ cot x dx = cot x x 36. ∫ ln x dx = x ln x x 37. ∫ e sin bx dx = (a sin bx b cos bx )
39. ∫ e [ (x) (x)]dx = e (x)
Integration by parts: ∫ u v dx = u. ∫ v dx ∫( ∫ v dx)dx
1.4.5 Rules for Definite Integral
1. ∫ (x)dx =∫ (x)dx+∫ (x)dx a<c<b 2. ∫ (x)dx =∫ (a b x)dx ∫ (x)dx =∫ (a x)dx 3. ∫ (x)dx =∫ / (x)dx+∫ / (a x)dx ∫ (x)dx = ∫ / (x)dx if f(a-x)=f(x) = 0 if f(a-x)=-f(x) 4. ∫ (x)dx =2 ∫ (x)dxif f(-x) = f(x), even function = 0 if f(x) = -f(x), odd function Improper Integral
Those integrals for which limit is infinite or integrand is infinite in a x b in case of ∫ (x)dx, then it is called as improper integral.
1.4.6 Convergence:
∫ (x)dxis said to be convergent if the value of the integral is finite.
(i) (x) g(x) for all x and (ii) ∫ g(x)dx converges , then ∫ (x)dx also converges (i) (x) g(x) for all x and (ii) ∫ g(x)dx diverges, then ∫ (x)dx also diverges If lim ( )
( ) = c where c 0, then both integrals ∫ (x)dx and ∫ g(x)dx converge or both
diverge.
∫ is converges when p and diverges when p ∫ e dx and ∫ e dx
is converges for any constant p and diverges for p
The integral ∫ ( ) is convergent if and only ifp The integral ∫ ( ) is convergent if and only ifp
Selection of U & V I L A T E E Logarithmic Inverse circular (e.g.
tan
x)
Algebraic Trigonometric Exponential1.4.7 Vector Calculus: Scalar Point Function:
If corresponding to each point P of region R there is a corresponding scalar then (P) is said to be a scalar point function for the region R.
(P)= (x,y,z)
Vector Point Function:
If corresponding to each point P of region R, there corresponds a vector defined by F(P) then F is called a vector point function for region R.
F(P) = F(x,y,z) = f1(x,y,z) ̂ +f2(x,y,z)ĵ 3(x,y,z) ̂
Vector Differential Operator or Del Operator: = (
ĵ ̂ )
Directional Derivative:
The directional derivative of f in a direction N⃗⃗ is the resolved part of in directionN⃗⃗ . . N⃗⃗ = | |cos
Where N⃗⃗ is a unit vector in a particular direction Direction cosine: l m n =
Where, l =cos , m=cos β , n=cos , 1.4.8 Gradient:
The vector function is defined as the gradient of the scalar point function f(x,y,z) and written as grad f.
grad f = = î ĵ + ̂
is vector function
If f(x,y,z)= 0 is any surface, then is a vector normal to the surface f and has a magnitude equal to rate of change of f along this normal.
Directional derivative of f(x,y,z) is maximum along and magnitude o this maximum is | |.
1.4.9 Divergence:
The divergence of a continuously differentiable vector point function F is denoted by div. F and is defined by the equation.
F = f + ĵ Ψ ̂ div.F= . = ( ĵ ̂ ) .( f + ĵ Ψ ̂) = + + . is scalar . = is Laplacian operator 1.4.10 Curl:
The curl of a continuously differentiable vector point function F is denoted by curl F and is defined by the equation.
Curl F = = | ĵ ̂ φ Ψ | is vector function 1.4.11 SolenoidalVector Function
If .A = 0 , then A is called as solenoidal vector function. 1.4.12 IrrotationalVectorFunction
If A =0, then A is said to be irrotational otherwise rotational. 1.4.13 DEL Applied Twice to Point Functions:
1. div grad f = f=
+ + --- this is Laplace equation
2. curl grad f = = 0 3. divcurl F = . =0
4. curl curl F = ( ) = ( . ) - F 5. grad div F = ( . )= ( ) + F 1.4.14 Vector Identities:
f, g are scalar functions & F, G are vector functions 1. ( g) = + g 2. . ( )= . . 3. ( )= 4. ( g) = f g + g f 5. . ( )= . . 6. ( ) = 7. ( . ) = F ( ) ( ) 8. . ( )= G.( ) . ( ) 9. ( )= F( ) ( )
Also note: 1. (f/g)= (g f – f g)/g 2. ( . )’ = ’. . ’ 3. (F )’ = ’ G + F ’ 4. (fg) = g f + 2 f. g + f g 1.4.15 Vector product
1. Dot product of A B with C is called scalar triplet product and denoted as [ABC] Rule: For evaluating the scalar triplet product
(i) Independent of position of dot and cross (ii) Dependent on the cyclic order of the vector [ABC] = A B. C = A. B C
= B C. A= B.C A = C A. B = C.A B A B. C = -(B A. C)
2. (A⃗⃗ B⃗⃗ ) C⃗ = (extreme adjacent) Outer
= (Outer. extreme) adjacent (Outer. adjacent) extreme (A ⃗⃗⃗ B)⃗⃗⃗⃗ C⃗ = (C⃗ . A⃗⃗ )B⃗⃗ - (C⃗ . B⃗⃗ ) A⃗⃗
A⃗⃗ (B⃗⃗ C⃗ ) = (A⃗⃗ . C⃗ ) B⃗⃗ - (A⃗⃗ . B⃗⃗ )C⃗ (A⃗⃗ B⃗⃗ ) C⃗ A⃗⃗ (B⃗⃗ C⃗ )
1.4.16 Line Integral, Surface Integral & Volume Integral
Line integral = ∫ ( )d
( )= (x,y,z) ĵ (x,y,z) + ̂ Ψ(x,y,z) d = dx ĵ dy ̂ dz
∫ ( )d = ∫ ( dx dy Ψ dz )
Surface integral: ∫ ⃗ .ds⃗⃗⃗⃗ or∫ ⃗ . N⃗⃗ ds, Where N is unit outward normal to Surface. Volume integral : ∫ dv
If F(R ) = f(x,y,z)î + (x,y,z)ĵ Ψ (x,y,z) ̂ and v = x y z , then
∫ dv = î∫ ∫ ∫ dxdydz ĵ ∫ ∫ ∫ dxdydz + ̂ ∫ ∫ ∫ Ψdxdydz 1.4.17 reen’s Theorem
If R be a closed region in the xy plane bounded by a simple closed curve c and if P and Q are continuous unctions o x and y having continuous derivative in , then according to reen’s theorem.
∮ (P dx dy)= ∫ ∫ ( x
P
1.4.18 Sto e’s theorem
If F be continuously differentiable vector function in R, then ∮ . dr = ∫ .N ds 1.4.19 Gauss divergence theorem
The normal surface integral of a vector point function F which is continuously differentiable over the boundary of a closed region is equal to the
Part – 2: Discrete Mathematics and Graph Theory
2.1: Mathematical Logic
Logic is a formal language and it has a syntax and semantics and a way of manipulating expressions in the language.
Syntax is a description of what you are allowed to write down (i.e., what expressions are legal) Semantics give meanings to legal expressions.
A language is used to describe about a set
Logic usually comes with a proof system which is away of manipulating syntactic expressions which will give you new syntactic expressions
The new syntactic expressions will have semantics which tell us new information about sets. In the next 2 topics we will discuss 2 forms of logic
1. Propositional logic 2. First order logic
Propositional logic
Sentences are usually classified as declarative, exclamatory interrogative, or imperative
Proposition is a declarative sentenceto which we can assign one and only one of the truth values “true” or “false” or A statement which is either “true” or “false”
Assumptions about propositions
For every proposition p, if p is not true, then it is false & vice-versa. For every proposition p, it cannot be simultaneously “true” or “false”
Atomic proposition: are the proposition which cannot be further divided
Ex: p, q, r
2 or more propositions may be combined to form compound proposition using logical
connectives.
Conjunction (v), disjunction (∧), implication ⟶, by implication (⟷), negation ( ) are 5 basic connectives
If p is a proposition then negation p is a compound proposition. We represent it as p. Example: p: 2 + 2 = 4
Truth table for p
If p and q are 2 propositions then p conjunction q (p and q) is a compound proposition denoted by p ∧ .
p ∧ is true if both p and q are true otherwise it is false Truth table
If p and q are 2 propositions then p disjunction q (p or q) is a compound proposition denoted by p .
p is false if both p and q are false otherwise it is true.
If p and q are 2 propositions the p “implication” q is a compound proposition denoted by (antecedent) p ⟶ (consequent).
p ⟶ is false if p is true and q is false. Otherwise it is true. Whenever p is “false” p ⟶ is true.
truth table for p ⟶ truth table for p
{
p, converse
p , inverse or opposite p, contra positive We also write p ⟶ as if p then q or q if p
If p and q are 2 propositions then p bi implication q is a compound proposition denoted by p ⟷
p ⟷ is true if both p, q should have same truth value otherwise it is false. Also denoted as p iff q Truth table
p
T
q
T
T
F
F
T
F
F
p
⟶ q
T
F
T
T
p
T
q
T
T
F
F
T
F
F
p
q
T
T
T
F
p
T
q
T
T
F
F
T
F
F
p
∧ q
T
F
F
F
p
p
T
F
F
T
Two compound propositions are said to be equivalent if they have the same truth tables. Given below are some of the equivalence propositions.
( (p)) p (p ) p ∧ (p ∧ ) p p ⟶ p p ⟷ ( p ) ∧ ( p), p (p ⟶ ) ∧ ( ⟶ p)
A propositional function is a function whose variables are propositions
A propositional function p is called tautology if the truth table of p contains all the entries as true ⟶ e p p
A propositional function p is called contradiction if the truth table of p contains all the entries as false⟶ e p ∧ p
A propositional function p which is neither tautology nor contradiction is called contingency (i e A statement should be “true” for atleast one case, A statement should be “false” for atleast one case) ⟶ e p ⟶
Whenever p ⟶ is a tautology, then we can replace the symbol ⟶ with i.e. p Ex. If p q, then p ⟶ is a tautology, is a tautological implication.
Inference will be used to designate a set of premises accompanied by a suggested conclusion. (p ∧ p ∧ p p ) ⟶ Q
Here each p is called premise and Q is called conclusion.
If (p ∧ p ∧ p p ) ⟶ Q is tautology then we say Q is logically derived from p ∧ p p
i.e., from set of premises i.e., {p , p , , p i.e. whenever the premises p , p , , p are true, then Q is true. or p , p , p if conclusion ‘ ’ is obtained by rule of inference Q
Otherwise it is called invalid inference Some rules of inference are:
I1 I2 ∧ ∧ } (simplification) I3 I4 } (addition)
I5 P ( )
(A false antecedent p implies P
to be “true”)I6
(A “true” conse uent is implied by any
proposition p)
I7 ( )
(if Q statement P
is false, p is “true”)I8 ( ) Q
(if a statement P
is “false”, is false)I9 , ∧Q I10 P,P Q (disjunctive syllogism)
p
T
q
T
T
F
F
T
F
F
p
⟷ q
T
F
F
T
I12 , P (modus tollens) I13 , R R (hypothetical syllogism) I14 P , R, R R (dilemma) I15 P , R, S R S (constructive dilemma) I16 R, S, R S V Q (destructive dilemma I17 ( Λ ), ⇨ Q (conjunctive syllogism) EQUIVALENCES E1 ⇔ (double negation) E2 E3 Λ ⇔ Λ ⇔ } (commutative laws) E4 E5 ( Λ )ΛR ⇔ Λ( ΛR) ( ) R ⇔ ( R)} (associative laws) E6 E7 Λ( R) ⇔ ( Λ ) ( ΛR) ( ΛR) ⇔ ( )Λ( R)} (distributive laws) E8 E9 ( Λ ) ⇔ ( ) ⇔ Λ }
(De Morgan’s law)
E10 ⇔ E11 Λ ⇔ E12 R ( Λ )⇔R E13 RΛ( )⇔R E14 R ( )⇔T E15 RΛ( Λ )⇔F E16 ⇔ E17 ( )⇔ Λ E18 ⇔
(contrapositive)
E19 ( R)⇔( Λ ) R E20 ( )⇔~ E21 ⇔( )Λ( ) E22 (P Q) ⇔( Λ ) ( Λ ) E23 ( Λ ) ⇔P(absorption laws)
E25 PV~P⇔T E26 Λ ⇔F E27 PVF⇔P(trivial laws)
E28 PVT⇔T E29 ΛT⇔P E30 ΛF⇔FFirst Order Logic
1. Let A be a given set. A propositional function (or an open sentence or condition)defined on A is an expression p(x) which has the property that p(a)is true or false for each ‘a’ in A. That is, p(x) becomes a statement (with a truth value) whenever any element a ∈ A is substituted for the variable x.
2. The set A is called the domain of p(x), and the set Tp of all elements of A for which p(a) is true is called the truth set of p(x).
3. Tp= {x | x ∈ A, p(x) is true} or Tp= {x | p(x)}.
4. Frequently, when A is some set of numbers, the condition p(x) has the form of an equation or inequality involving the variable x.
5. The symbol ∀which reads “for all” or “for every” is called the universal quantifier. 6. The expression (∀x ∈ A) p(x) or ∀x p(x) is true if and only if p(x) is true for all x in A.
7. The symbol ∃which reads “there e ists” or “for some” or “for at least one” is called the existential quantifier.
8. The expression (∃x ∈ A)p(x) or ∃x, p(x) is true if and only if p(a) is true for atleast one element x in A.
Sentence Abbreviated Meaning
∀ x, F(x) all true
∃x, F(x) at least one true
~[∃x, F(x)] none true
∀ x, [~F(x)] all false
∃x, [~F(x)] at least one false
~(∃x,[~F(x)]) none false
~(∀ x,[F(x)]) not all true
Statement Negation
“all true” ∀x, F(x) ∃ , [ F( )] “ at least one false” “at least one false” ∃x, [~F(x)] ∀ , F( ) “all true”
“all false” ∀x, [~F(x)] ∃x, F(x) “at least one true” “at least one true” ∃x, F(x) ∀ , [ F( )] “all false”
We see that to form the negation of a statement involving one quantifier, we need to only change thequantifier from universal to existential, or from existential to universal and negate the statements which it quantifies.
i.e. (∀ , F( )) ∃x[ F( )], (∃ , F( )) ∀ [ F( )]
Sentences with Multiple quantifiers:
In general if P (x, y) is any predicate involving the two variables x and y, then the following possibilitiesexist:
(∀x)(∀y)P (x,y) (∀x)(∃y) P (x,y) (∃x)(∀y)P (x,y) (∃x)(∃y) P (x,y) (∀y)(∀x)P (x,y) (∃y)(∀x) P (x,y) (∀y)(∃x)P (x,y) (∃y)(∃x) P (x,y) ∃∀ ∀ ∃
Rules of Inference For Quantified Propositions:
“Universal Specification”: If a statement of the form ∀x, P(x) is assumed to be true then the universal quantifier can be dropped to obtain that P(c) is true for any arbitrary object c in the universe. This rule may be represented as ( ) ∀ , ( )
Universal generalization : If a statement P(c) is true for each element c of the universe, then the universal quantifier may be prefixed to obtain ∀x, P(x), In symbols, this rule is
( ) ∀ , ( )
This rule holds provided we know P(c) is true for each element c in the universe.
Existential specification: If ∃x, P(x) is assumed to be true, then there is an element c in the universe such that P(c) is true. This rule takes the form.
∃ , ( ) ( ) (∀ )(∀ ) (∀ )(∀ ) (∃ )(∀ ) (∀ )(∃ ) (∃ )(∃ ) (∃ )(∃ ) (∃ )(∀ ) P(x,y) (∀ )(∃ ) (∃ )
2.2: Combinatorics
Counting:
Let x be a set. Let us use |x| to denote the number of elements in x.
Two elementary principles act as “building blocks” for all counting problems Sum rule:
If a set x is the union of disjoint non empty subsets s . . . s , then |x| = |s | + |s |+ . . . . . . |s |.
If E1, E2, En are mutually exclusive events, and E1 can happen in e1 ways, E2 can
happen in e2 ways, ,En can happen in en ways, then E1 or E2 or En can happen e1 + e2
+ en ways.
Product rule:
If s , s . . . s are non empty subsets then the number of elements in the Cartesian product s s s . . . s is the product ∏ s
If events E1, E2 En can happen in (e1, e2 , en) ways respectively, then the
sequence of events E1 first followed by E2 , followed by En can happen in (e1 x
e2 en ) ways.
Permutations:
P (n, r) =
= the number of permutations of n objects taken r at a time (without any
repetitions) = n
(n – 1)(n – 2) (n +r + 1)
NOTE:
1. P (n, n) = n! i.e.., there are n! permutations of n objects 2. There are (n - 1)! permutations of n distinct objects in a circle.
3. A permutation of n objects taken r at a time (also called an r - permutation of n objects) is an ordered selection or arrangement of r of the objects.
4. U (n, r) = The number of r-permutations of n objects with unlimited repetitions =nr.
5. The number of permutations of n objects of which n1 are alike, n2 are alike nr are alike
is
6. The number of ordered partitions of a set S of type (q1, q2 z). Where |S| = n is p (n; q1,
Combinations
A combination of n – objects taken r at a time (called an r-combination of n objects) is an unordered selection of n objects.
C (n, r) = The number of combinations of n – objects taken r at time (without repetition) n
r (n r) NOTE
1. P (n, r) = r! C(n, r) 2. C (n, n) = 1
3. V (n, r) = The number of combinations of n distinct objects taken r at a time with unlimited repetitions.
4. V (n, r) = C ( n – 1 + r, r ) = C (n – 1 + r, n – 1)
V (n, r) =The number of ways distributing r – similar balls in to n numbered boxes.
V (n, r) =The number of non negative integral solutions to x1 + x2 + + n = r. Generating
functions can be used to compute V (n, r).
Enumeration of permutations and combinations
The number of r-permutations of n-elements without repetitions = n = P(n, r)
The number of r-combinations of n-elements without repetitions = nC = C(n, r)
Enumerating combinations and permutations with repetitions
The number of r-permutations with unlimited repetitions = U(n, r) = n
The number of r-combinations of n objects with unlimited repetitions = V(n, r) = (n + r –1)C
Enumerating permutations with constrained repetitions:
a , a . . . a are t distinct objects, each a is repeating times. Let + . . . = n, then
The number of n-permutations of that objects denoted by
P (n, , , . . . ) =
Pigeonhole Principle:
If A is the average number of pigeons per hole, then some pigeon hole contains at least ⌈A⌉ pigeons and some pigeon hole contains at most ⌊A⌋ pigeons.
E ample: If n + 1 pigeons are distributed among ‘n’ pigeon holes, then some pigeon hole contains at least 2 pigeons.
E ample: If 2n + 1 pigeons are distributed among ‘n’ pigeon holes, then some pigeon hole contains at least 3 pigeons.
E ample: In general, if k is a positive integer and ‘kn+1’ pigeons are distributed among ‘n’ pigeon holes, then some hole contains at least ‘k + 1’ pigeons
Example: In a group of 61 people at least 6 people were born in the same month.
Example: If 401 letters were delivered to 50 apartments, then some apartment received at most 8 letters.
Euler’s ∅ - Function:
If n is a ‘+ve’ integer then ∅ (n) = The number of integers such that 1 n and such that n and are relatively prime ∅ (n) = n [(1 – (1/p1)) (1- (1/p2)) (1- (1/pk))]
Where p1, p2 , pk are prime divisors of n.
Derangements:
Among the permutations of 1, 2, , n there are some, called derangements, in which none of the n integers appears in its natural place.
Dn = The number of derangements of n elements
Dn = n ∑ ( )
Summation:
1. C (n, r) C (r, k) = C (n, k) = C (n – k, r – k) = for integers n > r > k > 0 (Newtons identity) 2. C (n, r).r = n. C (n -1, r – 1) 3. P (n, r) = n. P (n – 1, r – 1) 4. ascal’s identity C (n, r) = C (n - 1, r) + C (n - 1, r – 1) 5. C (n, 0) = 1 = C (n, n) C (n, 1) = n = C (n, n – 1) Notation: C (n, 0) = C0, C (n, 1)= C1, C (n, 2) = C2 C (n, r) = Cr C (n, n) = Cn.
Row Summation:
C0 + C1 + C2 + Cn = 2n
Row square summation:
6. C + C + C + + C = C (2n, n) 7. C0 - C1 + C2 C3 + + (-1)nCn = 0 8. (C0 + C2 + C4 + ) = ( C1 + C3 + C5 + ) = 2n-1 9. C1 + 2C2 +3C3 + + n Cn = n 2n-1 10. 20 C0 + 21 C1 + 22 C2 + + 2nCn = 3n Diagonal Summation: 11. C (n, 0) + C (n + 1, 1) + C (n + 2, 2) + + C (n + r, r) = C (n +r + 1, r) 12. C (m, 0) C (n, 0) + C (m, 1) C (n, 1) + + C (m, n) C (n, n) = C (m + n, n) for integers m > n > 0 Column Summation:
13. C (r, r) + C (r + 1, r) + + C (n, r) = C (n + 1, r + 1), for any positive integer n > r 14. 2.1 C2 + 3.2 C2 + + n (n – 1) Cn = 2n - 1 n (n - 1)
15. 12 C1 + 22 C2 + + n2Cn = 2n – 2 n (n + 1)
16. 13 C1 + 23 C2 + + n3Cn = 2n – 3 n2 (n + 3)
Recurrence Relations
Definition: A recurrence relation is a formula that relates for any integer n>1, the n-th term of sequence an to one or more of the terms a0, a1 an-1.
Examples of recurrence relations: If Sn denotes the sum of the first n positive integers, then
1. Sn=n+Sn-1.
Similarly if d is a real number, then the nth term of an arithmetic progression with common
difference satisfies the relation 2. an=an-1+d.
Likewise if Pn denotes the nth term of a geometric progression with common ratio r, then
3. Pn = rPn-1.
We list other examples as:
Fibonacci relation: The relation F = F + F is called the Fibonacci relation with the initial conditionF = 0 and = F = 1
The numbers generated by the Fibonacci relation with the initial condition are called Fibonacci numbers.
Linear Recurrence Relation
A relation of the form c (n)a + c (n)a + c (n)a = f(n), when n, ∈ , n > c (n), c (n) c (n)&f(n) are function of n is linear recurrence relation.
ifc (n) are constants, then Linear Recurrence Relation with constant coefficient Homogeneous f(n) = 0
Non-homogeneous f(n) ≠ 0
Degree: the number of previous terms of sequence used to define an Ex: 1. f = f + f (degree z linear)
2. a = a (degree 5 linear)
3. a = a + a ( non-linear)
4. a = a + 2a ( linear homogeneous degree 2 )
5. a = a + 11a + a (linear homogeneous degree 3) Solution Of Recurrence Relations
Homogenous linear recurrence relations with coefficients: In general, to solve the equation
y +a y + a y + +a y = 0
Where a’s are constants:
i) Write the equation in the symbolic form (E + a E + +a )y =0
ii) Write down the auxillary equation i.eE + a E + +a = 0 and solve it for E
iii) write the solution as follows: