P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 1
MAT-41 ENGINEERING MATHEMATICS – IV
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)
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
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
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
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.
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
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
Literature
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 9
QUESTION BANK
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
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
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?
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.
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
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
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:
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.
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.
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
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
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*
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.
143. Apply Warshall’s algorithm to find transitive closure of the digraphs defined by the 10
following adjacency matrix.
⎡0100⎤
⎢0010⎥
⎢ ⎥
⎢0001⎥
⎢ ⎥
⎣0000⎦
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.
⎡00010⎤
⎢10100 ⎥
⎢ ⎥
⎢00001⎥
⎢ ⎥
⎢01100⎥
⎢⎣10000 ⎥⎦
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⎥⎦
Character A B C D -
Probability 0.4 0.1 0.2 0.15 0.15
⎡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*
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
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
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
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
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.
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
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
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*
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.
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.
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.
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.
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
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.
P E S Institute of Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 57