Anda di halaman 1dari 57

GENERAL GUIDELINES

• This book is to be brought to the class daily.


• Students are not permitted to attend the class without the identity card.
• Students should be well in time for the first class and subsequent classes thereafter.
• Students should keep the Classrooms, Laboratories and Workplace clean and tidy.
• Writing on desks, walls is strictly prohibited, failing which the students will be fined heavily. If the identity of the individual is
not established the entire class / students in the block will be fined.
• Students are advised to show due respect to all faculty regardless of their department and maintain affable personality.
• Students are to maintain absolute discipline and decorum, so as to promote the fair name of the college in all its activities.
• Students securing less than 85% attendance in any individual subject in the semester will not be allowed to take up the exams.
Attendance and test performance will be announced in the concerned department notice board as per the calendar of events
and the students are advised to bring any discrepancy to the notice of the HOD.
• Students are informed to clarify their doubts in the respective subjects with the faculty by taking prior appointment.
• Students are to inform their parents that they should follow up the progress of their wards by being in touch with the college authorities at
regular intervals.
• Ragging is punishable under Karnataka Education Act and is strictly prohibited. Any student involved in ragging, will be
severely punished.
• Students should come prepared with algorithm / flowchart / program for all the experiments before attending the laboratory
session.
• Students should bring the data sheets and laboratory records completed in all respect to the laboratory.
• Take the PRINTOUTS of the SOURCE LISTING and OUTPUT of the program after EXECUTION and DELETE your files.
• Students are not supposed to alter the configuration of the system / any software on the system.
• Students who secure less than 60% in the University exam and / or who secure less than 60% in the internal test are to go through the
Academic Support programme compulsorily. The guidelines will be issued separately by the concerned department.
• Students are to present the mentor meeting failing which appropriate disciplinary action will be taken.

SEMESTER - IV - TIME TABLE


Day / Time 8.15 - 9.15 9.15 - 10.15 10.45 –11.45 11.45-12.45 1.30-2.30 2.30-3.30 3.45-4.45 4.45-5.45
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday

SCHEME OF STUDY AND EXAMINATIONS


FOR BE DEGREE COURSE IN COMPUTER SCIENCE & ENGINEERING
No. of Hr. / week Duration of Exams Class
Sl.
Code No. Subject Sessional Exam Marks Total Marks
No Theory Practical Theory Practical
Marks
1. MAT 41 Engg. Mathematics – IV 04 -- 03 -- 25 100 125
2. Graph Theory and
CSE 42 04 -- 03 -- 25 100 125
Combinatorics
3. Analysis and design of
CSE 43 04 -- 03 -- 25 100 125
Algorithms
4. Finite Automata &
CSE 44 04 -- 03 -- 25 100 125
Formal Languages
5. Introduction to
CSE 45 04 -- 03 -- 25 100 125
Microprocessors
6. CSE 46 Computer Organization 04 -- 03 -- 25 100 125
7. CSEL 47 OOP Lab with C++ -- 03 -- 03 25 50 75
8. CSEL 48 Algorithms Lab -- 03 -- 03 25 50 75
Total 24 06 200 700 900

STUDENT SELF APPRAISAL


MARKS ATTENDANCE
SUBJECT
TEST 1 TEST 2 TEST 3 REPORT 1 REPORT 2 REPORT 3
Engg. Mathematics –
IV
Graph Theory and
Combinatorics
Analysis and design of
Algorithms
Finite Automata &
Formal Languages
Introduction to
Microprocessors
Computer Organization
OOP Lab with C++
Algorithms Lab

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 1
MAT-41 ENGINEERING MATHEMATICS – IV

Faculty: No. of Hours: 52

Title & Reference


Class # Topics to be covered

1 Complex Analysis- Introduction


Definition of Limit, continuity, differentiability and Analytic function
Calculus of Complex
functions
2-3 T1-Chapter 20:-20.1 to Cauchy-Riemann equations in Cartesian and Polar forms
4 20.6, 20.8(4), 20.9(1), Consequences of C-R equations and examples
5 20.10(1 to 3). Conformal transformations: z2, ez
6 z + a2 / z
7 Bilinear transformations
8 Calculus of complex Complex integration: Line integral
9-10 functions Cauchy’s theorem – corollaries and Problems
11 T1-Chapter 20:- Cauchy’s integral formula
12 20.12 to 20.14, Taylor’s and Laurent’s series examples
13 20.16(2,3), 20.17 to Singularities, poles, Calculation of Residues
14 20.19. Residue theorem: examples.

15-16 Series Solution of Bessel’s Differential equation


17-18 Series solutions of Recurrence relations
19 Differential equations Generating function
20-21 and special functions Orthogonality Property, Bessel’s integral formula
22-23 T1-Chapter 16:- 16.6 to Series Solution of Legendre’s differential equation
16.9, 16.11, 16.13 to
24-25 16.17. Generating functions , Recurrence relations
26 Orthogonality Property
27 Rodrigue’s formula
28-30 Curve fitting by the method of Least squares
31 Correlation
32 Statistics & Probability Regression
T1-Chapter1:-1.13, 1.14
33 Probability, conditional probability & Problems
T1-Chapter 23- 23.9,
34 Baye’s rule
23.10, 23.14, 23.16 to
35 Discrete and continuous random variables
23.21, 23.26, 23.27(5),
36 23. 28. PDF and CDF
37-38 Binomial distribution, Poison distribution
39 Poison and Exponential
40 Normal distribution
41 Statistical Methods T1- Sampling, Sampling distribution, Standard error
42 Chapter 23:- Type-I and Type-II errors
43 23.31 to 23.33, 23.35 to Testing of hypothesis for Means large and Small samples
44 23.37 Level of Significance and Confidence limits large and small samples
45 Student’s t-distribution.
46 Joint Probability distributions
47 Discrete and independent random variables
Relevant articles of T2-
48 Problems on expectation and variance
Chapter 5 & Chapter 7
49 Introduction to Markov Chains
from Schaum Series
50 Probability vectors and Stochastic Matrices
51 Higher transition probabilities
52 Stationary distribution of regular Markov chains and absorbing states.

Note: 1)Percentage of portions covered per class on an average is 1.92 per class
2)All questions carry equal marks (i.e 5marks in test & 6/7/8 marks in exam)

Part-A Complex Variables- Bilinear Transformation One Question


Complex Integration
One Question
Part-B Bessel’s Differential Equation One Question
Legendre’s Differential Equation One Question
Part-C Curve fitting- Baye’s Rule One Question
Random Varibles - End One Question
Part-D Sampling Distributions One Question
Joint Probability Distributions- End One Question

Test Portions
Test 1 Complex Analysis: Analytic Functions, C-R Equations, conformal Mapping
Statistics: Curve Fitting, Correlation, Regression
Probability: Upto Baye’s theorem.
Test 2 Complex Analysis: Bilinear Transformation
Complex Integration
Probability: Random variables, discrete & continuous distributions.
Test 3 Special Functions
Sampling distribution.
Literature:
Publication Info
Book Type Code Title & Author
Edition Publisher Year
Text book T1 Higher Engineering Mathematics – Dr.B.S.Grewal 36th Khanna Publisher 2001
Text book T2 Probability by Seymour Lipschutz 2nd Schaum’s Outlines 2000
Reference book R1 Advanced Engineering mathematics by E Kreyszig John Wiley & Sons

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 2
QUESTION BANK
ANALYTIC FUNCTIONS:
1. Show that the function f ( z ) = z is continuous at every point but not differentiable at any point.

2. Show that the function f (z ) =| z |2 is continuous at every point but is not differentiable at any point other than origin.

∂u ∂v ∂v ∂u
3. Show that the necessary sufficient condition for the function f(z)= u + iv to be analytic is = , =−
∂x ∂y ∂x ∂y
3. If f (z) is analytic on an open set S and f ′(z ) = 0 for all z ∈ S show that f (z) is constant.
4. Show that an analytic function with constant real part is constant.
5. Show that an analytic function with constant modulus is constant.
6. If f (z ) = u + iv is analytic and ψ is any differential function of x and y prove that
2 2 ⎧⎪⎛ ∂ψ ⎞ 2 ⎛ ∂ψ ⎞ 2 ⎫⎪
⎛ ∂ψ ⎞ ⎛ ∂ψ ⎞
⎟ ⎬| f ′(z )|
2
⎜ ⎟ + ⎜⎜ ⎟⎟ = ⎨⎜ ⎟ +⎜
⎝ ∂x ⎠ ⎝ ∂y ⎠ ⎪⎩⎝ ∂u ⎠ ⎝ ∂v ⎠ ⎪⎭
7. If f (z ) = u + iv is an analytic function, prove the following
⎛ ∂2 ∂ 2 ⎞⎟
(a) ⎜ + | f (z )|2 = 4| f ′(z )|2
⎜ ∂x 2 ∂y 2 ⎟
⎝ ⎠
2 2
⎛ ∂ ⎞ ⎛ ∂ ⎞
(b) ⎜ | f (z )|⎟ + ⎜⎜ | f (z )|⎟⎟ =| f ′(z )|2
⎝ ∂x ⎠ ⎝ ∂y ⎠
⎛ ∂ 2
∂ ⎞⎟
2
(c) ⎜ + log | f (z )|= 0
⎜ ∂x 2 ∂y 2 ⎟
⎝ ⎠
(d) If f (z ) = u + iv is analytic and φ is any differentiable function of x and y, prove that
2 2 ⎧⎪⎛ ∂φ ⎞ 2 ⎛ ∂φ ⎞ 2 ⎫⎪
⎛ ∂φ ⎞ ⎛ ∂φ ⎞
⎜ ⎟ + ⎜⎜ ⎟⎟ = ⎨⎜ ⎟ + ⎜ ⎟ ⎬ | f ′(z )|
2

⎝ ⎠x ∂
⎝ ⎠y ∂u
⎪⎩⎝ ⎠ ∂v
⎝ ⎠ ⎪⎭
(e) If f (z ) = u + iv is analytic, show that ∇ 2 | f (z )|2 =| f ′(z )|2
∂ 2F ∂ 2F ∂ 2F
8. Prove that + =4 Here F=F(x, y) z= x+ iy, z = x − iy
∂x 2 ∂y 2 ∂z∂z
9. If f(z) = u +iv is analytic u and v satisfy Laplace’s equation, show that

∂ 2u ∂ 2u ∂ 2v ∂ 2v
+ =0 + = 0 i.e ., u & v are harmonic functions.
∂x 2 ∂y 2 ∂x 2 2
∂y
10. If f(z) = u + iv is analytic then the families of curves u= c1 and v= c2 here c1& c2 are constant are orthogonal.
11. Show that an analytic function constant modulus is constant.
12. Find the analytic function f(z)=u + iv, given
(a) u =2x(1-y) x
(b) u = ex (x cosy – y siny) (f) u + v =
(c) x sinx coshy – ycosx sinhy x + y2
2
(d) v=exsiny
sin x sin y
(e) v=
cos 2x + cosh 2y
cos x + sin x − e −y
(g) u −v =
2 cos x − e y − e − y
∂u 1 ∂v ∂v 1 ∂u
13. If z = re iθ and f (z ) = u(r ,θ ) + iv (r ,θ ) prove that = ; =−
∂r r ∂θ ∂r r ∂θ

14. f (z ) = u(r ,θ ) + iv (r ,θ ) is analytic function, show that u and v satisfy the function

∂ 2ϕ 1 ∂ϕ 1 ∂ 2ϕ
(a) + + =0
∂r 2 r ∂r r 2 ∂θ 2

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 3
∂ 2u 1 ∂u 1 ∂ 2u
(b) ++ =0
∂r 2 r ∂r r 2 ∂θ 2
∂ 2v 1 ∂v 1 ∂ 2v
(c) + + =0
∂r 2 r ∂r r 2 ∂θ 2
15. Find the analytic function f (z ) = u + iv , given

cos 2θ
(a) u = r 2 cos 2θ − 4 sinθ (b) u = ,r ≠ 0
r2

COMPLEX INTEGRATION
1. Prove that f (z )dz = (udx − vdy ) + i (udy + vdx )
∫ ∫ ∫
c c c
2. Prove that
∫ f (z )dz = 0
c
3. If c1,c2,c3…..cn are ‘n’ non overlapping simple closed curves within C and f(z) is analytic on these curves in the region
bounded by them then prove that
∫ f (z )dz = ∫ f (z )dz + ∫ f (z )dz + ..... + ∫ f (z )dz
c c1 c2 cn

4. Verify the Cauchy’s theorem for the function f (z ) = 3 z + iz − 4


2
with c as the square having vertices at 1 ± i , -1 ± i
5. If f(z) is analytic within and on a simple closed curve c in the complex plane and a is any point c then prove that
1 f (z )
f (a) = ∫ dz
2πi c z − a
n! f (z )
6. If f(z) is analytic within and on a simple closed curve C and a is any point within C then f n (a) = ∫ (z − a)n +1 dz
2πi c
z +1
7. Evaluate
∫ z2
dz, where C is a simple closed contour enclosing the origin.
c
ez
8. Evaluate
∫ z 3 dz where C is the circle |z|=1
c
z2 +1
9. Evaluate
∫ z 2 − 1 dz, where C is a circle of unit radius with center at (i) z= 1 (ii) z=-1
c
1
10. Obtain the Taylor’s and Laurent’s series for the function f(z)=
(1 + z )(z + 2)
2
for (a)|Z|<1

11. (b) 1<|z|<2 (c) |z|>2

z2
12. Obtain Laurent’s expansion for f (z ) = in the region (a) 1<|z|<3 (b) |z-1|<2.
(z − 1)(z − 3)
13. If C is a simple closed curve and f(z) is analytic within and on simple closed curve c except at finite points a1,a2,a3…..an
inside c then prove that
∫ f (z )dz = 2πi (R1 + R2 + R3 + ......Rn ) here R1, R2 , R3 ....Rn are residues of f(z) at
c
a1,a2,a3,……an
3z − 4
14. Evaluate
∫ z (z − 1)(z − 2) dz where C: |z|=3/2
c
2
2z + z
15.
∫ z 2 −1
dz, where (i) C: |z|=2 (ii) C: |z-1|=1
c

16. Show that the transformation w = z2 transforms the circle | z-a | = c to a cardioid or a limacon.
17. Find the bilinear transformation that transforms the points z1 = 1, z2 = i, z3 = -1 onto the points w1 = 2, w2 = i, w3 = -2.
Find the fixed points of the transformation.
18. Find the images of (i) x-y = 1 (ii) x2 – y2 = 1 under the transformation w = z2.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 4
BESSELS FUNCTIONS:
1. Find the series solution of Bessel's differential equation.
2. Show that y = c1 Jn(kx ) + c2 J-n (kx) is the solution of x2 y2 + xy1 + (k2 x2 - n2)y =0.
3. Verify that y = xn Jn(x) is the solution of x y2 +(1-2n)y1 + xy =0.

2 2
4. Show that (a) J ½ (x) =
Sinx (b) J -½ (x) = Cosx.
πx πx
5. Show that 2n J n(x) = x [J n-1 (x) + J n + 1 (x) ]
6. Show that J n'(x) = x [J n-1 (x) - J n + 1 (x) ]

7. Show that
d n
dx
[ ]
x J n ( x ) = xn J n-1 (x).

8. Show that
d −n
dx
[
x J n ( x ) = x-n J n+1 (x). ]
2 2
9. Show that (a) J 3/2 (x) = {(Sinx )/x - cosx } (b) J --3/2 (x) = {(Cosx)/x +sinx}
πx πx
10. Show that
d
dx
[ ]
x J n ( x )J n −1 ( x ). = x[ J2 n (x) .- J2 n-1 (x)]
11. Show that cos (x sinθ) = J0(x) +2ΣJ2n(x)cos 2nθ
12. Show that sin (x sinθ) = 2ΣJ2n-1(x)sin (2n-1)θ
1
13. Prove that J n(x) =
π
∫ cos(nθ − x sinθ)dθ
14. State and prove orthogonal property of Bessel's functions.
∞ 1
− ax
15. Show that ∫e J 0 (bx )dx =
0 a 2 + b2
16. Prove that J − n(x ) = (− 1)n J n (x ), where n is a positive integer.

LEGENDRE POLYNOMIALS:
1. Find the series solution of Legendre's differential function.
2. Show that (a)Pn (1) = 1 (b)Pn (-x) = (-1) n Pn (x) . Hence deduce that Pn (-1) = (-1)n
3. Express 3 - x + 2x2 + 2x3 + x4 in terms of Legendre’s polynomials.
4. By using Rodrigue’s formula verify that Pn (x) satisfies Legendre’s differential equation.

1 π⎡
5. Show that Pn (x) = ∫ x ± x 2 − 1 cos θ⎤dθ
π 0⎣⎢ ⎥⎦
6. Show that [ (2n+ 1) x Pn (x)] = (n+1) Pn+1 (x) + n Pn-1 (x)
7. Show that Pn (x) = xP'n (x) - P'n-1 (x)
8. Show that Pn (x) = P'n+1 (x) - 2x P'n (x) + P'n-1 (x)
1
2 2n (n + 1)
9. Show that ∫ x .Pn + 1 (x).Pn − 1 (x) dx = (2n − 1)(2n + 1)(2n + 3)
−1
1 2n
10. Show that ∫ x .Pn (x).Pn − 1 (x) dx =
−1 (4n 2 − 1)
1
2n
11. Show that
−1
∫ x .Pn (x).P' n (x) dx = (2n − 1)
12. Prove that Pn
1 dn 2
(x ) =
n
2 n! dx n
( x − 1)
n

Express x + 3 x − 4 x + 5 in terms of Lagendre’s Polynomials.


3 2
13.

Prove that P n ( x ) = xP n −1 ( x ) + nPn −1 ( x )


' '
14.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 5
STATISTICS:
1. Fit the straight line of the form y= a + bx to the given data
x: 0 5 10 15 20 25
y: 12 15 17 22 24 30

2. Fit a parabola y = ax 2 + bx + c to the following data.


x: 20 40 60 80 100 120
y: 5.5 9.1 14.9 22.8 33.3 46.0
3. Fit a curve of the form y=axb for the data
x: 1 2 3 4 5 6
y: 2.98 4.26 5.21 6.1 6.8 7.5

4. The following table gives the marks obtained by a student in two subjects in ten tests. Find the coefficient of correlation.
Sub A : 77 54 27 52 14 35 90 25 56 60
Sub B: 35 58 60 40 50 40 35 56 34 42
5. Show that there is a perfect correlation between x & y .
x: 10 12 14 16 18 20
y: 20 25 30 35 40 45
6. A computer while calculating the correlation coefficient bet x & y from 25 pairs of observations got the following constants
n = 25, Σ x = 125, Σ x2 = 650, Σ y = 100, Σy2 = 460& Σ xy = 508. Later it was discovered it had copied down the
pairs (8, 12) & (6, 8) as (6, 14) & (8, 6) respectively. Obtain the correct value of the correlation coefficient.
7. If θ is the angle between two regression lines show that
1 - r2 σ x σ y
tan θ = and explain the significance when r = 0.
r σ x2 + σ y 2
8. Find the lines of regression for the following data:
x: 1 2 3 4 5 6 7 8 9 10
y: 10 12 16 28 25 36 41 49 40 50

9. If the mean of x is 65, mean of y is 67, σx = 7. 5, σx = 3.5 & r = 0.8 find the value of x corresponding to y= 75 & y
corresponding to x = 70.
10. The two regression lines are x = 4y + 5 & 16y = x + 64 find the mean values of x, y & r.
11. In a partially destroyed laboratory record of correlation data only the following results are legible. variance of y is 16,
regression equations are y = x + 5, 16x = 9y - 94, find the variance of x.

12. Fit a straight line to the data:


(a) x: 0 1 2 3 4
y: 1 1.8 3.3 4.5 6.3
(b) x: 1 2 3 4 5
y: 14 13 9 5 2
13. Fit a second degree parabola of the form y = ax2 + bx + c for the data:
x: 1 2 3 4 5
y: 1.8 5.1 8.9 14.1 19.8 . Estimate y for x = 2.5.
14. Fit an exponential curve of the form y = abx, for the following data:
x: 1 2 3 4 5 6 7
y: 87 97 113 129 202 195 193. Estimate y for x = 8.

