Computer Science and Engineering
Computer Science and Engineering
SEMESTER -3
COMPUTER SCIENCE AND ENGINEERING
DISCRETE MATHEMATICAL STRUCTURES
Preamble:
The purpose of this course is to create awareness in students about the basic terminologies used
in advanced courses in Computer Science and develop rigorous logical thinking for solving
different kinds of problems in Computer Science. This course helps the learner to apply the
theory and applications of elementary Counting Principles, Propositional Logic, Predicate Logic,
Lattices, Generating Functions, Recurrence Relations and Algebraic Structures eventually in
practical applications.
Course Outcomes: After the completion of the course the student will be able to
CO# CO
Check the validity of predicates in Propositional and Quantified Propositional Logic
CO1 using truth tables, deductive reasoning and inference theory on Propositional Logic
(Cognitive Knowledge Level: Apply)
Solve counting problems by applying the elementary counting techniques - Rule of
Sum, Rule of Product, Permutation, Combination, Binomial Theorem, Pigeonhole
CO2
Principle and Principle of Inclusion and Exclusion (Cognitive Knowledge Level:
Apply)
Classify binary relations into various types and illustrate an application for each type
CO3 of binary relation, in Computer Science (Cognitive Knowledge Level:
Understand)
Illustrate an application for Partially Ordered Sets and Complete Lattices, in
CO4
Computer Science (Cognitive Knowledge Level: Apply)
Explain Generating Functions and solve First Order and Second Order Linear
CO5 Recurrence Relations with Constant Coefficients (Cognitive Knowledge Level:
Apply)
Illustrate the abstract algebraic systems - Semigroups, Monoids, Groups,
CO6 Homomorphism and Isomorphism of Monoids and Groups (Cognitive Knowledge
Level: Understand)
COMPUTER SCIENCE AND ENGINEERING
Mapping of course outcomes with program outcomes
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
CO6
Assessment Pattern
Continuous Assessment Tests
Bloom’s End Semester Examination
Category Marks (%)
Test 1 (%) Test 2 (%)
Remember 30 30 30
Understand 30 30 30
Apply 40 40 40
Analyze
Evaluate
Create
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
There will be two parts; Part A and Part B. Part A contains 10 questions with 2 questions from
each module, having 3 marks for each question. Students should answer all questions. Part B
contains 2 full questions from each module of which student should answer any one. Each
question can have maximum 2 sub-divisions and carries 14 marks.
Syllabus
Module – 1 (Fundamentals of Logic)
Mathematical logic - Basic connectives and truth table, Statements, Logical Connectives,
Tautology, Contradiction. Logical Equivalence - The Laws of Logic, The Principle of duality,
Substitution Rules . The implication - The Contrapositive, The Converse,The Inverse.
Logical Implication - Rules of Inference. The use COMPUTER
of Quantifiers SCIENCE ANDQuantifier.
- Open Statement, ENGINEERING
Logically Equivalent – Contrapositive, Converse , Inverse , Logical equivalences and
implications for quantified statement, Implications , Negation .
Partially ordered Set – Hasse Diagram, Maximal-Minimal Element, Least upper bound (lub),
Greatest Lower bound(glb) ( Topological sorting Algorithm- excluded). Equivalence Relations
and Partitions - Equivalence Class.
Lattice - Dual Lattice , Sub lattice , Properties of glb and lub , Properties of Lattice , Special
Lattice , Complete Lattice, Bounded Lattice, Completed Lattice , Distributive Lattice.
Text Book
PART A
1. Show the following implication without constructing the truth table: (P ^ Q) => P→Q
2. Write the negation of the following statement. “ If I drive, then I will not walk”
3. What is pigeon hole principle? Explain. If you select any five numbers from 1 to 8 then
prove that at least two of them will add up to 9 .
4. In how many ways can the letters of the word ALLAHABAD be arranged ?
5. Show that the divisibility relation ' / ' is a partial ordering on the set Z+.
6. Consider the functions given by f(x) = 2x+3 and g(x) = x2. Find (g o f ) and ( f o g).
7. What is meant by exponential generating function? Explain.
8. Provide one example of linear homogeneous recurrence relation. Mention the degree
also.
9. What is a monoid ? Explain.
10. Let (A, .) be a group. Show that (ab)-1 = b-1a-1
(10 x 3 = 30 Marks)
PART B
(Answer any one Question from each Module. Each question carries 14 Marks)
11.
(a) Show that S ⋁ R is tautologically implied by (PVQ) ⋀ (P→R) ⋀ (Q→S)
(6 marks)
(b) Show that from COMPUTER SCIENCE AND ENGINEERING
(ii) (∃x)(F(x) ⋀ S(x)) → (y) (M(y) → W(y)).
(iii)(∃y) (M(y) ⋀ W(y)) the conclusion (x)(F(x) → S(x)) follows.
(8 marks)
OR
12.
(a) Show that (x) (P(x) ⋁ Q(x)) ⇒ ((x)P(x) ⋁ (∃x) Q(x)) using indirect method of
proof .
(6 marks)
(b) Discuss indirect method of proof . Show that the following premises are inconsistent
(i) If Jack misses many classes through illness, then he fails high school.
(ii) If Jack fails high school, then he is uneducated.
(iii)If Jack reads a lot of books, then he is not uneducated.
(iv) Jack misses many classes through illness and reads a lot of books.
(8 marks)
13.
(a) Explain binomial theorem. Determine the coefficient of x9y3 in the expansion of
(x+y)12, (x+2y)12 and (2x- 3y)12 using binomial theorem.
(6 marks)
(b) How many 5 digit numbers can be formed from the digits 1,2,3,4,5 using the digits without
repetition ?
15.
COMPUTER
(a) Let A = { 1,2,3,4,...11,12} and let R be the equivalenceSCIENCE
relation on AAND ENGINEERING
x A defined by
(a,b) R (c,d) iff a+d = b+c. Prove that R is an equivalence relation and find the
equivalence class of (2 ,5)
(8 marks)
(b) What is a chain lattice ? Explain. Also show that every chain is a distributive lattice.
(6 marks)
OR
16.
(a) Suppose f(x) = x+2 , g(x) = x-2, and h(x) = 3x for x ɛ R , where R is the set of real
numbers. Find (g o f ) , ( f o g ) , (f o f) and ( g o g)
(8 marks)
(b) Let R and S be two relations on a set A . If R and S are symmetric, Prove that (R∩S)
is also symmetric.
(6 marks)
17.
(a) Solve the recurrence relation ar - 7ar-1+ 10ar-2 = 0 for r ≥ 2 ; Given a0 = 0; a1 = 41
using generating functions
(8 marks)
(b) Solve the recurrence relation ar - 4ar-1 + 4ar-2 = (r+1)2 using generating function.
(6 marks)
OR
18.
(a) Solve an - 3an-1 + 2 ; a0 = 1 n ≥ 1, using generating functions.
(8 marks)
(b) Use generating function to solve the following recurrence relation an = 2an-1+ 2n ;
with a0 = 2.
(6 marks)
19.
(a) Prove that the set 'Q' of rational numbers other than 1 forms an abelian group with
respect to the operation ' * ' defined by a * b = a+b -ab.
(8 Marks)
(b) Show that the direct product of two group is a group.
(6 Marks)
OR
20.
(a) Show that the subgroup of a cyclic group is cyclic.
(8 Marks)
(b) Let (A,*) be a group. Show that (A,*) is an abelian group if and only if a2* b2=(a*b)2 for all
‘a’ and ‘b’ in A
(6 Marks)
COMPUTER
TEACHING PLAN SCIENCE AND ENGINEERING
No of Lecture
No Contents
Hrs
Module – 1 (Fundamentals of Logic) (9 hrs)
1.1 1
Mathematical logic, Basic Connectives and Truth Table
YEAR OF
CST DATA CATEGORY L T P CREDIT
INTRODUCTION
201 STRUCTURES
PCC 3 1 0 4 2019
Preamble: This course aims at moulding the learner to understand the various data structures,
their organization and operations. The course helps the learners to assess the applicability of
different data structures and associated algorithms for solving real world problem which requires
to compare and select appropriate data structures to solve the problem efficiently. This course
introduces abstract concepts for data organization and manipulation using data structures such as
stacks, queues, linked lists, binary trees, heaps and graphs for designing their own data structures
to solve practical application problems in various fields of Computer Science.
Identify the suitable data structure (array or linked list) to represent a data item
required to be processed to solve a given computational problem and write an
CO2
algorithm to find the solution of the computational problem (Cognitive Knowledge
Level: Apply)
Store a given dataset using an appropriate Hash Function to enable efficient access of
CO4
data in the given set (Cognitive Knowledge Level: Apply)
Select appropriate sorting algorithms to be used in specific circumstances (Cognitive
CO5
Knowledge Level: Analyze)
Design and implement Data Structures for solving real world problems efficiently
CO6
(Cognitive Knowledge Level: Apply)
COMPUTER SCIENCE AND ENGINEERING
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
CO6
Assessment Pattern
Remember 30 30 30
Understand 30 30 30
Apply 40 40 40
COMPUTER SCIENCE AND ENGINEERING
Analyse
Evaluate
Create
Mark Distribution
Attendance : 10 marks
First Internal Examination shall be preferably conducted after completing the first half of the
syllabus and the Second Internal Examination shall be preferably conducted after completing
remaining part of the syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions
each from the completed modules and 1 question from the partly covered module), having 3
marks for each question adding up to 15 marks for part A. Students should answer all questions
from Part A. Part B contains 7 questions (preferably, 3 questions each from the completed
modules and 1 question from the partly covered module), each with 7 marks. Out of the 7
questions in Part B, a student should answer any 5.
There will be two parts; Part A and Part B. Part A contains 10 questions with 2 questions from
each module, having 3 marks for each question. Students should answer all questions. Part B
contains 2 questions from each module of which a student should answer any one. Each question
can have maximum 2 sub-divisions and carries 14 marks.
COMPUTER SCIENCE AND ENGINEERING
SYLLABUS
Module 1
Module 2
Module 4
Trees and Graphs
Trees, Binary Trees-Tree Operations, Binary Tree Representation, Tree Traversals, Binary Search
Trees- Binary Search Tree Operations
Graphs, Representation of Graphs, Depth First Search and Breadth First Search on Graphs,
Applications of Graphs
Module 5
Text Book
Reference Books
3. Aho A. V., J. E. Hopcroft and J. D. Ullman, Data Structures and Algorithms, Pearson
Publication.
Course Outcome1(CO1): Write an algorithm for matrix multiplication and calculate its
time complexity.
Course Outcome 2(CO2): How a linked list can be used to represent the polynomial
5x4y6+24x3y4-17x2y3+15xy2+45.Write an algorithm to add two Bivariate polynomials
represented using linked list.
Course Outcome 3(CO3): Create a Binary search Tree with node representing the
following sequence 14, 15, 4, 18, 9, 16, 20, 17, 3, 7, 5, 2 and perform inorder, preorder
and postorder traversals on the above tree and print the output.
Course Outcome 4(CO4): The size of a hash table is 7. The index of the hash table
varies from 0 to 6. Consider the keys 89, 18, 49, 58, 25 in the order. Show how the keys
are stored in the hash table using Linear probing.
COMPUTER SCIENCE AND ENGINEERING
Course Outcome 5(CO5): In what circumstances does Quick Sort perform over Merge
sort.
Course Outcome 6(CO6): Design a reservation system for railways that include
waiting list. If the reservation is full “Display reservation full” and put the passenger in
in waiting list and give a waiting list number. If a passenger cancels the ticket, then the
seat should be automatically allocated to the first passenger in the waiting list.
QP CODE: PAGES:3
Reg No:_______________
Name:_________________
PART A
1. Calculate the frequency count of the statement x = x+1; in the following code segment
x = x + 1;
4. Convert the expression ((A/(B-D+E))*(F-G)*H) to postfix form. Show each step in the
conversion including the stack contents
5. Write an algorithm to count the number of occurrences of a character in a linked list (each
node contains only one character)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A B C - D E - - - - F G - - -
B C D
E F G
10. Let the size of a hash table is 10. The index of the hash table varies from 0 to 9. Assume
the keys 73, 54, 15, 48, 89, 66, 37, 18, 41, 22, 62 are mapped using modulo operator.
Show how the keys are distributed using chaining method.
COMPUTER SCIENCE AND ENGINEERING
Part B
Answer any one Question from each module. Each question carries 14 Marks
OR
12. a) Write algorithms for Linear Search and Binary Search and Compare their time
complexities (10)
b) Between O(nlogn) and O(logn) which one is better and why? (4)
13. a) Write algorithms to insert and delete elements from a double ended queue.
OR
14. a) Write an algorithm to insert and delete elements from a Priority Queue (8)
15. a) Write an algorithm to multiply two polynomials represented using linked list (10)
OR
b) Discuss the advantages and disadvantages of First-fit, Best-fit and Worst-fit allocation
schemes (6)
COMPUTER SCIENCE AND ENGINEERING
17. a) List the properties of Binary Search Tree. Write an algorithm to search an element
OR
18. a) Give algorithms for DFS and BFS of a graph and explain with examples (8)
19. a) Write algorithms for Merge sort and Quick Sort. (10)
b) Illustrate the working of Quick sort on the following input 38, 8, 0, 28, 45, -12, 89, 66,
42 (4)
OR
20. a) With examples discuss the different hash functions used for hashing (10)
b) Apply the hash function h(x) = x mod 7 for linear probing on the data 2341, 4234,
2839, 430, 22, 397, 3920 and show the resulting hash table (4)
Teaching Plan
Module 1 :Basic Concepts of Data Structures (5 hours)
4.7 Depth First Search and Breadth First Search on Graphs 1hour
4.8 Applications of Graphs 1hour
Preamble: The objective of the course is to familiarize learners with the basic concepts of
Boolean algebra and digital systems. This course covers the design of simple combinational and
sequential logic circuits, representation and arithmetic algorithms for Binary, BCD (Binary
Coded Decimal) and Floating point numbers which in turn are helpful in understanding
organization & design of a computer system and understanding how patterns of ones and zeros
can be used to store information on computers, including multimedia data.
Prerequisite: Nil
Course Outcomes: After the completion of the course the student will be able to
CO# CO
Illustrate decimal, binary, octal, hexadecimal and BCD number systems, perform
conversions among them and do the operations - complementation, addition,
CO1
subtraction, multiplication and division on binary numbers (Cognitive Knowledge
level: Understand)
Simplify a given Boolean Function and design a combinational circuit to implement
CO2 the simplified function using Digital Logic Gates (Cognitive Knowledge level:
Apply)
Design combinational circuits - Adders, Code Convertors, Decoders, Magnitude
CO3 Comparators, Parity Generator/Checker and design the Programmable Logic Devices -
ROM and PLA. (Cognitive Knowledge level: Apply)
Design sequential circuits - Registers, Counters and Shift Registers. (Cognitive
CO4
Knowledge level: Apply)
Use algorithms to perform addition and subtraction on binary, BCD and floating point
CO5
numbers (Cognitive Knowledge level: Understand)
COMPUTER SCIENCE AND ENGINEERING
Mapping of course outcomes with program outcomes
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
Assessment Pattern:
End Semester
Bloom’s Category Test 1 (%) Test 2 (%)
Examination Marks (%)
Remember 20 20 20
Understand 35 35 35
Apply 45 45 45
Analyse
Evaluate
Create
Mark Distribution: COMPUTER SCIENCE AND ENGINEERING
150 50 100 3
SYLLABUS
Module I
Number systems, Operations & Codes
Decimal, Binary, Octal and Hexadecimal Number Systems- Number Base Conversions.
Addition, Subtraction, Multiplication and Division of binary numbers. Representation of
negative numbers- Complements, Subtraction with complements. Addition and subtraction of
BCD, Octal and Hexadecimal numbers. Binary codes- Decimal codes, Error detection codes,
Reflected code, Character coding schemes – ASCII, EBCDIC.
Module II
Boolean Algebra
Postulates of Boolean Algebra. Basic theorems and Properties of Boolean Algebra. Boolean
Functions - Canonical and Standard forms. Simplification of Boolean Functions- Using
Karnaugh- Map Method (upto five variables), Don’t care conditions, Product of sums
COMPUTER
simplification, Tabulation Method. Digital Logic SCIENCE
Gates- Implementation AND ENGINEERING
of Boolean functions
using basic and universal gates.
Module III
Combinational Logic Circuits
Design Procedure & Implementation of combinational logic circuits- Binary adders and
subtractors, Binary Parallel adder, Carry look ahead adder, BCD adder, Code converter,
Magnitude comparator, Decoder, Demultiplexer, Encoder, Multiplexer, Parity generator/
Checker.
Module IV
Sequential logic circuits:
Flip-flops- SR, JK, T and D. Triggering of flip-flops- Master slave flip- flops, Edge- triggered
flip- flops. Excitation table and characteristic equation. Registers- register with parallel load.
Counter design: Asynchronous counters- Binary and BCD counters, timing sequences and state
diagrams. Synchronous counters- Binary Up- down counter, BCD counter.
Module V
Shift registers
Shift registers – Serial In Serial Out, Serial In Parallel Out, Bidirectional Shift Register with
Parallel load. Ring counter. Johnson counter- timing sequences and state diagrams.
Arithmetic algorithms
Algorithms for addition and subtraction of binary numbers in signed magnitude and 2’s
complement representations. Algorithm for addition and subtraction of BCD numbers.
Representation of floating point numbers, Algorithm for addition and subtraction of floating
point numbers.
Text Books:
1. M. Morris Mano, Digital Logic & Computer Design, 4/e, Pearson Education, 2013
2. Thomas L Floyd, Digital Fundamentals, 10/e, Pearson Education, 2009.
3. M. Morris Mano, Computer System Architecture, 3/e, Pearson Education, 2007.
Reference Books:
1. M. Morris Mano, Michael D Ciletti , Digital Design With An Introduction to the Verilog
HDL, 5/e, Pearson Education, 2013.
2. Donald D Givone, Digital Principles and Design, Tata McGraw Hill, 2003
Sample Course Level Assessment Questions COMPUTER SCIENCE AND ENGINEERING
Course Outcome 2(CO2): Given a Boolean function F and don’t care conditions D, using
Karnaugh map obtain the simplified expression in (i) SOP and (ii) POS:
! F(A, B, C, D) = A′B′D′ + A′CD + A′BC
! D(A, B, C, D) = A′BC′D + ACD + A B′D
Reg No:_______________
Name:_________________
PART-A
1. Represent the decimal numbers (459)10 and (859)10 in hexadecimal and perform
2. Subtract (1101)
! 2 from !(11010)2 using: i) !2′s complement and ii) 1′
! s complement
arithmetic.
8. Construct D flip- flop using NAND gates. Also give its truth table.
9. Explain how a shift register is used for serial data transfer?
PART-B
(Answer any one full question from each module) (14X5=70)
COMPUTER SCIENCE AND ENGINEERING
11. (a) Perform the following operations using 2’s complement arithmetic: (8)
(i) !8810 + (−37)10 (ii) !(−20)10 + (−12)10
OR
(b) Using K-map, simplify the Boolean function F in sum of products form, (10
using the don’t care conditions d:
!F(w, x, y, z) = w′(x′y + x′y′ + x yz) + x′z′(y + w)
!d(w, x, y, z) = w′ x (y′z + yz′) + w yz
OR
14. (a) Simplify the following expressions using Karnaugh- map method. (8)
(i) !F = Σ(0,2,4,6,9,11,13,15,17,21,25,27,29,31)
(ii) !F = Π(0,2,5,7)
∑
(i) !F(x, y, z, a) = (1,3,7)
(iii) F(A,
! B, C, D) = Π(0,1,2,3,4,6,12)
15. (a) Implement Full adder circuit using NAND gate only. (4)
(b) Design a code converter for converting BCD to Excess 3 code (10)
OR
16. (a) With a neat diagram explain 4-bit carry look-ahead adder. (6)
COMPUTER SCIENCE AND ENGINEERING
(b) Design a Gray to binary code converter using a 4x1 MUX. Draw the (8)
circuit diagram and explain.
17. (a) Design a counter that count the states 0,3,5,6,0… using T flip- flops. (10)
(b) Write the characteristics equation, excitation table of JK, T and D flipflop. (4)
OR
18. (a) Explain race around condition and how it can be avoided. (6)
(b) Design a synchronous Binary Up-Down Counter. (8)
19. (a) With a neat diagram explain universal shift register. (8)
20. (a) Write algorithm for floating point addition and subtraction. (8)
(b) Implement the functions Y
! 1 = A B′C′ + A B′C + A BC and Y
! 2 = BC + AC (6)
using minimum gates Programmable Logic Array.
Teaching Plan
(7
Module 1: Number systems, Operations & Codes (No algorithms)
hours)
Number Systems: Decimal, Binary, Octal and Hexadecimal number systems,
1.1 1 hour
Number Base Conversions.
2.4 Simplification of Boolean Functions: Karnaugh -Map Method (upto five 1 hour
variables), Don’t care conditions (Lecture 1)
Simplification of Boolean Functions: Karnaugh -Map Method (upto five
2.5 1 hour
variables), Don’t care conditions (Lecture 2)
Digital Logic Gates: AND, OR, NOT, NAND, NOR, XOR, XNOR,
2.8 Implementation of Boolean functions using basic and universal gates. (Lecture 1 hour
1)
Digital Logic Gates: AND, OR, NOT, NAND, NOR, XOR, XNOR,
2.9 Implementation of Boolean functions using basic and universal gates. (Lecture 1 hour
2)
(9
Module 3: Combinational Logic Circuits
hours)
Binary Adders:
3.2 1 hour
Implementation of Half Adder, Full Adder
Binary Subtractors:
3.3 1 hour
Implementation of Half Subtractor, Full Subtractor
Implementation of Binary Parallel Adder ,Carry look ahead Adder, BCD Adder
3.4 1 hour
(Lecture 1)
Implementation of Binary Parallel Adder ,Carry look ahead Adder, BCD Adder
3.5 1 hour
(Lecture 2)
COMPUTER SCIENCE AND ENGINEERING
Implementation of Various Combinational Circuits:
3.6 1 hour
Code Converters, Magnitude Comparator
(9
Module 4: Sequential logic circuits:
hours)
Flip flops:
4.1 1 hour
SR, JK, T and D flip- flops (Lecture 1)
Counter Design:
4.7 Asynchronous counters- Binary and BCD counters- timing sequences and state 1 hour
diagrams. (Lecture 1)
Asynchronous counters- Binary and BCD counters- timing sequences and state
4.8 1 hour
diagrams. (Lecture 2)
4.9 Synchronous counters- Binary Up- down counter, BCD counter 1 hour
(11
Module 5: Shift registers, Arithmetic algorithms & PLD’s
hours)
5.1 Shift Registers - Serial In Serial Out, Serial In Parallel Out. 1 hour
Preamble: The purpose of this course is to enable learners to solve problems by breaking it
down to object level while designing software and to implement it using Java. This course covers
Object Oriented Principles, Object Oriented Programming in Java, Inheritance, Exception
handling, Event handling, multithreaded programming and working with window-based
graphics. This course helps the learners to develop Desktop GUI Applications, Mobile
applications, Enterprise Applications, Scientific Applications and Web based Applications.
Course Outcomes: After the completion of the course the student will be able to
Write Java programs using the object oriented concepts - classes, objects,
CO1 constructors, data hiding, inheritance and polymorphism (Cognitive Knowledge
Level: Apply)
Utilise datatypes, operators, control statements, built in packages & interfaces, Input/
CO2 Output Streams and Files in Java to develop programs (Cognitive Knowledge Level:
Apply)
Illustrate how robust programs can be written in Java using exception handling
CO3
mechanism (Cognitive Knowledge Level: Understand)
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
Assessment Pattern
Remember 30 30 30
Understand 30 30 30
Apply 40 40 40
Analyse
Evaluate
Create
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
Attendance : 10 marks
First series test shall be preferably conducted after completing the first half of the syllabus and
the second series test shall be preferably conducted after completing remaining part of the
syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions
each from the completed modules and 1 question from the partly covered module), having 3
marks for each question adding up to 15 marks for part A. Students should answer all questions
from Part A. Part B contains 7 questions (preferably, 3 questions each from the completed
modules and 1 question from the partly covered module), each with 7 marks. Out of the 7
questions in Part B, a student should answer any 5.
End Semester Examination Pattern: There will be two parts; Part A and Part B. Part A contains
10 questions with 2 questions from each module, having 3 marks for each question. Students
should answer all questions. Part B contains 2 questions from each module of which a student
should answer any one. Each question can have maximum 2 sub-divisions and carry 14 marks.
COMPUTER SCIENCE AND ENGINEERING
SYLLABUS
Module 1
Introduction:
Approaches to Software Design - Functional Oriented Design, Object Oriented Design, Case
Study of Automated Fire Alarm System.
Object Modeling Using Unified Modeling Language (UML) – Basic Object Oriented concepts,
UML diagrams, Use case model, Class diagram, Interaction diagram, Activity diagram, State
chart diagram.
Introduction to Java - Java programming Environment and Runtime Environment, Development
Platforms -Standard, Enterprise. Java Virtual Machine (JVM), Java compiler, Bytecode, Java
applet, Java Buzzwords, Java program structure, Comments, Garbage Collection, Lexical Issues.
Module 2
Module 4
Advanced features of Java:
Java Library - String Handling – String Constructors, String Length, Special String Operations -
Character Extraction, String Comparison, Searching Strings, Modifying Strings, using valueOf(),
Comparison of StringBuffer and String.
Collections framework - Collections overview, Collections Interfaces- Collection Interface, List
Interface.
Collections Class – ArrayList class. Accessing a Collection via an Iterator.
Event handling - Event Handling Mechanisms, Delegation Event Model, Event Classes, Sources
of Events, Event Listener Interfaces, Using the Delegation Model.
Multithreaded Programming - The Java Thread Model, The Main Thread, Creating Thread,
Creating Multiple Threads, Synchronization, Suspending, Resuming and Stopping Threads.
Module 5
Text Books:
1. Herbert Schildt, Java: The Complete Reference, 8/e, Tata McGraw Hill, 2011.
2. Rajib Mall, Fundamentals of Software Engineering, 4th edition, PHI, 2014.
3. Paul Deitel, Harvey Deitel, Java How to Program, Early Objects 11th Edition, Pearson,
2018.
Reference Books:
Course Outcome1(CO1): For the following passage develop UML diagrams and then
implement it as a Java program in accordance with your UML design.
Passage: College Office collects semester fee and college bus fee for each student. A
clerk at the college office collects the fees from each student. The bus fee is calculated
depending on the distance of the corresponding bus stop from the college. The semester
fee varies depending upon the semester as well as branch of each student. Students are
supposed to pay the fees in full. Economically backward students are eligible for 50%
discount in semester fee. The consolidated fees receipt is issued to each student by the
clerk, which contains the student name, admission number, semester and branch of
student along with details of fees collected. Students can log in and view the details of
fees remitted and dues if any. The system allows students and clerk level login to the
system. Clerk is able to view reports of each class showing status of fees payment of
each student.
Course Outcome 2(CO2): Write a Java program to evaluate a post fix expression
containing two operands and a single operator using stack. Stack should be implemented
as a separate entity so as to reflect OOP concepts.
Course Outcome 3(CO3): Write a program to demonstrate the start, run, sleep and join
methods in Thread class.
Course Outcome 4(CO4): Write a GUI based program with separate buttons to add,
delete and display student details i.e. name, student ID, current semester and branch of
study based on student ID.
Course Outcome 5(CO5): Using Swing create a JFrame with a JLabel and two
JButtons. Set the texts of JButtons as “Yes” and “No” respectively. Set the JLabel’s text
to the text of the button currently being pressed. Initially the JLabel’s text is blank.
COMPUTER SCIENCE AND ENGINEERING
QP CODE: PAGES:3
Reg No:_______________
Name:_________________
PART A
2. Describe the concepts of object and class with a suitable Java program.
3. Explain the concept of method overriding with an example.
4. What is the use of the keyword final in Java?
5. Explain the concept of streams.
6. Explain any two applications of Serialization.
7. Distinguish the usage of “==” and equals() method when comparing String type?
8. What are Collections in Java? Explain any one Collection interface in Java.
9. Explain any two properties of Swing components in Java.
10. Explain JLabel component. With suitable examples explain any two of its constructors.
Part B
Answer any one question completely from each module
11.
(a) Describe in detail any three Object Oriented Programming principles. Illustrate with
suitable examples.
(9)
COMPUTER SCIENCE AND ENGINEERING
(b) What is Java Runtime Environment? What is the role of Java Virtual Machine in it?
(5)
OR
12.
(a) Compare and contrast Java standard edition and Java enterprise edition.
(5)
(b) Why is Java considered to be platform independent? What is the role of Bytecode in
making Java platform independent?
(9)
13.
(a) Explain in detail the primitive data types in Java.
(8)
(b) Explain automatic type conversion in Java with an example. What are the two
conditions required for it?
(6)
OR
14.
(a) Using a suitable Java program explain the difference between private and public
members in the context of inheritance.
(8)
(b) Is it possible to use the keyword super within a static method? Give justification for
your answer.
(6)
15.
(a) Explain in detail about byte streams and character streams with suitable code
samples.
(6)
(b) Describe in detail about exception handling, try block and catch clause with the help
of a suitable Java program.
(8)
OR
16.
(a) Explain object streams in Java. Explain the role of Serializable interface with a
suitable code sample.
(8)
(b) Explain throw, throws and finally constructs with the help of a Java program.
(6)
COMPUTER SCIENCE AND ENGINEERING
17.
(a) Describe in detail the creation of a thread using the Runnable interface and the
Thread class with suitable examples.
(10)
(b) Explain List Interface. Mention any two exceptions thrown by its methods.
(4)
OR
18.
(a) Explain in detail the Delegation Event model for event handling in Java.
(7)
(b) Write a simple program by extending appropriate class to demonstrate the working of
threads in java.
(7)
19.
(a) Write a Java program to demonstrate the use of JLabel and JButton by adding them
to JFrame.
(7)
(b) Explain step-by-step procedure of using Java DataBase Connectivity in Java
programs.
(7)
OR
20.
(a) Explain the class hierarchy of Java Swing components.
(7)
(b) Write a Java Program to create a student table and to add student details to it using
JDBC.
(7)
COMPUTER SCIENCE AND ENGINEERING
Teaching Plan
2.10 Calling Order of Constructors, Method Overriding, the Object class, 1 hour
2.11 Abstract Classes and Methods, Using final with Inheritance 1 hour
5.5 Exploring Swings –JFrame, JLabel, The Swing Buttons, JTextField. 1 hour
JDBC overview, Creating and Executing Queries – create table,
5.6 1hour
delete, insert, select (Basics only, DBMS course is not a prerequisite).
5.7 Creating and Executing Queries – create table, delete, insert, select. 1 hour
5.8 Creating and Executing Queries – create table, delete, insert, select. 1 hour
COMPUTER SCIENCE AND ENGINEERING
YEAR OF
DATA STRUCTURES CATEGORY L T P CREDIT INTRODUCTION
CSL 201
LAB
PCC 0 0 3 2 2019
Preamble: The aim of the Course is to give hands-on experience for Learners on creating and
using different Data Structures. Data Structures are used to process data and arrange data in
different formats for many applications. The most commonly performed operations on data
structures are traversing, searching, inserting, deleting and few special operations like merging
and sorting.
Write a time/space efficient program to sort a list of records based on a given key in
CO2
the record (Cognitive Knowledge Level: Apply)
Examine a given Data Structure to determine its space complexity and time
CO3
complexities of operations on it (Cognitive Knowledge Level: Apply)
CO4 Design and implement an efficient data structure to represent given data (Cognitive
Knowledge Level: Apply)
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
CO6
Assessment Pattern
Remember 20 20
Understand 20 20
Apply 60 60
Analyse
Evaluate
Create
Mark Distribution
Attendance : 15 marks
Viva-voce : 15 marks
Internal Examination Pattern: The marks will be distributed as Algorithm 30 marks, Program
20 marks, Output 20 marks and Viva 30 marks. Total 100 marks which will be converted out of
15 while calculating Internal Evaluation marks.
End Semester Examination Pattern: The marks will be distributed as Algorithm 30 marks,
Program 20 marks, Output 20 marks and Viva 30 marks. Total 100 marks will be converted out
of 75 for End Semester Examination.
COMPUTER SCIENCE AND ENGINEERING
SYLLABUS
8. Implementation of binary trees using linked lists and arrays- creations, insertion, deletion
and traversal. **
11. Implementation of sorting algorithms – bubble, insertion, selection, quick, merge sort
COMPUTER SCIENCE AND ENGINEERING
13. Representation of graphs and computing various parameters (in degree, out degree etc.) -
adjacency list, adjacency matrix.
15. Implementation of hash table using your own mapping functions and observe collisions
and overflow resolving schemes.**
17. Simulation of a basic memory allocator and garbage collector using doubly linked list.
** mandatory.
1. Write a program to read two polynomials and store them in an array. Calculate the sum of the
two polynomials and display the first polynomial, second polynomial and the resultant
polynomial.
2. C Write a program to enter two matrices in normal form . Write a function to convert two
matrices to tuple form and display it. Also find the transpose of the two matrices represented
in tuple form and display it. Find the sum of the two matrices in tuple form and display the
sum in tuple form.
3. Write a program to enter two matrices in normal form . Write a function to convert two
matrices to tuple form and display it. Also find the transpose of the two matrices represented
in tuple form and display it. Find the sum of the two matrices in tuple form and display the
sum in tuple form.
9. Using stack convert an infix expression to a postfix expression and evaluate the postfix
expression.
10. Write a program to convert an infix expression to a prefix expression using stacks.
12. Write a menu driven program for performing the following operations on a Linked List:
12.1.Display
12.2.Insert at Beginning
12.3.Insert at End
12.4.Insert at a specified Position
12.5.Delete from Beginning
12.6.Delete from End
12.7.Delete from a specified Position
16. Write a program to read two polynomials and store them using linked list. Calculate the sum
of the two polynomials and display the first polynomial, second polynomial and the resultant
polynomial.
17. Write a program to read two polynomials and store them using linked list. Find the product
of two polynomials and store the result using linked list. Display the resultant polynomial.
18. Write a program for addition of polynomials containing two variables using linked list.
19. The details of students(number, name, total-mark) are to be stored in a linked list. Write
functions for the following operations:
19.1.Insert
19.2.Delete
19.3.Search
19.4.Sort on the basis of number
19.5.Display the resultant list after every operation
20. Create a Doubly Linked List from a string taking each character from the string. Check if the
given string is palindrome in an efficient method.
22. Write a program to create a binary search tree and find the number of leaf nodes
26. Create a text file containing the name, height, weight of the students in a class. Perform
Quick sort and Merge sort on this data and store the resultant data in two separate files. Also
write the time taken by the two sorting methods into the respective files.
Eg. Sony Mathew 5.5 60
Arun Sajeev 5.7 58
Rajesh Kumar 6.1 70
27. Write a program to sort a set of numbers using Heap sort and find a particular number from
the sorted set using Binary Search.
28. Implement a Hash table using Chaining method. Let the size of hash table be 10 so that the
index varies from 0 to 9.
29. Implement a Hash table that uses Linear Probing for collision resolution
COMPUTER SCIENCE AND ENGINEERING
Course Outcomes:
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1 ! ! ! ! ! ! ! !
CO2 ! ! ! ! ! ! ! !
CO3 ! ! ! ! ! ! ! !
CO4 ! ! ! ! ! ! ! !
CO5 ! ! ! ! ! ! ! !
COMPUTER SCIENCE AND ENGINEERING
Assessment Pattern
Continuous Assessment
End Semester Examination
Bloom’s Category Test - Internal Exam
(Percentage)
(Percentage)
Remember 20 20
Understand 20 20
Apply 60 60
Analyse
Evaluate
Create
Mark Distribution
150 75 75 3 hours
COMPUTER SCIENCE AND ENGINEERING
Attendance : 15 marks
Viva-voce : 15 marks
Internal Examination Pattern: The marks will be distributed as Algorithm 30 marks, Pro-
gram 20 marks, Output 20 marks and Viva 30 marks. Total 100 marks which will be con-
verted out of 15 while calculating Internal Evaluation marks.
SYLLABUS
The syllabus contains six sessions (A, B, C, D, E, F). Each session consists of three concrete
Java exercises, out of which at least two questions are mandatory.
(A) Basic programs using datatypes, operators, and control statements in Java.
1) Write a Java program that checks whether a given string is a palindrome or not.
Ex: MALAYALAM is palindrome.
2) Write a Java Program to find the frequency of a given character in a string. **
3) Write a Java program to multiply two given matrices. **
(B) Object Oriented Programming Concepts: Problem on the use of constructors, inheritance,
method overloading & overriding, polymorphism and garbage collection:
4) Write a Java program which creates a class named 'Employee' having the following
members: Name, Age, Phone number, Address, Salary. It also has a method named 'print-
Salary( )' which prints the salary of the Employee. Two classes 'Officer' and 'Manager'
inherits the 'Employee' class. The 'Officer' and 'Manager' classes have data members 'spe-
cialization' and 'department' respectively. Now, assign name, age, phone number, address
and salary to an officer and a manager by making an object of both of these classes and
print the same. (Exercise to understand inheritance). **
5) Write a java program to create an abstract class named Shape that contains an empty
method named numberOfSides( ). Provide three classes named Rectangle, Triangle and
Hexagon such that each one of the classes extends the class Shape. Each one of the class-
es contains only the method numberOfSides( ) that shows the number of sides in the giv-
en geometrical structures. (Exercise to understand polymorphism). **
6) Write a Java program to demonstrate the use of garbage collector.
(C) Handling different types of files as well as input and output management methods:
10) Write a Java program that shows the usage of try, catch, throws and finally. **
11) Write a Java program that implements a multi-threaded program which has three threads.
First thread generates a random integer every 1 second. If the value is even, second
thread computes the square of the number and prints. If the value is odd the third thread
will print the value of cube of the number.
12) Write a Java program that shows thread synchronization. **
13) Write a Java program that works as a simple calculator. Arrange Buttons for digits and
the + - * % operations properly. Add a text field to display the result. Handle any possible
exceptions like divide by zero. Use Java Swing. **
14) Write a Java program that simulates a traffic light. The program lets the user select one of
three lights: red, yellow, or green. When a radio button is selected, the light is turned on,
and only one light can be on at a time. No light is on when the program starts. **
15) Write a Java program to display all records from a table using Java Database Connectivi-
ty (JDBC).
(F) Standard Searching and Sorting Algorithms using data structures and algorithms learned
from course Data Structures (CST 201):
** Mandatory
COMPUTER SCIENCE AND ENGINEERING
PRACTICE QUESTIONS
SEMESTER -3
MINOR
COMPUTER SCIENCE AND ENGINEERING
YEAR OF
CST OBJECT ORIENTED CATEGORY L T P CREDIT
INTRODUCTION
281 PROGRAMMING
MINOR 3 1 0 4 2019
Preamble: This is the programming course for awarding B.Tech. Minor in Computer Science
and Engineering with specialization in Software Engineering. The purpose of this course is to
enable learners to solve problems by breaking it down to object level while designing software
and to implement it using Java. This course covers Object Oriented Principles, Object Oriented
Programming in Java, Inheritance, Exception handling, Event handling, multithreaded
programming and working with window-based graphics. This course helps the learners to
develop Mobile applications, Enterprise Applications, Scientific Applications and Web based
Applications.
Course Outcomes: After the completion of the course the student will be able to
Write Java programs using the object oriented concepts - classes, objects,
CO1 constructors, data hiding, inheritance and polymorphism (Cognitive Knowledge
Level: Apply)
Utilise datatypes, operators, control statements, built in packages & interfaces, Input/
CO2 Output Streams and Files in Java to develop programs (Cognitive Knowledge Level:
Apply)
Illustrate how robust programs can be written in Java using exception handling
CO3
mechanism (Cognitive Knowledge Level: Understand)
Write application programs in Java using multithreading (Cognitive Knowledge
CO4
Level: Apply)
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
Assessment Pattern
Remember 30 30 30
Understand 30 30 30
Apply 40 40 40
Analyse
Evaluate
Create
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
Attendance : 10 marks
First series test shall be preferably conducted after completing the first half of the syllabus and
the second series test shall be preferably conducted after completing remaining part of the
syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions
each from the completed modules and 1 question from the partly covered module), having 3
marks for each question adding up to 15 marks for part A. Students should answer all questions
from Part A. Part B contains 7 questions (preferably, 3 questions each from the completed
modules and 1 question from the partly covered module), each with 7 marks. Out of the 7
questions in Part B, a student should answer any 5.
End Semester Examination Pattern: There will be two parts; Part A and Part B. Part A contains
10 questions with 2 questions from each module, having 3 marks for each question. Students
should answer all questions. Part B contains 2 questions from each module of which a student
should answer any one. Each question can have maximum 2 sub-divisions and carry 14 marks.
COMPUTER SCIENCE AND ENGINEERING
SYLLABUS
Module 1
Introduction:
Approaches to Software Design - Functional Oriented Design, Object Oriented Design, Case
Study of Automated Fire Alarm System.
Object Modeling Using UML – Basic Object Oriented concepts, UML (Unified Modeling
Language) diagrams, Use case model, Class diagram, Interaction diagram, Activity diagram,
State chart diagram.
Introduction to Java - Java programming Environment and Runtime Environment, Development
Platforms -Standard, Enterprise. Java Virtual Machine (JVM), Java compiler, Bytecode, Java
applet, Java Buzzwords, Java program structure, Comments, Garbage Collection, Lexical Issues.
Module 2
Module 4
Advanced features of Java:
Input/Output - I/O Basics, Reading Console Input, Writing Console Output, PrintWriter Class,
Object Streams and Serialization, Reading and Writing Files.
Java Library - String Handling – String Constructors, String Length, Special String Operations -
Character Extraction, String Comparison, Searching Strings, Modifying Strings, Using
valueOf(), Comparison of StringBuffer and String.
Collections framework – Collections overview, Collections Class – ArrayList. Accessing
Collections via an Iterator.
Module 5
Event handling - Event Handling Mechanisms, Delegation Event Model, Event Classes, Sources
of Events, Event Listener Interfaces, Using the Delegation Model.
Multithreaded Programming - The Java Thread Model, The Main Thread, Creating Thread,
Creating Multiple Threads, Suspending, Resuming and Stopping Threads.
Text Books:
1. Herbert Schildt, Java: The Complete Reference, 8/e, Tata McGraw Hill, 2011.
2. Rajib Mall, Fundamentals of Software Engineering, 4th edition, PHI, 2014.
3. Paul Deitel, Harvey Deitel, Java How to Program, Early Objects 11th Edition, Pearson,
2018.
Reference Books:
Course Outcome1(CO1): For the following passage develop UML diagrams and then
implement it as a Java program in accordance with your UML design.
Passage: College Office collects semester fee and college bus fee for each student. A
clerk at the college office collects the fees from each student. The bus fee is calculated
depending on the distance of the corresponding bus stop from the college. The semester
fee varies depending upon the semester as well as branch of each student. Students are
supposed to pay the fees in full. Economically backward students are eligible for 50%
discount in semester fee. The consolidated fees receipt is issued to each student by the
clerk, which contains the student name, admission number, semester and branch of
student along with details of fees collected. Students can log in and view the details of
fees remitted and dues if any. The system allows students and clerk level login to the
system. Clerk is able to view reports of each class showing status of fees payment of
each student.
Course Outcome 2 (CO2): Write a Java program to prepare the rank list of students
based one their performance in the first Semester B.Tech. Degree examination at APJ
Abdul Kalam Technological University. The output should be stored in a file.
Course Outcome 3 (CO3): Write a program to demonstrate how event handling and
exception handling are supported in Java..
Course Outcome 4 (CO4): Write a program to demonstrate the start, run, sleep and join
methods in Thread class..
COMPUTER SCIENCE AND ENGINEERING
QP CODE: PAGES:3
Reg No:_______________
Name:_________________
PART A
11.
(a) Describe in detail polymorphism, abstraction and inheritance with suitable examples.
(9)
(b) What is Java Virtual Machine?
(5)
OR
12.
(a) Compare and contrast Functional Oriented and Object Oriented approach by
considering a simple bus ticket reservation system.
(5)
(b) What is a class diagram? Explain with an example.
(9)
13.
(a) Explain primitive data types in Java. How are they different from other data types?
(8)
(b) Explain variables and arrays in Java.
(6)
OR
14.s
(a) Using a suitable Java program explain the concept of methods and constructors.
(8)
(b) Explain the keyword super and its usage in Java.
(6)
15.
(a) Using a table, explain the effect of access specifiers in inheritance.
(6)
(b) Describe in detail about exception handling using try block and catch clause in Java
with the help of a suitable Java program.
(8)
OR
16.
(a) What is an interface in Java? Explain with a suitable example.
(8)
(b) Explain throw, throws and finally constructs with the help of a Java program.
(6)
17.
COMPUTER SCIENCE AND ENGINEERING
(a) Explain ArrayList collections framework. Also explain the use of iterator in
accessing collections.
(8)
(b) Bring out difference between “==” and equals() method with the help of a sample
program
(6)
OR
18.
(a) Compare Byte Streams and Character Streams. Write a program to demonstrate the
usage of the PrintWriter class.
(8)
(b) Explain any three String constructors with the help of sample code for each.
(6)
19.
(a) Explain in detail the Delegation Event model for event handling in Java.
(7)
(b) Describe in detail the creation of a thread using the Runnable interface.
(7)
OR
20.
(a) What are the differences between a process and a thread?
(4)
(b) Write a Graphical User Interface (GUI) based Java program to implement a simple
calculator supporting the operations addition, subtraction, multiplication and
division. Use Swing controls to implement GUI. There may be three text boxes, the
first two for operands and the last for result. Add four buttons for the above
operations. Write neat comments in your program to show how you handle events.
(10)
COMPUTER SCIENCE AND ENGINEERING
Teaching Plan
3.2 Calling Order of Constructors, Method Overriding, the Object class, 1 hour
3.3 Abstract Classes and Methods, Using final with Inheritance 1 hour
Preamble: This is a programming course for awarding B. Tech. Minor in Computer Science and
Engineering with specialization in Machine Learning. The objective of the course is to provide
learners an insight into Python programming, and develop programming skills to manage the
development of software systems. It covers programming environment, important instructions,
data representations, intermediate level features, Object Oriented Programming and file data
processing of Python. This course lays the foundation to develop web applications, Machine
Learning, and Artificial Intelligence-based applications and tools, Data Science and Data
Visualization applications.
Prerequisite: Nil
Course Outcomes: After the completion of the course the student will be able to
CO1 Write, test and debug Python programs (Cognitive Knowledge level: Apply)
Illustrate uses of conditional (if, if-else, if-elif-else and switch-case) and iterative
CO2
(while and for) statements in Python programs (Cognitive Knowledge level: Apply)
Develop programs by utilizing the modules Lists, Tuples, Sets and Dictionaries in
CO3
Python (Cognitive Knowledge level: Apply)
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1 ✔ ✔ ✔ ✔ ✔ ✔
CO2 ✔ ✔ ✔ ✔ ✔ ✔
CO3 ✔ ✔ ✔ ✔ ✔ ✔ ✔
CO4 ✔ ✔ ✔ ✔ ✔ ✔
CO5 ✔ ✔ ✔ ✔ ✔ ✔ ✔
COMPUTER SCIENCE AND ENGINEERING
Assessment Pattern
End Semester
Test 1 (Marks in Test 2 (Marks
Bloom’s Category Examination (Marks in
percentage) in percentage)
percentage)
Remember 20 20 20
Understand 35 35 35
Apply 45 45 45
Analyse
Evaluate
Create
Mark Distribution
SYLLABUS
Module I
Programming Environment and Python Basics:
Getting Started with Python Programming - Running code in the interactive shell, Editing,
Saving, and Running a script. Using editors - IDLE, Jupyter. The software development process
- Case Study.
Basic coding skills - Working with data types, Numeric data types and Character sets, Keywords,
Variables and Assignment statement, Operators, Expressions, Working with numeric data, Type
conversions, Comments in the program. Input, Processing, and Output. Formatting output. How
Python works. Detecting and correcting syntax errors. Using built in functions and modules in
math module.
Module II
Building Python Programs:
Control statements - Selection structure (if-else, switch-case), Iteration structure(for, while),
Testing the control statements, Lazy evaluation. Functions - Hiding redundancy and complexity,
Arguments and return values, Variable scopes and parameter passing, Named arguments, Main
function, Working with recursion, Lambda functions. Strings and number systems - String
function, Handling numbers in various formats.
Module III
Data Representation:
Lists - Basic list Operations and functions, List of lists, Slicing, Searching and sorting list, List
comprehension. Work with tuples. Sets. Work with dates and times. Dictionaries - Dictionary
COMPUTER
functions, dictionary literals, adding and removing SCIENCE
keys, accessing and AND ENGINEERING
replacing values,
traversing dictionaries, reverse lookup. Case Study - Data Structure Selection.
Module IV
Object Oriented Programming:
Design with classes - Objects and Classes, Methods, Instance Variables, Constructor, Accessors
and Mutators. Structuring classes with Inheritance and Polymorphism. Abstract Classes.
Exceptions - Handle a single exception, handle multiple exceptions.
Module V
Data Processing:
The os and sys modules. Introduction to file I/O - Reading and writing text files, Manipulating
binary files. NumPy - Basics, Creating arrays, Arithmetic, Slicing, Matrix Operations, Random
numbers. Plotting and visualization. Matplotlib - Basic plot, Ticks, Labels, and Legends.
Working with CSV files. – Pandas - Reading, Manipulating, and Processing Data.
Text Books:
1. Kenneth A Lambert., Fundamentals of Python : First Programs, 2/e, Cengage Publishing,
2016
2. Wes McKinney, Python for Data Analysis, 2/e, Shroff / O’Reilly Publishers, 2017
Reference Books:
1. Allen B. Downey, Think Python: How to Think Like a Computer Scientist, 2/e, Schroff,
2016
2. Michael Urban and Joel Murach, Python Programming, Shroff/Murach, 2016
3. David M.Baezly, Python Essential Reference. Addison-Wesley Professional; 4/e, 2009.
4. Charles Severance. Python for Informatics: Exploring Information,
5. http://swcarpentry.github.io/python-novice-gapminder/
Course Outcome 2(CO2): Write a Python program which takes a positive integer n as input
and finds the sum of cubes all positive even numbers less than or equal to the number.
Course Outcome 3(CO3): Given is a list of of words, wordlist, and a string, name. Write a
Python function which takes wordlist and name as input and returns a tuple. The first element of
COMPUTER
the output tuple is the number of words in the wordlist SCIENCE
which have AND ENGINEERING
name as a substring in it. The
second element of the tuple is a list showing the index at which the name occurs in each of the
words of the wordlist and a 0 if it doesn’t occur.
Course Outcome 4(CO4): Write a Python program to implement the addition, subtraction, and
multiplication of complex numbers using classes. Use constructors to create objects. The input to
the program consist of real and imaginary parts of the complex numbers.
Course Outcome 5(CO5): Given a file “auto.csv” of automobile data with the fields index,
company, body-style, wheel-base, length, engine-type, num-of-cylinders, horsepower, average-
mileage, and price, write python code to
1) Clean and Update the CSV file
2) Print total cars of all companies
3) Find the average mileage of all companies
4) Find the highest priced car of all companies.
COMPUTER SCIENCE AND ENGINEERING
Model Question Paper
QP CODE: PAGES:
Reg No:_______________
Name:_________________
PART-A
13. (a) Write a Python code to check whether a given year is a leap year or not [An (5)
year is a leap year if it’s divisible by 4 but not divisible by 100 except for
those divisible by 400].
(b) Input 4 integers (+ve and −ve). Write a Python code to find the sum of (9)
negative numbers, positive numbers, and print them. Also, find the
averages of these two groups of numbers and print.
OR
14. (a) Write a Python program to find the value for sin(x) up to n terms using the (8)
series
where x is in degrees
(b) Write a Python code to determine whether the given string is a Palindrome (6)
or not using slicing. Do not use any string function.
15. (a) Write a Python code to create a function called list_of_frequency that takes (5)
a string and prints the letters in non-increasing order of the frequency of
their occurrences. Use dictionaries.
(b) Write a Python program to read a list of numbers and sort the list in a non- (9)
decreasing order without using any built in functions. Separate function
should be written to sort the list wherein the name of the list is passed as
the parameter.
OR
16.
COMPUTER SCIENCE AND ENGINEERING
(a) Illustrate the following Set methods with an example. (6)
i. intersection( ) ii. Union( ) iii. Issubset( ) iv. Difference( ) v. update( ) vi.
discard( )
(b) Write a Python program to check the validity of a password given by the (8)
user.
The Password should satisfy the following criteria:
1. Contains at least one letter between a and z
2. Contains at least one number between 0 and 9
3. Contains at least one letter between A and Z
4. Contains at least one special character from $, #, @
5. Minimum length of password: 6
17. (a) How can a class be instantiated in Python? Write a Python program to (10)
express the instances as return values to define a class RECTANGLE with
parameters height, width, corner_x, and corner_y and member functions to
find center, area, and perimeter of an instance.
(b) Explain inheritance in Python. Give examples for each type of inheritance. (4)
OR
18. (a) Write a Python class named Circle constructed by a radius and two (6)
methods which will compute the area and the perimeter of a given circle
(b) Write Python program to create a class called as Complex and implement (8)
__add__( ) method to add two complex numbers. Display the result by
overloading the + Operator.
19. (a) Write a Python program to add two matrices and also find the transpose of (8)
the resultant matrix.
(b) Given a file “auto.csv” of automobile data with the fields index, company, (6)
body-style, wheel-base, length, engine-type, num-of-cylinders, horsepower,
average-mileage, and price, write Python codes using Pandas to
1) Clean and Update the CSV file
2) Print total cars of all companies
3) Find the average mileage of all companies
4) Find the highest priced car of all companies.
OR
20.
COMPUTER SCIENCE AND ENGINEERING
(a) Write Python program to write the data given below to a CSV file.
(5)
SN Name Country Contribution Year
1 Linus Torvalds Finland Linux Kernel 1991
2 Tim Berners-Lee England World Wide Web 1990
3 Guido van Rossum Netherlands Python 1991
(b) Given the sales information of a company as CSV file with the following (9)
fields month_number, facecream, facewash, toothpaste, bathingsoap,
shampoo, moisturizer, total_units, total_profit. Write Python codes to
visualize the data as follows
1) Toothpaste sales data of each month and show it using a scatter plot
2) Face cream and face wash product sales data and show it using the
bar chart
3) Calculate total sale data for last year for each product and show it
using a Pie chart.
(14X5=70)
Teaching Plan
(10
Module 1: Programming Environment and Python Basics
hours)
Getting Started with Python Programming: Running code in the interactive
1.1 1 hour
shell Editing, Saving, and Running a script
1.6 Working with numeric data, Type conversions, Comments in the program 1 hour
1.7 Input, Processing, and Output, Formatting output – How Python works 1 hour
1.8 How Python works – Detecting and correcting syntax errors 1 hour
1.9 Using built in functions and modules: Case – Using math module 1 hour
5.2 Introduction to file I/O: Reading and writing text files 1 hour
5.3 Manipulating binary files 1 hour
Year of
CST DATA Category L T P Credit
Introduction
285 COMMUNICATION
MINOR 3 1 0 4 2019
Preamble: This is a basic course in communication for awarding B. Tech. Minor in Computer
Science and Engineering with specialization in Networing. The purpose of this course is to
prepare learners to understand the communication entities and the associated issues in the
field of Computer Science. This course covers fundamental concepts of data transmission &
media, digital & analog transmissions, multiplexing & spread spectrum, error detection &
correction and switching. Concepts in data communication help the learner to understand the
concepts in networking and mobile communication.
Prerequisite: NIL
Course Outcomes: After the completion of the course the student will be able to
CO1 ! ! ! !
CO2 ! ! ! !
CO3 ! !
CO4 ! ! ! ! !
CO5 ! ! ! ! ! !
CO6 ! ! ! ! ! !
Conduct investigations of
PO4 PO10 Communication
complex problems
Assessment Pattern
End Semester
Test 1 (Marks Test 2 (Marks
Bloom’s Category Examination (Marks in
in percentage) in percentage)
percentage)
Remember 30 30 30
Understand 40 40 40
Apply 30 30 30
Analyse
Evaluate
Create
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
Total Marks CIE Marks ESE Marks ESE Duration
150 50 100 3
Syllabus
Module 1
Data Transmission Basics
Communication model - Simplex, Half duplex, Full duplex transmission. Periodic Analog
signals - Sine wave, Amplitude, Phase, Wavelength, Time and frequency domain, Bandwidth.
Analog & digital data and signals. Transmission impairments - Attenuation, Delay distortion,
Noise. Data rate limits - Noiseless channel, Nyquist bandwidth, Noisy channel, Shannon's
capacity formula.
Module 2
Transmission Media
Guided Transmission Media - Twisted pair, Coaxial cable, Optical fiber. Unguided media -
Radio waves, Terrestrial microwave, Satellite microwave, Infrared. Wireless Propagation -
Ground wave propagation, Sky Wave propagation, Line-of-Sight (LoS) Propagation.
Module 3
Digital Transmission and Analog Transmission
Digital data to Digital signal – Non-Return-to-Zero (NRZ), Return-to-Zero (RZ), Multilevel
COMPUTER SCIENCE AND ENGINEERING
binary, Biphase. Analog data to Digital signal - Sampling theorem, Pulse Code Modulation
(PCM), Delta Modulation (DM). Digital data to Analog signal: Amplitude Shift Keying
(ASK), Frequency Shift Keying (FSK), Phase Shift Keying (PSK). Analog data to Analog
signal: Amplitude Modulation (AM), Frequency Modulation (FM), Phase Modulation (PM).
Module 4
Multiplexing and Spread Spectrum
Multiplexing - Frequency Division Multiplexing (FDM), Wave length Division Multiplexing
(WDM), Time Division Multiplexing (TDM), Characteristics, Synchronous TDM, Statistical
TDM. Spread Spectrum Techniques - Direct Sequence Spread Spectrum (DSSS), Frequency
Hopping Spread Spectrum (FHSS), Code Division Multiplexing, Code Division Multiple
Access (CDMA).
Module 5
Error Detection, Correction and Switching
Digital data communication techniques - Asynchronous transmission, Synchronous
transmission. Detecting and correcting errors - Types of Errors, Parity check, Checksum,
Cyclic Redundancy Check (CRC), Forward Error Correction (FEC), Hamming Distance,
Hamming Code. Basic principles of Switching - Circuit Switching, Packet Switching,
Message Switching.
Text Books
1. Forouzan B. A., Data Communications and Networking, 5/e, McGraw Hill, 2013.
2. William Stallings, Data and Computer Communication 9/e, Pearson Education, Inc.
Reference Books
1. Schiller J., Mobile Communications, 2/e, Pearson Education, 2009.
2. Curt M. White, Fundamentals of Networking and Communication 7/e, Cengage learning.
Reg No:_______________
Name:_________________
1. What is bandwidth? Find the lowest frequency, if a periodic signal has a bandwidth of 20
Hz and the highest frequency is 60 Hz. Draw the Spectrum if the signal contains all
frequencies of same amplitude.
2. Assume that a TV picture is to be transmitted over a channel with 4.5 MHz bandwidth and
a 35 dB Signal-to-Noise-Ratio. Find the capacity of the channel.
3. What is the purpose of cladding in optical fibres?
4. Which wireless propagation is suitable for satellite communication? Justify your answer.
5. Explain the working of Delta Modulation with an example.
6. Illustrate the equivalent square wave pattern of the bit string 01001101 using Non-Return-
to-Zero(NRZ) - Level and NRZ-Invert encoding schemes.
7. Distinguish between synchronous and statistical Time Division Multiplexing.
8. Apply Direct Sequence Spread Spectrum to the data 101 using the Barker sequence
10110111000. Show the encoding and decoding steps.
9. Find the minimum hamming distance for the following cases:
a) Detection of two errors
b) Correction of two errors
c) Detection of 3 errors or correction of 2 errors
d) Detection of 6 errors or correction of 2 errors
10. Find the parity bit for simple even parity check for the following.
a) 1001010
b) 0001100
c) 1000000
d) 1110111
COMPUTER SCIENCE AND ENGINEERING
PART-B
(Answer ANY one full question from each module. Each question carries 14 marks)
11. a) With the help of suitable figures, distinguish between time domain and frequency
domain. (4)
OR
12. a) Calculate the bandwidth, if a periodic signal is decomposed into 4 sine waves with
frequencies 50 Hz, 100 Hz, 150 Hz and 200Hz. Draw the spectrum, assuming all
components having amplitude in the range 6-12 V and all are multiple of two in the
increasing order.
(6)
13. a) Fora parabolic reflective antenna operating at 12 GHz with a diameter of 2 m, calculate
the effective area and the antenna gain.
(6)
b) List any four advantages and disadvantages of twisted pair, coaxial cable and fiber optic
cable.
(8)
OR
(6)
b) With the help of suitable diagrams, differentiate Multi-mode and Single-mode optical
fibres. How the rays are propagated in Step-index and Graded-index Multi-mode fibres.
(8)
(4)
COMPUTER SCIENCE AND ENGINEERING
b) What is polar encoding? Encode the pattern 010011001110 using the two Biphase
schemes.
(10)
OR
16. a) Show the equivalent analog sine wave pattern of the bit string 010011010 using
Amplitude Shift Keying, Frequency Shift Keying and Phase Shift Keying.
(4)
b) State Sampling theorem. Explain Pulse Code Modulation with suitable figures.
(10)
17. a) Four channels are multiplexed using Time Division Multiplexing. If each channel sends
100 bytes/sec and we multiplex one byte per channel, determine the frame size, duration of
a frame, frame rate and bit rate of the link.
(6)
b) With the help of an example, explain the working of Frequency Hopping Spread
Spectrum.
(8)
OR
18. a)Explain the different techniques by which the disparity in input data rate is handled by
Time Division Multiplexing.
(4)
b) Suppose Alice and Bob are communicating using Code Division Multiple Access. Alice
uses the code [+1 +1] and Bob uses the code [+1 -1]. Alice sends the data bit 0 and Bob
sends the data bit 1. Show the data in the channel and how they can detect what the other
person has sent.
(10)
b) Describe the need for a switch. What are the different phases in circuit switching?
(10)
OR
COMPUTER SCIENCE AND ENGINEERING
20. a) With the help of a suitable example, explain the virtual circuit approach of packet
switching.
(6)
b) Find the Hamming code for the data-word 1011001. Assume odd parity.
(8)
Teaching Plan
(10
Module 3: Digital Transmission and Analog Transmission
Hours)
3.1 Digital data to Digital signal – Non-Return-to-Zero (NRZ) 1
3.3 Biphase 1
3.4 Analog data to Digital signal - Sampling theorem 1
4.9 CDMA 1
5.5 CRC 1
SEMESTER -4
COMPUTER SCIENCE AND ENGINEERING
Prerequisite: The topics covered under the course Discrete Mathematical Structures (MAT
203 )
Course Outcomes: After the completion of the course the student will be able to
Explain vertices and their properties, types of paths, classification of graphs and
CO 1
trees & their properties. (Cognitive Knowledge Level: Understand)
Demonstrate the fundamental theorems on Eulerian and Hamiltonian graphs.
CO 2
(Cognitive Knowledge Level: Understand)
Illustrate the working of Prim’s and Kruskal’s algorithms for finding minimum cost
CO 3 spanning tree and Dijkstra’s and Floyd-Warshall algorithms for finding shortest
paths. (Cognitive Knowledge Level: Apply)
Explain planar graphs, their properties and an application for planar graphs.
CO 4
(Cognitive Knowledge Level: Apply)
Explain the Vertex Color problem in graphs and illustrate an example application
CO 6
for vertex coloring. (Cognitive Knowledge Level: Apply)
COMPUTER SCIENCE AND ENGINEERING
Mapping of course outcomes with program outcomes
PO PO PO PO PO
PO 2 PO 3 PO 4 PO 7 PO 10 PO 11 PO 12
1 5 6 8 9
CO 1 √ √ √ √ √
CO 2 √ √ √ √ √ √
CO 3 √ √ √ √ √ √
CO 4 √ √ √ √ √ √
CO 5 √ √ √ √ √
CO 6 √ √ √ √ √ √
Assessment Pattern
Understand 30 30 30
Apply 40 40 40
Analyse
Evaluate
Create
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
Attendance : 10 marks
First Internal Examination shall be preferably conducted after completing the first half of the
syllabus and the Second Internal Examination shall be preferably conducted after completing
remaining part of the syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2
questions each from the completed modules and 1 question from the partly covered module),
having 3 marks for each question adding up to 15 marks for part A. Students should answer
all questions from Part A. Part B contains 7 questions (preferably, 3 questions each from the
completed modules and 1 question from the partly covered module), each with 7 marks. Out
of the 7 questions in Part B, a student should answer any 5.
End Semester Examination Pattern: There will be two parts; Part A and Part B. Part A
contain 10 questions with 2 questions from each module, having 3 marks for each question.
Students should answer all questions. Part B contains 2 questions from each module of which
student should answer anyone. Each question can have maximum 2 sub-divisions and carries
14 marks.
COMPUTER SCIENCE AND ENGINEERING
Syllabus
Module 1
Module 2
Eulerian and Hamiltonian graphs : Euler graphs, Operations on graphs, Hamiltonian paths
and circuits, Travelling salesman problem. Directed graphs – types of digraphs, Digraphs and
binary relation, Directed paths, Fleury’s algorithm.
Module 3
Trees and Graph Algorithms : Trees – properties, pendant vertex, Distance and centres in a
tree - Rooted and binary trees, counting trees, spanning trees, Prim’s algorithm and Kruskal’s
algorithm, Dijkstra’s shortest path algorithm, Floyd-Warshall shortest path algorithm.
Module 4
Connectivity and Planar Graphs : Vertex Connectivity, Edge Connectivity, Cut set and Cut
Vertices, Fundamental circuits, Planar graphs, Kuratowski’s theorem (proof not required),
Different representations of planar graphs, Euler's theorem, Geometric dual.
Module 5
Text book:
Reference Books:
2. Is it possible to construct a graph with 12 vertices such that two of the vertices have
degree 3 and the remaining vertices have degree 4? Justify
3. Prove that a simple graph with n vertices must be connected, if it has more than
(n − 1)(n − 2)
edges.
2
4. Prove the statement: If a graph (connected or disconnected) has exactly two odd degree,
then there must be a path joining these two vertices.
1. Define Hamiltonian circuit and Euler graph. Give one example for each.
3. Prove that a connected graph G is an Euler graph if all vertices of G are of even degree.
4. Prove that a graph G of n vertices always has a Hamiltonian path if the sum of the degrees
of every pair of vertices Vi, Vj in G satisfies the condition d(Vi) + d(Vj) =n−1
Course Outcome 3 (CO3):
1. Define edge connectivity, vertex connectivity and separable graphs. Give an example for
each.
2. Prove that a connected graph with n vertices and e edges has e − n + 2 edges.
3. Prove the statement: Every cut set in a connected graph G must also contain at least one
branch of every spanning tree of G.
4. Draw the geometrical dual (G*) of the graph given below, also check whether G and G*
are self-duals or not, substantiate your answer clearly.
1. Show that if A(G) is an incidence matrix of a connected graph G with n vertices, then
rank of A(G) is n−1.
2. Show that if B is a cycle matrix of a connected graph G with n vertices and m edges, then
rank B = m−n+1.
3. Derive the relations between the reduced incidence matrix, the fundamental cycle matrix,
and the fundamental cut-set matrix of a graph G.
4. Characterize simple, self-dual graphs in terms of their cycle and cut-set matrices.
1. Show that an n vertex graph is a tree iff its chromatic polynomial is P n(λ) = λ(λ − 1)n−1
QP
Code : Total Pages: 4
1 Construct a simple graph of 12 vertices with two of them having degree 1, (3)
three having degree 3 and the remaining seven having degree 10.
2 What is the largest number of vertices in a graph with 35 edges, if all (3)
vertices are of degree at least 3 ?
3 Define a Euler graph. Give an example of Eulerian graph which is not (3)
Hamiltonian
4 Give an example of a strongly connected simple digraph without a directed (3)
Hamiltonian path.
5 What is the sum of the degrees of any tree of n vertices? (3)
6 How many spanning trees are there for the following graph (3)
COMPUTER SCIENCE AND ENGINEERING
7 Show that in a simple connected planar graph G having V-vertices, E-edges, (3)
and no triangles E <= 3V - 6.
8 Let G be the following disconnected planar graph. Draw its dual G*, and the (3)
dual of the dual (G*)*.
9 Consider the circuit matrix B and incidence matrix A of a simple connected (3)
graph whose columns are arranged using the same order of edges. Prove that
every row of B is orthogonal to every row of A?
10 A graph is critical if the removal of any one of its vertices (and the edges (3)
adjacent to that vertex) results in a graph with a lower chromatic number.
Show that Kn is critical for all n > 1.
PART B
Answer any one Question from each module. Each question carries 14 Marks
11 a) Prove that for any simple graph with at least two vertices has two vertices of (6)
the same degree.
b) Prove that in a complete graph with n vertices there are (n-1)/2 edge disjoint (8)
Hamiltonian circuits and n >= 3
OR
OR
COMPUTER SCIENCE AND ENGINEERING
etermine whether the following graphs G1 = (V1, E1) and G2 = (V2, E2) are isomorphic
12. a) D
12 a) Determine whether the following graphs G1 = (V1, E1) and G2 = (V2, E2) are (6)
or not. Give justification. (6)
isomorphic or not. Give justification.
b) P b) that
rove Prove that a graph
a simple simplewith n vertices
graph with nand k components
vertices and k components
can have atcan have
most at (n-(8)
(n-k)
k+1)/2 edges.
most (n-k) (n-k+1)/2 edges (8)
13Leta)S bLet
13. a) e a Ssetbeofa 5set
elements. Construct
of 5 elements. Construct whose
a graphaGgraph G vertices are subsets
whose vertices of S of size
are subsets (8)
2 and twoofsuch
S ofsubsets are two
size 2 and adjacent
such in G if they
subsets are disjoint.
are adjacent in G if they are disjoint. (8)
i. Drawi.theDraw G.graph G.
graphthe
ii. How ii.
many edges
How manymust musttobeG added
be added
edges to order
in ordertoforGGin have afor
Hamiltonian
G to havecycle?
a
b) Let G be a graph with exactly
Hamiltonian two connected components, both being Eulerian. What is
cycle?
theb)
minimum
Let G number of edges
be a graph withthat need totwo
exactly be added to G to
connected obtain an Eulerian
components, graph? (6)
both being
Eulerian. What is the minimum number of edges that need to be added to G (6)
to obtain an Eulerian graph?
OR
14. a) Show that a k-connected graph with no hamiltonian
OR cycle has an independent set of size
14k +a)1. Show that a k-connected graph with no hamiltonian cycle has an (8)
(8)
b) independent set of size k + 1. (6)
i.b) Let Gi.beLet
a graph
G bethat has exactly
a graph twoexactly
that has connected
two components, both being both
connected components,
Hamiltonian
beinggraphs. Find thegraphs.
Hamiltonian minimumFindnumber of edgesnumber
the minimum that oneofneeds to that
edges add to
G to obtain
oneaneeds
Hamiltonian
to add tograph.
G to obtain a Hamiltonian graph. (6)
ii. For which
ii. Forvalues
which n the graph
of values n (hyper-cube
of n Qthe on n vertices)onis nEulerian.
graph Qn (hyper-cube vertices) is
Eulerian.
15 a) A tree T has at least one vertex v of degree 4, and at least one vertex w of (5)
degree 3. Prove that T has at least 5 leaves.
COMPUTER SCIENCE AND ENGINEERING
b) Write Dijkstra’s shortest path algorithm. (9)
Consider the following weighted directed graph G.
Find the shortest path between a and every other vertices in G using
Dijkstra’s shortest path algorithm.
OR
16 a) Define pendent vertices in a binary tree? Prove that the number of pendent (5)
vertices in a binary tree with n vertices is (n+1)/2.
b) (9)
Write Prim’s algorithm for finding minimum spanning tree.
Find a minimum spanning tree in the following weighted graph, using
Prim's algorithm.
Determine the number of minimum spanning trees for the given graph.
COMPUTER SCIENCE AND ENGINEERING
17 a) i. State and prove Euler's Theorem relating the number of faces, edges and (9)
vertices for a planar graph.
ii. If G is a 5-regular simple graph and |V| = 10, prove that G is non-planar.
b) Let G be a connected graph and e an edge of G. Show that e is a cut-edge if (5)
and only if e belongs to every spanning tree.
OR OR
18 a) 18. a) State
State Kuratowski's
Kuratowski's theorem,
theorem, andituse
and use it to show
to show thatgraph
that the the graph G below
G below is notis not
(9)planar.
Draw
planar. G on
Draw the the
G on plane without
plane edges
without crossing.
edges YourYour
crossing. drawing should
drawing use the labelling of
should
thelabelling
use the vertices of
given.
the vertices given. (9)
b) Let G
b) be
LetaGconnected graph graph
be a connected and e and
an edge of G.ofShow
e an edge that that
G. Show e belongs to ato a(5)
e belongs loop if and
loop if only
and only if e belongs
if e belongs to notospanning
no spanning
tree.tree. (5)
19 a) 19.
Define the circuit
a) Define matrix
the circuit B(G)Bof
matrix a connected
(G) graphgraph
of a connected G with n vertices
G with and and
n vertices e (7)
e edges with
edgesanwith an example.
example. Prove Prove that
that the theofrank
rank of is
B(G) B(G) is .e-n+1
e-n+1
b) Give
(7) the definition of the chromatic polynomial PG(k). Directly from the (7)
definition, prove
b) Give the that theofchromatic
definition polynomials
the chromatic of P
polynomial
and
WGn(k) Cn satisfy
. Directly fromthe
the definition,
identity PWnthat
prove (k) =the
k Pchromatic polynomials of Wn and Cn satisfy the identity PWn(k) = k PCn-1
Cn-1 (k – 1).
(k – 1). (7)
OR
OR
20 a) Define the incidence matrix of a graph G with an example. Prove that the (4)
20. a) of
rank Define the incidence
an incidence matrixmatrix
of a connected G with
of a graphgraph an nexample.
with Prove
vertices is n-1. that the rank of an
incidence matrix of a connected graph with n vertices is n-1. (4)
b) (10)
i. A graph G has chromatic polynomial PG(k) = k4-4k3+5k2-2k. How many vertices
and edges does G have? Is G bipartite? Justify your answers.
COMPUTER SCIENCE AND ENGINEERING
b) i. A graph G has chromatic polynomial PG(k) = k4-4k3+5k2-2k. How
many vertices and edges does G have? Is G bipartite? Justify your
answers.
ii. Find a maximum matching in the graph below and use Hall's theorem
to show that it is indeed maximum.
(10)
****
Assignments
No. of
No Topic
Lectures
2. Incidence and Degree – Isolated vertex, pendent vertex and Null graph 1
4. Isomorphism 1
7. Connected graphs. 1
1. Euler graphs 1
2. Operations on graphs 1
8. Fleury’s algorithm 1
1. Trees – properties 1
2. Trees – properties 1
6. Counting trees 1
8. Prim’s algorithm 1
9. Kruskal’s algorithm 1
3. Fundamental circuits 1
4. Fundamental circuits 1
5. Planar graphs 1
6. Kuratowski’s theorem 1
8. Euler's theorem 1
9. Geometric dual 1
4. Chromatic polynomial 1
5. Matching 1
6. Covering 1
Computer YEAR OF
CATEGORY L T P CREDIT
CST 202 Organization INTRODUCTION
and Architecture PCC 3 1 0 4 2019
Preamble:
The course is prepared with the view of enabling the learners capable of understanding the
fundamental architecture of a digital computer. Study of Computer Organization and
Architecture is essential to understand the hardware behind the code and its execution at
physical level by interacting with existing memory and I/O structure. It helps the learners
to understand the fundamentals about computer system design so that they can extend the
features of computer organization to detect and solve problems occurring in computer
architecture.
Prerequisite : Topics covered under the course Logic System Design (CST 203)
Course Outcomes: After the completion of the course the student will be able to
CO# CO
Recognize and express the relevance of basic components, I/O organization and
CO1
pipelining schemes in a digital computer (Cognitive knowledge: Understand)
Explain the types of memory systems and mapping functions used in memory systems
CO2
(Cognitive Knowledge Level: Understand)
Demonstrate the control signals required for the execution of a given instruction
CO3
(Cognitive Knowledge Level: Apply) )
Illustrate the design of Arithmetic Logic Unit and explain the usage of registers in it
CO4
(Cognitive Knowledge Level: Apply)
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
CO6
Assessment Pattern
Remember 20 20 30
Understand 40 40 30
Apply 40 40 40
Analyze
COMPUTER SCIENCE AND ENGINEERING
Evaluate
Create
Mark Distribution
Attendance : 10 marks
First Internal Examination shall be preferably conducted after completing the first half of the
syllabus and the Second Internal Examination shall be preferably conducted after completing
remaining part of the syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions
each from the completed modules and 1 question from the partly covered module), having 3
marks for each question adding up to 15 marks for part A. Students should answer all questions
from Part A. Part B contains 7 questions (preferably, 3 questions each from the completed
modules and 1 question from the partly covered module), each with 7 marks. Out of the 7
questions in Part B, a student should answer any 5.
COMPUTER SCIENCE AND ENGINEERING
There will be two parts; Part A and Part B. Part A contains 10 questions with 2 questions from
each module, having 3 marks for each question. Students should answer all questions. Part B
contains 2 questions from each module of which a student should answer any one. Each question
can have maximum 2 sub-divisions and carries 14 marks.
Syllabus
Module 1
Basic Structure of computers – functional units - basic operational concepts - bus structures.
Memory locations and addresses - memory operations,Instructions and instruction sequencing ,
addressing modes.
Module 2
Register transfer logic: inter register transfer – arithmetic, logic and shift micro operations.
Processor logic design: - processor organization – Arithmetic logic unit - design of
arithmetic circuit - design of logic circuit - Design of arithmetic logic unit - status register –
design of shifter - processor unit – design of accumulator.
Module 3
Arithmetic algorithms: Algorithms for multiplication and division (restoring method) of binary
numbers. Array multiplier , Booth’s multiplication algorithm.
Pipelining: Basic principles, classification of pipeline processors, instruction and arithmetic
pipelines (Design examples not required), hazard detection and resolution.
Module 4
Control Logic Design: Control organization – Hard_wired control-microprogram control –
control of processor unit - Microprogram sequencer,micro programmed CPU organization -
horizontal and vertical micro instructions.
Module 5
I/O organization: accessing of I/O devices – interrupts, interrupt hardware -Direct memory
access.
COMPUTER SCIENCE AND ENGINEERING
Text Books
1. Hamacher C., Z. Vranesic and S. Zaky, Computer Organization ,5/e, McGraw Hill, 2011
3. KaiHwang, Faye Alye Briggs, Computer architecture and parallel processing McGraw-
Hill, 1984
Reference Books
1. Mano M. M., Digital Logic & Computer Design, 3/e, Pearson Education, 2013.
2. Patterson D.A. and J. L. Hennessy, Computer Organization and Design, 5/e, Morgan
Kaufmann Publishers, 2013.
4. Chaudhuri P., Computer Organization and Design, 2/e, Prentice Hall, 2008.
Course Outcome 2(CO2): Explain the steps taken by the system to handle a write miss
condition inside the cache memory.
Course Outcome 3(CO3): Generate the sequence of control signals required for the
execution of the instruction MOV [R1],R2 in a threebus organization.
Course Outcome 4(CO4): Design a 4-bit combinational logic shifter with 2 control
signals H0 and H1 that perform the following operations :
COMPUTER SCIENCE AND ENGINEERING
H1 H0 Operation
0 1 No shift operation
1 0 Shift left
1 1 Shift right
Course Outcome 5(CO5): Explain the restoring algorithm for binary division. Also
trace the algorithm to divide (1001)2 by (11)2
QP CODE: PAGES:2
Reg No:_______________
Name:_________________
PART A
2. Distinguish between big endian and little endian notations. Also give the significance of
these notations.
Part B
Answer any one Question from each module. Each question carries 14 Marks
COMPUTER SCIENCE AND ENGINEERING
11.
(4)
11.(b) Write the control sequence for the instruction DIV R1,[R2] in a three bus structure.
(10)
OR
12. Explain the concept of a single bus organization with help of a diagram. Write the control
sequence for the instruction ADD [R1],[R2].
(14)
(14)
OR
14.
14.(a) Design a 4 bit combinational logic shifter with 2 control signals H1 and H2 that
perform the following operations (bit values given in parenthesis are the values of
control variable H1 and H2 respectively.) : Transfer of 0’s to S (00), shift right (01),
shift left (10), no shift (11).
(5)
14.(b) Design an ALU unit which will perform arithmetic and logic operation with a given
binary adder.
(9)
15.
15.(a) Give the logic used behind Booth’s multiplication algorithm.
(4)
15.(b) Identify the appropriate algorithm available inside the system to perform the
multiplication between -14 and -9. Also trace the algorithm for the above input.
(10)
OR
16.
16.(a) List and explain the different pipeline hazards and their possible solutions
(10)
COMPUTER SCIENCE AND ENGINEERING
(14)
OR
18. Give the structure of the micro program sequencer and its role in sequencing the micro
instructions.
(14)
19.
19.(a) Explain the different ways in which interrupt priority schemes can be implemented
(10)
(4)
OR
20.
TEACHING PLAN
No of
No Contents Lecture
Hrs
Module 1 : (Basic Structure of computers) (9 hours)
Functional units,basic operational concepts,bus structures
1.1 1
(introduction)
1.2 Memory locations and addresses , memory operations 1
Module 2 :(Register transfer logic and Processor logic design) (10 hours)
YEAR OF
CST Database Management CATEGORY L T P CREDIT
INTRODUCTION
204 Systems
PCC 3 1 0 4 2019
Prerequisite: Topics covered under the course Data Structures (CST 201), Exposure to a High
Level Language like C/python.
Course Outcomes: After the completion of the course the student will be able to
Model and design solutions for efficiently representing and querying data using
CO3
relational model (Cognitive Knowledge Level: Analyze)
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
CO6
Assessment Pattern
Analyze
Evaluate
Create
Mark Distribution
Attendance : 10 marks
First Internal Examination shall be preferably conducted after completing the first half of the
syllabus and the Second Internal Examination shall be preferably conducted after completing
remaining part of the syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions
each from the completed modules and 1 question from the partly covered module), having 3
marks for each question adding up to 15 marks for part A. Students should answer all questions
from Part A. Part B contains 7 questions (preferably, 3 questions each from the completed
modules and 1 question from the partly covered module), each with 7 marks. Out of the 7
questions in Part B, a student should answer any 5.
COMPUTER SCIENCE AND ENGINEERING
There will be two parts; Part A and Part B. Part A contains 10 questions with 2 questions from
each module, having 3 marks for each question. Students should answer all questions. Part B
contains 2 questions from each module of which a student should answer any one. Each question
can have maximum 2 sub-divisions and carries 14 marks.
Syllabus
ER model - Basic concepts, entity set & attributes, notations, Relationships and constraints,
cardinality, participation, notations, weak entities, relationships of degree 3.
Introduction to Relational Algebra - select, project, cartesian product operations, join - Equi-join,
natural join. query examples, introduction to Structured Query Language (SQL), Data Definition
Language (DDL), Table definitions and operations – CREATE, DROP, ALTER, INSERT,
DELETE, UPDATE.
SQL DML (Data Manipulation Language) - SQL queries on single and multiple tables, Nested
queries (correlated and non-correlated), Aggregation and grouping, Views, assertions, Triggers,
SQL data types.
Physical Data Organization - Review of terms: physical and logical records, blocking factor,
pinned and unpinned organization. Heap files, Indexing, Singe level indices, numerical examples,
Multi-level-indices, numerical examples, B-Trees & B+-Trees (structure only, algorithms not
required), Extendible Hashing, Indexing on multiple keys – grid files.
COMPUTER SCIENCE AND ENGINEERING
Module 4: Normalization
Different anomalies in designing a database, The idea of normalization, Functional dependency,
Armstrong’s Axioms (proofs not required), Closures and their computation, Equivalence of
Functional Dependencies (FD), Minimal Cover (proofs not required). First Normal Form (1NF),
Second Normal Form (2NF), Third Normal Form (3NF), Boyce Codd Normal Form (BCNF),
Lossless join and dependency preserving decomposition, Algorithms for checking Lossless Join
(LJ) and Dependency Preserving (DP) properties.
Text Books
2. Sliberschatz A., H. F. Korth and S. Sudarshan, Database System Concepts, 6/e, McGraw
Hill, 2011.
Reference Books:
1. Adam Fowler, NoSQL for Dummies, John Wiley & Sons, 2015
2. NoSQL Data Models: Trends and Challenges (Computer Engineering: Databases and Big
Data), Wiley, 2018
3. Web Resource: https://www.w3resource.com/redis/
4. web Resource: https://www.w3schools.in/category/mongodb/
5. Web Resource: https://www.tutorialspoint.com/cassandra/cassandra_introduction.htm
6. Web Resource : https://www.tutorialspoint.com/arangodb/index.htm
COMPUTER SCIENCE AND ENGINEERING
1. For the SQL query, SELECT A, B FROM R WHERE B=’apple’ AND C = ‘orange’ on the
table R(A, B, C, D), where A is a key, write any three equivalent relational algebra
expressions.
2. Given the FDs P→Q, P→R, QR→S, Q→T, QR→U, PR→U, write the sequence of
Armstrong’s Axioms needed to arrive at the following FDs: (a) P → T (b) PR → S (c)
QR → SU
3. Consider a relation PLAYER (PLAYER-NO, PLAYER-NAME, PLAYER-POSN,
TEAM, TEAM-COLOR, COACH-NO, COACH-NAME, TEAM-CAPTAIN). Assume
that PLAYER-NO is the only key of the relation and that the following dependencies
hold:
TEAM→{TEAM-COLOR, COACH-NO, TEAM-CAPTAIN}
COACH-NO→COACH-NAME.
i. Is the relation in 2NF? If not, decompose to 2NF.
ii. Is the relation in 3NF? If not, decompose to 3NF.
COMPUTER SCIENCE AND ENGINEERING
4. In the following tables foreign keys have the same name as primary keys except
DIRECTED-BY, which refers to the primary key ARTIST-ID. Consider only single-
director movies.
MOVIES(MOVIE-ID, MNAME, GENRE, LENGTH, DIRECTED-BY)
ARTIST(ARTIST-ID, ANAME)
ACTING(ARTIST-ID, MOVIE-ID)
Write SQL expressions for the following queries:
(a) Name(s) and director name(s) of movie(s) acted by ‘Jenny’.
(b) Names of actors who have never acted with ‘Rony’
(c) Count of movies genre-wise.
(d) Name(s) of movies with maximum length.
PART B
COMPUTER SCIENCE AND ENGINEERING
Answer any one Question from each module. Each question carries 14 Marks
11 a. Design an ER diagram for the following scenario: There is a set of teams, each (14)
team has an ID (unique identifier), name, main stadium, and to which city this
team belongs. Each team has many players, and each player belongs to one
team. Each player has a number (unique identifier), name, DoB, start year, and
shirt number that he uses. Teams play matches, in each match there is a host
team and a guest team. The match takes place in the stadium of the host team.
For each match we need to keep track of the following: The date on which the
game is played The final result of the match. The players participated in the
match. For each player, how many goals he scored, whether or not he took
yellow card, and whether or not he took red card. During the match, one player
may substitute another player. We want to capture this substitution and the time
at which it took place. Each match has exactly three referees. For each referee
we have an ID (unique identifier), name, DoB, years of experience. One referee
is the main referee and the other two are assistant referee.
OR
12 a. Interpret the the following ER diagram.
(8)
"
b. Distinguish between physical data independence and logical data independence (6)
with suitable examples.
COMPUTER SCIENCE AND ENGINEERING
OR
14 a.Write SQL DDL statements for the the following (Assume suitable domain (10)
types):
i. Create the tables STUDENT(ROLLNO, NAME, CLASS, SEM,
ADVISER), FACULTY(FID, NAME, SALARY, DEPT). Assume that
ADVISER is a foreign key referring FACUTY table.
ii. Delete department with name ‘CS’ and all employees of the
department.
iii. Increment salary of every faculty by 10%.
b.Illustrate foreign key constraint with a typical example. (4)
COMPUTER SCIENCE AND ENGINEERING
15 For the relation schema below, give an expression in SQL for each of the queries (14)
that follows:
a) Find the names, street address, and cities of residence for all employees
who work for the Company ‘RIL Inc.' and earn more than $10,000.
b) Find the names of all employees who live in the same cities as the
companies for which they work.
c) Find the names of all employees who do not work for ‘KYS Inc.’. Assume
that all people work for exactly one company.
d) Find the names of all employees who earn more than every employee of
‘SB Corporation'. Assume that all people work for at most one company.
e) List out number of employees company-wise in the decreasing order of
number of employees.
OR
16 a. Consider an EMPLOYEE file with 10000 records where each record is of (9)
size 80 bytes. The file is sorted on employee number (15 bytes long), which
is the primary key. Assuming un-spanned organization and block size of
512 bytes compute the number of block accesses needed for selecting
records based on employee number if,
i. No index is used
ii. Single level primary index is used
iii. Multi-level primary index is used
Assume a block pointer size of 6 bytes.
b. Illustrate correlated and non-correlated nested queries with real examples. (5)
Teaching Plan
Hours
Course Name
(48)
Module 1: Introduction & ER Model 8
Concept & Overview of DBMS, Characteristics of DB system,
1.1 1
Database Users.
Structured, semi-structured and unstructured data. Data Models and
1.2 1
Schema
Hours
Course Name
(48)
3.4 Views, assertions (with examples) 1
3.5 Triggers (with examples), SQL data types 1
Review of terms: physical and logical records, blocking factor,
3.6 1
pinned and unpinned organization. Heap files, Indexing
3.7 Singe level indices, numerical examples 1
Hours
Course Name
(48)
5.4 Desirable Properties of transactions, Serial schedules 1
5.5 Concurrent and Serializable Schedules 1
5.6 Conflict equivalence and conflict serializability 1
5.7 Recoverable and cascade-less schedules 1
Prerequisite: Topics covered in the courses are Data Structures (CST 201) and Programming
in C (EST 102)
Course Outcomes: After the completion of the course the student will be able to
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
CO6
Assessment Pattern
Understand 30 30 30
Apply 40 40 40
Analyse
Evaluate
Create
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
Each of the two internal examinations has to be conducted out of 50 marks. First series test shall
be preferably conducted after completing the first half of the syllabus and the second series test
shall be preferably conducted after completing remaining part of the syllabus. There will be two
parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions each from the
completed modules and 1 question from the partly completed module), having 3 marks for each
question adding up to 15 marks for part A. Students should answer all questions from Part A.
Part B contains 7 questions (preferably, 3 questions each from the completed modules and 1
question from the partly completed module), each with 7 marks. Out of the 7 questions, a student
should answer any 5.
Syllabus
Module I
Module II
Processes - Process states, Process control block, threads, scheduling, Operations on processes -
process creation and termination – Inter-process communication - shared memory systems,
Message passing systems.
Process Scheduling – Basic concepts- Scheduling COMPUTER SCIENCE
criteria -scheduling AND ENGINEERING
algorithms- First come
First Served, Shortest Job Firs, Priority scheduling, Round robin scheduling
Module III
Module IV
Module V
File System: File concept - Attributes, Operations, types, structure – Access methods, Protection.
File-system implementation, Directory implementation. Allocation methods.
Storage Management: Magnetic disks, Solid-state disks, Disk Structure, Disk scheduling,
Disk formatting.
Text Book
Abraham Silberschatz, Peter Baer Galvin, Greg Gagne, ' Operating System Concepts' 9th
Edition, Wiley India 2015.
Reference Books:
1. Andrew S Tanenbaum, “Modern Operating Systems” , 4th Edition, Prentice Hall, 2015.
2. William Stallings, “Operating systems”, 6th Edition, Pearson, Global Edition, 2015.
3. Garry Nutt, Nabendu Chaki, Sarmistha Neogy, “Operating Systems”, 3rd Edition, Pearson
Education.
4. D.M.Dhamdhere, “Operating Systems”, 2nd Edition, Tata McGraw Hill, 2011.
5. Sibsankar Haldar, Alex A Aravind, “Operating Systems”, Pearson Education.
Sample Course Level Assessment Questions COMPUTER SCIENCE AND ENGINEERING
Course Outcome1 (CO1): What is the main advantage of the micro kernel approach to system
design? How do user program and system program interact in a microkernel architecture?
Course Outcome 2 (CO2): Define process. With the help of a neat diagram explain different
states of process.
Course Outcome 3 (CO3): What do you mean by binary semaphore and counting semaphore?
With C, explain implementation of wait () and signal().
Course Outcome 4 (CO4): Describe resource allocation graph for the following. a) with a
deadlock b) with a cycle but no deadlock.
Course Outcome 6 (CO6): Explain the different file allocation methods with advantages and
disadvantages.
Reg No:_______________
Name:_________________
PART-A
1. How does hardware find the Operating System kernel after system switch-on?
6. What is critical section? What requirement should be satisfied by a solution to the critical
section problem?
a) frame=2 b)frame=3
10. Define the terms (i) Disk bandwidth (ii) Seek time.
11. a) Explain the following structures of operating system (i) Monolithic systems
(ii) Layered Systems (iii) Micro Kernel (iv) Modular approach. (12)
b) Under what circumstances would a user be better of using a time sharing system than a
PC or a single user workstation? (2)
OR
12. a) What is the main advantage of the micro kernel approach to system design? How do user
program and system program interact in a microkernel architecture? (8)
b) Describe the differences between symmetric and asymmetric multiprocessing? What are
the advantages and disadvantages of multiprocessor systems? (6)
13. a) Define process. With the help of a neat diagram explain different states of process. (8)
b) Explain how a new process can be created in Unix using fork system call. (6)
OR
14 a) Find the average waiting time and average turnaround time for the processes given in the
table below using:- i) SRT scheduling algorithm ii) Priority scheduling algorithm (9)
Process Arrival Time (ms)COMPUTER SCIENCE
CPU Burst Time (ms) AND ENGINEERING
Priority
P1 0 5 3
P2 2 4 1
P3 3 1 2
P4 5 2 4
b) What is a Process Control Block? Explain the fields used in a Process Control Block. (5)
15. Consider a system with five processes P0 through P4 and three resources of type A, B, C.
Resource type A has 10 instances, B has 5 instances and C has 7 instances. Suppose at time
t0 following snapshot of the system has been taken:
i) What will be the content of the Need matrix? Is the system in a safe state? If Yes, then what is
the safe sequence? (8)
iii)What will happen if process P1 requests one additional instance of resource type A and two
instances of resource type C? (6)
OR
16. a) State dining philosopher’s problem and give a solution using semaphores. (7)
b) What do you mean by binary semaphore and counting semaphore? With C struct, explain
implementation of wait () and signal() (7)
COMPUTER
17. a) Consider the following page reference string SCIENCE
1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2,AND
3, 7, 6,ENGINEERING
3, 2, 1, 2,
3, 6. Find out the number of page faults if there are 4 page frames, using the following
page replacement algorithms i) LRU ii) FIFO iii) Optimal (9)
OR
18. a) With a diagram, explain how paging is done with TLB. (5)
b) Memory partitions of sizes 100 kb, 500 kb, 200 kb, 300 kb, 600 kb are available, how
would best ,worst and first fit algorithms place processes of size 212 kb, 417 kb, 112 kb,
426 kb in order. Rank the algorithms in terms of how efficiently they uses memory. (9)
19. a) Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. the drive currently
services a request at cylinder 143, and the previous request was at cylinder 125. the queue
of pending request in FIFO order is 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130.
Starting from the current position, what is the total distance (in cylinders) that the disk arm
moves to satisfy all pending requests for each of the following algorithms
OR
20. a) Explain the different file allocation operations with advantages and disadvantages. (8)
b) Explain the following i) file types ii) file operation iii) file attributes (6)
Teaching Plan
3.4 Semaphores 1
3.5 Monitors 1
4.2 Swapping 1
4.3 Contiguous memory allocation, fixed and variable partitions 1
4.4 Segmentation. 1
4.5 Paging (Lecture 1) 1
5.3 Protection 1
5.4 File-System implementation 1
Preamble: This course helps the learners to get familiarized with (i) Digital Logic Design
through the implementation of Logic Circuits using ICs of basic logic gates & flip-
flops and (ii) Hardware Description Language based Digital Design. This course helps the
learners to design and implement hardware systems in areas such as games, music, digital
filters, wireless communications and graphical displays.
Prerequisite:Topics covered under the course Logic System Design (CST 203)
Course Outcomes: After the completion of the course the student will be able to
Design and implement combinational logic circuits using Logic Gates (Cognitive
CO 1
Knowledge Level: Apply)
CO 1
CO 2
CO 3
CO 4
COMPUTER SCIENCE AND ENGINEERING
Assessment Pattern
Continuous Assessment
End Semester
Bloom’s Category Test (Internal Exam)
Examination (Percentage)
(Percentage)
Remember 20 20
Understand 20 20
Apply 60 60
Analyse
Evaluate
Create
Mark Distribution
150 75 75 3 hours
Attendance : 15 marks
Viva-voce : 15 marks
SYLLABUS
• A 2 hour session should be spent to make the students comfortable with the use of
trainer kit/breadboard and ICs.
• The following experiments can be conducted on breadboard or trainer kits.
• Out of the 15 experiments listed below, a minimum of 8 experiments should be
completed by a student, including the mandatory experiments (5).
1. Realization of functions using basic and universal gates (SOP and POS forms).
2. Design and realization of half adder, full adder, half subtractor and full subtractor using:
a) basic gates (b) universal gates. *
3. Code converters: Design and implement BCD to Excess 3 and Binary to Gray code
converters.
4. Design and implement 4 bit adder/subtractor circuit and BCD adder using IC7483.
5. Implementation of Flip Flops: SR, D, T, JK and Master Slave JK Flip Flops using basic
gates.*
6. Asynchronous Counter: Design and implement 3 bit up/down counter.
7. Asynchronous Counter: Realization of Mod N counters (At least one up counter and one
down counter to be implemented). *
8. Synchronous Counter: Realization of 4-bit up/down counter.
9. Synchronous Counter: Realization of Mod-N counters and sequence generators. (At least
one mod N counter and one sequence generator to be implemented) *
10. Realization of Shift Register (Serial input left/right shift register), Ring counter and
Johnson Counter using flipflops. *
11. Realization of counters using IC’s (7490, 7492, 7493).
12. Design and implement BCD to Seven Segment Decoder.
13. Realization of Multiplexers and De-multiplexers using gates.
14. Realization of combinational circuits using MUX & DEMUX ICs (74150, 74154).
15. To design and set up a 2-bit magnitude comparator using basic gates.
COMPUTER SCIENCE AND ENGINEERING
PART B (Any 4 Experiments)
• The following experiments aim at training the students in digital circuit design with
Verilog. The experiments will lay a foundation for digital design with Hardware
Description Languages.
• A 3 hour introductory session shall be spent to make the students aware of the
fundamentals of development using Verilog
• Out of the 8 experiments listed below, a minimum of 4 experiments should be
completed by a student
Experiment 1. Realization of Logic Gates and Familiarization of Verilog
(a) Familiarization of the basic syntax of Verilog
(b) Development of Verilog modules for basic gates and to verify truth tables.
(c) Design and simulate the HDL code to realize three and four variable Boolean
functions
Experiment 5: Adder/Subtractor
(a) Write the Verilog modules for a 4-bit adder/subtractor
(b) Development of Verilog modules for a BCD adder
Experiment 8: Counters
(a) Development of Verilog modules for an asynchronous decade counter.
(b) Development of Verilog modules for a 3 bit synchronous up-down counter.
COMPUTER SCIENCE AND ENGINEERING
Practice Questions
PART A
1. Design a two bit parallel adder using gates and implement it using ICs of basic gates
2. A combinatorial circuit has 4 inputs and one output. The output is equal to 1 when (a)
all inputs are 1, (b) none of the inputs are 1, (c) an odd number of inputs are equal to
1. Obtain the truth table and output function for this circuit and implement the same.
3. Design and implement a parallel subtractor.
4. Design and implement a digital circuit that converts Gray code to Binary.
5. Design a combinational logic circuit that will output the 1’s compliment of a 4-bit
input number.
∑
6. Implement and test the logic function f! (A, B, C ) = m(0,1,3,6) using an 8:1 MUX
IC
7. Design a circuit that will work as a ring counter or a Johnson counter based on a mode
bit, M.
8. Design a 4-bit synchronous down counter.
9. Design a Counter to generate the binary sequence 0,1,3,7,6,4
10. Design an asynchronous mod 10 down counter
11. Design and implement a synchronous counter using JK flip flop ICs to generate the
sequence: 0 - 1 -3 - 5 - 7 - 0.
PART B
1. Develop Verilog modules for a full subtractor in structural modeling using half
subtractors.
2. Design a 4 bit parallel adder using Verilog.
3. Develop Verilog modules for a 4 bit synchronous down counter.
4. Write Verilog code for implementing a 8:1 multiplexer.
5. Develop Verilog modules for a circuit that converts Excess 3 code to binary.
6. Write the Verilog code for a JK Flip flop, and its test-bench. Use all possible
combinations of inputs to test its working
7. Write the hardware description in Verilog of a 8-bit register with shift left and shift
right modes of operations and test its functioning.
8. Write the hardware description in Verilog of a mod-N (N > 9) counter and test it.
COMPUTER SCIENCE AND ENGINEERING
YEAR OF
OPERATING CATEGORY L T P CREDIT
CST 206 INTRODUCTION
SYSTEMS LAB
PCC 0 0 3 2 2019
Preamble: The course aims to offer students a hands-on experience on Operating System
concepts using a constructivist approach and problem-oriented learning. Operating systems are
the fundamental part of every computing device to run any type of software.
Prerequisite: Topics covered in the courses are Data Structures (CST 201) and Programming
in C (EST 102)
Course Outcomes:
Illustrate the performance of First In First Out, Least Recently Used and Least
CO4
Frequently Used Page Replacement Algorithms. (Cognitive knowledge: Apply)
Implement modules for Deadlock Detection and Deadlock Avoidance in Operating
CO5
Systems. (Cognitive knowledge: Apply)
Implement modules for Storage Management and Disk Scheduling in Operating
CO6
Systems. (Cognitive knowledge: Apply)
COMPUTER SCIENCE AND ENGINEERING
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
CO6
Assessment Pattern:
Evaluate
Create
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
ESE
Total Marks CIE Marks ESE Duration
Marks
150 75 75 3 hours
Attendance : 15 marks
All Students attending the Operating System Lab should have a Fair Record. The fair record
should be produced in the University Lab Examination. Every experiment conducted in the
lab should be noted in the fair record. For every experiment in the fair record, the right hand
page should contain Experiment Heading, Experiment Number, Date of experiment, Aim of
the Experiment and the operations performed on them, Details of experiment including
algorithm and result of Experiment. The left hand page should contain a print out of the code
used for experiment and sample output obtained for a set of input.
COMPUTER SCIENCE AND ENGINEERING
SYLLABUS
OPERATING SYSTEMS LAB
* mandatory
4. Given the list of processes, their CPU burst times and arrival times, display/print the
Gantt chart for FCFS and SJF. For each of the scheduling policies, compute and print the
average waiting time and average turnaround time
5. Write a C program to simulate following non-preemptive CPU scheduling algorithms to
find turnaround time and waiting time.
a)FCFS b) SJF c) Round Robin (pre-emptive) d) Priority
6. Write a C program to simulate following contiguous memory allocation techniques
a) Worst-fit b) Best-fit c) First-fit
7. Write a C program to simulate paging technique of memory management.
8. Write a C program to simulate Bankers algorithm for the purpose of deadlock avoidance.
9. Write a C program to simulate disk scheduling algorithms a) FCFS b) SCAN c) C-SCAN
10. Write a C program to simulate page replacement algorithms a) FIFO b) LRU c) LFU
11. Write a C program to simulate producer-consumer problem using semaphores.
12. Write a program for file manipulation for display a file and directory in memory.
13. Write a program to simulate algorithm for deadlock prevention.
14. Write a C program to simulate following file allocation strategies.
a)Sequential b) Indexed c) Linked
COMPUTER SCIENCE AND ENGINEERING
SEMESTER -4
MINOR
COMPUTER SCIENCE AND ENGINEERING
Preamble: This is the second course for awarding B.Tech Minor in Computer Science and
Engineering with specialization in Software Engineering. The course provides the learners a
clear understanding of the main constructs of contemporary programming languages and the
various systems of ideas that have been used to guide the design of programming languages.
This course covers the concepts of Names, Bindings & Scope, Statement-Level Control
Structures, Sub Programs, support for Object Oriented Programming, Exception Handling, Event
Handling, Concurrency Control, Functional Programming and Logic Programming. This course
helps the learners to equip with the knowledge necessary for the critical evaluation of existing
and upcoming programming languages. It also enables the learner to choose the most appropriate
language for a given programming task, apply that language's approach to structure or organize
the code and classify programming languages based on their features.
Prerequisite:
Course Outcomes: After the completion of the course the student will be able to
Explain the criteria for evaluating programming languages and compare Imperative,
CO1 Functional and Logic programming languages (Cognitive Knowledge Level:
Understand)
Explain the characteristics of data types and variables (Cognitive Knowledge Level:
CO2
Understand)
Illustrate how control flow structures and subprograms help in developing the
CO3 structure of a program to solve a computational problem (Cognitive Knowledge Level:
Apply)
Explain the characteristics of Object Oriented Programming Languages (Cognitive
CO4
Knowledge Level: Understand)
Compare concurrency constructs in different programming languages (Cognitive
CO5
Knowledge Level: Understand)
1
COMPUTER SCIENCE AND ENGINEERING
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
Assessment Pattern
Remember 30 30 30
Understand 50 50 50
Apply 20 20 20
Analyze
Evaluate
Create
2
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
Attendance : 10 marks
Continuous Assessment Test : 25 marks
Continuous Assessment Assignment : 15 marks
Each of the two internal examinations has to be conducted out of 50 marks. First series test shall
be preferably conducted after completing the first half of the syllabus and the second series test
shall be preferably conducted after completing remaining part of the syllabus. There will be two
parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions each from the
completed modules and 1 question from the partly completed module), having 3 marks for each
question adding up to 15 marks for part A. Students should answer all questions from Part A.
Part B contains 7 questions (preferably, 3 questions each from the completed modules and 1
question from the partly completed module), each with 7 marks. Out of the 7 questions, a student
should answer any 5.
There will be two parts; Part A and Part B. Part A contains 10 questions with 2 questions from
each module, having 3 marks for each question. Students should answer all questions. Part B
contains 2 questions from each module of which a student should answer any one. Each question
can have maximum 2 sub-divisions and carries 14 marks.
3
COMPUTER SCIENCE AND ENGINEERING
SYLLABUS
Module 1
Data Types – Primitive Data Types, Character String Types, User-Defined Ordinal Types, Array
Types, Record Types, List Types, Pointer & Reference Types, Type Checking, Strong Typing,
Type Equivalence. Expressions – Arithmetic Expressions, Overloaded Operators, Type
Conversions, Relational and Boolean Expressions, Short-Circuit Evaluation. Assignment -
Assignment Statements, Mixed-mode Assignment.
Module 3
Module 4
Support for Object Oriented Programming – Inheritance, Dynamic Binding, Design Issues for Object
Oriented Languages, Support for Object Oriented Programming in C++, Implementation of Object-
Oriented Constructs. Exception Handling – Basic Concepts, Design Issues. Event Handling - Introduction
to Event Handling.
Module 5
Text Books
2. Scott M. L., Programming Language Pragmatics, 3rd Edn., Morgan Kaufmann Publishers.
4
COMPUTER SCIENCE AND ENGINEERING
Reference Books:
1. Kenneth C. Louden, Programming Languages: Principles and Practice, 2nd Edn., Cengage
Learning.
3. Ravi Sethi, Programming Languages: Concepts & Constructs, 2nd Edn., Pearson
Education.
Course Outcome 1 (CO1): Compare any three programming languages based on the language
evaluation criteria. Prepare a list of characteristics that affect the language evaluation criteria.
Identify the advantages and disadvantages of imperative, functional and logic programming
languages.
Course Outcome 2 (CO2): Two most important design issues that are specific to character
string types are (1) whether a string is simply a special kind of character array or a primitive type
(2) whether strings have static or dynamic length. Justify your answer.
Course Outcome 3 (CO3):
1. Describe three situations where a combined counting and logical looping statement is
needed.
2. Describe the ways that aliases can occur with pass-by-reference parameters.
3. Identify the two fundamental design considerations for parameter-passing methods.
Course Outcome 4 (CO4):
1. Describe the role of a virtual method table in implementing dynamic method binding.
2. Identify one disadvantage of inheritance.
Course Outcome 5 (CO5): Evaluate the use of semaphores and monitors for providing
competition synchronization and cooperation synchronization.
5
COMPUTER SCIENCE AND ENGINEERING
QP CODE: PAGES:3
PART A
Part B
Answer any one Question from each module. Each question carries 14 Marks
11.
(a) Explain different criteria used for evaluating languages.
(7 marks)
(b) Explain the major methods of implementing programming languages.
(7 marks)
OR
12.
(a) Explain the meanings, purposes, advantages and disadvantages of four categories of
scalar variables according to their storage bindings.
(7 marks)
6
COMPUTER SCIENCE AND ENGINEERING
program example;
var a, b : integer;
procedure sub1;
var x, y: integer;
begin { sub1 }
……….. (1)
end { sub1 }
procedure sub2;
var x : integer;
……..
procedure sub3;
var x: integer;
begin { sub3 }
……….. (2)
end { sub3 }
begin { sub2 }
……….. (3)
end { sub2}
begin {example}
……….. (4)
end {example } (7 Marks)
13.
(a) Explain any two problems associated with the pointer data types and also indicate
how dangling pointer problem can be solved.
(7 marks)
(b) Describe the lazy and eager approaches for reclaiming garbage.
(7 marks)
OR
14.
(a) What is meant by side effect and illustrate the advantages of referential
transparency?
(8 marks)
(b) Explain the terms: compound assignment operator, coercion and short circuit
evaluation. (6 marks)
7
COMPUTER SCIENCE AND ENGINEERING
15.
(a) Explain different categories of iteration control statements.
(8 marks)
(b) Explain techniques used for identifying correct referencing environment for a
subprogram that was sent as a parameter.
(6 marks)
OR
16.
(a) Describe the implementation models of Parameter passing.
(10 Marks)
(b) Differentiate coroutines from conventional subprograms.
(4 marks)
17.
(a) What is an exception handler? Explain how exceptions are handled in object
oriented language?
(7 Marks)
(b) What are the design issues in object oriented languages? (7 Marks)
OR
8
COMPUTER SCIENCE AND ENGINEERING
Teaching Plan
2.3 Record Types, List Types, Pointer and Reference Types 1 Hour
9
COMPUTER SCIENCE AND ENGINEERING
10
COMPUTER SCIENCE AND ENGINEERING
11
COMPUTER SCIENCE AND ENGINEERING
CODE Mathematics for Machine CATEGORY L T P CREDIT
CST 284 Learning MINOR 3 1 0 4
Preamble: This is a foundational course for awarding B. Tech. Minor in Computer Science
and Engineering with specialization in Machine Learning. The purpose of this course is to
introduce mathematical foundations of basic Machine Learning concepts among learners, on which
Machine Learning systems are built. This course covers Linear Algebra, Vector Calculus, Probability
and Distributions, Optimization and Machine Learning problems. Concepts in this course help the
learners to understand the mathematical principles in Machine Learning and aid in the creation of new
Machine Learning solutions, understand & debug existing ones, and learn about the inherent
assumptions & limitations of the current methodologies.
Prerequisite:
1. A sound background in higher secondary school Mathematics.
2. Python for Machine Learning (CST 253)
Course Outcomes: After the completion of the course the student will be able to
Make use of the concepts, rules and results about linear equations, matrix algebra,
CO 1 vector spaces, eigenvalues & eigenvectors and orthogonality & diagonalization to
solve computational problems (Cognitive Knowledge Level: Apply)
Perform calculus operations on functions of several variables and matrices,
CO 2
including partial derivatives and gradients (Cognitive Knowledge Level: Apply)
Utilize the concepts, rules and results about probability, random variables, additive
& multiplicative rules, conditional probability, probability distributions and Bayes’
CO 3
theorem to find solutions of computational problems (Cognitive Knowledge Level:
Apply)
Train Machine Learning Models using unconstrained and constrained optimization
CO 4
methods (Cognitive Knowledge Level: Apply)
Illustrate how the mathematical objects - linear algebra, probability, and calculus
CO 5 can be used to design machine learning algorithms (Cognitive Knowledge Level:
Understand)
PO 1 PO 2 PO 3 PO 4 PO 5 PO 6 PO 7 PO 8 PO 9 PO 10 PO 11 PO 12
CO 1 √ √ √ √ √
CO 2 √ √ √ √
CO 3 √ √ √ √ √
CO 4 √ √ √ √ √ √
CO 5 √ √ √ √ √ √ √ √
COMPUTER SCIENCE AND ENGINEERING
Abstract POs defined by National Board of Accreditation
Assessment Pattern
Analyse
Evaluate
Create
Mark Distribution
Attendance : 10 marks
First Internal Examination shall be preferably conducted after completing the first half of the
syllabus and the Second Internal Examination shall be preferably conducted after completing
remaining part of the syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2
questions each from the completed modules and 1 question from the partly covered module),
having 3 marks for each question adding up to 15 marks for part A. Students should answer
all questions from Part A. Part B contains 7 questions (preferably, 3 questions each from the
completed modules and 1 question from the partly covered module), each with 7 marks. Out
of the 7 questions in Part B, a student should answer any 5.
End Semester Examination Pattern: There will be two parts; Part A and Part B. Part A
contains 10 questions with 2 questions from each module, having 3 marks for each question.
Students should answer all questions. Part B contains 2 questions from each module of which
student should answer anyone. Each question can have maximum 2 sub-divisions and carries
14 marks.
COMPUTER SCIENCE AND ENGINEERING
Syllabus
Module 1
Module 2
Module 3
Module 4
Module 5
Text book:
1.Mathematics for Machine Learning by Marc Peter Deisenroth, A. Aldo Faisal, and
Cheng Soon Ong published by Cambridge University Press (freely available at https://
mml - book.github.io)
Reference books:
4. 4.A set
A set
of of n linearly
n linearly independent
independent vectors
vectors in R inn R n
formsforms a basis.
a basis. Does
Does thethe
set set of vectors
of vectors (2, (2, 4,−3) ,
n
4. 4.4.
A setA set
A(0,
set1,
of of n linearly
noflinearly
1)n, linearly independent
independent
independent
(0, 1,−1) vectors
vectors
vectors
form a basis 3 in R forms a basis. Does the set of vectors (2, 4,−3) ,
n n
forinRR?inExplain
R3 forms
forms a basis.
a your
basis. DoesDoes
reasons. the of
the set setvectors
of vectors (2, 4,−3)
(2, 4,−3) , ,
4,−3) , (0, 1, 1) , (0, 1,−1) form a basis for R ? Explain your reasons.
(0, 1, (0,
(0,1)1,1, 1),1,−1)
, 1)
(0, ,(0,
(0,1,−1)
1,−1) form
formform aabasis
a basisbasis
for R for
3
for?R R33??Explain
ExplainExplainyouryour your reasons.
reasons.
reasons.
5. 5.Consider the transformation T (x, y) = (x +
Consider the transformation T (x, y) = (x + y, x + 2y, 2x y, x + 2y, 2x + 3y). Obtain
+ 3y). kerker
Obtain T and useuse this to
T and
5. 5.5. this
Consider
Consider
Consider the
the
to calculate
calculate transformation
the transformation
thetransformation
the nullity.
nullity. Also (x,TTy)
TAlso
find (x,
(x,=y)
find
the y)
(x ==+(x
the (x
y, +x+ y,+y, x2y,
transformation
transformation x ++2x2y,+2x
2y,
matrix 2x
3y).+ 3y).
+for
matrix 3y). Obtain
Obtain
T. Tker
T. ker ker
forObtain TT and
and and use
use use this
this this to
to to
calculate
calculate
calculate thenullity.
nullity.
the nullity.
the Also
AlsoAlso find
findfind thetransformation
transformation
the transformation
the matrix matrix
for T.
matrix forT.
for T.
6. 6.Find
Find
the the characteristic
characteristic equation,
equation, eigenvalues,
eigenvalues, and eigenspaces
and eigenspaces corresponding
corresponding to each to each
6. 6.6. Find
Find Find the
the the
eigenvalue characteristic
characteristic equation,
equation,
characteristic eigenvalues,
eigenvalues,
equation,
of the following matrix and
and and
eigenvalues, eigenspaces
eigenspaces corresponding
corresponding
eigenspaces to each
to each
corresponding to each
eigenvalue of the following matrix
eigenvalue
eigenvalue offollowing
of the
eigenvalue of thefollowing
the following matrix
matrix
matrix
"
7. Diagonalize the following matrix, if possible
7. 7.7. Diagonalize
Diagonalize thefollowing
following
the following
Diagonalize the matrix,
matrix, ififpossible
possible
if possible
matrix,
COMPUTER SCIENCE AND ENGINEERING
7. Diagonalize the following matrix, if possible
"
1. 1. For
Fora scalar
a scalar function
function f(x,f(x, x2 +3y
y, zy,) z=) x=2 +3y
2
2 +2z+2z
2
, find
2, find the the gradient
gradient andand its magnitude
its magnitude at at the
1.thepoint
For
(1, 2, -1).
a scalar
point function f(x, y, z ) = x2 +3y2 +2z2, find the gradient and its magnitude at the
(1, 2, -1).
pointthe
2. 2. Find
Find (1, maximum
2, -1). andminimum
minimumvalues
values of
of the
the function f(x, y) 2 2
the maximum and y) == 4x
4x++4y4y- x- x-2 y- ysubject
2 to
2 2
the
Findcondition
2.subject to the
the x + y and
<=
condition
maximum x2 2.
+ y2 <= 2. values of the function f(x, y) = 4x + 4y - x 2 - y2 subject to
minimum
2 2
the condition
3. 3. Suppose x +trying
y <= 2. f(x, y) y)
= x2=+ x
2y2 + 2y2. Along
Supposeyou
youwere to to
were trying minimize
minimize f(x, + 2y + 2y2. what vector
Along what vector
3.should you
should
Suppose
travel
you from (5,(5,
travel
you werefrom
12)?
trying 12)?
to minimize f(x, y) = x2+ 2y + 2y2. Along what vector
4. should you travel from (5, 12)?
4. Find thethe
second order Taylor series expansion forfor
f(x, y) y)
= (x + y)
+ y)about (0 (0
, 0).
2 2
Find second order Taylor series expansion f(x, = (x about , 0).
5.
4.Find thethe
critical points
orderofTaylor
f(x, y)series
= x expansion
3xy+5x-2y+6y +8.y) = (x + y)2 about (0 , 0).
2– 2
Find second for f(x,
5. Find the critical points of f(x, y) = x2 – 3xy+5x-2y+6y2+8.
6. Compute the gradient of the Rectified Linear Unit (ReLU) function ReLU(z) =
5. Find the critical points of f(x, y) = x2 – 3xy+5x-2y+6y2+8.
6. Compute the gradient of the Rectified Linear Unit (ReLU) function ReLU(z) = max(0 , z).
max(0 , z).
7. 6.LetCompute
LL ==||Ax
the gradient of the Rectified Linear Unit (ReLU) function ReLU(z) = max(0 , z).
||Ax- b||
- b||2,22where
, whereAAisisa amatrix
matrixand
andx xand
andb bare
arevectors.
vectors.Derive
DerivedL
dLininterms
termsofof dx.
2
7. Let
7.dx.Let L = ||Ax - b||22, where A is a matrix and x and b are vectors. Derive dL in terms of dx.
Course Outcome 3 (CO3):
Course Outcome 3 (CO3):
1. Let J and T be independent events, where P(J)=0.4 and P(T)=0.7.
i. Find P(J∩T)
1. Let J and T be independent events, where P(J)=0.4 and P(T)=0.7.
ii. Find P(J∪T)
i. Find P(J∩T)
iii. Find P(J∩T′)
ii. Find P(J∪T)
iii. Find P(J∩T′)
COMPUTER SCIENCE AND ENGINEERING
Course Outcome 3 (CO3):
i. Find P(J∩T)
i.
i. Given that E(R)=2.85, find a and b.
i. Given
ii. that E(R)=2.85,
Find P(R>2). find a and b.
ii. Find P(R>2).
4. A biased coin (with probability of obtaining a head equal to p > 0) is tossed repeatedly and
4. A biasedindependently
coin (with probability
until the of obtaining
first head isaobserved.
head equalCompute
to p > 0)the
is tossed repeatedly
probability that the first head
and independently
appears at anuntil
eventhenumbered
first headtoss.
is observed. Compute the probability that the
first head appears at an even numbered toss.
5. Two players A and B are competing at a trivia quiz game involving a series of questions. On
5. Two players A and B question,
are competing at a triviathat
quiz game involving a series of are p and q
any individual the probabilities A and B give the correct answer
questions. On any individual
respectively, question,with
for all questions, the outcomes
probabilities
for that A andquestions
different B give the correct
being independent. The
answer gameare p finishes
and q respectively,
when a player for wins
all questions, with outcomes
by answering a questionforcorrectly.
differentCompute the
questions being independent.
probability that A winsThe if game finishes when a player wins by answering a
i. A answers
question correctly. Compute thethe
first question, that A wins if
probability
ii. B answers the first question.
i. A answers the first question,
6. A coin for which P(heads) = p is tossed until two successive tails are obtained. Find the
ii. Bprobability
answers the first
that thequestion.
experiment is completed on the nth toss.
6. A coin for which P(heads) = p is tossed until two successive tails are obtained. Find
7. You roll a fair dice twice. Let the random variable X be the product of the outcomes of the
the probability that the experiment is completed on the nth toss.
two rolls. What is the probability mass function of X? What are the expected value and the
7. You rollstandard
a fair dice twice. Let the random variable X be the product of the outcomes of
deviation of X?
the two rolls. What is the probability mass function of X? What are the expected value
and 8. While watching
the standard deviationaofgameX? of Cricket, you observe someone who is clearly supporting
Mumbai Indians. What is the probability that they were actually born within 25KM of
Mumbai? Assume that:
• the probability that a randomly selected person is born within 25KM of Mumbai is
1/20;
• the chance that a person born within 25KMs of Mumbai actually supports MI is
7/10 ;
• the probability that a person not born within 25KM of Mumbai supports MI with
probability 1/10.
5. Consider
5. Consider the
the update
update equation
equation for
for stochastic
stochastic gradient
gradient descent.
descent. Write
Write down
down the
the update
update when
when
we use
we use aa mini-batch
mini-batch size
size of
of one.
one.
COMPUTER SCIENCE AND ENGINEERING
6. Consider
6.
6. Consider the
Consider the function
the function
function
"
"
9. 9.
Solve the following
Solve LP problem
the following withwith
LP problem the simplex method.
the simplex method.
9. Solve the following LP problem with the simplex method.
"
subject
subject to toto constraints
the the constraints
subject the constraints
Course
Course Outcome
Outcome 5 (CO5):
5 (CO5):
Course Outcome 5 (CO5):
1. What is a loss function? Give examples.
1. What is a loss function? Give examples.
2.1. What is
area loss
training/validation/test sets? What is cross-validation? Name one or two
function? Give examples.
2. What areoftraining/validation/test
examples sets? What is cross-validation? Name one or two examples
cross-validation methods.
2. What are training/validation/test sets? What is cross-validation? Name one or two examples
of cross-validation methods.
3. of cross-validation
Explain methods.
generalization, overfitting, model selection, kernel trick, Bayesian learning
3. Explain generalization, overfitting, model selection, kernel trick, Bayesian learning
3. Explain generalization, overfitting, model selection, kernel trick, Bayesian learning
4. Distinguish between Maximum Likelihood Estimation (MLE) and Maximum A Posteriori
4. Distinguish between Maximum Likelihood Estimation (MLE) and Maximum A Posteriori
Estimation (MAP)?
Estimation (MAP)?
5. What is the link between structural risk minimization and regularization?
5. What is the link between structural risk minimization and regularization?
6. What is a kernel? What is a dot product? Give examples of kernels that are valid dot
6. What is a kernel? What is a dot product? Give examples of kernels that are valid dot
products.
products.
Course Outcome 5 (CO5):
4.2. Distinguish
What are training/validation/test
between Maximum sets? What isEstimation
Likelihood cross-validation?
(MLE) Name one or two A
and Maximum examples
of cross-validation
Posteriori Estimationmethods.
(MAP)?
5.3. What
Explain generalization,
is the link between overfitting, model
structural risk selection, and
minimization kernel trick, Bayesian learning
regularization?
6.4. What
Distinguish between
is a kernel? WhatMaximum Likelihood
is a dot product? GiveEstimation
examples (MLE) andthat
of kernels Maximum
are validAdot
Posteriori
Estimation (MAP)?
products.
7.5. What
Whatisisridge
the link between How
regression? structural risktrain
can one minimization and regularization?
a ridge regression linear model?
8.6. What
What isis Principal
a kernel?Component
What is a Analysis
dot product?
(PCA)?GiveWhich
examples
eigenof value
kernels that arethevalid dot
indicates
products.of largest variance? In what sense is the representation obtained from a
direction
7. projection
What is ridge ontoregression?
the eigenHow can onecorresponding
directions train a ridge regression
the the linear
largestmodel?
eigen values
optimal for data reconstruction?
8. What is Principal Component Analysis (PCA)? Which eigen value indicates the direction of
largest variance?
9. Suppose that you In what
have sense is
a linear the representation
support vector machine obtained
(SVM) from a projection
binary classifier.onto the
eigen directions
Consider a pointcorresponding the the
that is currently largest eigen
classified valuesand
correctly, optimal
is farforaway
data reconstruction?
from the
9. decision
Supposeboundary. If you
that you have remove
a linear the point
support vectorfrom the training
machine (SVM) set, andclassifier.
binary re-train the
Consider a
classifier, will the decision boundary change or stay the same? Explain your answer
point that is currently classified correctly, and is far away from the decision boundary. If you
inremove
one sentence.
the point from the training set, and re-train the classifier, will the decision boundary
change or stay the same? Explain your answer in one sentence.
10. Suppose you have n independent and identically distributed (i.i.d) sample data points
10. xSuppose
1, ... , xnyou havedata
. These n independent
points come andfrom
identically distributed
a distribution (i.i.d)
where thesample of a x1, ... ,
data points
probability
xn. These
given data points
datapoint x is come from a distribution where the probability of a given datapoint x is
"
i. What are the prior and posterior odds for the fair coin?
ii. What are the prior and posterior predictive probabilities of heads on the next
flip? Here prior predictive means prior to considering the data of the first four
flips.
uniform distributions with range 1 to N. Find the maximum likelihood estimate of N.
12. Ram has two coins: one fair coin and one biased coin which lands heads with probability
3/4. He picks one coin at random (50-50) and flips it repeatedly until he gets a tails. Given
that he observes 3 heads before the first tails, find the posterior probability that he picked
COMPUTER SCIENCE AND ENGINEERING
each coin.
i. What are the prior and posterior odds for the fair coin?
ii. What are the prior and posterior predictive probabilities of heads on the next flip?
Here prior predictiveModel
means Question paper the data of the first four flips.
prior to considering
QP Code : Total Pages: 4
Reg No.:_______________ Name:__________________________
Model Question paper
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
IV SEMESTER
QP Code : B.TECH (MINOR) DEGREE EXAMINATION, MONTH andPages:
Total YEAR4
Reg No.:_______________ Name:__________________________
Course Code: CST 284
APJ
Course ABDUL
Name: KALAM TECHNOLOGICAL
MATHEMATICS FOR MACHINE UNIVERSITY
LEARNING
IV SEMESTER B.TECH (HONOURS) DEGREE EXAMINATION, MONTH and YEAR
Max. Marks: 100 Duration: 3 Hours
Course Code: CST 274
Course Name: COMPUTATIONAL FUNDAMENTALS PART A FOR MACHINE LEARNING
Max. Marks: 100 Answer all questions, each carries 3 marks. Marks
Duration: 3 Hours
PART A
1 Show that withAnswer
the usual operation each
all questions, of scalar multiplication
carries 3 marks. but with Marks
1 Show that on
addition with the given
reals usual by
operation
x # y = of
2(xscalar
+ y) ismultiplication but with addition on
not a vector space.
reals given by x # y = 2(x + y) is not a vector space.
2 Find the eigenvalues of the following matrix in terms of k. Can you find
2 Find the eigenvalues of the following matrix in terms of k. Can you find an
an eigenvector corresponding to each of the eigenvalues?
eigenvector corresponding to each of the eigenvalues?
8
one over the other.
Briey explain the difference between (batch) gradient descent and stochastic
8 Briey explain the difference between (batch) gradient descent and stochastic
9 What isdescent.
gradient the empirical
Give an risk? What of
example is “empirical risk minimization”?
when you might prefer one over the other.
910gradient descent.
What Give
is thethe an
empirical example
risk? of
Whatwhen you might
is “empirical prefer
risk one over the other.
minimization”?
9 What is Explain
the empirical concept
risk? of ais
What Kernel function
“empirical risk in Support
minimization”? Vector Machines.
10 Explain the concept of a Kernel function in Support Vector Machines. Why are
10 Explain Why
the concept of aso
are kernels Kernel
useful?function in Supporta Vector
What properties kernel Machines. Why
should posses to are
be
kernels so useful? What properties a kernel should posses to be used in an SVM?
kernels so
useduseful?
in an What
SVM?properties a kernel should posses to be used in an SVM?
PART B
PART
Answer any one Question from each B module. Each question carries 14 Marks
11 a)Answer i. any one
Find allQuestion
solutionsfrom PART
to theeach B linear
module.
system of Each question carries 14 Marks
equations (6)
11 a) i. Answer
Find all any
solutions to the system of linear equations
one Question from each module. Each question carries 14 Marks (6)
"
OR
12 a) i. Let L be the line through the OR 2
ORorigin in R that is parallel to the vector (6)
12 a) i. Let L be 4]Tline
[3,the . Find the standard
through matrix
the origin in Rof
2 the orthogonal projection onto L. Also
that is parallel to the vector (6)
T
[3, 4] find
. Find
thethe standard
point matrixisofclosest
on L which the orthogonal projection
to the point onto
(7 , 1) and findL.the
Also
point on
find theL point
whichonis Lclosest
whichtoisthe
closest
pointto(-3
the, 5).
point (7 , 1) and find the point on
ii. Find
L which the rank-1
is closest approximation
to the point (-3 , 5).of
ii. Find the rank-1 approximation of
"
OR
OR
14 a) Let g be the function given by (8)
"
i. Calculate the partial derivatives of g at (0 , 0).
i. Calculate the partial derivatives of g at (0 , 0).
ii.
ii. Show
Showthatthatggisisnot
notdifferentiable
differentiableatat(0
(0,,0).
0).
b) Find the second order Taylor series expansion for f(x,y) = e-(x2+y2) cos(xy) about (0 , (6)
b) Find the second order Taylor series expansion for f(x,y) = e-(x2+y2) cos(xy) (6)
0).
aboutare
15 a) There (0 ,two
0). bags. The first bag contains four mangos and two apples; the second (6)
15 a) There
bag are twofour
contains bags. The first
mangos andbag
fourcontains
apples. four mangos
We also haveand two apples;
a biased (6)
coin, which
the second
shows bagwith
“heads” contains four mangos
probability 0.6 andand fourwith
“tails” apples. We also0.4.
probability haveIf athe coin
biased coin, which shows “heads” with probability 0.6 and “tails” with
probability 0.4. If the coin shows “heads”. we pick a fruit at
showsrandom
“heads”.from bag 1;
we pick otherwise
a fruit at we pick a fruit at random from bag 2. Your
random fromflips
friend bag the
1; otherwise
coin (youwe pick see
cannot a fruit
theatresult),
random froma bag
picks fruit2.atYour friend
random
flips the coin (you cannot see the result), picks a fruit at random from the
from the corresponding bag, and presents you a mango.
corresponding bag, and presents you a mango.
What What
is the is the probability
probability that
that the the mango
mango was picked
was picked from2?bag 2?
from bag
b) b)
Suppose that one
Suppose thathasone
written
has awritten
computer program that
a computer sometimes
program compiles and (8)(8)
that sometimes
sometimes notand
compiles (code does not
sometimes change).
not (code doesYou decide toYou
not change). model
decidethe apparent
to model
stochasticity (success vs. no success) x of the compiler using a Bernoulli
the apparent stochasticity (success vs. no success) x of the compiler using
distribution with parameter μ:
a Bernoulli distribution with parameter μ:
"
Choose a conjugate prior for the Bernoulli likelihood and compute the posterior
Choose a conjugate prior for the Bernoulli likelihood and compute the
distribution p( μ | x1 , ... , xN).
posterior distribution p( μ | x1 , ... OR
, xN).
OR
16 a) Consider a mixture of two Gaussian distributions (8)
i. i.Compute
Compute the the marginal
marginal distributions
distributions for for
eacheach dimension.
dimension.
ii. ii.
Compute
Compute the mean, mode and
the mean, modemedian
andformedian
each marginal
for eachdistribution.
marginal
iii. Compute the mean and mode for the two-dimensional distribution.
distribution.
i. Compute
b) Express the marginal distributions for each dimension.
iii.the Binomial
Compute the distribution
mean and mode as an
for exponential family distribution.
the two-dimensional distribution. Also (6)
ii. Compute the mean, mode and median for each marginal distribution.
express the Betathedistribution
iii. Compute mean and mode is an for
exponential family distribution.
the two-dimensional Show that the
distribution.
product of the Beta and the Binomial distribution is also a member of the
b) b)Express
Express the Binomial
the Binomial distribution
distribution as anas exponential
an exponential family
family distribution.
distribution. Also (6)(6)
exponential family.
FindAlso
17 a) express the express
theextrema thef(x,y,z)
of Beta distribution
Beta distribution =isxan is an exponential
- yexponential
+ z subject family =family
x2 + y2 distribution.
distribution.
to g(x,y,z) +Show that the
z2 = 2. (8)
b) product
Let Show of that
the the
Betaproduct
and theof the Beta and
Binomial the Binomial
distribution distribution
is also a member is also
of athe (6)
exponential
memberfamily.
of the exponential family.
17 a) Find the extrema of f(x,y,z) = x - y + z subject to g(x,y,z) = x2 + y2 + z2 = 2. (8)
17b) a)Let Find the extrema of f(x,y,z) = x - y + z subject to g(x,y,z) = x2 + y2 + z2 = (8)(6)
2.
b) Let
Show
" that x* = (1 , 1/2 , -1) is optimal for the optimization problem
Show that x* = (1 , 1/2 , -1) is optimal for the optimization problem
(6)
OR
18 a) Derive the gradient descent trainingOR
rule assuming that the target function (8)
18 a) Derive the gradient descent training rule assuming that the target function is (8)
is represented as od = w0 + w1x1 + ... + wnxn. Define explicitly the cost/
represented as od = w0 + w1x1 + ... + wnxn. Define explicitly the cost/error function
error function E, assuming that a set of training examples D is provided,
E, assuming that a set of training examples D is provided, where each training
where each training example d ∈ D is associated with the target output td.
example d ∈ D is associated with the target output td.
b) Find the maximum value of f(x,y,z) = xyz given that g(x,y,z) = x + y + z = 3 and (6)
x,y,z >= 0.
19 a) Consider the following probability distribution (7)
18 a) Derive the gradient
represented as od = wdescent
0 + w1x1 training
+ ... + wnrule assuming
xn. Define that the
explicitly target function
the cost/error is (8)
function
represented od =a wset
E, assumingasthat 0 +of
w1training
x1 + ... +examples
wnxn. Define
D isexplicitly
provided,thewhere
cost/error
each function
training
E, assuming
example d ∈ that
D is aassociated
set of training examples
with the D is tprovided,
target output d. where each training
COMPUTER
example d ∈ D is associated with the target output td. SCIENCE AND ENGINEERING
b) Find the maximum value of f(x,y,z) = xyz given that g(x,y,z) = x + y + z = 3 and (6)
b) Find the maximum value of f(x,y,z) = xyz given that g(x,y,z) = x + y + z = (6)
b) Find
x,y,z the maximum value of f(x,y,z) = xyz given that g(x,y,z) = x + y + z = 3 and (6)
>= 0.
19 a) x,y,z 3
Considerand x,y,z >= 0.
>= 0.the following probability distribution (7)
19 19
a) a)Consider the following
Consider probability
the following distribution
probability distribution (7) (7)
where θ is a parameter and x is a positive real number. Suppose you get m i.i.d.
where
where
samples is a parameter
θ isxi aθdrawn
parameter and
andthis
from xaispositive
a positive
x isdistribution. real
real number.
number.
Compute Suppose
Suppose
the you
maximumyou getmmi.i.d.
get
likelihood
samples
i.i.d.xfor
estimator drawn
isamples xfrom
θ based thisfrom
drawn
i on these distribution. ComputeCompute
this distribution.
samples. the maximum likelihood
the maximum
estimator for θ based
likelihood on these
estimator for θsamples.
based on these samples.
b) b)Consider the following
Consider Bayesian
the following network
Bayesian with with
network boolean variables.
boolean variables. (7) (7)
b) Consider the following Bayesian network with boolean variables. (7)
OR
Justify your answer.
OR
20 a) Consider the following one dimensional COMPUTER
training data set,SCIENCE
’x’ denotes AND
negative (6)
ENGINEERING
examples and ’o’ positive examples. The exact data points and their labels are
20 a) Consider the following one dimensional training data set, ’x’ denotes (6)
given in the table below. Suppose a SVM is used to classify this data.
negative examples and ’o’ positive examples. The exact data points and
their labels are given in the table below. Suppose a SVM is used to
classify this data.
"
i. Indicate which arewhich
i. Indicate the support vectors
are the andvectors
support mark theand
decision
mark boundary.
the decision
ii. Give the value of the cost function and the model parameter after training.
b) Supposeboundary.
that we are fitting a Gaussian mixture model for data items (8)
consisting of athe
ii. Give single
valuereal value,
of the costx,function
using K and
= 2 components. We haveafter
the model parameter N=
5 training cases, in which the values of x are as 5, 15, 25, 30, 40. Using the
training.
EM algorithm to find the maximum likeihood estimates for the model
parameters, what are the mixing proportions for the two components, π1
and π2, and the means for the two components, μ1 and μ2. The standard
deviations for the two components are fixed at 10.
COMPUTER SCIENCE AND ENGINEERING
b) Suppose that we are fitting a Gaussian mixture model for data (8)
items consisting of a single real value, x, using K = 2 components.
We have N = 5 training cases, in which the values of x are as 5,
15, 25, 30, 40. Using the EM algorithm to find the maximum
likeihood estimates for the model parameters, what are the mixing
proportions for the two components, π1 and π2, and the means for
the two components, µ1 and µ2. The standard deviations for the
two components are fixed at 10.
Suppose that at some point in the EM algorithm, the E step found
Suppose that at some point in the EM algorithm, the E step found that the
that the responsibilities of the two components for the five data
responsibilities of the two components for the five data items were as
items were as follows:
follows:
"
What values for the parameters π1, π2 , µ1, and µ2 will be found in
What
the nextvalues forofthe
M step algorithm?π1, π2 , μ1, and μ2 will be found in the next
theparameters
M step of the algorithm? ****
****
COMPUTER SCIENCE AND ENGINEERING
Teaching Plan
No. of
Lectures
No Topic
(45)
7. Quadratic Programming 1
5 Module-V (CENTRAL MACHINE LEARNING PROBLEMS) 14
14. Kernels 1
*Assignments may include applications of the above theory. With respect to module V,
programming assignments may be given.
COMPUTER SCIENCE AND ENGINEERING
INTRODUCTION TO Year of
CST Category L T P Credit
COMPUTER Introduction
286
NETWORKS MINOR 3 1 0 4 2019
Preamble: This is the second course for awarding B. Tech. Minor in Computer Science and
Engineering with specialization in Networking. Study of this course provides the learners a
clear understanding of how computer networks from local area networks to the massive and
global Internet are built and how they allow the usage of computers to share information and
communicate with one another. This course covers the layers of OSI Reference models and
inter-networking. This course helps the learners to compare and analyze the existing network
technologies and to choose a suitable network design for a given system.
Course Outcomes: After the completion of the course the student will be able to
Discuss the design issues of data link layer, data link layer protocols, bridges
CO 2 and switches (Cognitive Knowledge : Understand)
Illustrate wired LAN protocols (IEEE 802.3/4/5) and wireless LAN protocols
CO 3 (IEEE 802.11a/b/g/n, 802.15) (Cognitive Knowledge : Understand)
Illustrate the functions and protocols of network layer, transport layer and
CO 5 application layer in inter-networking (Cognitive Knowledge : Understand)
COMPUTER SCIENCE AND ENGINEERING
CO1 ! ! ! !
CO2 ! ! ! ! !
CO3 ! ! ! ! !
CO4 ! ! ! !
CO5 ! ! ! ! ! !
Assessment Pattern
End Semester
Test 1 (Marks Test 2 (Marks
Bloom’s Category Examination (Marks in
in percentage) in percentage)
percentage)
Remember 40 30 30
Understand 60 50 50
Apply 20 20
Analyse
Evaluate
Create
COMPUTER SCIENCE AND ENGINEERING
Mark Distribution
Total Marks CIE Marks ESE Marks ESE Duration
150 50 100 3
Each of the two internal examinations has to be conducted out of 50 marks. First series test shall
be preferably conducted after completing the first half of the syllabus and the second series test
shall be preferably conducted after completing remaining part of the syllabus. There will be two
parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions each from the
completed modules and 1 question from the partly completed module), having 3 marks for each
question adding up to 15 marks for part A. Students should answer all questions from Part A.
Part B contains 7 questions (preferably, 3 questions each from the completed modules and 1
question from the partly completed module), each with 7 marks. Out of the 7 questions, a
student should answer any 5.
Syllabus
Module 1
The Data Link Layer - Data Link layer Design Issues, Error Detection and Correction,
Elementary Data Link Protocols, Sliding Window Protocols, HDLC (High-Level Data Link
Control) Protocol. The Medium Access Control (MAC) Sub layer – The Channel Allocation
Problem, Multiple Access Protocols, Ethernet, Wireless LANs - 802.11 a/b/g/n, Bridges &
Switches.
Module 3
COMPUTER SCIENCE AND ENGINEERING
Network Layer Design Issues. Routing Algorithms - The Optimality Principle, Shortest path
routing, Flooding, Distance Vector Routing, Link State Routing, Multicast Routing, Routing for
Mobile Hosts. Congestion Control Algorithms, Quality of Service (QoS) - Requirements,
Techniques for Achieving Good QoS.
Module 4
Network Layer in Internet – The IP Protocol, IP Addresses, Internet Control Message Protocol
(ICMP), Address Resolution Protocol (ARP), Reverse Address Resolution Protocol (RARP),
Bootstrap Protocol (BOOTP), Dynamic Host Configuration Protocol (DHCP). Open Shortest
Path First (OSPF) Protocol, Border Gateway Protocol (BGP), Internet Multicasting, IPv6,
ICMPv6.
Module 5
Transport Layer – The Transport Service – Services Provided to the Upper Layers, Transport
Service Primitives. The User Datagram Protocol (UDP), Transmission Control Protocol (TCP) –
Overview of TCP, TCP Segment Header, Connection Establishment & Release, Connection
Management Modeling, TCP Retransmission Policy, TCP Congestion Control.
Application Layer – File Transfer Protocol (FTP), Domain Name System (DNS), Electronic
mail, MIME, Simple Network Management Protocol (SNMP), World Wide Web – Architectural
Overview.
Text Book
Andrew S. Tanenbaum, Computer Networks, 4/e, PHI (Prentice Hall India).
Reference Books
1. Behrouz A Forouzan, Data Communication and Networking, 4/e, Tata McGraw Hill
2. Larry L Peterson and Bruce S Dave, Computer Networks – A Systems Approach, 5/e,
Morgan Kaufmann.
3. Fred Halsall, Computer Networking and the Internet, 5/e.
4. James F. Kurose, Keith W. Ross, Computer Networking: A Top-Down Approach, 6/e.
5. Keshav, An Engineering Approach to Computer Networks, Addison Wesley, 1998.
6. W. Richard Stevens. TCP/IP Illustrated volume 1, Addison-Wesley, 2005.
7. William Stallings, Computer Networking with Internet Protocols, Prentice-Hall, 2004.
8. Request for Comments (RFC) Pages - IETF -https://www.ietf.org/rfc.html
CourseOutcome1 (CO1): Compare TCP/IP Reference model and OSI Reference model.
CourseOutcome2 (CO2): Distinguish between switches and bridges.
COMPUTER SCIENCE AND ENGINEERING
CourseOutcome3 (CO3): Draw and explain the frame format for Ethernet.
CourseOutcome5 (CO4): Discuss remedies for count to infinity problem in routing.
CourseOutcome4 (CO5): Subnet the Class C IP Address 206.16.2.0 so that you have 30
subnets. What is the subnet mask for the maximum number of hosts? How many hosts can
each subnet have?
Reg No:_______________
Name:_________________
PART-A
1. Why Layered Architecture is used in Computer Networks? Define the terms protocol and
interface?
2. What are the different service primitives in Computer Networks?
3. Draw and explain Ethernet frame format.
4. What is the output string when the bit string 0111101111101111110 is subjected to bit
stuffing?
5. Discuss the count to infinity problem in routing.
6. What is flooding? Describe any two situations where flooding is advantageous.
7. What is IP (Internet Protocol) subnetting? Illustrate with example.
8. How many octets does the smallest possible IPv6 (IP version 6) datagram contain?
9. Can TCP (Transmission Control Protocol) be used directly over a network (e.g. an
Ethernet) without using IP? Justify your answer
10. What is the role of SNMP (Simple Network Management Protocol)?
(10x3=30)
Part B
COMPUTER SCIENCE AND ENGINEERING
(Answer any one Question from each module. Each question carries 14 Marks)
Module I
11. (a) With a neat diagram, explain the OSI (Open Systems Interconnection) reference
Model. (8)
(b) Compare OSI Reference model and the TCP/IP model (6)
OR
12. (a) Consider two networks providing reliable connection-oriented service. One of them
offers a reliable byte stream and the other offers a reliable message stream. Are they
identical? Justify your answer. (8)
(b) Compare LAN (Local Area Networks), MAN (Metropolitan Area Networks) and
WAN (Wide Area Networks). (6)
Module II
13. (a) Discuss the different strategies used to avoid collisions in CSMA/CA (Carrier Sense
Multiple Access/Collision Avoidance) . (8)
(b) Briefly explain the working of HDLC (High-Level Data Link Control). (6)
OR
Module III
15. (a) Illustrate Distance Vector Routing Algorithm with an example. (8)
(b) Explain the characteristics of RIP (Routing Information Protocol). (6)
OR
16. (a) Explain an Interior Gateway protocol that uses a link state algorithm to propagate
routing information. (6)
(b) Explain how routing is performed in a Mobile network. (8)
Module IV
COMPUTER SCIENCE AND ENGINEERING
17. (a) Explain address resolution problem and RARP (Reverse Address Resolution Protocol)
with an example network. (10)
(b) How IGMP (Internet Group Management Protocol) supports internet multicasting?
Explain. (4)
OR
18. (a) Subnet the class C IP address 195.1.1.0 so that you have 10 subnets with a maximum
of 12 hosts in each subnet. (6)
(b) Draw IPv6 Datagram format and explain its features (8)
Module V
19. (a) Distinguish between TCP and UDP (User Datagram Protocol) header formats. (8)
(b) Explain the principal DNS (Domain Name System) resource record types for IPv4. (6)
OR
20. (a) What is the role of SMTP (Simple Mail Transfer Protocol) in E-mail? (6)
(b) With the help of a basic model explain the working of WWW (World Wide Web). (8)
Teaching Plan
Module 1 (8 Hours)
2.7 The Medium Access Control (MAC) Sub layer – The Channel 1
Allocation Problem, Multiple Access Protocols.
2.8 Ethernet - Ethernet Cabling, Manchester Encoding, The 1
Ethernet MAC Sub layer Protocol, The Binary Exponential
Backoff Algorithm.
2.9 Ethernet - Ethernet Performance, Switched Ethernet, Fast 1
Ethernet, Gigabit Ethernet, IEEE 802.2: Logical Link Control.
2.10 Wireless LANs - 802.11 a/b/g/n. 1
Module 3 (9 Hours)
Module 4 (9 Hours)
Module 5 (8 Hours)
SEMESTER -4
HONOURS
COMPUTER SCIENCE AND ENGINEERING
Year of
CODE COURSE NAME CATEGORY L T P CREDIT
Introduction
Preamble: This is the foundational course for awarding B. Tech. Honours in Computer Science and
Engineering with specialization in Security in Computing. The purpose of this course is to create
awareness among learners about the important areas of number theory used in computer science. This
course covers Divisibility & Modular Arithmetic, Primes & Congruences, Euler's Function, Quadratic
Residues and Arithmetic Functions, Sum of Squares and Continued fractions. Concepts in Number
Theory help the learner to apply them eventually in practical applications in Computer organization &
Security, Coding & Cryptography, Random number generation, Hash functions and Graphics.
Course Outcomes: After the completion of the course the student will be able to
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1 ! ! ! ! ! !
CO2 ! ! ! ! !
CO3 ! ! ! ! ! !
CO4 ! ! ! ! ! !
CO5 ! ! ! ! ! !
CO6
! ! ! ! ! ! !
Assessment Pattern
Remember 30 30 30
Understand 30 30 30
Apply 40 40 40
Analyse
Evaluate
Create
Mark Distribution
Attendance : 10 marks
First Internal Examination shall be preferably conducted after completing the first half of the syllabus
and the Second Internal Examination shall be preferably conducted after completing remaining part of
the syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions each
from the completed modules and 1 question from the partly covered module), having 3 marks for each
question adding up to 15 marks for part A. Students should answer all questions from Part A. Part B
contains 7 questions (preferably, 3 questions each from the completed modules and 1 question from
the partly covered module), each with 7 marks. Out of the 7 questions in Part B, a student should
answer any 5.
There will be two parts; Part A and Part B. Part A contains 10 questions with 2 questions from each
module, having 3 marks for each question. Students should answer all questions. Part B contains 2
questions from each module of which a student should answer any one. Each question can have
maximum 2 sub-divisions and carries 14 marks.
SYLLABUS
Module 1
Modular Arithmetic- Properties, Euclid's algorithm for the greatest common divisor, Extended Euclid’s
Algorithm, Least Common multiple, Solving Linear Diophantine Equations, Modular Division.
Module 2
Module 3
The Group of units- The group Un,Primitive roots, Existence of primitive roots, Applications of
primitive roots.
Module 4
Quadratic Residues- Quadratic Congruences, The group of Quadratic residues, Legendre symbol,
Jacobi Symbol, Quadratic reciprocity.
Arithmetic Functions- Definition and examples, Perfect numbers, Mobius function and its properties,
Mobius inversion formula, The Dirichlet Products.
Module 5
Sum of Squares- Sum of two squares, The Gaussian Integers, Sum of three squares, Sum of four
squares.
Continued Fractions -Finite continued fractions, Infinite continued fractions, Pell's Equation, Solution
of Pell’s equation by continued fractions.
Text Books
1. G.A. Jones & J.M. Jones, Elementary Number Theory, Springer UTM, 2007.
Reference Books
1. William Stallings, Cryptography and Network Security Principles and Practice, Pearson Ed.
2. Tom M.Apostol, ‘Introduction to Analytic Number Theory’, Narosa Publishing House Pvt. Ltd,
New Delhi, (1996).
3. Neal Koblitz, A course in Number Theory and Cryptography, 2nd Edition, Springer ,2004.
Course Outcome 1 (CO1): Describe the properties of modular arithmetic and modulo operator.
Course Outcome 2 (CO2): Prove that the equation y2 = x3 - 2 has only the integer solution (3, ±5).
Course Outcome 3 (CO3): State the law of reciprocity for Jacobi symbols and use it to determine
whether 888 is a quadratic residue or non residue of the prime 1999.
Course Outcome 4 (CO4): Using Chinese remainder theorem, solve the system of congruence x
≡2(mod 3), x ≡3(mod 5), x ≡2(mod 7)
PART A
Part B
11. (a) State the Euclidean algorithm and its extension with an example. (7)
(b) Find all the solutions of 24x + 34 y = 6. (7)
OR
12. (a) Describe the properties of modular arithmetic and modulo operator. (7)
(b) Explain Extended Euclidean algorithm. Using the algorithm find the
COMPUTER SCIENCE AND ENGINEERING
OR
14. (a) Using Chinese remainder theorem, solve the system of congruences,
x ≡2(mod 3), x ≡3(mod 5), x ≡2(mod 7) (7)
(b) Define Fermat primes. Show that any two distinct Fermat numbers are
Relatively prime. (7)
15. (a) Distinguish between public key and private key encryption techniques.
Also point out the merits and demerits of both. (7)
(b) Define Carmichael number and show that a Carmichael number must
be the product of at least three distinct primes. (7)
OR
16. (a)Define a pseudo prime to a base and find all non trivial bases for which
15 is a pseudo prime. (6)
(b) Find an element of
i) order 5 modulo 11 ii) order 4 modulo 13
iii) order 8 modulo 17 iv) order 6 modulo 19 (8)
17. (a) Determine the quadratic residues and non residues modulo 17. Also
determine whether 219 is a quadratic residue or non residue of the prime 383.
(8)
(b) State the law of quadratic reciprocity. Determine those odd primes p for
which 3 is a quadratic residue and those for which it is a non residue. (6)
OR
18. (a) State and prove properties of Legendre’s symbol. (7)
(b) State the law of reciprocity for Jacobi symbols and using it determine
whether 888 is a quadratic residue or non residue of the prime 1999. (7)
19. (a) Prove that the equation y2 = x3 - 2 has only the integer solution (3 , ±5). (7)
COMPUTER SCIENCE AND ENGINEERING
(b) Define a Gaussian integer. Factorize the Gaussian integer 440 − 55i. (7)
OR
20. (a) If m, and n can be expressed as sum of four squares, then show that mn can
also be expressed the sum of four squares. (7)
(b) Find all the solutions of the Diophantine equation x2 – 6 y 2 =1. (7)
Teaching Plan
2.3 Primality testing and factorization, Miller -Rabin Test for Primality. 1 hour
3.9 Existence of primitive roots for Primes, Applications of primitive roots. 1 hour
4.7 Mobius inversion formula., application of the Mobius inversion formula. 1 hour
Preamble: This is the foundational course for awarding B. Tech. Honours in Computer
Science and Engineering with specialization in Machine Learning. The purpose of this course
is to introduce mathematical foundations of basic Machine Learning concepts among learners, on
which Machine Learning systems are built. This course covers Linear Algebra, Vector Calculus,
Probability and Distributions, Optimization and Machine Learning problems. Concepts in this course
help the learners to understand the mathematical principles in Machine Learning and aid in the
creation of new Machine Learning solutions, understand & debug existing ones, and learn about the
inherent assumptions & limitations of the current methodologies.
Course Outcomes: After the completion of the course the student will be able to
Make use of the concepts, rules and results about linear equations, matrix algebra,
CO 1 vector spaces, eigenvalues & eigenvectors and orthogonality & diagonalization to
solve computational problems (Cognitive Knowledge Level: Apply)
PO 1 PO 2 PO 3 PO 4 PO 5 PO 6 PO 7 PO 8 PO 9 PO 10 PO 11 PO 12
CO 1 √ √ √ √ √
CO 2 √ √ √ √
CO 3 √ √ √ √ √
CO 4 √ √ √ √ √ √
CO 5 √ √ √ √ √ √ √ √
COMPUTER SCIENCE AND ENGINEERING
Assessment Pattern
Analyse
Evaluate
Create
Mark Distribution
Attendance : 10 marks
First Internal Examination shall be preferably conducted after completing the first half of the
syllabus and the Second Internal Examination shall be preferably conducted after completing
remaining part of the syllabus.
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2
questions each from the completed modules and 1 question from the partly covered module),
having 3 marks for each question adding up to 15 marks for part A. Students should answer
all questions from Part A. Part B contains 7 questions (preferably, 3 questions each from the
completed modules and 1 question from the partly covered module), each with 7 marks. Out
of the 7 questions in Part B, a student should answer any 5.
End Semester Examination Pattern: There will be two parts; Part A and Part B. Part A
contains 10 questions with 2 questions from each module, having 3 marks for each question.
Students should answer all questions. Part B contains 2 questions from each module of which
student should answer anyone. Each question can have maximum 2 sub-divisions and carries
14 marks.
COMPUTER SCIENCE AND ENGINEERING
Syllabus
Module 1
Module 2
Module 3
Module 4
Module 5
Text book:
1.Mathematics for Machine Learning by Marc Peter Deisenroth, A. Aldo Faisal, and
Cheng Soon Ong published by Cambridge University Press (freely available at https://
mml - book.github.io)
Reference books:
4. 4.A set
A set
of of n linearly
n linearly independent
independent vectors
vectors in R inn R n
formsforms a basis.
a basis. Does
Does thethe
set set of vectors
of vectors (2, (2, 4,−3) ,
n
4. 4.4.
A setA set
A(0,
set1,
of of n linearly
noflinearly
1)n, linearly independent
independent
independent
(0, 1,−1) vectors
vectors
vectors
form a basis 3 in R forms a basis. Does the set of vectors (2, 4,−3) ,
n n
forinRR?inExplain
R3 forms
forms a basis.
a your
basis. DoesDoes
reasons. the of
the set setvectors
of vectors (2, 4,−3)
(2, 4,−3) , ,
4,−3) , (0, 1, 1) , (0, 1,−1) form a basis for R ? Explain your reasons.
(0, 1, (0,
(0,1)1,1, 1),1,−1)
, 1)
(0, ,(0,
(0,1,−1)
1,−1) form
formform aabasis
a basisbasis
for R for
3
for?R R33??Explain
ExplainExplainyouryour your reasons.
reasons.
reasons.
5. 5.Consider the transformation T (x, y) = (x +
Consider the transformation T (x, y) = (x + y, x + 2y, 2x y, x + 2y, 2x + 3y). Obtain
+ 3y). kerker
Obtain T and useuse this to
T and
5. 5.5. this
Consider
Consider
Consider the
the
to calculate
calculate transformation
the transformation
thetransformation
the nullity.
nullity. Also (x,TTy)
TAlso
find (x,
(x,=y)
find
the y)
(x ==+(x
the (x
y, +x+ y,+y, x2y,
transformation
transformation x ++2x2y,+2x
2y,
matrix 2x
3y).+ 3y).
+for
matrix 3y). Obtain
Obtain
T. Tker
T. ker ker
forObtain TT and
and and use
use use this
this this to
to to
calculate
calculate
calculate thenullity.
nullity.
the nullity.
the Also
AlsoAlso find
findfind thetransformation
transformation
the transformation
the matrix matrix
for T.
matrix forT.
for T.
6. 6.Find
Find
the the characteristic
characteristic equation,
equation, eigenvalues,
eigenvalues, and eigenspaces
and eigenspaces corresponding
corresponding to each to each
6. 6.6. Find
Find Find the
the the
eigenvalue characteristic
characteristic equation,
equation,
characteristic eigenvalues,
eigenvalues,
equation,
of the following matrix and
and and
eigenvalues, eigenspaces
eigenspaces corresponding
corresponding
eigenspaces to each
to each
corresponding to each
eigenvalue of the following matrix
eigenvalue
eigenvalue offollowing
of the
eigenvalue of thefollowing
the following matrix
matrix
matrix
"
7. Diagonalize the following matrix, if possible
7. 7.7. Diagonalize
Diagonalize thefollowing
following
the following
Diagonalize the matrix,
matrix, ififpossible
possible
if possible
matrix,
COMPUTER SCIENCE AND ENGINEERING
7. Diagonalize the following matrix, if possible
"
1. 1. For
Fora scalar
a scalar function
function f(x,f(x, x2 +3y
y, zy,) z=) x=2 +3y
2
2 +2z+2z
2
, find
2, find the the gradient
gradient andand its magnitude
its magnitude at at the
1.thepoint
For
(1, 2, -1).
a scalar
point function f(x, y, z ) = x2 +3y2 +2z2, find the gradient and its magnitude at the
(1, 2, -1).
pointthe
2. 2. Find
Find (1, maximum
2, -1). andminimum
minimumvalues
values of
of the
the function f(x, y) 2 2
the maximum and y) == 4x
4x++4y4y- x- x-2 y- ysubject
2 to
2 2
the
Findcondition
2.subject to the
the x + y and
<=
condition
maximum x2 2.
+ y2 <= 2. values of the function f(x, y) = 4x + 4y - x 2 - y2 subject to
minimum
2 2
the condition
3. 3. Suppose x +trying
y <= 2. f(x, y) y)
= x2=+ x
2y2 + 2y2. Along
Supposeyou
youwere to to
were trying minimize
minimize f(x, + 2y + 2y2. what vector
Along what vector
3.should you
should
Suppose
travel
you from (5,(5,
travel
you werefrom
12)?
trying 12)?
to minimize f(x, y) = x2+ 2y + 2y2. Along what vector
4. should you travel from (5, 12)?
4. Find thethe
second order Taylor series expansion forfor
f(x, y) y)
= (x + y)
+ y)about (0 (0
, 0).
2 2
Find second order Taylor series expansion f(x, = (x about , 0).
5.
4.Find thethe
critical points
orderofTaylor
f(x, y)series
= x expansion
3xy+5x-2y+6y +8.y) = (x + y)2 about (0 , 0).
2– 2
Find second for f(x,
5. Find the critical points of f(x, y) = x2 – 3xy+5x-2y+6y2+8.
6. Compute the gradient of the Rectified Linear Unit (ReLU) function ReLU(z) =
5. Find the critical points of f(x, y) = x2 – 3xy+5x-2y+6y2+8.
6. Compute the gradient of the Rectified Linear Unit (ReLU) function ReLU(z) = max(0 , z).
max(0 , z).
7. 6.LetCompute
LL ==||Ax
the gradient of the Rectified Linear Unit (ReLU) function ReLU(z) = max(0 , z).
||Ax- b||
- b||2,22where
, whereAAisisa amatrix
matrixand
andx xand
andb bare
arevectors.
vectors.Derive
DerivedL
dLininterms
termsofof dx.
2
7. Let
7.dx.Let L = ||Ax - b||22, where A is a matrix and x and b are vectors. Derive dL in terms of dx.
Course Outcome 3 (CO3):
Course Outcome 3 (CO3):
1. Let J and T be independent events, where P(J)=0.4 and P(T)=0.7.
i. Find P(J∩T)
1. Let J and T be independent events, where P(J)=0.4 and P(T)=0.7.
ii. Find P(J∪T)
i. Find P(J∩T)
iii. Find P(J∩T′)
ii. Find P(J∪T)
iii. Find P(J∩T′)
COMPUTER SCIENCE AND ENGINEERING
Course Outcome 3 (CO3):
i. Find P(J∩T)
i.
i. Given that E(R)=2.85, find a and b.
i. Given
ii. that E(R)=2.85,
Find P(R>2). find a and b.
ii. Find P(R>2).
4. A biased coin (with probability of obtaining a head equal to p > 0) is tossed repeatedly and
4. A biasedindependently
coin (with probability
until the of obtaining
first head isaobserved.
head equalCompute
to p > 0)the
is tossed repeatedly
probability that the first head
and independently
appears at anuntil
eventhenumbered
first headtoss.
is observed. Compute the probability that the
first head appears at an even numbered toss.
5. Two players A and B are competing at a trivia quiz game involving a series of questions. On
5. Two players A and B question,
are competing at a triviathat
quiz game involving a series of are p and q
any individual the probabilities A and B give the correct answer
questions. On any individual
respectively, question,with
for all questions, the outcomes
probabilities
for that A andquestions
different B give the correct
being independent. The
answer gameare p finishes
and q respectively,
when a player for wins
all questions, with outcomes
by answering a questionforcorrectly.
differentCompute the
questions being independent.
probability that A winsThe if game finishes when a player wins by answering a
i. A answers
question correctly. Compute thethe
first question, that A wins if
probability
ii. B answers the first question.
i. A answers the first question,
6. A coin for which P(heads) = p is tossed until two successive tails are obtained. Find the
ii. Bprobability
answers the first
that thequestion.
experiment is completed on the nth toss.
6. A coin for which P(heads) = p is tossed until two successive tails are obtained. Find
7. You roll a fair dice twice. Let the random variable X be the product of the outcomes of the
the probability that the experiment is completed on the nth toss.
two rolls. What is the probability mass function of X? What are the expected value and the
7. You rollstandard
a fair dice twice. Let the random variable X be the product of the outcomes of
deviation of X?
the two rolls. What is the probability mass function of X? What are the expected value
and 8. While watching
the standard deviationaofgameX? of Cricket, you observe someone who is clearly supporting
Mumbai Indians. What is the probability that they were actually born within 25KM of
Mumbai? Assume that:
• the probability that a randomly selected person is born within 25KM of Mumbai is
1/20;
• the chance that a person born within 25KMs of Mumbai actually supports MI is
7/10 ;
• the probability that a person not born within 25KM of Mumbai supports MI with
probability 1/10.
5. Consider
5. Consider the
the update
update equation
equation for
for stochastic
stochastic gradient
gradient descent.
descent. Write
Write down
down the
the update
update when
when
we use
we use aa mini-batch
mini-batch size
size of
of one.
one.
COMPUTER SCIENCE AND ENGINEERING
6. Consider
6.
6. Consider the
Consider the function
the function
function
"
"
9. 9.
Solve the following
Solve LP problem
the following withwith
LP problem the simplex method.
the simplex method.
9. Solve the following LP problem with the simplex method.
"
subject
subject to toto constraints
the the constraints
subject the constraints
Course
Course Outcome
Outcome 5 (CO5):
5 (CO5):
Course Outcome 5 (CO5):
1. What is a loss function? Give examples.
1. What is a loss function? Give examples.
2.1. What is
area loss
training/validation/test sets? What is cross-validation? Name one or two
function? Give examples.
2. What areoftraining/validation/test
examples sets? What is cross-validation? Name one or two examples
cross-validation methods.
2. What are training/validation/test sets? What is cross-validation? Name one or two examples
of cross-validation methods.
3. of cross-validation
Explain methods.
generalization, overfitting, model selection, kernel trick, Bayesian learning
3. Explain generalization, overfitting, model selection, kernel trick, Bayesian learning
3. Explain generalization, overfitting, model selection, kernel trick, Bayesian learning
4. Distinguish between Maximum Likelihood Estimation (MLE) and Maximum A Posteriori
4. Distinguish between Maximum Likelihood Estimation (MLE) and Maximum A Posteriori
Estimation (MAP)?
Estimation (MAP)?
5. What is the link between structural risk minimization and regularization?
5. What is the link between structural risk minimization and regularization?
6. What is a kernel? What is a dot product? Give examples of kernels that are valid dot
6. What is a kernel? What is a dot product? Give examples of kernels that are valid dot
products.
products.
Course Outcome 5 (CO5):
4.2. Distinguish
What are training/validation/test
between Maximum sets? What isEstimation
Likelihood cross-validation?
(MLE) Name one or two A
and Maximum examples
of cross-validation
Posteriori Estimationmethods.
(MAP)?
5.3. What
Explain generalization,
is the link between overfitting, model
structural risk selection, and
minimization kernel trick, Bayesian learning
regularization?
6.4. What
Distinguish between
is a kernel? WhatMaximum Likelihood
is a dot product? GiveEstimation
examples (MLE) andthat
of kernels Maximum
are validAdot
Posteriori
Estimation (MAP)?
products.
7.5. What
Whatisisridge
the link between How
regression? structural risktrain
can one minimization and regularization?
a ridge regression linear model?
8.6. What
What isis Principal
a kernel?Component
What is a Analysis
dot product?
(PCA)?GiveWhich
examples
eigenof value
kernels that arethevalid dot
indicates
products.of largest variance? In what sense is the representation obtained from a
direction
7. projection
What is ridge ontoregression?
the eigenHow can onecorresponding
directions train a ridge regression
the the linear
largestmodel?
eigen values
optimal for data reconstruction?
8. What is Principal Component Analysis (PCA)? Which eigen value indicates the direction of
largest variance?
9. Suppose that you In what
have sense is
a linear the representation
support vector machine obtained
(SVM) from a projection
binary classifier.onto the
eigen directions
Consider a pointcorresponding the the
that is currently largest eigen
classified valuesand
correctly, optimal
is farforaway
data reconstruction?
from the
9. decision
Supposeboundary. If you
that you have remove
a linear the point
support vectorfrom the training
machine (SVM) set, andclassifier.
binary re-train the
Consider a
classifier, will the decision boundary change or stay the same? Explain your answer
point that is currently classified correctly, and is far away from the decision boundary. If you
inremove
one sentence.
the point from the training set, and re-train the classifier, will the decision boundary
change or stay the same? Explain your answer in one sentence.
10. Suppose you have n independent and identically distributed (i.i.d) sample data points
10. xSuppose
1, ... , xnyou havedata
. These n independent
points come andfrom
identically distributed
a distribution (i.i.d)
where thesample of a x1, ... ,
data points
probability
xn. These
given data points
datapoint x is come from a distribution where the probability of a given datapoint x is
"
i. What are the prior and posterior odds for the fair coin?
ii. What are the prior and posterior predictive probabilities of heads on the next
flip? Here prior predictive means prior to considering the data of the first four
flips.
11. Suppose the data set y1,...,yn is a drawn from a random sample consisting of i.i.d. discrete
uniform distributions with range 1 to N. Find the maximum likelihood estimate of N.
12. Ram has two coins: one fair coin and one biased coin which lands heads with probability
3/4. He picks one coin at random (50-50) and flips it repeatedly until he gets a tails. Given
COMPUTER SCIENCE AND ENGINEERING
that he observes 3 heads before the first tails, find the posterior probability that he picked
each coin.
i. What are the prior and posterior odds for the fair coin?
ii. What are the prior Model Question
and posterior paper
predictive probabilities of heads on the next flip?
Here: prior predictive means prior to considering the data of the first four flips.
QP Code Total Pages: 4
Reg No.:_______________ Name:__________________________
Model
APJ ABDUL KALAM Question paperUNIVERSITY
TECHNOLOGICAL
IV SEMESTER B.TECH (HONOURS) DEGREE EXAMINATION, MONTH and YEAR
QP Code : Total Pages: 4
Course Code: CST 294
Reg No.:_______________ Name:__________________________
Course Name: COMPUTATIONAL FUNDAMENTALS FOR MACHINE
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
LEARNING
IV SEMESTER B.TECH (HONOURS) DEGREE EXAMINATION, MONTH and YEAR
Max. Marks: 100 Duration: 3 Hours
Course Code: CST 274
Course Name: COMPUTATIONAL FUNDAMENTALS PART A FOR MACHINE LEARNING
Max. Marks: 100 Answer all questions, each carries 3 marks. Marks
Duration: 3 Hours
PART A
1 Show that withAnswer
the usual operation each
all questions, of scalar multiplication
carries 3 marks. but with Marks
1 Show that on
addition with the given
reals usual by
operation
x # y = of
2(xscalar
+ y) ismultiplication but with addition on
not a vector space.
reals given by x # y = 2(x + y) is not a vector space.
2 Find the eigenvalues of the following matrix in terms of k. Can you find
2 Find the eigenvalues of the following matrix in terms of k. Can you find an
an eigenvector corresponding to each of the eigenvalues?
eigenvector corresponding to each of the eigenvalues?
8
one over the other.
Briey explain the difference between (batch) gradient descent and stochastic
8 Briey explain the difference between (batch) gradient descent and stochastic
9 What isdescent.
gradient the empirical
Give an risk? What of
example is “empirical risk minimization”?
when you might prefer one over the other.
910gradient descent.
What Give
is thethe an
empirical example
risk? of
Whatwhen you might
is “empirical prefer
risk one over the other.
minimization”?
9 What is Explain
the empirical concept
risk? of ais
What Kernel function
“empirical risk in Support
minimization”? Vector Machines.
10 Explain the concept of a Kernel function in Support Vector Machines. Why are
10 Explain Why
the concept of aso
are kernels Kernel
useful?function in Supporta Vector
What properties kernel Machines. Why
should posses to are
be
kernels so useful? What properties a kernel should posses to be used in an SVM?
kernels so
useduseful?
in an What
SVM?properties a kernel should posses to be used in an SVM?
PART B
PART
Answer any one Question from each B module. Each question carries 14 Marks
11 a)Answer i. any one
Find allQuestion
solutionsfrom PART
to theeach B linear
module.
system of Each question carries 14 Marks
equations (6)
11 a) i. Answer
Find all any
solutions to the system of linear equations
one Question from each module. Each question carries 14 Marks (6)
"
OR
12 a) i. Let L be the line through the OR 2
ORorigin in R that is parallel to the vector (6)
12 a) i. Let L be 4]Tline
[3,the . Find the standard
through matrix
the origin in Rof
2 the orthogonal projection onto L. Also
that is parallel to the vector (6)
T
[3, 4] find
. Find
thethe standard
point matrixisofclosest
on L which the orthogonal projection
to the point onto
(7 , 1) and findL.the
Also
point on
find theL point
whichonis Lclosest
whichtoisthe
closest
pointto(-3
the, 5).
point (7 , 1) and find the point on
ii. Find
L which the rank-1
is closest approximation
to the point (-3 , 5).of
ii. Find the rank-1 approximation of
"
OR
OR
14 a) Let g be the function given by (8)
"
i. Calculate the partial derivatives of g at (0 , 0).
i. Calculate the partial derivatives of g at (0 , 0).
ii.
ii. Show
Showthatthatggisisnot
notdifferentiable
differentiableatat(0
(0,,0).
0).
b) Find the second order Taylor series expansion for f(x,y) = e-(x2+y2) cos(xy) about (0 , (6)
b) Find the second order Taylor series expansion for f(x,y) = e-(x2+y2) cos(xy) (6)
0).
aboutare
15 a) There (0 ,two
0). bags. The first bag contains four mangos and two apples; the second (6)
15 a) There
bag are twofour
contains bags. The first
mangos andbag
fourcontains
apples. four mangos
We also haveand two apples;
a biased (6)
coin, which
the second
shows bagwith
“heads” contains four mangos
probability 0.6 andand fourwith
“tails” apples. We also0.4.
probability haveIf athe coin
biased coin, which shows “heads” with probability 0.6 and “tails” with
probability 0.4. If the coin shows “heads”. we pick a fruit at
showsrandom
“heads”.from bag 1;
we pick otherwise
a fruit at we pick a fruit at random from bag 2. Your
random fromflips
friend bag the
1; otherwise
coin (youwe pick see
cannot a fruit
theatresult),
random froma bag
picks fruit2.atYour friend
random
flips the coin (you cannot see the result), picks a fruit at random from the
from the corresponding bag, and presents you a mango.
corresponding bag, and presents you a mango.
What What
is the is the probability
probability that
that the the mango
mango was picked
was picked from2?bag 2?
from bag
b) b)
Suppose that one
Suppose thathasone
written
has awritten
computer program that
a computer sometimes
program compiles and (8)(8)
that sometimes
sometimes notand
compiles (code does not
sometimes change).
not (code doesYou decide toYou
not change). model
decidethe apparent
to model
stochasticity (success vs. no success) x of the compiler using a Bernoulli
the apparent stochasticity (success vs. no success) x of the compiler using
distribution with parameter μ:
a Bernoulli distribution with parameter μ:
"
Choose a conjugate prior for the Bernoulli likelihood and compute the posterior
Choose a conjugate prior for the Bernoulli likelihood and compute the
distribution p( μ | x1 , ... , xN).
posterior distribution p( μ | x1 , ... OR
, xN).
OR
16 a) Consider a mixture of two Gaussian distributions (8)
i. i.Compute
Compute the the marginal
marginal distributions
distributions for for
eacheach dimension.
dimension.
ii. ii.
Compute
Compute the mean, mode and
the mean, modemedian
andformedian
each marginal
for eachdistribution.
marginal
iii. Compute the mean and mode for the two-dimensional distribution.
distribution.
i. Compute
b) Express the marginal distributions for each dimension.
iii.the Binomial
Compute the distribution
mean and mode as an
for exponential family distribution.
the two-dimensional distribution. Also (6)
ii. Compute the mean, mode and median for each marginal distribution.
express the Betathedistribution
iii. Compute mean and mode is an for
exponential family distribution.
the two-dimensional Show that the
distribution.
product of the Beta and the Binomial distribution is also a member of the
b) b)Express
Express the Binomial
the Binomial distribution
distribution as anas exponential
an exponential family
family distribution.
distribution. Also (6)(6)
exponential family.
FindAlso
17 a) express the express
theextrema thef(x,y,z)
of Beta distribution
Beta distribution =isxan is an exponential
- yexponential
+ z subject family =family
x2 + y2 distribution.
distribution.
to g(x,y,z) +Show that the
z2 = 2. (8)
b) product
Let Show of that
the the
Betaproduct
and theof the Beta and
Binomial the Binomial
distribution distribution
is also a member is also
of athe (6)
exponential
memberfamily.
of the exponential family.
17 a) Find the extrema of f(x,y,z) = x - y + z subject to g(x,y,z) = x2 + y2 + z2 = 2. (8)
17b) a)Let Find the extrema of f(x,y,z) = x - y + z subject to g(x,y,z) = x2 + y2 + z2 = (8)(6)
2.
b) Let
Show
" that x* = (1 , 1/2 , -1) is optimal for the optimization problem
Show that x* = (1 , 1/2 , -1) is optimal for the optimization problem
(6)
OR
18 a) Derive the gradient descent trainingOR
rule assuming that the target function (8)
18 a) Derive the gradient descent training rule assuming that the target function is (8)
is represented as od = w0 + w1x1 + ... + wnxn. Define explicitly the cost/
represented as od = w0 + w1x1 + ... + wnxn. Define explicitly the cost/error function
error function E, assuming that a set of training examples D is provided,
E, assuming that a set of training examples D is provided, where each training
where each training example d ∈ D is associated with the target output td.
example d ∈ D is associated with the target output td.
b) Find the maximum value of f(x,y,z) = xyz given that g(x,y,z) = x + y + z = 3 and (6)
x,y,z >= 0.
19 a) Consider the following probability distribution (7)
18 a) Derive the gradient
represented as od = wdescent
0 + w1x1 training
+ ... + wnrule assuming
xn. Define that the
explicitly target function
the cost/error is (8)
function
represented od =a wset
E, assumingasthat 0 +of
w1training
x1 + ... +examples
wnxn. Define
D isexplicitly
provided,thewhere
cost/error
each function
training
E, assuming
example d ∈ that
D is aassociated
set of training examples
with the D is tprovided,
target output d. where each training
COMPUTER
example d ∈ D is associated with the target output td. SCIENCE AND ENGINEERING
b) Find the maximum value of f(x,y,z) = xyz given that g(x,y,z) = x + y + z = 3 and (6)
b) Find the maximum value of f(x,y,z) = xyz given that g(x,y,z) = x + y + z = (6)
b) Find
x,y,z the maximum value of f(x,y,z) = xyz given that g(x,y,z) = x + y + z = 3 and (6)
>= 0.
19 a) x,y,z 3
Considerand x,y,z >= 0.
>= 0.the following probability distribution (7)
19 19
a) a)Consider the following
Consider probability
the following distribution
probability distribution (7) (7)
where θ is a parameter and x is a positive real number. Suppose you get m i.i.d.
where
where
samples is a parameter
θ isxi aθdrawn
parameter and
andthis
from xaispositive
a positive
x isdistribution. real
real number.
number.
Compute Suppose
Suppose
the you
maximumyou getmmi.i.d.
get
likelihood
samples
i.i.d.xfor
estimator drawn
isamples xfrom
θ based thisfrom
drawn
i on these distribution. ComputeCompute
this distribution.
samples. the maximum likelihood
the maximum
estimator for θ based
likelihood on these
estimator for θsamples.
based on these samples.
b) b)Consider the following
Consider Bayesian
the following network
Bayesian with with
network boolean variables.
boolean variables. (7) (7)
b) Consider the following Bayesian network with boolean variables. (7)
OR
Justify your answer.
OR
20 a) Consider the following one dimensional COMPUTER
training data set,SCIENCE
’x’ denotes AND
negative (6)
ENGINEERING
examples and ’o’ positive examples. The exact data points and their labels are
20 a) Consider the following one dimensional training data set, ’x’ denotes (6)
given in the table below. Suppose a SVM is used to classify this data.
negative examples and ’o’ positive examples. The exact data points and
their labels are given in the table below. Suppose a SVM is used to
classify this data.
"
i. Indicate which arewhich
i. Indicate the support vectors
are the andvectors
support mark theand
decision
mark boundary.
the decision
ii. Give the value of the cost function and the model parameter after training.
b) Supposeboundary.
that we are fitting a Gaussian mixture model for data items (8)
consisting of athe
ii. Give single
valuereal value,
of the costx,function
using K and
= 2 components. We haveafter
the model parameter N=
5 training cases, in which the values of x are as 5, 15, 25, 30, 40. Using the
training.
EM algorithm to find the maximum likeihood estimates for the model
parameters, what are the mixing proportions for the two components, π1
and π2, and the means for the two components, μ1 and μ2. The standard
deviations for the two components are fixed at 10.
COMPUTER SCIENCE AND ENGINEERING
b) Suppose that we are fitting a Gaussian mixture model for data (8)
items consisting of a single real value, x, using K = 2 components.
We have N = 5 training cases, in which the values of x are as 5,
15, 25, 30, 40. Using the EM algorithm to find the maximum
likeihood estimates for the model parameters, what are the mixing
proportions for the two components, π1 and π2, and the means for
the two components, µ1 and µ2. The standard deviations for the
two components are fixed at 10.
Suppose that at some point in the EM algorithm, the E step found
Suppose that at some point in the EM algorithm, the E step found that the
that the responsibilities of the two components for the five data
responsibilities of the two components for the five data items were as
items were as follows:
follows:
"
What values for the parameters π1, π2 , µ1, and µ2 will be found in
What
the nextvalues forofthe
M step algorithm?π1, π2 , μ1, and μ2 will be found in the next
theparameters
M step of the algorithm? ****
****
COMPUTER SCIENCE AND ENGINEERING
Teaching Plan
No. of
Lectures
No Topic
(45)
7. Quadratic Programming 1
5 Module-V (CENTRAL MACHINE LEARNING PROBLEMS) 14
14. Kernels 1
*Assignments may include applications of the above theory. With respect to module V,
programming assignments may be given.
COMPUTER SCIENCE AND ENGINEERING
YEAR OF
Category L T P CREDIT
CST Principles of Program INTRODUCTION
296 Analysis and Verification
HONOURS 3 1 0 4 2019
Preamble: This is the foundational course for awarding B. Tech. Honours in Computer Science
and Engineering with specialization in Formal Methods. Program Analysis and Program
Verification are two important areas of study, discussing Methods, Technologies and Tools to
ensure reliability and correctness of software systems. The syllabus for this course is prepared
with the view of introducing the Foundational Concepts, Methods and Tools in Program Analysis
and Program Verification.
Prerequisite: Topics covered in the course Discrete Mathematical Structures (MAT 203).
Course Outcomes: After the completion of the course the student will be able to
Explain the concepts and results about Lattices, Chains, Fixed Points, Galois
Connections, Monotone and Distributive Frameworks, Hoare Triples, Weakest
CO1
Preconditions, Loop Invariants and Verification Conditions to perform Analysis and
Verification of programs (Cognitive knowledge level: Understand)
Use the tool VCC to specify and verify the correctness of a C Program with respect to
CO6
a given set of properties (Cognitive knowledge level: Analyse)
1
COMPUTER SCIENCE AND ENGINEERING
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
CO6
2
COMPUTER SCIENCE AND ENGINEERING
Assessment Pattern:
Understand 30 30 30
Apply 40 40 40
Analyze
Evaluate
Create
Mark Distribution
Attendance : 10 Marks
Assignment : 15 Marks
First series test shall be preferably conducted after completing the first half of the syllabus and
the second series test shall be preferably conducted after completing the remaining part of the
syllabus.
3
COMPUTER SCIENCE AND ENGINEERING
There will be two parts: Part A and Part B. Part A contains 5 questions (preferably, 2 questions
each from the completed modules and 1 question from the partly covered module), having 3
marks for each question adding up to 15 marks for part A. Students should answer all questions
from Part A. Part B contains 7 questions (preferably, 3 questions each from the completed
modules and 1 question from the partly covered module), each with 7 marks. Out of the 7
questions in Part B, a student should answer any 5.
There will be two parts; Part A and Part B. Part A contains 10 questions with 2 questions from
each module, having 3 marks for each question. Students should answer all questions from Part
A. Part B contains 2 questions from each module of which a student should answer any one, each
question carries 14 marks. Each question in part B can have a maximum 2 sub-divisions.
SYLLABUS
Module 1
Module 2
Introduction to Program Analysis – The WHILE language, Reaching Definition Analysis, Data
Flow Analysis, Abstract Interpretation, Algorithm to find the least solutions for the Data Flow
Analysis problem.
Module 3
4
COMPUTER SCIENCE AND ENGINEERING
Module 4
Module 5
Program Verification - Why should we Specify and Verify Code, A framework for software
verification - A core programming Language, Hoare Triples, Partial and Total Correctness,
Program Variables and Logical Variables, Proof Calculus for Partial Correctness, Loop
Invariants, Verifying code using the tool VCC (Verifier for Concurrent C).
Text Books
1. Flemming Nielson, Henne Nielson and Chris Kankin, Principles of Program Analysis,
Springer (1998).
2. Michael Hutch and Mark Ryan, Logic in Computer Science - Modeling and Reasoning
about Systems, Cambridge University Press, Second Edition.
References
1. Julian Dolby and Manu Sridharan, Core WALA Tutorial (PLDI 2010), available online at
http://wala.sourceforge.net/files/PLDI_WALA_Tutorial.pdf
2. Ernie & Hillebrand, Mark & Tobies, Stephan (2012), Verifying C Programs: A VCC
Tutorial.
5
COMPUTER SCIENCE AND ENGINEERING
1. Find a lattice to represent the data states of a given program and propose a sound abstract
interpretation framework to do a given analysis on the program.
2. When is an abstract interpretation framework said to be sound? Illustrate with an
example.
3. When is an abstract interpretation framework said to be precise? Illustrate with an
example.
1. Illustrate how one can do Interprocedural Data Flow Analysis using the tool WALA.
1. Using the tool VCC prove that a given code segment satisfies a given property.
6
COMPUTER SCIENCE AND ENGINEERING
QP CODE: PAGES:3
PART A
7
COMPUTER SCIENCE AND ENGINEERING
PART B
Answer any one Question from each module. Each question carries 14 Marks
11.
a. What is an infinite ascending chain in a lattice? Show an example lattice with an
infinite ascending chain. Is it possible for a complete lattice to contain an infinite
ascending chain? (7 marks)
b. State and prove Knaster-Tarski fixed point theorem. (7 marks)
OR
12.
a. Consider the lattice (ℕ,! ≤ ) . Let f! : ℕ → ℕ , be a function defined as follows:
when x! < 100 , f! (x) = x + 1 , when x! > 100 , f! (x) = x − 1 , otherwise f! (x) = x .
Then, show the following for f! : (i) the set of all fixpoints, (ii) the set of all pre-
fixpoints and (iii) the set of all post-fixpoints. (7 marks)
b. Let (D,
! ≤ ) be a lattice with a least upper bound for each subset of D ! . Then, prove
that every subset of D! has a greatest lower bound. (7 marks)
13.
a. With a suitable example, explain the equational approach in Data Flow Analysis.
(7 marks)
b. With a suitable example, explain how you obtain the collecting semantics of a
program point. (7 marks)
OR
14.
a. With an example, explain the Constrained Based Approach in Data Flow
Analysis. (7 marks)
b. Discuss the properties of an algorithm to solve the problem of computing the least
solution to the program analysis problems in Data Flow Analysis. (7 marks)
15.
a. Using Intraprocedural Reaching Definition Analysis, find the assignments killed
and generated by each of the blocks in the program
[x:=5]1;
[y:=1]2 ;
while [x>1]3 do
([y:=x*y]4 ; [x:=x-1]5)
(7 marks)
b. Analyse the following program using Intraprocedural Very Busy Expression
analysis
8
COMPUTER SCIENCE AND ENGINEERING
if [a>b]1 then
([x: =b-a]2 ; [y: =a-b]3)
else
([y: =b-a]4; [x: =a-b]5)
(7 marks)
OR
16.
a. Find Maximal Fixed Point (MFP) solution for the program
[x: =a+b]1;
[y: =a*b]2 ;
while [y>a+b]3 do
([a: =a+l]4; [x: =a+b]5)
(7 marks)
b. With examples, explain the difference between flow sensitive and flow insensitive
analysis. (7 marks)
17.
a. Prove that (L,
! α, γ, M ) is an adjunction if and only if (L,
! α, γ, M ) is a Galois
connection. (7 marks)
b. Prove that if α
! : L → M is completely additive then there exists γ! : M → L such
that (L,
! α, γ, M ) is a Galois connection. Similarly, if γ! : M → L is completely
multiplicative then there exists α! : L → M such that (L,! α, γ, M ) is a Galois
connection. (7 marks)
OR
18.
a. Show that if (Li, αi, γi, Mi) are Galois connections and βi : Vi ➝ Li are
representation functions then
((α1 o β1) ↠ (α2 o β2)) (↝) = α2 o ((β1 ↠ β2) (↝)) o γ1
(7 marks)
b. Briefly explain Kildall’s algorithm for abstract interpretation (7 marks)
19.
a. Briefly explain the need of specification and verification of code. (7 marks)
b. Argue that Hoare Logic is sound. When Hoare Logic is complete? Let {A}P{B}
be a Hoare triple such that Hoare Logic is complete for the program P. Then, is it
always possible to check the validity of the Hoare Triple? If not, what is the
difficulty? (7 marks)
OR
20.
a. With suitable examples, show the difference between partial and total correctness.
(7 marks)
b. With a suitable example, show how a basic program segment can be verified
using the tool VCC. (7 marks)
9
COMPUTER SCIENCE AND ENGINEERING
Teaching Plan
Module 1 (Mathematical Foundations) 6 Hours
2.5 Algorithm to find the least solutions for the Data Flow Analysis problem 1 Hour
10
COMPUTER SCIENCE AND ENGINEERING
11
COMPUTER SCIENCE AND ENGINEERING
12