PROBABILITY:
1. Define a sample space and probability of an event.. When are two events said to be (a) mutually exclusive (b) mutually
independent.
2. If A & B are events P(A) = ½, P(B) = 1/3, P(A∩B) = 1/4, find (a) P(A/B) (b) P(B/A) (c) P(A∪B) (d) P(Ac)
3. An experiment succeeds twice as often as it fails. Find the chance that in the next 6 trials there will be at least 4 successes.
4. A class consists of 6 girls & 10 boys If a committee of 3 is chosen at random find the probability that (a) exactly 2 boys are
selected (b) at least 1 boy is selected (c) exactly 2 girls are selected.
5. A certain problem in mathematics is given to 4 students for solving. The probabilities of solving the problem individually are
½, 1/3, ¼, & 1/5 respectively. Find the probability that (a) the problem is solved (b) the problem is solved exactly by one
of them.
6. The chance that a doctor will diagnose a disease correctly is 60%. The chance that a patient will die after correct diagnosis is
40% and the chance of death after wrong diagnosis is 70%. If a patient dies what is the chance that his disease was not
diagnosed correctly.
7. Find the probability that a leap year selected at random will contain 53 Fridays.
8. Four cards are drawn from a pack of 52 cards without replacement. Find the probability that (a) they are all of different suits
(b) no 2 cards are of equal value.
9. State & prove Baye's theorem.
10. Define (a) a random variable (b) Discrete and continuous random variable
11. Define probability mass function and probability distribution function for a discrete random variable.
12. Define Geometrical distribution, uniform distribution, Exponential distribution.
13. 3 machines A, B & C manufacture 40%, 50% & 10% of the total production of a factory respectively. The percentage of
defective items produced by A, B & C are 2, 4, & 1.5 respectively. An item is chosen at random & is found to be defective.
Find the probability that it was a product of C.
14. There are 3 bags which contains 1 white, 2red & 3 green, 2 white, 3 red & 1 green and 3 white, 1 red & 2 green marbles
respectively. 2 marbles are drawn from a bag chosen at random and they are found to be 1 white & 1 red. Find the
probability that the balls came from the second bag.
15. Obtain the mean and variance for the following distributions: Binomial, Poisson, Exponential and Normal.
16. The probability of a man hitting a target is 1/3.
(a) If he fires 5 times what is the probability of hitting a target at least twice.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 6
(b) How many times must he fire so that the probability of hitting a target at least once is more than 90%.
17. A cricket team has probability 2/3 of winning whenever it plays. If it plays 4 games, find the probability that it wins (i) 2
games (ii) at least one game.
18. A group of 20 airplanes are sent on an operational flight. The chance that an aero plane fails to return from the flight is 5 %.
Find the probability that (a) one plane does not return (b) at the most 5 planes do not return.
19. The probability that an individual suffers a bad reaction from a certain injection is 0.001. Determine the probability that out
of 2000 individuals (a) exactly 3 (b) more than 2 individuals will suffer a bad reaction.
20. Given that 2% of the fuses manufactured by a firm are defective, find the probability that a box containing 200 fuses has (a)
at least 1 defective fuse (b) at most 3 defective fuses.
21. If the probability that a target is destroyed on any one shot is 0.5. What is the probability that it will be destroyed in the 6th
shot only and not before.
22. If the probability of the birth of a child with a defective heart in a certain city is 0.01. What is the probability that the 8th
child born is the first one to have a defective heart?
23. On a certain city transport route, buses ply every 30 minutes between 6 a.m. & 10 p.m. If a person reaches a bus stop on
this route at a random time during this period, what is the probability that he will have to wait for at least 20 minutes?
24. The duration of time that an overhead tank will serve without refilling is found to follow an exponential distribution with
mean 10 days. Find the probability that (i) it needs filling within 8 days & (ii) it will serve for more than 10 days.
25. Find the mean & S.D of a normal distribution of marks in an examination where 44% of candidates obtained below 55 & 6%
above 80 and rest between 55 & 80.
26. The mean marks of 1000 students is 34.4 & S.D 16.5.Assuming that the marks are normally distributed find the no. of
students obtaining marks (i) bet 30 & 60 (ii) bet 70 & 80.(iii) below 20 (iv)above 80.
27. A quality control engineer inspects a random sample of 3 batteries from each lot of 24 car batteries that is ready to be
shipped. If such a lot contains 6 batteries with slight defects, what are the probabilities that an inspectors sample will
contain
(i) none of the batteries with defects (ii) only one of the batteries with defects
(iii) at least 2 of the batteries with defects.
28. Among 300 employees of a company 240 are union members while the others are not. If 8 employees are chosen by lot
to serve on a committee, find the probability that 5 of them will be union members.
29. Find E(x) & V(x) for the following probability distribution:
x: 3 4 5 6 7 8 9
p: 0.05 0.12 0.20 0.24 0.17 0.14 0.008
30. A distributor makes a profit of $20 on an item. If it is shipped from the factory in perfect condition and arrives on time but it
is reduced by $2 if it does not arrive on time & $12 regardless of whether it arrives on time if it is not shipped from the
factory in perfect condition. If 70% of such items are shipped in perfect condition and arrive on time, 10% are shipped in
perfect condition but do not arrive on time and 20% are not shipped in perfect condition what is the distributors expected
profit per item.
31. If a dealers profit in units of $1000 on a new automobile can be looked upon as a random variable X having the density
⎧2(1 − x ), 0 < x < 1
function f(x) = ⎨ Find the average profit per automobile and also E(X2).
⎩0 , elsewhere
32. Show that (i) E(c) = c (ii) E (aX + b) = a E(X) + b (iii)V(X) = E(X2) - E(X)2 .
(iv) V(c) = 0 (v) V (aX + b) =a2 V(X).
33. The distribution of 2 independent random variables X & Y are given below:
X 0 1 Y 1 2 3
P(X) 0.2 0.8 P(Y) 0.1 0.4 0.5
Find the joint probability distribution of X & Y.

34. The following table gives the joint probability distribution of 2 random variables X &Y
X/Y -1 0 1
-1 0 0.2 0

0 0.1 0.2 0.1

1 0.1 0.2 0.1

Find the conditional probability of X given Y = 0.


35. The joint distribution of two random variables X and Y is given by the following table.

X /Y -4 2 7
1 1/8 1/4 1/8
5 ¼ 1/8 1/8
Determine (i) the marginal distributions of X and Y. (ii) E (X) and E(Y) (iii) are X and Y independent random variables?

SAMPLING DISTRIBUTION:
1. A Sample of 5 measurements of the diameter of a sphere was recorded as 6.33, 6.37, 6.36, 6.32, 6.37mm.Find unbiased
and efficient estimates of (i) the population mean (ii) the population variance.
2. For the frequency distribution given below find the unbiased and efficient estimates for the mean and variance
Xi 60 61 62 63 64 65 66 67 68
fi 02 00 15 29 25 12 10 04 03

3. The sample mean of a population was recorded as 184.67 with a probable error of 0.236. Find the 99.74% confidence limits
for the true (population) mean.
4. The S.D of life time of 200 electric bulbs was computed to be 80 hours. Find (i) 95%& (ii) 99%confidence limits for the S.D
of all such bulbs.
5. How large a sample should one take in order to be (i) 99% & (ii) 99.74 % confident that a population S.D will not differ from
a sample S.D by more than 2%.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 7
6. A die is thrown 9000 times and a draw of 3 or 4 observed 3240 times. Show that a die cannot be regarded as an unbiased
one. Also find the limits between which the probability of throw of 3 or 4 lies at 99.74% level of confidence
7. A mean of a sample of size 900 is 3.4.Can the sample be reasonably as a true random sample for a large population with
means 3.25 and S.D 1.61
8. Ten screws are chosen at random from a population and their lengths are found as (in mms)
63,63,66,67,68,69,70,70,71,71.On the basis of this information can we say that the mean length in the population is 66mm
at 95%confidence level?
9. Find 99% confidence limits for the correlation coefficient, which is computed to be 0.60 from a sample of size 28

TESTING OF HYPOTHESIS:
1. An electrical firm manufactures light bulbs that have a length of life that is approximately normally distributed with a
mean of 500 hours and a S.D of 40 hours. Test the hypothesis Ho: μ ≠ 800 of a random sample of 30 bulbs has an average
life of 788 hours. Use 5 % level of significance.
2. Test the hypothesis that the average content of containers of a particular lubricant is 10 liters if the contents of the random
sample of 10 containers are 10.2, 9.7, 10.1, 10.3, 10.1, 9.8, 9.9, 10.4, 10.3 & Use 0.01 level of significance and assume
that the distribution of contents is normal.
3. A random sample of size n1 = 2.5 taken from a normal population with a S.D σ1 = 5.2 has a mean x1 = 81. A second
random sample of size n2 = 36 taken from a different normal population with a S.D σ2 = 3.4 has mean x 2 = 76 . Test the
hypothesis that μ1 = μ2 against the alternative μ1 > μ2 at 5% level of significance.

4. A large automobile manufacturing company is trying to decide whether to purchase brand A or B tyres for its new models. To
help arrive at a decision, an experiment is conducted using 12 of each brand. The tyres are run until they wear out.
The results are
Brand A : x1 = 37,900kms, s1 = 5100kms
Brand B : x 2 = 39,800kms, s 2 = 5900kms .
Test the hypothesis at the 0.05 level of significance that there is no difference in the 2 brands of tyres. Assume the
population to be approximately normally distributed.
5. Explain the following a) Tests of Hypothesis b) Type I and Type II errors find mean and variance of the Chi square
distributions.

MARKOVCHAINS
⎡1 − x x ⎤
Show that the vector (y, x) is a fixed point of the stochastic matrix P= ⎢
1 − y ⎥⎦
1.
⎣ y

⎡1/ 2 1/ 4 1/ 4⎤
2. Find the unique fixed probability vector of the regular stochastic matrix
⎢1/ 2 0 1/ 2⎥
⎢ ⎥
⎢⎣ 0 1 0 ⎥⎦
⎡ 1 o ⎤ (0 ) = (1/ 3,2 / 3) . Define and
3. If P= ⎢ ⎥ is the transition matrix with initial probability distribution p
⎣1/2 1/2⎦
compute.(a) p
(3 ) (b) p (3 ) (c) p (3 )
21 2
4. A salesman’s territory consists of three cities A, B &C. He never sells in the same city on consecutive days. If he sells in a
city A, the next day he sells in city B. However if he sells in either B or C then the next day he is twice as likely to sell it in
city A or in other city. Show that in the long run he sells 40% of the time in the city A, 45% of the time in city B and 15% of
the time in the city C
5. A software engineer goes to his workplace everyday by motorbike or by car. He never goes by bike on 2 consecutive days
but if he goes by car on a day then he is equally likely to go by car or by bike the next day. Find the transition probability
matrix for the chain mode of transport he uses. If car is used on the first day of a week find the probability that after 4 day s
(i) bike is used (ii) car is used.
6. A gambler’s luck follows a pattern. If he wins a game, the probability of winning the next game is 0.6. However if he loses a
game, the probability of losing the next game is 0.7. There is an even chance that he wins the first game. If so,
(a) Find the transition matrix M of the Markov process.
(b) Find the probability that he wins the second game.
(c) Find the probability that he wins the third game.
(d) Find out how often, in the long run, he wins.

7. Define stochastic matrix. Find the unique fixed probability vector for the regular stochastic matrix

0 ¾ ¼
½ ½ 0
0 1 0

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 8
CSE42: GRAPH THEORY & COMBINATORICS
Faculty: No of hours: 52
% of portions covered
Chapter Title/
Class # Topics to be covered
Reference Literature Reference
Cumulative
Chapter
1 Introduction to Graph Theory
2 Basic terminologies – directed & undirected graphs, walks, paths &
circuits
3 Subgraphs and complements
4 Graph isomorphism
5 Chapter 1.1,2,3,4,5,6 Graph Isomorphism
6 Introduction To Graph Vertex degree & regular graphs
7 Theory Konigsberg bridge problem & Euler graphs.
26.9% 26.9%
8 T1: Page 477-546 Hamilton graphs & traveling salesman problem.
9 Inclusive of all exercise Planar graphs – definition & examples.
10 problems Bipartite & Kuratowskis graphs
11 Euler’s formula & detection of planarity
12 Dual of planar graphs
13 Graph coloring: proper coloring & chromatic number of graphs
14 Chromatic polynomial
15 Four color problem
16 Chapter 12.1,2,3,4 Trees: Definition & properties
17 Trees Rooted & binary rooted trees
18 T1: Page 547-579 Ordered trees & tree sorting 7.6% 34.5%
19 (Inclusive of all exercise Weighted trees & prefix codes. Spanning trees
problems )
20 Optimization and Matching
21 Optimization: Dijkstra’s shortest path algorithm
22 Chapter 13.1,2,3,4 Kruskal’s & Prim’s-algorithms for minimal spanning trees
23 Optimization and Matching Kruskals’s & Prim’s-algorithms for minimal spanning trees
24 T1: Page 591-630 Networks: Cutsets 15.3% 49.8%
25 (Inclusive of all exercise Edge & vertex connectivity of a graph.
26 problems ) Max - flow Min- cut theorem and its applications
27 Matching theory
28 Applications of matching.
29 Fundamental principles of Counting:
Chapter 1.1,2,3,4,5,6 The rules of sum and product
30 Fundamental principles of Permutations.
31 counting Combinations: The Binomial theorem 11.5% 61.3%
32 T1:Page 3 – 46 (Solved Combinations with repetition
33 problems only) Ramsey number
34 The Catalan numbers
35 Chapter 5.3 Striling numbers and Bell numbers 2% 63.3%
36 The Principles of Inclusion And Exclusion
37 Generalizations of the principles
Chapter 8.1,2,3,4,5
38 The principles of inclusion The pigeonhole principle
39 and exclusion Derangements – Nothing is in its Right Place 13.4% 76.7%
40 T1: Page 361-386 Rook polynomials
41 (Solved problems only) Rook Polynomials
42 Arrangements with Forbidden positions

43 Generating Functions – Introductory examples


44 Chapters 9.1,2,3,4,5 Definition and examples
45 Generating functions Calculational techniques
11.5% 88.2%
46 T1: Page 387-414 Partitions of integers
47 (Solved problems only) The exponential generating functions
48 The summation operator
49 Recurrence Relations – First order linear recurrence relation,
Chapters 10.1,2,3,4 formulation problems and examples
50 Recurrence relations Second order linear homogeneous recurrence relations with constant
11.5% 100%
T1: Page 415-449 coefficients
51 (Solved problems only) The non homogenous recurrence relations
52 The method of generating functions.

Literature

Book Code Title & Author Publication Info


Type Edition Publisher Year
Text Pearson Education,
T1 Discrete and Combinatorial Mathematics by Ralph. P Grimaldi 4th 2002
book Asia
Text Theory and problems of Combinatorics including concepts of
T2 Mc Graw Hill 1995
book Graph theory by V K Balakrishnan
Referenc Graph Theory with applications to Engineering and Computer
R1 PHI publications 1986
e book Science by Narsingh Deo

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 9
QUESTION BANK

GRAPH THEORY AND COMBINATORICS

GRAPH THEORY
OBJECTIVE:
This chapter deals with the following topics
• Introduction to Graph Theory
• Planar Graphs
• Trees
• Optimization and Matching
Even numbered questions carry 5 marks and odd numbered questions carry 10 marks…

1. Define with an example: (i) Graph (ii) multigraph (iii) pseudograph (iv) simple graph 10
(v) digraph (vi) regular graph (vii) complete graph (viii) bipartite Graph (ix) degree of
vertex (x) adjacent vertices (xi) pendant vertex
2. What is isomorphism of graphs? Check if the following pairs of graph are isomorphic & 05
give reason for your answer.

3. Define with an example : (i) Subgraph of a graph (ii) spanning sub graph (iii) 10
Complement of a graph (iv) Self complementary graph
4. Define with an example: (i) Path (ii) simple path (iii) circuit (iv) a connected graph. 05
5. Explain Dijkstra’s algorithm for finding the shortest path between 2 given vertices in a 10
graph.
6. Define with an example 05
a) Union (b) intersection (c) Ring sum of two graphs
7. Define (a) Decomposition of graph into two sub graphs 10
(b) Deletion of a vertex from a graph
(c) Fusion of two vertices in a graph
Give an example each
8. Discuss the presence or absence of Hamilton circuits and Eulerian circuits in the 05
following graph

b
e
9. Can you say if the following figure can be drawn in one continuous line with out 10
retracing any edge and without lifting the pencil from the paper?

10. Draw a graph that has a Hamiltonian path, which does not have a Hamiltonian circuit. 05
th
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4 Semester CS 10
11. Define (i) An Eulerian path and (ii) A Hamiltonian path, with an example each. 10
12. State and prove the necessary and sufficient condition for an undirected graph to 05
possess and Eulerian path.
13. State Konigsberg bridge problem & prove it using 13 above. 10
14. Prove that there is always a Hamiltonian path in a directed complete graph. 05
15. Explain traveling salesperson problem. 10
16. Explain nearest neighbour method to obtain a Hamiltonian circuit in a graph. 05
17. Define a Planar Graph with an example. 10
State and prove Euler’s formula for a planar graph.
18. (i) Prove that a graph K3.3 is a non-planar (ii) Show that the graph K5 is non planar 05
19. Explain a Geometric dual of a graph. What is self – dual graph? 10
20. Prove that a graph has dual if it is planar. 05
21. Define with an example : (i) tree (ii) leaf (iii) branch node (iv) distance between two 10
vertices
(v) Eccentricity of a graph (vi) Center of a tree (vii) directed tree (viii) rooted tree (ix)
binary tree (x) Spanning tree (xi) minimal spanning tree.
22. Prove that (i) there is one and only one path between every pair of vertices in a tree 05
T.
(ii) if there is one and only one path between every pair of vertices in a graph G, G is
a tree
(iii) a tree with n vertices has (n-1) edges. (iv) a tree with two are more vertices has
atleast two leaves (v) a connected graph with (n-1) edges in a tree (vi) a graph with
n-1 edges that has no circuit is a tree.
23. Explain Kruskal’s algorithm for finding a minimum spanning tree of a graph. 10
24. Use the above algorithm & find a minimum spanning tree for a graph of your own 05
25. What is a prefix code? Use Huffman’s procedure for finding an optimal binary prefix 10
code for the following weights assigning the code word for each weight (i)
5,7,8,15,35,40 (ii) 8,9,12,14,16,19 (iii) 3,4,5,6,12 (iv) 1,2,4,5,6,9,10,12 (v)1, 4,
9,16,25,36,49,64,81,100
26. Define a fundamental system of cutsets and a fundamental system of circuits. 05
27. Define a transport network and a flow in a transport network and explain with an 10
example.
28. Use the labeling procedure to find a maximal flow in the following transport networks: 05
Draw all the networks obtained after each step.
29. Define with an example each: (i) edge connectivity (ii) vertex connectivity (iii) 10
separable graph (iv) 1- isomorphism graph (v) 2 - isomorphism graph (vi) circuit
correspondence.
30. Show that the edge connectivity and vertex connectivity of the graph are both equal 05
to 3.
31. What is the edge connectivity of the complete graph of n vertices? 10
32. Define with an example: (i) incidence matrix (ii) fundamental circuit matrix (iii) cut set 05
matrix (iv) Path matrix (v) adjacency matrix.
33. Define (i) chromatic number (ii) chromatic partitioning of a graph. 10
34. What is a (i) matching (ii) covering of a graph? 05
35. Show that the graph 10

Has only one chromatic partition. What is it?


36. Show that the maximum number of edges in a complete bipartite graph of n vertices 05
is [n2/4]
37. List all types of digraph. Given an example each and draw them. 10
38. Enumerate all non isomorphic graphs on 4 vertices. 05
39. Are five colours sufficient to colour any map? State and prove your version of the 5- 10

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 11
colour theorem
40. Given a set of 6 people prove that there are atleast 3 people who know each other 05
and 3 people who don’t know each other.
41. Define Ramsey number. 10
42. For n> 2 let G = (V,E) be the loop-free undirected graph whzere V is the set of binary 05
n-tuples (of 0’s and 1’s) and E = {{v,w}|v,w Є V and v, w differ in (exactly two
positions}. Find ĸ(G).
43. Give an example of a connected graph G where removing any edge of G results in a 10
disconnected graph.
44. a) If G = (V,E) is an undirected graph with |V|=v, |E|=e, and no loops, prove that 05
2e< v - v.
b) State the corresponding inequality for the case when G is directed.
45. Let G be a loop-free undirected graph on n vertices. If G has 56 edges and its 10
complement has 80 edges, what is n?
46. Find all (loop-free) nonisomorphic undirected graphs with four vertices. How many of 05
thses graphs are connected?
47. For the undirected graph in fig., find and solve a recurrence relation for the number of 10
closed v

v walks of length n > 1.


48. a) How many spanning subgraphs are there for the graph G in Fig.? 05
b) How many are connected spanning subgraphs are there in part (a)?
c) How many of the spanning subgraphs in part (a) have vertex a as an isolated
vertex?

49. If G = (V,E) be a connected undirected graph with |E| = 17 and deg(v) > 3 for all v Є 10
V, what is the maximum value for |V| ?
50. Let G = (V,E) be a connected undirected graph. 05
a) What is the largest possible value for |V| if |E| = 19 and deg(v) > 4 for all v Є V ?
b) Draw a graph to demonstrate each possible case in part (a).
51. Let V = {a, b, c, d, e, f}. Draw three nonisomorphic loop-free undirected graphs G1= 10
(V, E1), G2 = (V, E2 ), and G3 = (V, E3 ) where, in all three graphs, we have deg(a)
= 3, deg(b)=deg(c)=2, and deg(d)=deg(e)=deg(f)=1.
52. For all k Є Z+ where k> 2, prove that there exists a loop-free connected undirected 05
graph G=(V,E) where |V|=2k and deg(v) =3 for all v Є V.
53. Let n Є Z+ with n > 2. How many subgraphs of Kn are isomorphic to the complete 10
bipartite graph K13?
54. Find all the nonisomorphic complete bipartite graphs G = (V,E) where |V| = 6. 05
55. How many nonisomorphic complete bipartite graphs G = (V,E) satisfy |V| = n > 2? 10
56. Characterize the type of graph in which an Euler trail (circuit) is also a Hamilton path 05
(cycle).
57. a) For n > 3, how many different Hamilton cycles are there in the complete graph Kn? 10
b) How many edge-disjoint Hamilton cycles are there in K21?
58. a) Determine P(G, λ) for G = K1,3 . 05
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 12
b) For n Є Z+, what is the chromatic polynomial for K1,n ? What is its chromatic
number?
59. a) Determine whether the graphs in fig. are isomorphic. 10
b) Find P(G, λ) for each graph.

60. a) Show that the graphs G1 and G2, in fig. are isomorphic. 05
b) How many different isomorphisms f: G1 → G2 are possible here?

61. If G = (V,E) is an undirected graph, a subset K of V is called a covering of G if for 10


every edge {a,b} of G either a or b is in K. The set K is a minimal covering if K – {x}
fails to cover G for each x Є K. The number of vertices in a smallest covering is called
the covering number of G.
a) Prove that if I C V, then I is an independent set in G if and only if V – I is a covering
of G.
b) Verify that |V| is the sum of the independence number of G and its covering
number.
62. If G = (V,E) is an undirected graph, a subset D of V is called a dominating set if for all 05
v Є V, either v Є D or vi is adjacent to a vertex in D. If D is a dominating set and no
proper subset of D has this property, then D is called minimal. The size of any
smallest dominating set in G is denoted by γ(G) and is called the domination number
of G.
a) If G has no isolated vertices, prove that if D is a minimal dominating set, then V –
D is a dominating set.
b) If I C V is independent, prove that I is a dominating set if and only if I is maximal
independent.
c) Show that γ(G) < β(G), and that |V|< β(G)χ(G)
63. Consider the four graphs in parts (i), (ii), (iii), and (iv) of fig. If an denotes the number 10
of independent subsets of { x1, x2, … xn, y1, , y2 … , yn }, where n > 1, find and solve a
recurrence relation for an .

(i) (ii) (iii) (iv)


Explain why each of the following polynomials in λ cannot be a chromatic polynomial.
a) λ - 5λ+ 7λ - 6λ + 3
b) 3λ - 4λ + λ
c) λ - 3λ+ 5λ - 4λ
64. If the edges of K6 are painted either red or blue, 05
a) Prove that there is a red triangle or a blue triangle that is a subgraph.
b) Prove that in any group of six people there must be three who are total strangers
to one another or three who are mutual friends.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 13
65. Let T = (V, E) be a tree with |V| = n > 2. How many distinct paths are there (as 10
subgraphs) in T?
66. Find two nonisomorphic spanning trees for the complete bipartite graph K2,3. How 05
many nonisomorphic spanning trees are there for K2,3 ?
67. For the tree shown in fig. list the vertices according to a preorder traversal, an inorder 10
traversal,

a
and a postorder traversal.
68. A code for {a, b, c, d, e} is given by a: 00 b: 01 c: 101 d: x10 e:yz1, where x, y, z Є 05
{0,1}. Determine x, y, and z so that the given code is a prefix code.
69. Construct and optimal prefix code for the symbols a, b, c, … , I, j that occur (in a 10
given sample) with respective frequencies 78, 16, 30, 35, 125, 31, 20, 50, 80, 3.
70. Using the weights 2, 3, 5, 10, 10, show that the height of a Huffman tree for a given 05
set of weights is not unique. How would you modify the algorithm so as to always
produce a Huffman tree of minimal height for the given weights?
71. Let T1 = (V1, E1), T2 = (V2, E2) be two trees where | E1 | = 17 and |V2 | =2|V1|. 10
Determine |V1|, |V2 |, and |E2|.
72. Let G = W4, the wheel on four spokes. Assign the weights 1, 1, 2, 2, 3, 3, 4, 4 to the 05
edges of G so that (a) G has a unique minimal spanning tree; (b) G has more than
one minimal spanning tree.
Let G = (V, E) be a loop-free weighted connected undirected graph with T = (V, E’) a
minimal spanning tree for G. For v, w Є V, is the path from v to w in T a path of
minimum weight in G?
73. If N =(V, E) is a transport network, let F be a flow in N and let (P,P’) be a cut. Prove 10
that the value of the flow f equals c(P,P’) if and only if
a) f(e) = c(e) for each edge e=(x, y), where x Є P, y Є P’, and
b) f(e) =0 for each edge e = (v, w), where v Є P’, w Є P.

FUNDAMENTAL PRINCIPLES OF COUNTING :


OBJECTIVE: This chapter deals with the following topics
• The rules of Sum and Product
• Permutations, Combinations: The Binomial Theorem, Combinations with Repetition
• Ramsey, Catalan , Stirling and Bell numbers

74. The chairs of an auditorium are to be labeled with a letter and a positive integer not 10
exceeding 100 what is the largest number of chairs that can be labeled differently.
75. There are 32 microcomputers in a computer center. Each microcomputer has 24 05
ports. How many different ports to a microcomputer in the center are there?
76. How many one-to-one functions are there from a set with m elements to one with n 10
elements?
77. A student can choose a computer project from one of three lists. The three lists 05
contain 23, 15, 19 possible projects respectively. How many possible projects are
there to choose from?
78. In how many ways can the letters in VISITING be arranged? For these arrangements 10
how many have all three I’s together?
79. How many positive integers n can we form using the digits 3,4,4,5,5,6,7 if we want n 05

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 14
to exceed 5,000,000?
80. In how many ways can 12 different books be distributed among 4 children so that (a) 10
each. Child gets three books? (b) The two oldest children get 4 books each and the
two youngest get two books each?
81. Determine the coefficient of 05
(i) xyz 2 in (x+y+z)4
(ii) xyz 2 in (2x-y-z)4
(iii) xyz-2 in (x-2y+3z-1)4
82. Define the Catalan numbers. 10
83. Let m,n be positive integers with 1< n ≤ m. Prove that S(m+1, n)= S(m, n-1)+ 05
nS(m,n)
84. Determine the number of(staircase) paths in a xy-plane from (2,1) to (7,4), where 10
each such path is made up of individual steps going one unit to the right ® or one
unit upward (U).
85. Buick models come in four models, 12 colors, three engine sizes, and two 05
transmission types. (a) How many distinct Buicks can be manufactured? (b) If one of
the available colors is blue, how many different blue Buicks can be manufactured?
86. Prove the Binomial and Multinomial theorem. 10
87. Show that for all positive integers m and n, n(m+n,m) = (m+1)(m+n,m+1). 05
88. (a)How many nonnegative integer solutions are there to the pair of equations x1 + x2 10
+ x3… + x7 =37, x1 + x2 + x3 =6? (b)How many solutions in part (a) have x1, x2, x3 >
0?
89. (a) Given positive integers m, n with m > n, show that the number of ways to 05
distribute m identical objects into n distinct containers with no container left empty is
C(m-1,m-n) = C(m-1,n-1).
(b) Show that the number of distributions in part (a) where each container holds at
least r objects (m > nr) is C(m-1+(1-r)n, n-1).
90. Verify for that integer n > 1, C(2n,n) – C(2n, n-1) = (n+1) -1 C(2n,n) 10

THE PRINCIPLES OF INCLUSION AND EXCLUSION.


OBJECTIVE: This chapter deals with the following topics
• The Pigeonhole Principle
• Rook Polynomials
• Arrangements with Forbidden Positions

91. How many positive integers not exceeding 1000 are divisible by 7 or 11? 05
92. Give a formula for the number of elements in the union of four sets. 10
93. For which n∈Z+ is φ(n) odd? 05
94. List all the derangements of 1,2,3,4,5 where the first three numbers are 1,2 and 3 in 10
some order.
95. How many permutations of 1,2,3,4,5,6,7 are not derangements? 05
96. Construct or describe a smallest chess board for which r 10 ≠ 0 10
97. Find the rook polynomial for the standard 8 X 8 chessboard. 05
98. Determine the number of positive integers n, 1 < n < 2000, that are 10
a) not divisible by 2, 3, or 5
b) not divisible by 2, 3, or 5 or 7
c) not divisible by 2, 3, or 5, but are divisible by 7
99. Determine the number of positive integers x where x < 9,999,999 and the sum of the 05
digits in x equals 31.
100. In how many ways can Troy select nine marbles from a bag of twelve (identical except 10
for color), where three are red, three blue, three white, and three green?
101. Compute Ф(n) for n equal to a)51 b) 5186 c) 5187 05
102. While at the race track, Ralph bets on each of the ten horses in a race to come in 10
according to how they are favored. In how many ways can they reach the finish line
so that he loses all of his bets?
103. We have a pair of dice; one is red, the other green. We roll these dice six times. What 05
is the probability that we obtain all six values on both the red die and eh green die if
we know that the ordered pairs (1,2), (2,1), (2,5) (3,4), (4,1), (4,5), and (6,6) did
not occur? [Here an ordered pair (a,b) indicates a on the red die and b on the green.]

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 15
GENERATING FUNCTIONS :
OBJECTIVE: This chapter deals with the following topics
• Calculational techniques
• Partitions of integers
• The Exponential Generating function
• The Summation operator

104. How many integer solutions are there for the equation c1 + c2 + c3 + c4 =25 if 0≤ c i 10
for all 1 ≤ I ≤ 4 ?
105. Determine the coefficient of x15 in (x2 +x3 + x4 +…)4 05
106. In how many ways can we select seven non consecutive integers from {1,2,3,…50}? 10
107. Show that the number of partitions of n∈Z+ where no sum m and is divisible by 4 05
equals the number of partitions of n where no even sum and is repeated.
108. Define the exponential generating function. 10
109. Determine the sequence generated by each of the following exponential generating 05
functions.
i) f(x) = 3e3x
ii) f(x) = ex + x2
iii) f(x) = 1/ (1-x)
iv) f(x) =e2x –3x3 + 5x2….+ 7x
110. Find the exponential generating function for the sequence 0! 1!, 2!……, 10
111. Let f(x) be the generating function for the sequence a0, a1,a2,…. For what sequence is 05
(1-x) f(x) the generating function?
112. Find the generating function for the number of integer solutions to the equation c1 + 10
c2 + c3 + c4 = 20 where -3 < c1 , -3 < c2 , -5 < c3 < 5, and 0 < c4.
113. How many integer solutions are there for the equation c1 + c2 + c3 + c4 = 25 if 0 < ci 05
for all 1 < i < 4 ?
114. Find the generating function for pd (n), the number of partitions of a positive integer n 10
int distinct summands.
115. Find the generating function for the number of integer solutions of 05
a) 2w + 3x +5y + 7z =n, 0 < w, x, y, z
b) 2w + 3x +5y + 7z =n, 0 < w, 4 < x, y, 5 < z.
116. A ship carries 48 flags, 12 each of the colors red, white, blue and black. Twelve of 10
these flags are placed on a vertical pole in order to communicate a signal to other
ships.
a) How many of these signals use an even number of blue flags and an odd number of
black flags?
b) How many of the signals have at least three white flags or no white flags at all?
117. A company hires 11 new employees, each of whom is to be assigned to one of four 05
sub-divisions. Each subdivision will get at least one new employee. In how many ways
can these assignments be made?
118. a) Find the exponential generating function for the number of ways to arrange n 10
letters, n > 0, selected from each of the following words.
i) HAWAII
ii) MISSISSIPPI
iii) ISOMORPHISM
b) For section (ii) of part (a), what is the exponential generating function if the
arrangement must contain at least two I’s?
119. Find the exponential generating function for the sequence 0!, 1!, 2!, 3!, ….. 05
120. Find a formula to express 02 +12 + 22 +… n2 as a function of n. 10

RECURRENCE RELATIONS:
OBJECTIVE: This chapter deals with the following topics
• First order Linear Recurrence Relation
• Second order Linear Homogeneous Recurrence Relations with constant coefficients
• The Non- Homogeneous Recurrence Relations

121. Find the general solution for each of the following recurrence relations. 10
a) an+1 –1.5 an =0, n ≥ 0
b) 4an-5an-1 = 0, n ≥ 1
c) 2an-3an-1 =0, n ≥ 1, a4 = 81
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 16
122. Suppose that the number of bacteria in a colony triples every hour 05
a) Set up a recurrence relation for the number of bacteria after n hours have elapsed
b) If 100 bacteria are use to begin a new colony, how many bacteria will be in the
colony in 10 hours?
123. Find an explicit formula for the Fibonacci sequence. 10
124. Prove that any two consecutive Fibonacci numbers are relatively prime 05
125. Solve the following recurrence relations 10
a) an = 5an-1 + 6an-2, n ≥ 2, ao=1, a1=3.
b) an+2 + an = 0, n ≥ 0 , ao=0, a1=3
c) an + 2an-1 + 2an-2 ≠ 0, n ≥ 2, ao=1, a1=3.
126. Solve the following recurrence relations by the method of generating functions 05
a) an+1- an = 3n, n ≥ 0, , ao=1
b) an+1- an = n2 , n ≥ 0, ao=1
c) an+2 - 3 an+1+ 2 an=0, n ≥ 0, ao=1, a1=6
d) an+2- 2 an+1+ an= 2n , n ≥ 0, ao=1, , a1=2
127. The number of bacteria in a culture is 1000 (approx.), and this number increases 10
250% every two hours. Use a recurrence relation to determine the number of bacteria
present after one day.
128. Paul invested the stock profits he recieved 15 years ago in an account that paid 8% 05
interest compounded quarterly. If his account now has $7218.27 in it, what was his
initial investment?
129. Solve the recurrence relation an + an-1 - 6 an-2=0, where n > 2 and a0 = -1, a1 = 8. 10
130. Solve the recurrence relation Fn+2 = Fn+1 + Fn, where n > n > 0 and F0 =0, F1 =1. 05
131. Solve the recurrence relation an = 2(an-1 - an-2 ), where n > 2 and a0 = 1, a1 =2. 10
132. Solve the recurrence relation an - 3an-1 = 5(7n ), where n > 1 and a0 = 2. 05
133. Explain the Tower of Hanoi problem and hence derive the recurrence relation 10
associated with it.
134. Pauline takes out a loan of S dollars that is to be paid back in T periods of time. If r is 05
the interest rate per period for the loan, what ( constant) payment P mush she make
at the end of each period?
135. Solve the following systems of recurrence relations. 10
a) an+1 = -2an - 4bn
b) bn+1 = 4an + 6bn , n > 0, a0 =1, b0 = 0

Marks No of Questions
05 66
10 69
Total 135

NOTES

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 17
CSE 43: ANALYSIS AND DESIGN OF ALGORITHMS

Faculty: No of hours: 52
Chapter Percentage of portions
Title/Reference covered
Class
Literature Topics to be covered
No Reference
Cumulative
Chapter
Introduction
Chapter #1
1 Introduction & Notion of algorithm
Introduction
2 Fundamental of Algorithmic problem
T1 :Page 1 - 39
solving :
3 Important problem types
11.5 % 11.5%
4 Exercises
5 Fundamental data structures : linear
data structures , graphs
6 Fundamental data structures : Trees ,
sets & dictionaries
FUNDAMENTAL OF THE ANALYSIS OF
Chapter #2 ALGORITHM EFFICIENCY
7 Fundamentals of Analysis frame work
8 Analysis of Asymptotic notations and basic
Algorithms efficiency classes
9 T1 :Page 41 - 83 Mathematical analysis of non recursive
algorithms 11.5 % 23.0%
10 Mathematical analysis of recursive
algorithms
11 Exercises
12 Example: Fibonacci numbers
Chapter #3 BRUTE FORCE
13 Brute Force Selection sort & Bubble sort
14 T1 : Page 91- Sequential search & Brute force string
118 5.8 % 28.8%
matching
15 Exhaustive search
16 DIVIDE & CONQUER - Merge sort
Chapter #4
17 Quick sort
Divide &
18 Binary search, Binary tree traversals & related
Conquer properties 7.7 % 38.4%
19 T1 : Page 121- Multiplication of large integers, Strassen’s
151 Matrix multiplication
20 Strassen’s Matrix Multiplication continued.
DECREASE & CONQUER
Chapter #5
21 Insertion sort
Decrease &
22 Depth first search
conquer
23 T1: Page 155-189
Breadth first search
9.6 % 48.0%
24 Topological sorting
25 Algorithms for generating combinatorial
objects
TRANSFORM & CONQUER
Chapter #6
26 Presorting
Transform &
27 Balanced search trees- AVL trees
conquer
28 T1: Page 193-242
2-3 trees
29 Heaps and heap sort 9.6 % 57.7%
30 Problem reduction

SPACE AND TIME TRADE OFF 7.7 % 65.4%


Chapter #7
31 Sorting by counting
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 18
32 Sorting & Time Input enhancement in string matching
Tradeoffs
33 Boyer moore algorithm
T1 :Page 245 -272
34 Hashing
35 DYNAMIC PROGRAMMING
Chapter #8 Computing a binomial coefficient
36 Dynamic Warshall’s algorithm
37
Programming Floyd’s algorithm 7.7 % 73.0%
T1 :Page 275 -300
38 The knapsack problem & memory
functions
GREEDY TECHNIQUE
Chapter #9
39 Prims algorithm
Greedy
40 Kruskal’s algorithm
Technique
41 Disjoint subsets & Union find algorithms 9.6% 82.7%
T1: Page 303 -329
42 Dijkstra’s algorithm
43 Huffman trees
LIMITATIONS OF ALGORITHM POWER
Chapter #10
44 Lower bound algorithms
Limitations of
45 Decision trees
Algorithm Power 7.7 % 90.4%
46 T1: Page 331 -364
P and NP problems
47 NP Complete problems
COPING WITH LIMITATIONS OF
Chapter #11 ALGORITHM POWER
48 Coping with Back tracking
Limitations of
49 Branch and bound 7.7 100%
Algorithm Power
50 T1: Page 368 -384
Approximation for NP hard problems- Traveling
salesman
52 Approximation for the knapsack problem

Literature
Book Code Title & Author Publication Info
Type Edition Publisher Year
Text book T1 Introduction to Design 1st PHI/Pearson 2003
and Analysis of
algorithms by Anany
Levitin
Reference R1 Introduction to 2nd PHI 1998
book Algorithms by Cormen
TH, Leirson C E & Rivest
RL
Reference R2 Computer Algorithms 2nd Galgotia 2001
book by Horowitz E Sahani, Publications
S.Rajashekaran .
Galgotia

Text Book:

1. Introduction to Design and Analysis of algorithms by Anany Levitin, Pearson Education

Reference Books:
1. Introduction to Algorithms by Cormen TH, Leirson C E & Rivest R L, PHI 1998.
2. Computer Algorithms by Horowitz E Sahani, S.Rajashekaran . Galgotia Publications,2001

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 19
QUESTION BANK

INTRODUCTION
OBJECTIVE: Algorithms play the central role in both the science and the practice of computing. There
are compelling reasons to study algorithms. This Unit is broadly divided into four sections. The first
section deals with the notion of algorithm. The second deals with algorithmic problem solving. Several
issues related to the design of and analysis of algorithms is discussed. The third section is devoted to a
few problem types that have proven to be particularly important to the study of algorithms and their
applications. Finally the fourth section contains a review of fundamental data structures.

1. What is an algorithm? 2
2. Explain the Euclids algorithm for compiling GCD. 5
3. Explain the consecutive integer checking algorithm for computing GCD. 5
4. Explain the Sieve’s algorithm for generating the prime numbers. 5
5. Explain the sorting problem. 5
6. Explain the searching problem. 5
7. What is string processing problem? 5
8. Define graph problems. 5
9. What are combinatorial problems? 5
10. What are Geometric and numerical problems? 5
11. What are the various data structures that have proved to be particularly important for 5
computer algorithms?
12. What are the ways in which you can classify algorithms? 5
13. Compare the Euclid’s algorithm and consecutive integer algorithm for computing GCD. 10
14. Explain the various linear data structures. 10
15. Define a graph and the terminologies used in graphs. 10
16. Explain the various graph representations. 10
17. Define tree and the terminologies used in trees. 10
18. What are sets and dictionaries? 10
19. Discuss the sequence of steps one goes through in designing and analyzing an 20
algorithm.

FUNDAMENTALS OF THE ANALYSIS OF ALGORITHM EFFICIENCY


OBJECTIVE: This chapter deals with the analysis of algorithms. It starts with the general framework of
analyzing algorithm efficiency. The three notations O Ω and θ are introduced. These notations have
become the language for discussing algorithm efficiency. The general framework outlined earlier is
then applied to analyzing the efficiency of recursive and non-recursive algorithms.

20. Discuss the time efficiency and space efficiency of an algorithm. 5


21. How does one measure an input’s size? 5
22. How does one measure a running time? 5
23. What is amortized efficiency? 5
24. What are homogenous recurrences? 5
25. Explain the various asymptotic notations with examples. 10*
26. What is the worst, best and average case efficiency of sequential search algorithm? 10
27. What is then general plan for analyzing efficiency of non-recursive algorithms? 10
28. Write an algorithm finding the max element in an array of numbers. Analyze its 10
efficiency?
29. Write an algorithm to check whether all elements in the array are distinct (element 10
uniqueness problem).Analyze its efficiency.
30. Analyze the efficiency of the matrix multiplication problem. 10
31. What is general plan for analyzing efficiency of recursive algorithms? 10
32. Analyze the recursive program for tower of Hanoi problem. 10
33. Analyze the recursive program for computing the factorial of an arbitrary number. 10
34. Analyze the recursive program to find the sum of first n cubes. 10
35. Write an algorithm for computing Fibonacci series. Analyze the algorithm. 10
36. Write the bubble sort algorithm and show that the worst case efficiency is quadratic 10*

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 20
BRUTE FORCE
OBJECTIVE: Brute force is a straightforward approach to solving a problem. This unit discusses the
various brute force algorithms like sorting, searching etc. This unit also discusses exhaustive search,
which is a brute approach to combinatorial problems like knapsack, traveling salesman, assignment
problem.

37. What is meant by a brute force method? Give example. 5


38. Name some of the algorithms that can be solved by brute force method. 5
39. Define exhaustive search. Name the problems that can be solved by exhaustive search 5
method.
40. Explain the selection sort algorithm. Analyze its efficiency. 10
41. Explain bubble sort algorithm. Analyze its efficiency. 10
42. Write an algorithm for sequential search. Determine its worst case, best case & 10
average case efficiency.
43. Explain the algorithm for brute force string matching. Determine its worst case, best 10
case & average case efficiency.
44. Explain the traveling salesman problem with a brute force solution. How can it be 10
improved?
45. Explain the knapsack problem. 10
46. Explain the assignment problem. 10
47. Outline exhaustive search algorithm for traveling salesman problem. What is the 10*
efficiency class of this algorithm? Illustrate with an example.

DIVIDE AND CONQUER


OBJECTIVE: Divide and conquer is probably the best known general algorithm design technique. Quite
a few very efficient algorithms are specific implantations of this general strategy. These unit discusses
and analyzes the various divide and conquer algorithms like merge sort, quick sort, binary search and
Strassen’s matrix multiplication

48. Determine the efficiency of divide and conquer algorithms. 5


49. Analyze the merge sort algorithm. 5
50. How quick sort can be improved? 5
51. Discuss the efficiency of binary search algorithm. 5
52. Write an algorithm for leaf count. 5
53. Explain the divide and conquer strategy with examples. 10
54. Explain the merge sort algorithm with example. 10
55. Write a pseudo code for divide & conquer algorithm for finding the position of the 10
largest element in an array of numbers.
56. Explain the quick sort algorithm with an example. What is the pivot element? 10
57. Discuss the efficiency of quick sort algorithm. 10
58. Explain the binary search algorithm with an example. 10
59. Explain a recursive algorithm to compute the height of a binary tree. 10
60. Explain the multiplication of large integers using divide and conquer. 10
61. Explain Strassen’s matrix multiplication. 10
62. Apply Strassen’s algorithm to compute the multiplication of the following matrix 20
instance. Exit the recursion when n=2.

1 0 2 1 0 1 0 1
4 1 1 0 2 1 0 4
0 1 3 0 2 0 1 1
5 0 2 1 1 3 5 0

DECREASE AND CONQUER


OBJECTIVE: Decrease and conquer technique is based on exploiting the relationship between a
solution to a given instance of a problem and a solution to a smaller instance of the same problem.
Once such relationship is established, it can be exploited either top down or bottom up. This unit
discusses the three major variations of decrease and conquers namely a) decrease by a constant b)
decrease by constant factor c) variable size decrease and also the examples associated with them.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 21
63. Explain the insertion sort algorithm. 5
64. Define a) digraph b) directed acyclic graph. 5
65. What is topological sorting? 5*
66. What is efficiency of DFS based algorithm for topological sorting? 5*
67. Explain the decrease and conquer strategy and its variations. 10
68. Analyze the insertion sort algorithm for the worst case, average case and the best case. 10
69. Sort the following by insertion sort algorithm 10
71, 85, 99, 21, 67, 87, 47, 35, 13.
70. Explain the DFS algorithm. 10*
71. Explain the efficiency of DFS Algorithm. 10*
72. What are the different applications of DFS? 10
73. Explain the BFS algorithm. 10
74. What is the efficiency of BFS? 10
75. What are the applications of BFS? 10
76. Compare BFS with respect to data structure used and efficiency. 10
77. Consider the graph with the following adjacency matrix with the vertices labeled from a 10
to g

⎡0110000⎤
⎢1001000 ⎥
⎢ ⎥
⎢1000001 ⎥
⎢ ⎥
⎢1100010 ⎥
⎢1000001 ⎥
⎢ ⎥
⎢0101000⎥
⎢0010100⎥
⎣ ⎦
Write down the adjacency linked list specifying this graph.
78. Starring at vertex a, traverse the graph by dfs and construct the corresponding DFS 10
tree.
79. Traverse the above graph by BFS and construct the corresponding BFS tree, start the 10
traversal at a.
80. Explain how we can identify connected components of a graph by using a)DFS b)BFS. 10
81. Write a program which for a given graph outputs a) Vertices of each connected 10
component b) Its cycle.
82. Explain the algorithm to solve topological sorting problem using DFS. 10
83. Explain the algorithm to solve topological sorting problem by decrease and conquer 10
technique.
84. Apply DFS based algorithm to solve topological sorting problem for the following 10*
digraphs with the adjacency matrices given below. The vertices are labeled from a to g
⎡0110000⎤ ⎡0100000⎤
⎢0000101⎥ ⎢0010000⎥
⎢ ⎥ ⎢ ⎥
⎢0000010⎥ ⎢0001000⎥
⎢ ⎥ ⎢ ⎥
⎢1110011 ⎥ ⎢0000001⎥
⎢0000000⎥ ⎢1000000 ⎥
⎢ ⎥ ⎢ ⎥
⎢0000000⎥ ⎢0110101⎥
⎢0000100⎥ ⎢0000100⎥
⎣ ⎦ ⎣ ⎦
85. Explain the Johnson-Trotter algorithm for generating permutations. What is the minimal 10
change requirement?
86. Explain the generating of subsets. Give a direct implementation. 10

TRANSFER AND CONQUER


OBJECTIVE: This unit deals with a group of design methods that are based on the idea of
transformation. This technique is called transform and conquer because these methods work in two
stages. First, in the transformation stage, the problem’s instance is modified to be more amenable to
solution. Then in the second stage, or the conquering stage it is solved. Some of the examples
discussed here are presorting, balanced search trees, heaps and heap sort.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 22
87. What is the efficiency of element uniqueness algorithm? 5
88. What is the efficiency of algorithm to compute a mode? 5
89. What you mean by a balanced search tree? 5
90. What are the various balanced search trees? 5
91. What is the efficiency of AVL trees? 5
92. What are 2-3 trees? 5*
93. What is the efficiency of 2-3 tree? 5
94. Define a heap. 5
95. List out important properties of heap. 5
96. What is the efficiency of bottom up heap construction algorithm? 5
97. What do you mean by problem reduction? 5
98. How do you solve optimization problems? 5
99. What is linear programming? 5
100. Explain the transform and conquer strategy and what are its variations. 10
101. What is presorting. Explain the algorithm to check element uniqueness in an array. 10
102. Explain the algorithm to compute a mode. 10
103. What is an AVL tree? Explain single right rotation and single left rotation with an 10
example?
104. Explain the double left right rotation and double right left rotation of AVL tree with an 10
example.
105. Construct an AVL tree for 5,6,8,3,2,4,7. 10
106. Construct a 2-3 tree for the list 9,5,8,3,2,4,7. 10
107. Explain bottom up heap construction algorithm for constructing a heap for a given list of 10
keys -2, 9, 7,6,5,8.
108. Explain the top down heap construction algorithm. 10*
109. Sort 2, 9, 7, 6, 5, 8. by heap sort. 10
110. What is simplex method? What are the drawbacks of simplex method and Karmakar’s 10
algorithm?
111. How a knapsack problem is reduced to a linear programming problem? 10
112. What is a state space graph? Where it is used? 10
113. What is a heap? Outline an algorithm for construction of a heap. Derive the efficiency 10*
class of this algorithm
115 What are 2-3 trees? Explain search , insertion and deletion operations and show the 10*
efficiency in worst and the average case
116 Design a O(n2) algorithm for finding an optimal binary search tree ? 10*

SPACE AND TIME TRADEOFFS


OBJECTIVE: space and time tradeoffs in algorithm design are a well known issue for both
theoreticians and practitioners of computing. This unit discusses an approach to problem solving called
input enhancement and examines the algorithms like counting method for sorting, Boyer Moore
algorithm for string matching. It also discusses the other approach called presorting and this approach
is illustrated by hashing and indexing with B-trees.

117. What is pre structuring approach? 2


118. What is distributed counting? 2
119. What is input enhancement approach? What algorithms are based on this approach? 5
120. What is hashing? What are different types of hashing? 5
121. Explain the comparison counting algorithm. What is the efficiency of this algorithm? 10
122. Explain the distributed counting algorithm. What is the efficiency of this algorithm? 10
123. Sort the following list in alphabetical order by distributing counting algorithm b, c, d, c, 10
b, a, a, b.
124. Explain the algorithm for computing the shift table entries. 10
125. Explain the harpool’s algorithm. 10
126. Explain the Bayer moore algorithm. 10
127. Apply horspool’s algorithm to search for the pattern BAOBAB in the BESS-KNEW- 10
ABOUT-BAOBABS.
128. Explain the open hashing method. 10
129. Explain the closed hashing. 10
130. Consider the problem of searching for genes in DNA sequence using horspool’s 20
algorithm, A DNA sequence is represented by a text on the alphabet {A,C,G,T} & the
gene or the gene segment is the pattern.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 23
a) construct the shift table for the following gene segment of your chromosome 10
TCCTATTCTT
b) Apply Horspool’s algorithm to locate the pattern in the following DNA sequence
TTATAGATCTCTCGTATTCTTTTATAGATCTCCTATTCTT
131. How many character comparisons would Bayer moore algorithm make in searching for 20
each of the following patterns in the binary text of 1000 zeros?
a) 00001 b)10000 c) 01010
132. For the input 30, 20, 56, 75, 31, 19 and the hash function h(k) = k mod 11 20
a) Construct the open hash table.
b) Find the largest and the average number of comparisons in a successful search
in this table.

DYNAMIC PROGRAMMING
OBJECTIVE: Dynamic programming is a technique for solving problems with overlapping sub
problems. These sub problems arise from a recurrence relation relating a solution to a given problem
with solutions to its smaller sub problems of the same type. Rather than solving overlapping sub
problems again and again, dynamic programming suggests solving each of the smaller sub problems
only once and recording the results in a table from which we can then obtain a solution to the original
problem. Some of the algorithms discussed here are computing a binomial coefficient, Warshall’s
algorithm, Flyod’s algorithm, Knapsack problem.

133. Define transitive closure of a directed graph. 2


134. Explain the dynamic programming design technique. 5
135. What is the efficiency of binomial coefficient algorithm? 5*
136. Compare divide and conquer strategy with dynamic programming. 5
137. What is the efficiency of Warshall’s algorithm? 5
138. What is the time and space efficiency of the algorithm for knapsack problem? 5
139. Explain the algorithm to find binomial coefficient. 10
140. Explain the Warshall’s algorithm with an example. 10
141. Explain Floyd’s algorithm for all pairs shortest problem. 10
142. Solve the all pairs shortest path problem for the digraph with the weight matrix given 10
below.
⎡02∞18 ⎤
⎢6032∞ ⎥
⎢ ⎥
⎢∞∞04∞ ⎥
⎢ ⎥
⎢∞∞ 203 ⎥
⎢⎣3∞∞∞ 0 ⎥⎦

143. Apply Warshall’s algorithm to find transitive closure of the digraphs defined by the 10
following adjacency matrix.
⎡0100⎤
⎢0010⎥
⎢ ⎥
⎢0001⎥
⎢ ⎥
⎣0000⎦

144. Explain the knapsack problem with a example. 10


145. Explain the algorithm for knapsack that uses memory function. 10
146. Apply the bottom up dynamic programming algorithm to the following instance of the 10
knapsack problem.
Item 1 2 3 4 5
Weight 3 2 1 4 5
Value 25 20 15 40 50

Capacity w=6
147. Apply the memory function to the instance of the above problem 10
148. Describe an algorithm with an example to compute binomial coefficient and derive its 10*
time efficiency.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 24
GREEDY TECHNIQUE
OBJECTIVE: The greedy technique approach suggests constructing a solution through a sequence of
steps, each expanding a partially constructed solution obtained so far, until a complete solution to the
problem is reached. This chapter discusses algorithms that use this technique. Some of them are Prims
and Kruskal’s algorithm to find minimum spanning tree. Dijkstra’s algorithm for the shortest path
problem. Huffman trees and their applications, Huffman codes.

149. Define a spanning tree. 2


150. What is the time efficiency of Dijkstra’s algorithm? 5
151. What is Huffman’s tree and Huffman’s code? 5
152. What are decision trees? How are they useful? 5
153. Solve the following instances of the single source shortest path problem with vertex a 10
as the source vertex. The graph is given as the following adjacency matrix. He vertices
are labeled from a to e.

⎡00010⎤
⎢10100 ⎥
⎢ ⎥
⎢00001⎥
⎢ ⎥
⎢01100⎥
⎢⎣10000 ⎥⎦

154. Explain the working phenomenon of greedy technique. 10


155. Explain the prims algorithm to generate MST. 10
156. Explain the Kruskal’s algorithm to generate MST. 10*
157. Apply prims algorithm to generate MST to the following graph. The graph is represented 10
as the weight matrix given below. The vertices are labeled form a to e.
⎡05060⎤
⎢50130 ⎥
⎢ ⎥
⎢01046⎥
⎢ ⎥
⎢63420⎥
⎢⎣00620⎥⎦
158. Apply Kruskal’s algorithm to generate MST to the following graph. The graph is 10*
represented as the weight matrix given below. The vertices are labeled form a to e.
⎡05702 ⎤
⎢05063 ⎥
⎢ ⎥
⎢70044 ⎥
⎢ ⎥
⎢06405 ⎥
⎢⎣23450⎥⎦

159. What is the efficiency of Kruskal’s and prims algorithm? 10*


160. Explain how find operation of Kruskal’s algorithm is implemented. 10
161. Explain how union operation of Kruskal’s algorithm is implemented. 10
162. Explain the Dijkstra’s algorithm to implement the single source shortest path problem. 10
163. Explain the Huffman’s algorithm. 10
164. Construct a Huffman tree for the following problem. 10

Character A B C D -
Probability 0.35 0.1 0.2 0.2 0.15

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 25
165. Apply prims and Kruskal’s algorithm to generate MST for the following graph. The graph 20
is represented as the weight matrix given below. The vertices are labeled form a to j.

⎡0354000000⎤
⎢3000360000 ⎥
⎢ ⎥
⎢5002004000 ⎥
⎢ ⎥
⎢4020100500⎥
⎢0301020040⎥
⎢ ⎥
⎢0600200005⎥
⎢0040000300⎥
⎢ ⎥
⎢0005003060⎥
⎢0000400603⎥
⎢ ⎥
⎢⎣0000050030⎥⎦

166. Construct a Huffman code for the following data 20

Character A B C D -
Probability 0.4 0.1 0.2 0.15 0.15

Encode the text ABACABAD using the code.


Decode the text whose encoding is 100010111001010

LIMITATIONS OF ALGORITHM POWER


OBJECTIVE: This unit deals with the fair assessment of the algorithms as problem solving tool. It
starts with the methods for obtaining lower bounds i.e estimates on a minimum amount of work
needed to solve a problem. The next section deals with decision trees. This technique allows us to
establish lower bounds on efficiency of comparison based algorithms for sorting and for searching in
sorted arrays. This unit also discusses about P NP and NP Complete problems.

167. Explain briefly the limits of algorithm power. 5


168. What are information theoretic arguments? 5
169. Obtain a decision tree for finding minimum of 3 numbers. 5
170. What do you mean by lower bound of an algorithm? 10
171. How do you obtain a lower bound of an algorithm? 10
172. Explain the adversary method for establishing lower bounds. 10
173. How is problem reduction method used in finding the limits of algorithm? 10
174. Find the product of matrices A & B through a transformation to a product of 2 10
symmetric matrices if

⎡1 − 1⎤ ⎡01 ⎤
A= ⎢ ⎥ and B= ⎢ ⎥
⎣23 ⎦ ⎣− 12⎦
175. How are decision trees used in judging the performance of an algorithm? 10
176. Obtain a decision tree for selection sort. 10
177. Obtain a decision tree for searching a sorted array. 10
178. What are P and NP problems? Give examples. 10*
179. What are NP problems? Give Examples. 10*

COPING WITH LIMITATIONS OF ALGORITHMIC POWER


OBJECTIVE: Many problems are different to solve algorithmically, This chapter outlines several ways
of dealings with such difficult problems . It introduces two algorithm design techniques back tracking
and branch & bound. Algorithms that solve problems approximately but fast are also discussed here.
Solutions to knapsack and TSP are also dealt here.
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 26
180. What is the method of backtracking? 5
181. State the general backtracking algorithm. 5
182. What is the method of branch & bound? 5
183. Explain the N-Queens problem. 10
184. Exp0lain the Hamiltonian circuit problem. 10
185. Explain the subset problem for s={3,6,7,}and d=15 10
186. Apply backtracking to the problem of finding a Hamiltonian circuit in the following graph 10
with adjacency matrix given below. The vertices are labeled from a to g
⎡0111010⎤
⎢1001101 ⎥
⎢ ⎥
⎢1000010 ⎥
⎢ ⎥
⎢1100011 ⎥
⎢0100001⎥
⎢ ⎥
⎢1011001 ⎥
⎢0101110⎥
⎣ ⎦

187. Explain the assignment problem. 10


188. Explain the knapsack problem using branch & bound technique with an example. 10
189. Explain the traveling salesman problem using branch & bound with an example. 10
190. Apply the branch & bound algorithm to solve the TSP for the following graph given the 10
cost adjacency matrix.
⎡0257⎤
⎢2083⎥
⎢ ⎥
⎢5801 ⎥
⎢ ⎥
⎣7310⎦

191. Explain the approximation algorithm for TSP. 10


192. Apply the twice around the tree algorithm for the following graph for solving TSP 10*
⎡0136⎤
⎢1023 ⎥
⎢ ⎥
⎢3201⎥
⎢ ⎥
⎣6310⎦

193. Explain the greedy algorithm for the discrete knapsack problem with an example. 10
194. Explain the greedy algorithm for the continuous knapsack problem with an example. 10
195. Apply the nearest neighbor algorithm to the instance defined by the distance matrix 10
given above. Start the algorithm at the first city. Assuming the cities is numbered from
1 to 4.

196. Solve the following instance of the knapsack problem by the branch & bound algorithm. 10

Item 1 2 3 4
Weight 10 7 8 4
Value 100 63 56 12

W=16

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 27
197. Apply the nearest neighbor algorithm for the following graph for solving TSP 10

⎡0564⎤
⎢5036 ⎥
⎢ ⎥
⎢6301⎥
⎢ ⎥
⎣4610⎦

Marks No of Questions
2 005
5 057
10 128
20 007
Total 197

NOTES

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 28
CSE44 : FINITE AUTOMATA & FORMAL LANGUAGES

Faculty: No of hours: 52
Chapter % of portions covered
Class # Title/Reference Topics to be covered
Reference
Literature Cumulative
chapter
Introduction to Finite Automata
1 Introduction to subject, overview of syllabus, pre-requisites for
studying the subject
Chapter #:1
2 Mathematical preliminaries & notation
Introduction
3 Three basic concepts
T1: Page#1-5, 18% 18%
4 28-81 Some applications
5 R2: Page#1-62 Finite Automata & Deterministic Finite Acceptors (DFA)
6 Non-deterministic Finite Acceptors (NFA)
7 Equivalence of DFA & NFA
8,9 Reduction of number of states in Finite Automata
Regular Expressions & Languages, Properties of Regular
10,11 Chapter #:2 Languages
Regular
12,13 Connection between Regular Expression and Regular Languages
Expressions
14 Applications of Regular Expressions 18% 37%
T1: Page#83-113,
15 Closure properties of Regular Languages
125-167
16 R2: Page# 71-124 Decision properties of Regular Languages
17,18 Equivalence and minimization of Automata
19 Chapter #:3 Context Free Grammars and Programming Languages
20,21,22 Context Free Parse trees
23,24 Grammars & Applications of Context-Free Grammars 12% 49%
Languages
25,26 T1: Page#169-217 Ambiguity in Grammars and Languages
R2: Page#125-148
27 Chapter #:4 Pushdown Automata
28,29 Pushdown Non-deterministic pushdown automata
30,31 Automata The languages of a PDA 15% 64%
32,33 T1: Page#219-253 Pushdown Automata & Context Free Languages (CFL)
34,35 R2: Page#175-203 Deterministic Pushdown Automata & Deterministic CFL
36 Chapter #:5 Properties of Context-Free languages
37 Properties of Normal forms for Context-Free Languages CFL
38 Context-Free The pumping lemma for CFL
languages 11% 75%
T1: Page#255-293
39 Closure properties of CFL
R2: Page#149-
171, 205-220
40 Introduction to Turing Machines
41,42 Chapter #:6 The standard Turing Machine
43,44 Introduction to Programming techniques for Turing Machine
45,46 Turing Machines Turing Machines with more complex storage 14% 89%
T1: Page#307-366 Minor variations on the Turing Machine theme, , Non-
47 R2: Page#221-247 Deterministic Turing Machine
48 Turing Machines and Computers
49 Chapter #:7 Undecidability
49 Undecidability Recursively Enumerable Languages
50 T1: Page# 367- Recursive Languages 11% 100%
51 382, 392-394, Post’s correspondence problem
403-411
52 R1: Page#319-333 Other Undecidable problems

Literature:

Publication specification
Book type Code Title and Author
Edition Publication Year
Introduction to automata theory, languages and
Text Book T1 2nd Pearson Education 2001
Computation by JP Hpocroft, R Motwani, JD Ullman.
Introduction to languages and the theory of
Reference Book R1 TMH 2003
Computation by John Martin
An Introduction to formal languages and automata
Reference Book R2 3rd Narosa publishing 2002
by Peter Linz

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 29
QUESTION BANK

INTRODUCTION TO THEORY OF COMPUTATION AND FINITE AUTOMATA


OBJECTIVE: This chapter introduces automata theory, finite automata, and the class of languages
known as “regular languages.” These languages are the ones that can be described by finite automata.
• Automata theory: Automata theory is the study of abstract computing devices or “machines.”
• Finite automata: Finite Automata are a useful model for many important kinds of hardware
and software.

1. Define a) Symbol or element b) Alphabet c) String (w, u, v) d) Concatenation or strings 10


e) Reverse of string f) length of string g) substring, prefix, suffix of a string
h) wn i) ∑* j) ∑+
2. Define a) Language (L) b) Sentence c) Complement (L’) d) LR e) L1.L2 f) Ln g) L* h) L 10
3. Prove by induction |uv| = |u| + |v| 5*
4. Use induction on the size of S to show that if S is a finite set |2s| = 2|s| 4
Give the grammar that generates the language.
5. L = {an bn+1 : n ≥ 0} Derive the string “aaabbbb” from the grammar 5
6. Given the following grammars and corresponding languages, show that the language is 5*
indeed generated by the grammar.
G = ({s}, {a,b}, S, {s -> aSb, S -> λ})
L(G) = {anbn : n ≥ 0}
G = ({s}, {a,b}, S, {S -> SS, S -> λ, S -> aSb, S -> bSa})
L(G) = {w : na (w) = nb(w) }
7. Define equivalency of grammars. 5*
8. Explain different units of automata. Explain the terms 1) Configuration 2) Move 6
3) Transition functions
9. Give a simple description of the language generated by the grammar with productions 6
s->aA, A -> bS, S-> λ
10. Define acceptors & Transducers. 6
11. Write a note on applications of formal languages and automata. 6
12. Explain the operation of a Deterministic Finite Acceptor (DFA) with a diagram. 5*
13. Give the formal definition of DFA? Explain transition graph? Give an example. 5*
14. Define extended transition function (δ)? Define transition table. 5
15. Define language accepted by DFA? 5*
16. Derive the DFA that accepts the language L = {anb : n >=0} 6
17. Let M = (Q, ∑, δ, qo, F) be a DFA. Let Gm be its associated transition graph. Then prove 10
that for every qi, qj ε Q and w ε ∑+, δ*(qi,w) = qj if and only if there is in Gm a walk with
label w from qi to qj
18. Find the DFA that recognizes the set of all string on ∑ = {a,b} starting with the prefix “ab” 5*
19. Find the DFA that accepts all strings on alphabet {0,1} except those containing substring 5
001
20. Define a regular language. 4
21. Show that the language L = {awa : wε{a,b}*} is regular ? Also show that L2 is regular? 6
22. Define the transition table, transition diagram, transition function DFA. 12
Which accepts strings which have odd number of a’s and b’s over the alphabet {a,b}
Which accepts strings which have even number of a’s and b’s over the alphabet {a,b}
Which accepts all strings ending in 00 over {0,1}
Which accepts all strings having 3 consecutive zeros
Which accepts all strings having 5 consecutive zeros
Which accepts all strings having even number of symbols
23. What language does grammar with these productions generate? S-> Aa, A-> B, B-> Aa 5
24. Prove that (L1L2)R = L2RL 5
25. Give the formal definition of NFA. 5
26. Distinguish between NFA & DFA. 5
27. Define extended transition function for NFA. 5
28. Define language accepted by a NFA. 5
29. Define dead configuration in case of NFA. 5
30. What are the advantages of non-determinism? 5
31. Are the two grammars with respective productions 8
S-> aSb|ab|λ, and S-> aAb|ab, A->aAb|λ, equivalent? Assume that S is a start symbol in
both cases.
32. Construct a DFA and NFA to accept all string in {a,b} such that every “a” has one “b” 5
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 30
immediately to its right?
33. Define the equivalence between two finite acceptors? 5
34. Give DFA & NFA which accepts the language {(10)n : n ≥ 0} 5
35. Prove the equivalence between DFA & NFA OR 10
Let L be the language accepted by NFA MN = (QN, ∑,δN, QN, FN). Then prove that there
exists a deterministic finite acceptor MD = (QD,∑D,δD,QD,FD) such that L = L(Md).
36. Convert the following NFA to DFA 10*
37. Draw NFA for transition table given below : 10*
Input
States a b
q0 {q0,q1) {q2}
q1 {q0} {q1}
q2 -- {q0,q1}
38. Define distinguishable and indistinguishable states. 5
39. Give the procedure to reduce number of states in DFA. 5
40. Reduce the number of states in DFA. 10*

REGULAR LANGUAGES, REGULAR GRAMMARS, PROPERTIES OF


REGULAR LANGUAGES
OBJECTIVE: This chapter introduces the notation called “regular expressions” and how they
are capable of defining regular languages.
• Regular expressions: Regular expressions are a type of language defining notation.
They are closely related to nondeterministic finite automata.
41. Give the formal definition of a regular expression with example. 6*
42. How is language L® denoted by regular expression “R” defined? Give examples. 6*
43. Give the set of notation of language L® denoted by regular expressions given below 8
a) a* . (a+b)
b) (a+b) * (a+bb)
c) (aa)* (bb)* b
44. For ∑ = {0,1}, give a regular expression “ ” such that 6*
L(r) = { wε ∑* : w has at least one pair of consecutive zeros}
45. Find all strings in L ((a+b)*b(a+ab)*) of length less that four. 4
46. Show that r = (1+01)*(0+1*) denotes that language L = (w {0, 1)*: w has no pair of 6*
consecutive zeros). Find the other two expressions.
47. Give the set and explain in English the sets denoted by following regular expressions 10
a) (11+0)(00+1)
b) (1+01+001)(0+00)
c) (0+1)00(0+1)
d) 00 11 22
48. Show that the automation generated by procedure reduces is deterministic. 5
49. Prove the following : 6*
If the states qa and qb are indistinguishable, and if qc and qa are distinguishable, then qb,
qc must be indistinguishable.
50. Let r be a regular expression. Then prove that there is some NFA that accepts L(r) & 8
hence L(r) is a regular language.
51. Write the NFA which accepts L(r) where r = (a+bb)*(ba* + λ)
52. Let L be a regular language i.e., there is a NFA that accepts L. Then prove that there 5
exists a regular expression “r” such that L = L(R)
53. Explain generalized transition graphs & how they are used for writing regular expression 6
denoting same language as given NFA.
54. Given the below NFA, write the corresponding regular expression using generalized 6
transition graphs
55. Define regular grammar with example. 4*
56. Denote the regular languages defined by the following grammar as regular expressions 10
a) G1 = ( {S}, {a,b}, S, {S-> abS|a})
b) G2 = ( {S,S1,S2}, {a,b},S,{S->S1ab, S1->S1ab|S2, S2->a})
57. Define a linear grammar. 4
58. Prove that “Language generated by a right linear grammar is a regular language” 6*
59. Construct the finite automaton that accepts the language generated by grammar 6*
({V0, V1}, {a,b}, {V0}, {V0 -> aV1, V1-> abV0|b})
60. Write a NFA & right linear grammar for L(aab*a) 5
61. Prove that “A language L is regular if and only if there exists a left linear grammar G such 5
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 31
that L = L(G)”.
62. Prove that “A language L is regular if and only if there exists a regular grammar G such 5
that L = L(G)”.
63. Show that the family of regular languages is closed under following operations 10*
a) union b) intersection c) concatenation d) complementation e) star-closure
f) difference g) reversal
64. Let h be a homomorphism & L a regular language. Then prove that homomorphic image 6
h(L) is also regular.
65. If L1 & L2 are regular languages, then prove that L1/L2 is also regular 6*
L1/L2 = right quotient of L1 with L2 = {x:xy ε L1 for some y ε L2}
66. Given a standard representation of any regular language L on ε 8
a) prove that there exists an algorithm for determining whether or not any w ε ∑*
is in L
b) Prove that there exists an algorithm for determining whether L is empty, finite
or infinite
67. Given standard representations of two regular languages L1 & L2, prove that there is an 8
algorithm to determine whether or not L1 = L2
68. Prove that the language L = {an bn : n ≥0} is not regular using pigeonhole principle 8
69. State and prove pumping lemma for regular languages? What is the application of 6*
pumping lemma?
70. Using pumping lemma, prove that following languages are not regular : 14
a) L = {anbn : n≥ 0}
b) L = {wwr : w ε ∑*} ∑ = {a,b}
c) L = {w ε ∑* : na(w) < nb(w)} ∑ = {a,b}
d) L = { (ab)nak : n > k, K ≥ 0}
e) L = { an! : n ≥ 0}
f) L = { anbkcn+k : n ≥ 0, k ≥0}
g) L = { anb1 : n ≠ 1}
71. Give the regular expression for the following languages on ∑ = {a,b,c} 10*
a) all strings containing exactly one a
b) all strings containing no more than three a’s
c) all strings which contain at least one occurrence of each symbol in ∑

CONTEXT FREE GRAMMMARS AND LANGUAGES.


OBJECTIVE: This chapter introduces context-free grammar notation, parse tree and shows
how grammars define languages.
• Context-free grammar: context-free grammars have played a central role in computer
technology since the 1960’s. More recently context-free grammar has been used to
describe document formats that are used in XML for information exchange on the web.
• Parse tree: A picture of the structure that a grammar places on the strings of its
language. The parse tree is the output of a parser for a programming language and is
the way that the structure of programs is normally captured.
72. Define context free grammars formally. Give some examples. 6*
73. Write CFG which generates the following CFL’s 10*
a) L(G) = {wwr : w ε ∑* } ∑ = {a,b}
b) L(G) = { ab (bbaa)n bba (ba)n : n ≥ o}
c) L = {anbm : n ≠ m}
d) L = {w ε {a,b}* : na(w) = nb(b) and na(v) ≥ nb(v) where v is any prefix of
w}
e) L = { a2nbm : n ≥ 0 ≥ 0}
74. Define leftmost and rightmost derivation with example 4*
75. Define derivation tree, partial derivation tree, and yield. 4*
76. Let G = (V, T, S, P) be a CFG. Then prove that for every w ε l(G), there exists a derivation 6*
tree of G whose yield is w.
77. Prove that yield of any derivation tree is in L (G), where G is a CFG. 6*
78. Prove that is TG is any partial derivation tree for G whose root is labeled S, then the yield 6
of TG is sentential form of G.
79. Define parsing 4
80. Explain exhaustive search parsing? What is the serious flaw in using exhaustive search 6
parsing?
81. Given a CFG & a string w, prove that exhaustive search parsing method either produces a 6
th
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4 Semester CS 32
parse of w or tells us that no parsing is possible, if P has no rules of form A -> λ or
A -> B?
82. Define simple grammar or s-grammar? What are its applications? 4
83. Define a ambiguous CFG 4
84. Show that the following grammars are ambiguous 6*
a) ({S}, {a,b}, S, {S->aSb|SS|λ})
b) ({E,I}, {a b c +*()}, E, {
E -> I
E -> E + E,
E -> E * E,
E -> (E),
I -> a|b|c
})
Write equivalent unambiguous grammar.
85. Define inherently ambiguous language and give an example. 4
86. Explain the use of CFG in definition of PL. 4
87. What is a normal form & why is it required? 4
88. Prove the substitution rule of context free grammar. 4
89. Define a useful / useless variable. Define a useless production. Explain two cases when a 10*
variable become useless.
90. Eliminate useless symbols and productions from the following grammar 6
a) G = (V,T,P,S) = ({S,A}, {a,b}, {S-> aSb|λ|A, A->aA}, S)
b) G = (V,T,P,S) = ({S,A,B}, {a,b}, {S->A, A-> aA|λ b->bA}, S)
91. Explain dependency graph & its applications in CFG. 5
92. Let G = (V,T,P,S) be a CFG. Then prove that there exists an equivalent grammar G1 = (V1, 5
T1, S, P1) that does not contain any useless variables or productions.
93. Define λ-productions and nullable variable. When can be a λ-production removed from the 6*
grammar?
94. Eliminate λ-production from the following grammar : G = (V,T,,P,S) = ({S,S1}, {a,b}, 10
{S->As1b, S1-> aS1b|λ},S)
95. Let G be any context free grammar with λ not in L(G). Then prove that there exists an 10
equivalent grammar G1 having no λ-productions?
96. Find the CFG without λ-production equivalent to grammar defined by the following 10
productions
S-> AbaC, A -> BC, B -> b|λ, C -> D|λ, D->d
97. Define unit production. 4
98. Let G = (V, T, S, P) be any CFG without λ productions. Then prove that there exists a CFG 6
G1 = (V1, T1, S, P1) that does not have any unit productions and that is equivalent to G
99. Remove all unit productions from S->Aa|B, B->A|bb, A-> a|bc|B 8
100. Define CNF of a CFG 6
101. Let G = (V, T, S, P) be a CFG with λ L(G). Then prove that there exists a equivalent 8
grammar G1 = (V1, T1, s, p1) in CNF.
102. Convert the grammar with productions S-> Aba, A-> aab B->Ac to CNF 8
103. Define GNF of a CFG 6
104. Convert the grammar with productions below into GNF 6
a) S->AB, A->aA|bB|b, b->b
b) S->abSb|aa
105. Write the regular expression for all Pascal real numbers 4
106. Find the regular expression for Pascal sets whose elements are integer numbers 4
107. Let L1 = L(a*baa*) and L2 = L(aba*) find L1/L2 5
108. If L is a regular language, prove that the language {uv : UcL, VcLR Is also regular 6
109. Find DFA’s that accepts the following languages 8
a) L(aa* + aba*b*)
b) L(ab(a+ab)*(a+aa))
c) L((abab)*+(aaa*+b)*)

PUSHDOWN AUTOMATA
OBJECTIVE: This chapter defines two different versions of the pushdown automaton: one that
accepts by entering an accepting state, like finite automata do, and another version that
accepts by emptying its stack, regardless of the state it is in.
• Pushdown automata: The pushdown automaton is in essence a nondeterministic finite
automaton with Є-transitions permitted and one additional capability: a stack on which it
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 33
can store a string of “stack symbols.”
110. Give two reasons why finite automata cannot be used to recognize all CFL and why PDA is 5
required for that purpose.
111. Explain the operations of a NPDA with diagram. 6
112. Give the formal definition of NPDA. Explain clearly the transition function? 6
113. Write a NPDA that accepts the language L = {anbn : n ≥ 0 }U {a} 6*
114. Define the instantaneous description of a NPDA 4
115. When do we say a CFL is accepted by NPDA? Define 6
a) acceptance by final state
b) acceptance by empty stack
116. Construct a NPDA for the following languages 10
a) L = {w ε {a,b}* : na(w) = nb(w)}
b) L = {wwr : w ε {a,b}+}
117. Prove that for any CFL L(specified as CFG without λ productions), there exists a NPDA M 6
such that L = L(M)
118. Construct a NPDA that accepts that language generated by grammar with productions 8
a) S -> aA
b) S -> Aabc|bB|a
c) B -> b
d) C -> c
119. Write the CFG for language accepted by NPDA whose transitions are given below: 8*
δ(q0,a,z) = {(Q0,Az)}
δ(q0,a,A) = {(q0,A)}
δ(q0,b,A) = { {q1,λ)}
δ(q1,λ,z) = {q2,λ)}
120. If L = L(M) for some NPDA M, then prove that L is CFL. 5
121. Give the formal definition of DPDA and deterministic CFL. 6

PROPERTIES OF CONTEXT-FREE LANGUAGES


OBJECTIVE: This chapter introduces some of the properties of context-free languages. We will
learn normal forms for CFG. We will prove the “pumping lemma” for CFL’s.
122. State and prove pumping lemma for CFL? What is its application? 8
123. Define linear CFL. State pumping lemma for Linear CFL. 5
124. Prove that family of CFL is closed under union, concatenation and star closure. 6
125. Prove that family of CFL is not closed under intersection and complementation 6
126. Let L1 be a CFL and L2 be a regular language. Then prove that L1 intersection 6
L2 is context free.
127. Show that the language L = {w ε {a,b,c}* : na(w) = nb(w) = nc(w) is not context free 6
128. Show that the language L = {anbn : n ≥ 0, n ≠ 100} is context free 6
129. Determine whether or not the following language is context-free. 4
L={an bj an bj : n ≥ 0 , j ≥ 0}

130. Show that the complement of the language L = { an2 : n ≥ 0} is not context-free. 5
131. Determine whether or not the following language is context-free. 4
L={an w wR: n ≥ 0, w Є {a, b}*}
132. Is the language context-free? L = { anm : n and m are prime numbers } 4
133. Show that following languages are not context free using pumping lemma 10
a) L = {anbncn : n≥ 0}
b) L = {ww : w ε {a,b}*}
c) L = {an! : n≥ 0}
d) L = {anbj : n = i2}
134. Show that language L = {w : na(w)} is not linear 5

INTRODUCTION TO TURING MACHINES


OBJECTIVE: In this chapter we shall start looking at the question of what languages can be
defined by any computational device. We begin with an informal argument, using an assumed
knowledge of C programming, to show that there are specific problems we cannot solve using a
computer. We then introduce a venerable formalism for computers called Turing machine.
• Turing machine: It has been recognized as an accurate model for what any physical
computing device is capable of doing.
135. Explain with diagram the operation of Turing machines? Give formal definition of Turing 6
th
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4 Semester CS 34
machine.
136. Consider the Turing machine defined as follows 10*
Q = {q0,q1} ∑ = {a,b} = a,b,} F = q1}
δ(q0,a) = (q0,b,R)
δ(q0,b) = (q0,b,R)
δ(q0, ) = (q1, L)
Starting with state, draw the different stages of the processing the string “aa”. Write also
the instantaneous descriptions?
137. Give an example of TM that never halts i.e., that goes to infinite loop. How is that 5
represented in instantaneous description?
138. Summarize the features of standard Turing machine. 4
139. Explain what is meant by instantaneous description of a TM. 6
140. Define computations of a TM. 5
141. Define language accepted by TM. 5
142. When do we say that a language is not accepted by TM? 5
143. For ∑ = {0,1} design a TM that accepts language denoted by the regular expression 00 5
144. For ∑ = (a,b} design a TM that accepts L = {anbn : n≥ 1} 6
145. Design a TM that accepts L = {anbncn : n≥1} 6*
146. Define the operation of TM as transducers? Define a Turing computable function? 6
147. Given two positive integers x and y, design a TM that computes x+y 6
148. Design a TM that copies strings of 1’s 5
149. Design a Turing machine that halts at a final state if x≥y and at a nonfinal state x<y 6
150. Design a TM that computes the function 10
x+y if x≥ y
F(x,y) 0 if x<y
151. Design a TM to implement the macroinstruction 8
If a
Then qj
Else qk
152. Design a TM that multiplies two +VE integers in unary notation. 6
153. Write a note on Turing Thesis. Define algorithm in terms of TM. 6
154. Define equivalence of automata? Demonstrate the equivalence of TM using simulation. 6
155. Define TM with stay on option. Prove that they are equivalent to class os standard TM? 6
156. Define TM with semi-infinite tape & prove that they are equivalent to class of standard 6
Turing machine.
157. Define offline TM & prove that they are equivalent to class of standard TM. 5
158. Write a note on multitape TM. 5
159. Write a note on multidimensional TM. 5
160. Define formally non-deterministic TM. 5
161. Prove that class of deterministic TM & class of non-deterministic TM are equivalent 6*
162. Write a note on universal TM. 6
163. Explain what you mean by countable, uncountable sets and enumeration procedure. 6*
164. Prove that set of all TM, although infinite is countable. 8

UNDECIDABILITY
OBJECTIVE: This chapter begins by repeating, in the context of Turing machines, a plausibility
argument for the existence of problems that could not be solved by computer. The chapter gives a
formal proof of the existence of the problem about Turing machines that no Turing machine can solve.
We then divide problems that can be solved by a Turing machine into two classes: those that have an
algorithm, and those that are only solved by Turing machines that may run forever on inputs they do
not accept.

165. Show that the halting problem, the set of (M, w) pairs such that M halts (with or with out 6
accepting) when given input is RE but not recursive.
166. Let L1, L2, …, Lk be a collection of languages over alphabet ∑ such that: 10
1. For all i ≠ j, Li ∩ Lj = Ø; i.e., no string is in two of the languages.
2. L1 υ L2 υ …. υ L k = ∑*; i.e., every string is in one of the languages.
3. Each of the languages Li, for I = 1,2,…, k is recursively enumerable.
Prove that each of the languages is therefore recursive.
167. What strings are: 6
a) w37?
b) W100?

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 35
168. Prove “if L is a recursive language, so is L¯”. 5
169. Informally describe multi tape Turing machines that enumerate the following sets of 8
integers, in the sense that started with blank tapes, it prints one of its tapes 10i210i21...
to represent the set { i1, i2,..}.
a) The set of all perfect squares {1, 4, 9…}.
b) The set of all primes {2, 3, 5, 7, 11…..}.
170. What are Recursive languages? What is the relationship between the recursive, RE, and 5
non RE languages?

Marks No of Questions
04 22
05 49
06 60
08 16
10 21
12 01
14 01
Total 170

NOTES

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 36
CSE 45: INTRODUCTION TO MICROPROCESSORS

Faculty: No of Hours: 52
% of portion covered
Chapter Title/
Class # Topics to be Covered
Reference Literature Reference
Cumulative
chapter
Introduction to Microprocessors
1. Chapter # 2, 3 Evolution of Microprocessors, Microcomputer hardware. The system bus
2. Introduction to The Microprocessor, Memory organization,
3. Microprocessors Input/Output 11.5% 11.5%
4. R1: Page #25-52, Direct Memory Access, Coprocessor, System software
5. 65-79 The 8085 Microprocessor. Bus structure, Interrupts,
6. The 8085 Architecture.
The 8086/8088 Processors
7. Registers of 8086, Architecture
8. Chapter # 1 Signal description, Physical memory organization
9. The 8086/8088 Processors General Bus operations, I/O addressing capability. 11.5% 23.0%
10. T1: Page #1-30 Special processor activities.
11. Minimum and maximum mode 8086 system and timings
12. The processor 8088
The 8086/8088 Instruction set and assembler directives
13. Machine Language Instruction formats.
14. Addressing modes of 8086.
Chapter #2
15. Data movement Instruction set of 8086/8088.
The 8086/8088 Instruction
16. Basic Assembler Directives and operators.
set and assembler 17.3% 40.3%
17. Arithmetic and logical instructions.
directives
18. T1: Page # 33-73 Control transfer instructions
19. Miscellaneous instructions
20. String instructions of 8086.
21. Assembly language example programs and advanced assembler directives.
The Art of Assembly Language Programming with 8086/8088
22. Few machine level programs
23. Machine coding the programs (hand assembly)
24. Chapter # 3 Programming with an assembler
25. The Art of Assembly Assembly language example Programs (Simple programs like GCD, LCM)
Language Programming Assembly language example Programs (Declaring and accessing, single and two dimensional 16.3% 56.6%
26.
with 8086/8088 arrays)
27. T1: page # 75-116 Assembly language example Programs (sorting and searching)
28. Assembly language example Programs (Using procedures)
29. Assembly language example Programs (Using far procedures and extern variables)
30. Assembly language example Programs (Miscellaneous)
Special Architectural Features and Related Programming
31. Chapter # 4 Introduction to stack and Stack structure of 8086/8088
32. Special Architectural Interrupts and Interrupt service routines.
33. Features and Related Interrupt Cycle of 8086/8088 13.4% 70.0%
34. Programming Non Maskable and Maskable Interrupts.
35. T1: page # 118-137 Interrupt Programming,
36. MACROS, timings and Delays.
Basic Peripherals and their Interfacing with 8086/8088
37. Semiconductor memory interfacing.
38. Dynamic RAM Interfacing.
39. Example problems on Memory Interfacing
40. Example problems on Memory Interfacing
41. Memory mapped and I/O mapped I/O
42. Chapter # 5 Interfacing I/O Ports.
43. Basic Peripherals and their Introduction to programmable Peripherals
44. Interfacing with Programmable Peripheral Interface 8255 30% 100%
45. 8086/8088 Modes of operations of 8255
46. T1: page # 139-212 Interfacing Analog to digital data converter.
47. Interfacing Analog to digital data converter.
48. Interfacing digital to analog data converter
49. Interfacing digital to analog data converter
50. Interfacing stepper motor
51. Control of High power devices using 8255
52. Control of High power devices using 8255

Literature:
Publication specification
Book type Code Title and Author
Edition Publication Year
Advanced Microprocessors and Peripherals Architecture, Programming &
Text Book T1 Tata McGraw-Hill 2000
Interfacing by Ajoy Kumar Ray & Kishore M Bhurchandi.
The Intel Microprocessors 8086/8088, 80186/80188, 80286, 80386, th
Text Book T2 6 Pearson Education 2003
80486, Pentium amd Pentium Pro Processor by Barry B. Brey
Microprocessor Aechitecture, Programming & Applications with 8085. th
Reference Book R1 4 Penram International 1996
by Ramesh S.Gaonkar.
Reference Book R2 Microprocessors and Microcomputer – Based System Design by Mohaamed rafiquzzam 4th Universal Book stall
Microprocessor and Interfacing Programming &Hardware
Reference Book R3 2nd Tata McGraw-Hill 1986
by Douglas V. hall

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 37
QUESTION BANK

INTRODUCTION TO MICROPROCESSORS
OBJECTIVE: This chapter deals with basic concept of microprocessor with an Intel 8 bit processor
8085

1. Write a note on evolution of microprocessor. 10


2. What are coprocessors? Name few. 05
3. What is the purpose of coprocessor? What are the different ways of building system 08*
without coprocessor?
4. Why coprocessor is a separate chip, not embedded on the processor? 05*
5. What are the operations the coprocessor can do? 05
6. Explain the architecture of 8085 with block diagram. 12*
7. What do you mean by 8 bit & 16 bit processors explain? 08*
8. Write a short note on 8085 bus structure. 10
9. Describe a scheme to demultiplex the multiplexed AD0 – AD7 bus of 8085 CPU. 10
10. Differentiate between memory mapped I/O with I/O mapped I/O. 04*
11. What is the need of Co-processors? Give an example. 04
12. Draw and explain the block diagram of microprocessor- based system and also explain 08*
the general sequence it follows the instruction.
13. Explain the different methods of data transfer possible between MPU and I/O. 05*

THE 8086/8088 PROCESSORS


OBJECTIVE: This chapter deals with advanced microprocessor Intel 8086, Its architecture pin details.
This Chapter deals with different working mode of 8086 processor.

14. Describe the architecture of 8086 with suitable figure. 12 *


15. What do you mean by pipelined architecture? How is it implemented in 8086? 06
16. Explain the concepts of segmented memory? What are its advantages? 06
17. Discuss 8086 based system configured in Maximum mode with a neat diagram. 08*
18. Discuss the minimum mode configuration system of 8086 with a block diagram. 10*
19. How does 8086 differentiate between an opcode and instruction format 05
20. Explain the function of opcode prefetch queue in 8086.
21. Explain clearly the generation of 20 bit address in 8086. 10 *
22. Explain the usage of segment register in 8086 for generating physical addresses. 12
23. Explain the feature provided in the 8086 architecture for fetching the next instruction 10
when current instruction being executed.
24. Describe the functions of 8086 with respect to a) Queue b) Flag register c) General 08 *
purpose register d) Segment register.
25. Explain queue and flag register of 8086. 08
26. Explain the general purpose registers of 8086. 08 *
27. Write the symbolic pin configuration of 8086 explain each of them. 10
28. Differentiate between maximum and minimum mode of 8086. 10 *
29. Describe various addressing modes of 8086. 10 *

THE 8086/8088 INSTRUCTION SETS AND ASSEMBLER DIRECTIVES


OBJECTIVE: This chapter deals with some sample programs by introducing all kind of instructions
supported by 8086 processor and directives supported by the and assemblers

30. Explain the arithmetic instruction in 8086. 05


31. Explain the different looping instruction in 8086. 10
32. Explain different type of JUMP instruction in 8086. 08
33. Explain how T flag can be altered in 8086. 05
34. Explain the different instruction formats in 8086. 08*
35. Explain the different data related addressing modes of 8086 with examples. 10*
36. How does 8086 identifies between 8 bit and 16 bit operation. 03*
37. What is lock prefix? What is it use? 03*
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 38
38. How is the addressing mode of an instruction communicated to the CPU? 04
39. Explain the importance of string instructions. Give 1 example with simple program to 05*
support the importance.
40. Which instruction of 8086 can be used for lookup table manipulation? Justify. 04*
41. Bring out the difference between the jump & loop instruction. 06
42. Explain why memory is divided into segments in 8086? What are its advantages? 06*
43. What is addressing mode? Explain different addressing schemes used in 8086 with 10*
examples.
44. Explain the sign extension instruction. 05
45. What are the assembler directives? Explain directives used in MASM assembler for 10*
8086 programming.
46. Explain the different form of unconditional jump instruction in 8086/8080. 10*
47. What are the assembler directives & pseudo-ops? 06
48. Explain the addressing modes for the control transfer instruction. 05
49. List the conditional jump instruction that is used for signed numbers. Explain why they 10*
are used for signed numbers only with the flag condition.
50. Describe with example the effect of execution of following instruction. 12 *
a) DAS b) DIV DX c) IMUL BX d) MUL BL
e) LAHF f) XLAT g) CMPSB
51. Describe the general instruction format of 8086. 10
52. Explain the fields in the instruction templates given below for data transfer between a 10 *
register and another register, register and memory location.
100010DW MOD REG R/M
Using the above template, generate codes for a) MOV AL, DH b) MOV 1234[BX], CL
53. What are assembler directive? Explain the following assembler directive. 08
a) MODEL b) DD c) WORD PTR d) EQU
54. Describe the different memory model of 8086 assembly language programming. 08
55. Describe with neat diagram the wave form of memory read operation of 8086. 10
56. Describe with neat diagram the wave form of memory write operation of 8086. 10
57. Clearly explain how a word at an even address and a word at an odd address accessed 10
in 8086.
58. Write an 8086 assembly language program to move block of 100h bytes of data 10
starting at address 2340h there in DS and to the block starting at 1234h there in ES
register assume DS and ES are already initialized.

THE ART OF ASSEMBLY LANGUAGE PROGRAMMING 8086/8088.


OBJECTIVE: This chapter deals with advanced programming concept such as recursion, array
accessing and block data accessing.

59. Write a program to find largest element in an array using recursion. 08 *


60. Write an ALP in 8086 to count numbers of positive & negative numbers present in a 10*
series of ten signed 8 bit numbers stored from address ARRAY. Store the results at
locations PNOS & NNOS respectively.
61. Write an ALP to find odd & even numbers of an array of ‘n’ numbers. The value of ‘n’ is 12*
available in memory location VALVE. Store all odd numbers from memory ODD and
even numbers from memory EVEN. Write the comment for the program.
62. Write an ALP to convert BCD numbers to binary. 10
63. Write an ALP to find the sum of the series of 8 bit numbers. 10
64. Write an ALP to perform addition, subtraction, multiplication and division for BCD 10
numbers.
65. Write an ALP to calculate a factorial of a number (Byte size) using recursion and result 10
should be displayed on the monitor (max length of 4 EX digit).
66. Write an ALP to calculate the G C D of four 16 bit number and store the result in word 08
location called RES.
67. Write an ALP to sort array (of 16 bit numbers) in descending order using bubble sort. 08 *
68. Write an ALP to sort array (of 16 bit numbers) in ascending order using insertion sort. 08 *
69. Write an ALP to sort array (of 16 bit numbers) in descending order using selection 08
sort.
70. Write an ALP to compute ncr using with and without recursion. 08
71. Write an ALP to search for a given key element in the array (of 16 bit numbers) using 08 *
binary search. (with and without recursion)

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 39
SPECIAL ARCHITECTURE FEATURES AND RELATED PROGRAMMING
OBJECTIVE: This chapter deals with other architecture features of 8086 such as stack interrupts
management etc.

72. Describe the Interrupt and Interrupt related instruction of 8086. 12


73. Explain the stack structure of 8086. 05
74. Describe the interrupt system of 8086 in detail. 10*
75. Differentiate between a macro & a subroutine. 06*
76. Explain how to pass parameters in MACROs with the help of an example 10*
77. Describe the interrupt sequence of 8086. 06*
78. How does main program & subroutine communicate explain with an examples 10*
79. List out the difference between MACRO & PROCEDURE. 05*
80. Describe the multiply and divide instruction of 8086 with example. 10
81. Write a short note on priority of interrupts in 8086. 10
82. Explain the following instruction a) TEST b) CLC c) STI d) SAHF 12
83. How do the following differ a) test pin and test instruction b) Ready pin and wait 12 *
instruction c) HOLD/HLDA pin with RQ/GT signal
84. What are assembler pseudo instructions? 10
85. What do you mean by interrupt priorities? List out interrupt priorities in 8086. 05*
86. Write an 8086 MACRO to produce 25ms of delay, without changing any of the 10*
processor registers. Consider 8086 operating on a 4MHa clock.
87. Explain the following pseudo instruction a) DUP b) EQU c) DD d) DW 12
88. Discuss the purpose of the following assembler directives. 10
a) ASSUME b) SEGMENT ENDS
c) DUP d) PROC
89. Describe the various stack manipulation instruction in 8086. 10
90. Explain the different memory devices in detail. 10
91. What do you mean by interrupts? Explain how they will be handled by 8086. 12 *
92. Explain the Interrupt structure of 8086 and action taken when interrupts are 12 *
activated.
93. Given (IP) = 2BCDH, (CS) = 0200H, displacement = (5119H), BX = (1200H), 12
(DS) = 212AH, (222A0H) = 0600H and (275B9)= 098AH, find the branch address for
a branch instruction that uses (I) Intra segment direct (II) Intra segment Indirect
which uses the BX register.

PERIPHERAL AND THEIR INTERFACING WITH 8086/8088.


OBJECTIVE: This chapter deals PPI 8255, its different mode of working and interfacing I/O devices via
8255.

94. With neat diagram explain the architecture of 8255. 12 *


95. Explain the working of DMA processor. 10
96. Bring out the difference between a static and dynamic RAM. 04*
97. Explain the Mode-0, Mode-1 and BSR modes of 8255. 06*
98. Interface a DAC 0800 to 8086 and write a program to generate a triangular waveform. 10*
99. Write a neat internal block diagram of 8255, give control word format for the 10*
operating modes
100. Draw and explain a typical stepper motor interface, further write an ALP to rotate a 12*
shaft of a 4-phase stepper motor in clockwise by 5 rotations.
101. Explain the different modes of 8255 operation. 12
102. Explain the control word of 8255. 10 *
103. Explain how Analog to digital converter can be interfaced using 8255. 12
104. Explain how Digital to Analog converter can be interfaced with 8255. 12
105. Interface stepper motor to 8086 with 8255. 12*
106. What are the criteria to be considered before interfacing memory to the processor? 10*
Interface 64KB EPROM and 64KB RAM to 8086 in minimum mode.
107. Explain how high power devices can be controlled using 8086 processors 10*
108. Explain how delay routine works. 10
109. Write a ALP procedure to generate a delay of one sec if processor speed = 3mhz. 10

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 40
Marks No. of Questions
03 02
04 05
05 13
06 08
08 18
10 45
12 18
Total 109

NOTES

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 41
CSE46: COMPUTER ORGANIZATION

Faculty No. of hours: 52


Chapter % of portion covered
Class# Title/Reference Topics to be covered
Reference
Literature Cumulative
chapter
Basic Structures of Computers
1 Introduction :Computer types: Functional units: input units, memory units, arithmetic & logic
Chapter #1 units, output unit, control unit,
Basic Structures of Basic operational concept: bus structure: Performance: processor clock, basic performance
2 7.6% 7.6%
Computers equation, pipelining & superscalar operation
3 T1:Page# 2-10,13-21 Clock rate, performance measurement; Multiprocessor & multicomputer
Historical perspective; the 1st generation, the 2nd generation, the third generation, the fourth
4
generation, Beyond the 4th generation, Evolution of performance.
Machine Instructions & Programs
Numbers, arithmetic operation and characters, memory location & addresses: byte
5
addressability, big-endian & little–endian assignment, word alignment, accessing numbers,
characters & characters strings.
6 Memory operation: instruction and instruction sequencing.
Register transfer Notation, Assembly Language Notation, Basic Instruction types, Instruction
7
Chapter#2: Execution & Straight-line sequencing.
8 Machine Instructions Branching, Condition codes, Generating memory addresses.
& Programs Addressing modes: implementation of variables & constants, Indirection & Pointers, Indexing & 19.2% 26.8%
9 T1:Page# 27-62,64- Arrays.
86,94-98
Relative addressing, Additional modes. Assembly language: Assemblers Directives, number
10
notation; basic input & output operations.
11 Stack & Queues : Subroutines
12 Subroutine Nesting & processor stack, Parameter Passing, The Stack Frame
13 Additional Instructions: logic Instruction, Shift & Rotate Instructions.
14 Multiplication & Division; Encoding of Machine instruction: General features of CISC & RISC.
Input/Output Organization
15
Accessing I/O devices: Interrupts: Interrupt Hardware.
16 Enabling & Disabling Interrupt
17 Chapter #4: Handling Multiple devices
18 Input/Output Controlling Device Requests
Organization 19.2% 46.0%
19 T1:Page 204- Exceptions
20 220,234-282 Direct memory Access
21 Bus Arbitration Buses: synchronous bus, Asynchronous Bus.
22 Interface circuits
23 Parallel port, serial port
24 Standard I/O interfaces, PCI bus, SCSI bus, USB.
The Memory System
25
Basic concepts: semiconductor ram memories; internal org. of memory chips
26 Static memories.
27 Chapter#5 Asynchronous drams, Synchronous drams
28 The Memory System Structure of larger memories, memory system consideration, rambus memory.
T1:Page# 292- 19% 65%
29 Read- only memories: ROM, prom, Eprom, EEPROM.
321,329-334,337-
30 Flash memory; speed size & cost.
358
31 Cache memories: Mapping functions; performance consideration.
32 Interleaving, Hit Rate & MISS PENALTY. Virtual memories :Address translation
33 Secondary Storage: Magnetic hard disks, Optical disk.
Arithmetic
34
Addition & Subtraction of Signed Numbers: Addition/Subtraction Logic Unit.
Chapter# 6:
35 Design of fast adders: Carry-Lookahead Addition.
Arithmetic
36 Multiplication of positive numbers : Signed-Operand Multiplication booth Algorithm
T1 Page# 368- 13.4% 78.4%
37 Fast Multiplication :Bit-pair Recoding of multipliers;
385,390-398,400-
38 402 Integer Division : Floating-point Numbers & operations
39 IEEE Standard for floating point Numbers
40 Arithmetic Operations on Floating Point Numbers, Implementing Floating-Point opr
Basic Processing Unit
41
Some Fundamental concepts: Register Transfers, performing an Arithmetic or Logic Operation.
42 Chapter #7: Fetching a word from memory, storing a word in memory; Execution of a complete Instruction
43, 44 Basic Processing Unit Branch instruction & Multiple-bus organization
15.3% 93.7%
45 T1 Page#412- Hardwired Control
46 437,440-443 A complete processor
47 Micro programmed: control Microinstructions.
48 Micro program Sequencing microinstruction with next-address field.
49 Embedded Systems : Microwave oven
50 Chapter#9: Digital camera, home Telemetry.
Embedded Systems 6.3% 100%
51 Processor chips for Embedded Applications
T1 Page# 512-525
52 A simple Microcontroller

Literature:
Publication Information
Book Type Code Title And Author
Edition Publisher Year
Text Book T1 Computer Organization by Carl Hamacher,Zvonko Vranesic, Safwat Z 5th McGraw-Hill Education 2002
Reference Book R1 Computer system Architecture by Morris Mano 2nd PHI 1986
Reference Book R2 Computer System Design And Architecture by Vincent H & Harry J 1st Addison-Wesley 1999

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 42
QUESTION BANK

BASIC STRUCTURES OF COMPUTERS


OBJECTIVE: Computer performs the function of storing and processing the information. It has various
functional units, and has evolved to the present day form after generations. In this chapter we learn
and understand basic operational concepts of a computer, its performance, and about the evolution of
computer from 1st generation to 4th.

1. List the steps needed to execute the machine instruction Add LOC, R0 in terms of 08
transfers between memory and processor and some simple control commands. Assume
that the instruction itself is stored in the memory at location INSTR and that this address
is initially in register PC.
2. Give a short sequence of machine instructions for the task: “Add the contents of memory 08
location A to those of location B, and place the answer in location C.”
Instructions Load LOC, Ri
and Store Ri, LOC
are the only instructions available to transfer data between the memory and general
purpose register Ri. Do not destroy the contents of either location A or B.
3. Suppose that Move and Add instructions are available with the format 08
Move / Add Location 1, Location 2
These instructions move or add a copy of the operand at first location to the second
location, overwriting the original operand at the second location. Location can be in
either the memory or the processor register set. Is it possible to use fewer instructions
to accomplish the task in question 2? If Yes, give the sequence.
4. Explain different functional units of a digital computer. 06*
5. List and explain the developments made during different generations of a computer. 08*
6. What is a bus? Explain single bus structure in architecture. 06*

MACHINE INSTRUCTIONS & PROGRAMS


OBJECTIVE: Computer executes programs, i.e. a set of instructions along with some operands. These
instructions and operands are stored generally in memory. In this chapter we study how these
instructions and operands are brought from memory to the processor and executed. At the end of the
chapter one will know about machine instructions and program execution, number representation,
addressing modes, operations on stack, queue, list, linked-list and array data structures.

7. Represent the decimal values 5, -2, 14, -10, 26, -19, 51 and –43, as signed, 7- bit 10
numbers in the following binary formats:
a) Sign-and-magnitude b) 1’s complement c) 2’s complement
8. (a) Convert the following pairs of decimal numbers to 5-bit, signed, 2’s- complement 10
binary numbers and add them. State whether or not overflow occurs in each case.
a) 5 and 10 b) 7 and 13 c) –14 and 11 d) –5 and 7 e) –3 and –8
(b) Repeat Part a for the subtract operation, where the second number of each pair is to
be subtracted from the first number. State whether or not overflow occurs in each case.
9. Given a binary pattern in some memory location, is it possible to tell whether this pattern 04
represents a machine instruction or a number?
10. A memory byte location contains the pattern 00101100. What does this pattern represent 04
when interpreted as a binary number? What does it represent as an ASCII code?
11. Consider a computer that has a byte-addressable memory organized in 32-bit words 06
according to the big-endian scheme. A program reads ASCII characters entered at a
keyboard and stores them in successive byte locations, starting at location 1000. Show the
contents of the two memory words at locations 1000 and 1004 after the name “Johnson”
has been entered.
12. A program reads ASCII characters representing the digits of a decimal number as they are 06
entered at a keyboard and stores the characters in successive memory bytes. Examine the
ASCII code and indicate what operation is needed to convert each character into an
equivalent binary number.
13. Write a program that can evaluate the expression 06
A*B+C*D
In a single-accumulator processor. Assume that the processor has Load, Store, Multiply,
and Add instructions and that all values fit in the accumulator.
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 43
14. a) 08
Move #AVEC, R1
Move #BVEC, R2
Move N, R3
Clear R0
LOOP Move (R1)+, R4
Multiply (R2)+, R4
Add R4, R0
Decrement R3
Branch>0 LOOP
Move R0, DOTPROD

Rewrite the dot product program above for an instruction set in which the arithmetic
and logic operators can only be applied to operands in processor registers. The two
instructions Load and Store are used to transfer operands between registers and the
memory.
b) Calculate the values of the constants k1 and k2 in the expression k1+k2n, which
represents the number of memory accesses required to execute your program for
Part a, including instruction word fetches. Assume that each instruction occupies a
single word.
15. “Having a large number of processor registers makes it possible to reduce the number of 05
memory accesses needed to perform complex tasks.” Devise a simple computational task
to show the validity of this statement for a processor that has four registers compared to
another that has only two registers.
16. Registers R1 and R2 of a computer contains the decimal values 1200 and 4600. What is 06
the effective address of the memory operand in each of the following instructions?
(a) load 20(R), R5 b) move #3000,R5 c) store d) add R5,30(R1,R2)
(e) add -(R2), R5 f) subtract (R1)+,R5
17. Consider an array of numbers A (i, j), where i=0 through n – 1 is the row index, and j=0 06
through m-1 is the column index. The array will be stored in the memory of a computer
one row after another, with elements of elements of each row occupying m successive
word locations. Assume that the memory is byte-addressable and that the word length is
32 bits. Write a subroutine for adding column x to column y, element by element, leaving
the sum elements in column y. The indices x and y are passed to the subroutine in
registers R1 and R2. The parameters n and m are passed to the subroutine in registers R3
and R4, and the address of element A (0,0) is passed in register R0. Any of the addressing
modes in table 1 can be used. At most, one operand of an instruction can be in memory.
18. Both of the following statements cause the value 300 to be stored in location 1000, but at 05
different times.
ORIGIN 1000
DATAWORD 300
and
move #300, 1000
Explain the difference.
19. Register R5 is used in a program to point to the top of a stack. Write a sequence of 06
instructions using the Index, Autoincrement, and Autodecrement addressing modes to
perform each of the following tasks:
(a) Pop the top two items off the stack, and them, and then push the result onto the
stack.
(b) Copy the fifth item from the top into register R3.
(c) Remove the top ten items from the stack.
20. A FIFO queue of bites is to be implemented in the memory, occupying a fixed region of k 08
bytes. You need two pointers, an IN pointer and an OUT pointer. The IN pointer keeps
track of the location where the next byte is to be appended to the queue and the OUT
pointer keeps track of the location containing the next byte to be removed from the
queue.
a) As data items are added to the queue, they are added at successively higher
addresses until the end of the memory region is reached. What happens next,
when a new item is to be added to the queue?
b) Choose a suitable definition for the IN and OUT pointers, indicating what they point
to in the data structure. Use a simple diagram to illustrate your answer.
c) Show that if the state of the queue is described only by the two pointers, the
situations when the queue is completely full and completely empty are
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 44
indistinguishable.
d) What condition would you add to solve the problem in part c?
e) Propose a procedure for manipulating the two pointers IN and OUT to append and
remove items from the queue.
21. Consider the queue structure described in the above problem. Write APPEND and REMOVE 06
routines that transfer data between a processor register and the queue. Be careful to
inspect and update the state of the queue and the pointers each time an operation is
attempted and performed.
22. Consider the following possibilities for saving the return address of a subroutine: 04
a) In a processor register.
b) In a memory location associated with the call, so that a different location is used
when the subroutine is called from different places.
c) On a stack.
Which of these possibilities supports subroutine nesting and which supports subroutine
recursion (that is, a subroutine that calls itself)?
23. The subroutine call instruction of a computer saves the return address in a processor 05
register called the link register, RL. What would you do to allow subroutine nesting? Would
your scheme allow the subroutine to call itself?
24. Assume you want to organize subroutine calls on a computer as follows: When routine 06
Main wishes to call subroutine SUB1, it calls an intermediate routine, CALLSUB, and passes
to it the address of SUB1 as a parameter in register R1. CALLSUB saves the return address
on a stack, making sure that the upper limit of the stack is not exceeded. Then it branches
to SUB1. To return to the calling program, subroutine SUB1 calls another intermediate
routine, RETRN. This routine checks that the stack is not empty and then uses the top
element to return to the original calling program.
Write routine CALLSUB and RETRN, assuming that the subroutine call instruction saves the
return address in a link register, RL. The upper and lower limits of the stack are recorded
in memory locations UPPERLIMIT and LOWERLIMIT, respectively.
25. Explain various forms of representation of numerical data. Justify which is better method 06
with examples.
26. Explain Big-Endian, Little-Endian assignment and byte addressability. 06*
27. Explain the Instruction Sequencing and its complete execution. 05
28. What is an Instruction? Explain its functionalities. 06
29. Write the complete execution of Straight Line Sequencing with an example. 05
30. Write a note on Branching Instruction with reference to the PC. 05
31. What is Addressing Mode? Explain various methods with examples. 08*
32. Write notes on: 06
a) Register transfer notation. b) Assembly language Notation. c) Assembler Directives.
33. Explain SUBROUTINE LINKAGE with example. 04
34. Mention various parameter-passing techniques with examples. 06
35. What is Stack? Write the line of code to implement the same. 04
36. What is a Queue? Write the line of code for its implementation. 04
37. Write a brief note on Input and output operations with a neat diagram. 06
38. What do you understand by stack frame? Discuss their use in sub-routines. 10*
39. Write a note on RISC and CISC machines. 06
40. What are the instructions to manipulate bit wise data? Explain. 06
41. Write the use of ROTATE & SHIFT Instructions with examples. 06
42. Write a piece of code in ALP to implement the student record and compute average. 08
43. (a) Consider the memory system of a computer storing the following data: 20*
Address in Hex Data stored (binary)
2000 00111000
2001 00110100
2002 00110010
2003 00111001
Interpret the storage as numbers in the manner indicated below and find their decimal
values in each case.
i) Big-endian storage of 2 hex words of 4-digits each
ii) Big-endian storage of 2 BCD words of 4-digits each
iii) Little-endian storage, in ASCII, of a 4-digit signed hex word
iv) Little-endian storage, in ASCII, of a 4-digit BCD word.
(b) Give reasons to justify using, generally,
i) Single address instructions in 8-bit CPU’s
ii) Double address instruction in 16-bit CPU’s
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 45
iii) Three address instructions in RISC systems
In each of these systems give assembly language programs for performing the
operation:
Data at mem A + Data at mem B -> mem C.
44. Write an assembly program to multiply 2 memory arrays and store their result in a third 10*
memory array:
a(i) * b(i) = c(i) for i=0 to n-1. Consider load/store and 3-address system.
45. What are assembler directive? Explain any two directives. 06*
46. Explain Logical, Shift and Rotate instructions with examples. 06*
47. Write an assembly language program to solve an expression ax2 + bx + c = 0 using two 06*
addressing modes.

INPUT / OUTPUT ORGANIZATION


OBJECTIVE: One of the basic features of a computer is its ability to exchange data with other devices.
It means computer performs various input/output operations. In this chapter we will learn in detail
about how these operations are performed. We will know about program-controlled I/O using polling,
interrupts, direct memory access, data transfer over synchronous and asynchronous buses, and about
PCI, SCSI and USB buses.

48. What is Program Controlled I/O? Explain. 05


49. Explain with a neat diagram the single bus organization. 05
50. What is Interrupt I/O? Explain how an I/O is serviced? 06
51. What is an ISR? Write how interrupts are enabled or disabled. 08
52. Explain any two methods of handling multiple I/O devices. 06*
53. What are Vectored Interrupts? Explain. 06
54. What is Priority Interrupts? Explain. 05
55. What is DMA? Explain. 06
56. Why does DMA have priority over the CPU when both request a memory transfer? 04
57. What is bus arbitration? Explain how it is resolved when requested for service by both 06
processor and memory.
58. Explain different types of arbitration. 04
59. What is I/O BUS? Explain. 04
60. Explain different types of data Transfer methods. 06
61. What is Synchronous Bus Transfer? Explain with a timing diagram. 08
62. What is Asynchronous Bus Transfer? Explain with a timing diagram. 08
63. What is an Interface? Write a note on its types. 06
64. Write a note on Serial Interface. 04
65. Write a note on Parallel Interface. 04
66. Write a note on Standard Interfaces. 04
67. Write a note on Peripheral Component Interconnect (PCI) Bus. 04
68. Explain data transfer using PCI Bus. 04
69. Write a note on SCSI bus signals. 06
70. Explain SCSI, USB and PCI Bus. 05
71. Differentiate all the three buses. 04
72. Write a note on USB protocols. 04
73. Explain how a read operation is performed using PCI Bus. 04
74. Explain the USB architecture with a neat diagram. 06
75. Explain how USB operates using split-traffic mode. 05
76. Write a note on addressing scheme used in USB. 04
77. a) Explain how interrupt request from several I/O devices can be communicated to a 10*
processor through a single INTR line.
b) Which type of I/O devices is interfaced through DMA?
Explain the bus-arbitration process used for DMA.
78. Explain the general features of interfacing a parallel I/O port to a processor. 10*
79. Consider the daisy chain arrangement shown in figure 3 (available at the end of the Q- 10*
bank) in which the bus request signal from the I/O is directly fed back as grant signal.
Assume device I/O3 requests the bus and begins using it. When the device is finished, it
deactivates BR3. Assume the delay from BGi to BGi+1 in any device is d. Show that a
spurious bus-grant pulse will travel down stream from device 3. Estimate the width of this
pulse.
80. Why is bus arbitration required? Explain with block diagram bus arbitration using daisy 08*
chain.
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 46
81. With a block diagram, explain how a keyboard is connected to a processor. 06*
82. A CPU with a 20-MHz clock is connected to a memory unit whose access time is 40 ns. 08
Formulate a read and write timing diagrams using a READ strobe and a WRITE strobe.
Include the address in the timing diagram.
83. Obtain the truth table of an 8x3 priority encoder. Assume that the three outputs xyz from 10
the priority encoder are used to provide a vector address of the form 101xyz00. List the
eight vector addresses starting from the one with the highest priority.
84. What programming steps are required to check when a source interrupts the computer 08
while it is still being serviced by a previous interrupt request from the same source?
85. Why are the read and write control lines in a DMA controller bi-directional? Under what 06
condition and for what purpose are they used as inputs? Under what condition and for
what purpose are they used as outputs?
86. What is the basic advantage of using interrupt-initiated data transfer over transfer under 04
program control without an interrupt?
87. The address of a terminal connected to a data communication processor consists of two 04
letters of the alphabet or a letter followed by one of the 10 numerals. How many different
addresses can be formulated?

THE MEMORY SYSTEM


OBJECTIVE: Programs and the data operated on are stored in the memory of a computer. The
execution speed of programs is highly dependent on the speed with which instructions and data can be
transferred between the processor and the memory. In this chapter you will learn about basic memory
circuits, organization of the main memory, cache memory, virtual memory mechanism, magnetic disks,
optical disks and magnetic tapes.

88. Explain the memory operations Read and Write. 08


89. Mention the various memory performance parameters. 08
90. Explain the following: 08
a) Primary memory b) Secondary memory
c) Tertiary memory d) Block transfer in menu hierarchy.
91. What is refreshing? Explain the concept of refreshing in dynamic memory. 05
92. Explain the static RAM cell design. 05
93. Explain the dynamic RAM. 05
94. Explain the following: 08
a) PROM b) EPROM c) Flash EPROM d) EEPROM
95. Explain the general properties of a 2 level hierarchy. 05
96. Explain the following: 08
a) Hit ratio b) Miss ratio c) Cache regime d) Disk regime
97. Differentiate between Miss and Main memory miss. 05
98. With a suitable block diagram explain the cache swapping function. 08
99. Write a note on virtual memory and give the advantages. 08
100. Explain the following: 08
a) Effective address b) Logical address c) Virtual address d) Physical address
101. Explain memory management segmentation and paging. 10
102. Differentiate between internal fragmentation and external fragmentation. 05
103. Explain the following: 08
a) Multiprogramming b) Page placement and replacement
104. Explain the structure and operation of translation look- aside buffer. 08
105. Explain the operation of memory hierarchy with block diagram. 08
106. Explain the Read/Write operation of an SRAM cell designed using CMOS, with the help of a 06
neat diagram.
107. Discuss the organization of 1K x 1 memory cell. 06
108. Describe the operation of 2M x 8 asynchronous DRAM chip. 06
109. Discuss the main features of SDRAM with a neat diagram. 06
110. Write a note on memory expansion. Show how a 8K x 8 memory can be obtained using 2K 06
x 8 chips.
111. Write a block diagram of 256K x 8 memory using 256K x 1 chips. 06
112. Design a 4M x 32 module using 512K x 8 memory chips. Show the address lines and 08
control signals required.
113. Write briefly about Read only memories. 04
114. Describe the terms latency, bandwidth, locality of reference, mapping function and 08
replacement algorithm, with reference to cache memory.
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 47
115. Discuss how read and write operations are carried out in a cache memory. 06
116. Consider a system having 512K main memory organized as 16K blocks of 32 words each 08
and a cache memory of 16K arranged as 512 blocks of 32 words each. Show how the
mapping is done using direct mapping.
117. A set-associative cache consists of 128 blocks divided into 4 block / set. The main 06
memory has 8192 blocks each consists of 128 words.
a. How many address bits are required to access a main memory location?
b. What are the number of bits in TAG, SET and WORD fields?
118. A computer has L1 and L2 caches. The cache block consists of a 8 words. The hit rate is 05
0.95 for both caches. The time required to access an 8-word block in L1 cache is 1 cycle
and in L2 cache is 10 cycles. Time needed to access L1 cache is 1 cycle, L2 cache is 10
cycles and main memory is 50 cycles. Calculate the average access time experienced by
the processor.
119. Consider a disk unit having 24 surfaces and 14000 cylinders. There are 400 sectors per 04
track with each sector having 512 bytes of data.
a. What is the total capacity of the disk in bytes?
b. What is the data transfer rate in bytes per second at a rotational speed of 6000 rpm?
120. Describe SDRAM and DDR SDRAM operations for data transfer between main memory and 10*
cache memory systems.
121. Consider a processor running a program. 30% of the instructions of which require a 10*
memory read or write operation if the cache bit ratio is 0.95 for instructions and 0.9 for
data. When a cache bit occurs for instruction or for data, only one clock is needed while
the cache miss penalty is 17 clocks to read/write on the main memory. Work out the time
saved by using the cache, given the total number of instructions executed is 1 million.
122. How read and write operation takes place in 1KX 1 memory chip? Explain. 06*
123. Explain any two cache mapping functions. 08*
124. What are the key factors that affect the performance and cost of a computer with respect 06*
to memory? Explain briefly.
125. Explain the working principles of magnetic disk. 08*
126. A magnetic disk system has the following parameters: 04
Ts = average time to position the magnetic head over a track
R = rotation speed of disk in revolutions per second
Nt = number of bits per track
Ns = number of bits per sector
Calculate the average time Ta that it will take to read one sector.
127. An 8-bit computer has a 16-bit address bus. The first 15 lines of the address are used to 06
select a bank of 32K bytes of memory. The high-order bit of the address is used to select
a register which receives the contents of the data bus. Explain how this configuration can
be used to extend the memory capacity of the system to eight banks of 32K bytes each,
for a total of 256K bytes of memory.
128. A digital computer has a memory unit of 64K x 16 and a cache memory of 1K words. The 08
cache uses direct mapping with a block size of four words.
a. How many bits are there in the tag, index, block and word fields of the address format?
b. How many bits are there in each word of cache, and how are they divided into
functions? Include a valid bit.
c. How many blocks can the cache accommodate?
129. A two-way set associative cache memory uses blocks of four words. The cache can 06
accommodate a total of 2048 words from main memory. The main memory size is
128Kx32.
a. Formulate all pertinent information required to construct the cache memory.
b. What is the size of the cache memory?
130. A virtual memory has a page size of 1K words. There are eight pages and four blocks. The 06
associative memory page table contains the following entries:
Page Block
a. 3
b. 1
a. 2
a. 0
Make a list of all virtual addresses (in decimal) that will cause a page fault if used by the
CPU.
131. The logical address space in a computer system consists of 128 segments. Each segment 06
can have upto 32 pages of 4K words in each. Physical memory consists of 4K blocks of 4K
words in each. Formulate the logical and physical address formats.
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 48
132. a. What is the memory layout of the 16-bit value, ABCDH in a big-endian 16-bit machine, 05
and a little-endian 16-bit machine?
b. What would the layouts be in 32-bit machines?
133. What would the layout of the following data structure be in little-endian and big-endian 04
machines?
char d[7]; /* ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’ byte array */

ARITHMETIC UNIT
OBJECTIVE: A basic operation in all digital computers is the addition or subtraction of two numbers.
Arithmetic operations occur at the machine instruction level. They are implemented along with basic
logic functions. In this chapter we learn about design of arithmetic and logic unit viz., Adders,
Multiplications, etc., booth’s algorithm, representation of Floating point numbers in IEEE standards and
its implementation.

134. Explain 2’s complement Adder/ Subtracter with a suitable block diagram. 08
135. Give the Pseudocode for multiplying 2 m-digit unsigned integers. 05
136. Explain 2’s complement multiplier with suitable block diagram. 08
137. Write the procedure for integer division for dividing (101101)2 (45)10 by (000110)2 (6)10. 05
138. Explain floating-point addition and subtraction with a suitable example and also give the 08
h/w structure for that.
139. Give the procedure for floating-point multiplication and division. 05
140. Perform addition and subtraction on the following pairs of numbers represented in 2’s- 06
complement format. In each case, verify whether overflow has occurred or not. The
numbers are represented using 7-bits including the sign bit.
a) +25 and +38 b) +33 and +51 c) –24 and +63
d) –23 and –57 e) –12 and –40 f) –62 and +18
141. Show how to implement a full adder using half-adders and external logic gates. 08
142. Design a BCD adder for adding 2 decimal digits using 4-bit binary adder and external logic 06
gates. The inputs are A = A3 A2A1A0 and B = B3B2B1B0 and a carry-in, cin bit. The range of
A and B is from 0 to 9.
143. Work out the multi level look-ahead carry scheme for doing a 32-bit number addition. 10*
How many gate delays are required to do the complete addition in this method?
144. Design a 16-bit adder using 4-bit ripple-carry adder blocks. Calculate the time required to 08
generate the sum and output carry assuming a CUP frequency of 100 MHz.
145. Design a 16-bit adder using 4-bit carry-lookahead adder blocks. Calculate the time 10
required to generate the sum and output carry assuming a CUP frequency of 100 MHz. Is
there any improvement in performance?
146. Write a note on IEEE standard for floating-point numbers. 08*
147. Write the complete logic diagram of 4-bit carry-lookahead adder. How many logic gates 08
are required?
148. Using longhand methods, perform the operations AxB and A÷B on the given set of 5-bit 06
unsigned numbers a) A = 10101, B = 00101 b) A = 11001, B = 01000
149. Multiply each of the following pairs of signed 2’s – complement numbers using Booth 08
Algorithm. A is the multiplicand and B is the multiplier. What is your observation in each
case?
a) A = 010111, B = 110110 b) A = 111000, B = 011111
c) A = 001110, B = 001110 d) A = 001101, B = 010101
150. Multiply each of the following pairs of signed 2’s – complement numbers using bit-paring 10
of the multipliers. A is the multiplicand and B is the multiplier. What is your observation in
each case?
a) A = 010111, B = 110110 b) A = 111000, B = 011111
c) A = 001110, B = 001110 d) A = 001101, B = 010101
151. Show the sequential multiplication process for each of the following pairs of numbers. X is 06
the multiplier and Y is the multiplicand.
a) X = 0101, Y = 1101 b) X = 1110, Y = 0111
152. Perform the operation of division using a) restoring and b) non-restoring method on the 08
following pairs of numbers. X is the divisor and Y is the dividend.
a) X = 0101, Y = 11111 b) X = 1001, Y = 10010
153. Represent the following decimal numbers using IEEE standard floating point notation. 08
a) +1.725 b) –25.125 c) –0.08125 d) +45
154. The hexadecimal value of ∏ is 3.243F6A8885A308D3… Work out the IEEE standard 10*
representation (IEEE standard 754-1985) of ∏ in single and double precision formats.
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 49
155. Give Booth’s algorithm to multiply two binary numbers. Explain the working of the 12*
algorithm taking an example.
156. Perform the arithmetic operations below with binary numbers and with negative numbers 06
in signed-2’s complement representation. Use seven bits to accommodate each number
together with its sign. In each case, determine if there is an overflow by checking the
carries into and out of the sign bit position.
a. (+35) + (+40)
b. (-35) + (-40)
c. (-35) – (+40)
157. Prove that the multiplication of two n-digit numbers in base r gives a product no more 06
than 2n digits in length. Show that this statement implies that no overflow can occur in
the multiplication operation.
158. What decimal value does the binary word 1010 1111 0101 0100 have when it represents 04
an a. unsigned integer b. 1’s complement integer
c. 2’s complement integer d. sign-magnitude integer
159. Design a 3-bit carry lookahead adder and determine the maximum number of gates 08
between any input and each of the four outputs (3 sum bits and a carry)
160. How many gate delays are there in the longest path from some input to some output of a 08
64-bit adder using 4-bit carry lookahead groups and a multiple level structure? Compare
with the longest path for a 64-bit ripple carry adder.

BASIC PROCESSING UNIT


OBJECTIVE: A typical computing task consists of a series of steps specified by a sequence of machine
instructions that constitute a program. In this chapter we focus on the processing unit, which executes
machine instructions and coordinates the activities of other units. In this chapter we learn about the
processor’s internal structure and how it performs the tasks of fetching, decoding, and executing
instructions of a program, fundamental concepts- register transfer, execution of instruction, control
unit–design of hardwired & microprogram sequencing, microinstruction with next–address field.

161. Why is the Wait-for-memory-function-completed step needed for reading from or writing 04
to the main memory?
162. Assume that a memory read or write operation takes the same time as one internal 04
processor step and that both the processor and the memory are controlled by the same
clock. Estimate the execution time of this sequence.
163. Assume that propagation delays along the bus and through the ALU of figure 1 are 0.3 04
and 2 ns, respectively. The set up time for the registers is 0.2 ns and the hold time is 0.
What is the minimum clock period needed?
164. Write the sequence of control steps required for the bus structure in figure 1 in each of 06
the following instructions:
a) Add the immediate number NUM to register R1.
b) Add the contents of memory location NUM to register R1.
c) Add the contents of the memory location whose address is at memory location NUM to
register R1.
Assume that each instruction consists of two words. The first word specifies the operation
and the addressing mode, and the second word contains the number NUM.

165. Step Action 06


1 PCout , MARin , READ , Select4, Add, Zin
2 Zout , PCin ,Yin ,WMFC
3 MDRout , IRin
4 R3out , MARin , Read
5 R1out , Yin , WMFC
6 MDRout ,Select Y, Add, Zin
7 Zout , R1in , End
Consider the add instruction that has the control sequence given above. The processor is
driven by a continuously running clock, such that each control step is 2 ns in duration how
long will the processor have to wait in steps 2 and 5, assuming that a memory read
operation takes 16 ns to complete? What percentage of time is the processor idle during
execution of this instruction?
166. Show the control steps for the Branch on Negative instruction for a processor with three- 06
bus organization of the data path. (Refer figure 4)
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 50
167. The multiplexer and feed back connection in figure 2 eliminates the need for gating the 08
clock input as a means of enabling and disabling register input. Using a timing diagram,
explain the problems that may arise if clock gating were used.
168. Write a microroutine, such as the one shown below, for the instruction 06
MOV X (Rsrc), Rdst
when the source and destination operands are specified in index and register addressing
modes respectively.
Address Microinstruction for Add (Rsrc)+, Rdst
(octal)
000 PCout , MARin , Read, Select4, Add, Zin
001 Zout , PCin , Yin , WMFC
002 MDRout , IRin
003 µBranch {μPC<--101 (from instruction decoder);
μPC5,4 Å [IR10,9 ]; μPC3 Å [IR10 ] · [IR9 ] · [IR8]}
121 Rsrcout ,MARin, Read, Select4, Add, Zin
122 Zout , Rsrcin
123 μBranch {µPC Å 170;μPC0 Å [IR8]}, WMFC
170 MDRout , MARin , Read, WMFC
171 MDRout ,Yin
172 Rdstout , SelectY, Add, Zin
173 Zout , Rdstin , End
169. A BGT (Branch if>0) machine instruction has the expression Z+(N +V)=0 as its branch 08
condition, where Z, N and V are the zero, negative and overflow condition flags
respectively. Write a microroutine that can implement this instruction. Show the circuitry
needed to test the condition codes.
170. What are the advantages and disadvantages of hardwired and microprogrammed control? 06
171. Show the basic organization of a CPU in terms of registers and other units for a single bus 08
data path CPU. In such a CPU, show the complete action of the CPU in fetching and
executing the instruction.
172. Explain single bus organization of the processor. 06
173. Discuss the internal and external operations performed in a computer system. 04
174. Discuss the need for gating signals with an example. 06
175. With the help of a neat sketch, explain three-bus organization of the processor. 06
176. Discuss how unconditional branching is taken into account in a control sequence. 04
177. Write the sequence of control steps required to perform the following operations in a 06
single bus structure.
a. Add the contents of memory location NUM to register R1 and storing the result in
NUM.
b. Add an immediate number VALUE to register R1 and storing the result in R1.
c. Add the contents of a memory location whose address is at memory location NUM to
register R1.
178. Write the control sequence for the operation Sub R2, R3, R4 of the three-bus organization 04
of a processor.
179. Discuss the organization of hardwired control unit. 08
180. Describe the organization of microprogrammed control unit. Define the following terms: 10
microinstruction, microoperation, microroutine, control word and control store.
181. Describe how field encoding of microinstructions is implemented? 06
182. Discuss two types of microinstructions. 04
183. Write a microroutine for the instruction MOV X (Rsrc), Rdst. 06

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 51
184. Show the basic organization of a CPU in terms of registers and other units for a single bus 10*
data path CPU. In such a CPU, show the complete action of CPU in fetching and executing
the instruction.
Load R1 from memory data at A, where A is a memory address. Assume the instruction is
in one process or word. Indicate the control signals to be used at each stage of execution.
185. Explain the basic concepts of micro programmed control. 10*
186. Show the control sequences for execution of Add (R3), R1 and explain. 06*
187. A computer has 32-bit instructions and 12-bit addresses. If there are 250 two-address 04
instructions, how many one-address instructions can be formulated?
188. A two-word instruction is stored in memory at an address designated by the symbol W. 06
The address field of the instruction (stored at W+1) is designated by the symbol Y. The
operand used during the execution of the instruction is stored at an address symbolized
by Z. An index register contains the value X. State how Z is calculated from the other
addresses if the addressing mode of the instruction is
a. Direct
b. Indirect
c. Relative
d. Indexed
189. Perform the logic AND, OR and XOR with the two binary strings 10011100 and 10101010. 04

EMBEDDED SYSTEMS
OBJECTIVE: Computer systems are used in a myriad of applications; therefore they come in a variety
of organizations, sizes, and capabilities. A physical system that employs computer control for a specific
purpose rather than for general-purpose computation is referred to as an embedded system. In this
chapter, we learn about embedded applications and microcontrollers for embedded systems.

190. Explain the applications of Embedded systems. 05


191. With a neat block diagram explain the working of a microwave oven system. 06*
192. With a neat block diagram explain digital camera. 10*
193. What is Embedded Processor? Explain. 08
194. Write the Organization of Micro controller with a neat diagram. 08
195. Write short notes on: 08
a) Embedded Processor Families and its features. b) System design approaches.
c) Field Programmable Gate Array [FPGA] d) Interrupt Control mechanism.

Marks No. of Questions


04 34
05 23
06 68
08 49
10 19
12 01
20 01
Total 195

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 52
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 53
Bus A Bus B Bus C
Incrementer

PC

Register
file

Constant 4

MU
X A
ALU R
B

Instruction
decoder

IR

MDR

MAR

Memory bus Address


data lines lines
Figure 4. Three-b organization of the datapath

Figure 4. Three-b us org anization of the datapath.


Table1. Generic addressing modes

Name Assembler syntax Addressing function


Immediate #Value Operand = Value
Register Ri EA = Ri
Absolute (Direct) LOC EA = LOC
Indirect (Ri) EA = [Ri]
(LOC) EA = [LOC]
Index X(Ri) EA = [Ri] + X
Base with Index (Ri, Rj) EA = [Ri] + [Rj]
Base with Index and offset X(Ri, Rj)
EA = [Ri] + [Rj] + X
Relative X(PC) EA = [PC] + X
EA = [Ri];
Autoincrement (Ri)+
Increment Ri
Decrement Ri;
Autodecrement -(Ri)
EA = [Ri]

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 54
CSEL 47: OOPS LAB

Class # Programs
1 Program No: 1,2
2 Program No: 3
3 Program No: 4
4 Program No: 5
5 Program No: 6
6 Program No: 7
7 Program No: 13
8 Program No: 8
9 Program No: 9
10 Program No: 11
11 Program No: 10
12 Program No: 12
13 Program No: 14
14 Program No: 15

Sl LIST OF PROGRAMS
Given that an EMPLOYEE class contains following members:
Data members: Employee_number, Employee_Name, Basic, DA, IT, Net_Sal
1. Member functions: to read the data, to calculate Net_Sal and to print data members.
Write a c++ program to read the data of N employees and compute Net_Sal of each employee.
(DA)=52% of Basic and Income Tax (IT) = 30% of the gross salary).
Define a STUDENT class with USN, Name, and Marks in 3 tests of a subject. Declare an array of
2. 10 STUDENT objects. Using appropriate functions, find the average of two better marks for
each student. Print the USN, Name and the average marks of all the students.
Write C++ program to create a class called COMPLEX and implement the following overloading
functions ADD that return a COMPLEX number.
3.
i. ADD (a, s2) – where a is an integer (real part) and s2 is a complex number.
ii. ADD (s1, s2) – where s1 and s2 are complex numbers.
Write a C++ program to create a class called LIST (linked list) with member functions to insert
4. an element at the front as well as to delete an element from the front of the list. Demonstrate
all the functions after creating a list object.
Write a c++ program to crate a template function for quick sort and demonstrate sorting of
5.
integers and doubles.
Write a c++ program to create class called stack using an array of integers. Implement the
following operation by overloading the operators + and -.
i. s1=s1 + element; where s1 is an object of class stack and element is an
integer to be pushed on the top of the stack.
6.
ii. s1= s1 - ; where s1 is an object of the class stack. – operator pops the
element .
Handle the stack empty and stack full conditions. Also display the contents of the stack after
each, operation. By overloading the operator <<.
Write a c++ program to create a class called DATE. Accept two valid dates in the form
DD/MM/YY. Implement the following operator by overloading the operators + and -. After every
operation display the results by overloading the operator <<.
7.
i. no_of_days= d1-d2; where d1 and d2 are date objects, d1 >= d2 and
no_of_days is an integer.
ii. d2=d1+no_of_days; where d1 is a date object and no_of_days is an integer.
Write a c++ program to create a class called MATRIX using a two dimensional array of
integers. Implement the following operations by overloading the operator == which checks the
compatibility of two matrices to be added and subtracted. Perform the addition and subtraction
by overloading the operators + and - respectively. Display the results by overloading the
operator <<.
8.
If(m1==m2)
{ m3=m1+m2;
m4=m1-m2;
} else display error.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 55
Write a c++ program to create a class called OCTAL which has the characteristics of an octal
number. Implement the following operations by writing an appropriate constructor and an
overloaded operator +.
9.
i. Octal h=x; hwre x is an integer.
ii. In y=h+k; where h is an octal object and k is an integer.
Display the octal result by overloading operator <<. also display the value of h and y.
Write a c++ program to create class called QUEUE with member functions to add an element
and to delete an element from the queue. Using these member functions, implement a queue
10.
of integer and double. Demonstrate the operations by displaying the content of the queue after
every operation.
Write a c++ program to create class called DLIST (doubly linked list) with member functions to
11. insert a node a specified position and delete a node form specified position of the list.
Demonstrate the operations by displaying the content of the list after every operation.
Write a c++ program to create class called STUDENT with a data members usn,name and age.
Using inheritance creates the classes’ ugstudent and pgstudent hasving fields as semester, fees
12.
and stipend. Enter the for atleast five students. Find the semester wise average age for all ug
and pg students separately.
Write a c++ program to create a class called string and implement the following operations.
Display the results after every operation by overloading the operator <<.
13. i. STRING s1=”VTU”
ii. STRING s2=”BELGAUM”
iii. STRING s3=s1+s2;(use copy constructor)
Write a c++ program to create a class called bin_tree (binary tree) with member functions to
14. perform inorder, preorder and postorder traversals. Create a bin_tree object and demonstrate
their traversals.
Write a c++ program to create class called expression. Using appropriate member function
15.
convert a given valid infix expression to postfix form. Display the infix and postfix expressions.

NOTES

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 56
CSEL48: ALGORITHMS LAB

Class no Programs
Brute Force, Divide & Conquer
1 Program no: 1, 3a.
Divide & Conquer.
2 Program no: 4, 8.
Decrease & Conquer.
3 Program no: 5b, 3b, 10a
Decrease & Conquer.
4 Program no: 5a, 14a.
Transform & Conquer, Space & time trade offs.
5 Program no: 2, 12a.
Dynamic programming
6 Program no, 6,10b, 14b.
Dynamic Programming, Greedy Technique
7 Program no: 12b, 9.
Greedy Technique
8 Program no: 7, 13.
Coping with Limitations
9 Program no: 15, 11.

Sl. LIST OF PROGRAMS


1 Perform recursive binary search & linear search. Hence find the time required to
search an element.
2 Sort a given set of elements using heap sort method.
3 a) Sort a given set of elements using merge sort.
b) Check whether a given digraph is connected or not using DFS method.
4 Sort a given set of elements using selection sort and hence find the time required to
sort the elements.
5 a) Obtain topological ordering of vertices in a given digraph.
b) Sort a given set of elements using insertion sort method.
6 Implement 0/1 knapsack problem using dynamic programming.
7 From a given vertex in a weighted connected graph, find shortest paths to other
vertices using Dijkstra’s algorithm.
8 Sort a given set of elements using Quick sort method.
9 Find the minimum spanning tree of a given undirected graph using Kruskal’s
algorithm.
10 a) Print all nodes reachable from a given starting node in a digraph using Breadth
first search.
b) Implement all pairs shortest paths problem using Floyd’s algorithm.
11 Find a subset of a given set s={s1,s2,….n} of n positive integers whose sum is equal
to a given positive integer d. For example if S={1,2,5,6,8} and d=9, there are 2
solutions {1,2,6} and {1,8}. A suitable message is to be displayed if the given
problem instance doesn’t have a solution.
12 a) Implement Horspool algorithm for String matching.
b) Find the binomial coefficient using Dynamic programming.
13 Find Minimum-spanning tree of a given undirected graph using Prims algorithm.
14 a) Print all the nodes reachable from a given starting node in a given digraph using
DFS method.
b) Compute the transitive closure of a given directed graph using Warshall’s
algorithm.
15 Implement N queens problem.

P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 57

Anda mungkin juga menyukai