UNIX&C - BIT Mesra



SEMESTER ICS1302FUNDAMENTALS OF UNIX & C PROGRAMMINGLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRA [Problems in BOLD are optional]Write an interactive program that will read in a +ve integer value and determine the followingi) If the integer is a prime numberii) If the integer is a Fibonacci numberWAP in C to compute sinx = x – x3/3! + x5/3! – x7/7! ….. Continue adding successive terms in the series until the value of the next term becomes smaller (in magnitude) than 10-5. Test the program for x = 1, x = 2, and x = 3. In each case display the number of terms used to obtain the final answer.WAP to generate every 3rd integer beginning with I = 2 and continue for all integers that are less than 150. Calculate the sum of those integers that are evenly divisible by 5.WAP to find whether a given year is a leap year or not. Modify it to generate a list of leap years between two year limits given by user.WAP to display the following pattern :1111101111109101111109891011Using Ternary / Conditional operator find the greatest among 3 numbers.WAP to convert a decimal number into an equivalent number of the input base. Test your program for base 2,8,10 & 16.WAP to read a number n, and print it out digit-by-digit, as a series of words. For e.g. 123 would be printed as “one two three”.WAP to check whether any input +ve integer is palindrome or not.WAP to simulate a simple calculator (+ - / * %) that takes two operands and an operator as input and displays the result.WAP to find the GCD of two input +ve integer numbers.WAP to swap the values of two variables without using a third variable.Read a line of mixed text, and then write it out with all lower case and uppercase letters reversed, all digits replaced by 0s and all other characters (non-letters and non-digits) replaced by ‘*’.WAP to find the product of two matrices A and B. Display the source matrices and product matrix C in matrix format.WAP to find whether a given matrix is a triangular matrix or not.WAP to find the transpose of a matrix. Display the source and the transposed matrix in matrix format.Implement Prob. No. – 14 to 16 using functions for reading, manipulating and displaying the corresponding matrices in matrix form.WAP to sort a list of strings alphabetically using a 2-dim. Character array.WAP to display the row sum and the column – sum of an input 2- dim. Matrix. Display the source matrix with row and column sum.Write a recursive function to calculate S = 2 + 4 + 6 + 8 + …… +2N. Implement the function in a complete C program.Write a function that accepts two arguments an array and its size n. It performs Bubble up sort on the array elements. Using indirection operator ‘*’ implement this in a complete C program. Display the source and the sorted array.Using pointer, write a function that receives a character string and a character as argument. Delete all occurrences of this character in the string. The function should return corrected string with no holes. Write a function for reading character string using pointer. Calculate the length of the string (without using strlen ()). Finally print the string in reverse order, using pointer.Implement prob. No. 14 using pointers representation of 2 – dim. array.Implement prob. No. 15 using pointer representation of 2 dim. array.Implement prob. No. 16 using pointer representation of 2 dim. array.WAP to sort a list of strings into alphabetical order using array of pointers.Create records of 60 students, where each record has fields-name, roll, gpa and fees. Write a function update () to reduce the fees of those students who have obtained gpa greater than 8.5 by 25% of the original fees. Write a complete program to exercise this function in the main program and display all the records before and after updation.Define a structure that describes a hotel. It should have members that include the name, address, grade, average room charge and number of rooms. Write a function to perform the following operations:To print out hotels of a given grade in order of charges.To print out hotels with room charges less than a given value.WAP to concatenate the contents of two files into a third file.WAP to copy the content of one file into another file. Names of both the files are to be input as command line arguments.The call sort +r to the program sort.c should sort an input list of element in ascending order and display the list before sorting & after sorting.Perfrom operations with the following unix commands. (a) mkdir(b) cd ..(c) pwd(d) ls(e) who(f)tty(g) vi (h) cp(i) mv(j) rm(k) rmdirPerform operations with the following vi editior commands in unix.J, k, l, :wq!, :q!, nx , ndw, ndd , nyy & p, :se nu, i, a, Esc. ***************SEMESTER IICS2201DATA STRUCTURESTUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAModule – IHow can you define algorithms? Discuss structure and properties of algorithms.Define and Classify data structures.How does one measure the efficiency of algorithms?Distinguish between best, worst and average case complexities of an algorithm.Define O, Ω and Θ notations of time pare and contrast exponential time complexity with polynomial time complexity.How are recursive programs analyzed?Analyze the time complexity of the following program:for send = 1 to n dofor receive = 1 to send dofor ack = 2 to receive doMessage = send – (receive + ack);endendendSolve the recurrence relation:S(n) = 2 ? S(n – 1) + b ? n, if n > 1 = a,if n = 1Module – IIDistinguish between row major and column major ordering of an array.For an n-dimensional array [1 : u1, 1: u2, … 1 : un] obtain the address of the element A[i1, i2, i3, … in] given β to be the home address.Declare a one, two and a three-dimensional array in a programming language ( C/C++) which has the capability to display the addresses of array elements. Verify the various address calculation formulae for any arbitrary element of these arrays.Open an ordered list L[d1, d2, … dn] where each di is the name of a peripheral device, which is maintained in the alphabetical order. Write a program toInsert a device dk onto the list L.Delete an existing device di from L. In this case the new ordered list should be Lnew = (d1, d2, … di-1, di+1, … dn) with (n – 1) elements.Find the length of L.Update the device dj to dk and print the new list.How are insert operations carried out in a stack?What are demerits of a linear stack?If a stack S[1 : N] were to be implemented with the bottom of the stack at S[N], write a procedure to undertake push and pop operations on S.For the following logical expression( a and b and c) or d or e or (not h)Obtain the equivalent postfix expression.Evaluate the postfix expression for a = true, b = false, c = true, d = true, e = true, h = false.Implement a stack S of n elements using arrays. Write functions to perform PUSH and POP operations. Implement queries using push and pop functions to Retrieve the mth element of the stack S from the top (m < n), leaving the stack without its top m – 1 elements.Retain only the elements in the odd position of the stack and pop out all even positioned elements.Write a recursive program to obtain the nth order Fibonacci sequence number. Include appropriate input/output statements to track the variables participating in recursion.Implement a program to evaluate any given postfix expression. Test your program for the evaluation of the equivalent postfix form of the expression ( - (A*B)/D) ↑ C + E – F * H * I for A = 1, B = 2, D = 3, C = 14, E = 110, F = 220, H = 16.78, I = 364.621.What are the disadvantages of the linear queues? How do circular queues help overcome the disadvantages of linear queues?If FRONT and REAR were pointers to the physical front and rear of a linear queue, comment on the condition, FRONT = REAR.How priority queues are implemented using a single queue?Write a program to maintain a list of items as a circular queue which is implemented using an array. Simulate insertions and deletions to the queue and display the content of the queue after every operation.Let PQUE be a priority queue data structure and a1(p1), a2(p2), an(pn) be n elements with priorities pi ( 0 ≤ pi ≤ m – 1). Implement PQUE as a two dimensional array ARR_PQUE[1:m, 1:d] where m is the number of priority values and d is the maximum number of data items with a given priority. Execute insertions and deletions presented in a random sequence.Implement a deque DQUE in a one dimensional array.Module – IIIWhat is the need for linked representation of lists?What are the advantages of circular lists over singly linked lists?What are the advantages and disadvantages of doubly linked lists over singly linked lists?What is the use of a head node in a linked list?What are the conditions for testing a linked list T is empty, if T is a (i) Simple singly linked list (ii) headed singly linked list (iii) Simple circularly linked list and (iv) headed circularly linked list?Sketch a multiply linked list representation for the following sparse matrix:-900000000502070533. Demonstrate the application of singly linked lists for the addition of the polynomials P1 and P2 given below:P1: 19x6 + 78x4 + 6x3 – 23x2 – 34P2: 67x6 + 89x5 – 23x3 – 75x2 – 89x -21Let X = (x1, x2, … xn), Y = (y1, y2, …yn) be two lists with a sorted sequence of elements. Write a program to merge the two lists together as a single list Z with m + n elements. Implement the lists using singly linked list representations.Write a program which will split a circularly linked list P with n nodes into two circularly linked lists P1, P2 with the first n/2 and the last n - n/2 nodes of the list P in them, respectively.What are the merits of linked stacks and queues over their sequential counterparts?How is the memory storage pool associated with a linked stack data structure for its operations?How are push and pop operations implemented on a linked stack?What are traversable queues?Outline the node structure and a linked queue to represent the polynomial: 17x5 + 18x2 + 9x + 89.Write a program to evaluate a postfix expression using a linked stack implementation.Module – IVDistinguish between digraphs and undirected graphs.For a graph of your choice, trace its (i) adjacency matrix and (ii) adjacency list representations.Draw graphs that contain (i) an Eulerian walk and (ii) a Hamiltonian circuit.How can graph traversal procedures help in detecting graph connectivity?Discuss an algorithm for finding minimum cost spanning tree.Implement Dijkstra’s algorithm to obtain shortest path from a given source vertex (of your choice) to every other vertex of a graph of your choice which must at least 10 nodes with 5 cycles.Module - VSketch (i) an array representation and (ii) a linked representation for the binary tree shown in figure 1.849175Fig. 1Sketch a linked representation for a threaded binary tree equivalent of the binary tree shown in fig. 1.Obtain inorder and post order traversals for the binary tree shown in fig. 1.Draw an expression tree for the following logical expression: p and (q or not k) and (s or b or h)Given the following inorder and preorder traversals, trace the binary tree.Inorder traversal: B F G H P R S T W Y Z Preorder traversal: P F B H G S R Y T W Z.Write a program to implement a binary tree using linked representation. Use functions to traverse it in inorder, preorder and post order.Write a recursive function to count the number of nodes in a binary tree.Write non-recursive functions to perform inorder, preorder and post order traversals of a binary tree.How is binary search tree representation of lists advantageous over their sequential list representations?How is the deletion of a node that has both left and right subtrees, undertaken in a binary search tree?What is the need for an AVL Tree?How is the rotation free deletion of a node having both the subtrees, done in an AVL search tree?For the data list { AND, BEGIN, CASE, DO , END , FOR, GOTO, IF, IN, LET, NOT, OR, QUIT, READ, REPEAT, RESET, THEN, UNTIL, WHILE, XOR}Construct a binary search tree. What are your observations? Construct an AVL search tree.What are the merits of m-way search trees over AVL search trees?What are the demerits of m-way search trees?What is the need for B trees?What is the height of a B tree of order m?Insert the following elements in the order given into an empty B tree of order (i) 3 (ii) 4 and (iii) 7: Z R T A D F H Q W C V B S E O P L J K M N U T X.Undertake the following operations on the B trees: (i) delete Q (ii) delete A (iii) delete MFor the data list given in Question 63, construct a 3-way search tree. Insert G and delete J K and Z from the search tree.Module – VIDistinguish between internal sorting and external sorting.When is a sorting process said to be stable? Why is bubble sort stable?What is the principle behind Shell sort?Distinguish between a heap and a binary search tree. Give an example.Can bubble sort ever perform better than quick sort? If so, list a case.Trace Quick sort on the following list L = { 123, 678, 345, 225, 890, 345, 111, 654, 789, 144, 324, 209}.Module – VIIWhat are the advantages of binary search over sequential search?When is a transpose sequential search said to be most successful?What is the principle behind interpolation search?For the following search list undertake (i) linear ordered search (ii) binary search in the data list given. Tabulate the number of comparisons made for each key in the search list.Search list: {766, 009, 999, 238}Data list: {111, 453, 231, 112, 679, 238, 876, 655, 766, 877, 988, 009, 122, 233, 344, 566}For the given data list and search list, tabulate the number of comparisons made when (i) a transpose sequential search and (ii) interpolation search is undertaken on the keys belonging to the search list.Data list: {pin, ink, pen, clip, ribbon, eraser, duster, chalk, pencil, paper, stapler, pot, scale, calculator}Search list: {pen, clip, paper, pin, calculator}SEMESTER IICS2302DATA STRUCTURESLAB ASSIGNMENTSDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAThe questions appearing in BOLD are optional and carry more credit.Write a program to create a one dimensional array at run time using a user defined function with user given number of elements into it. Also write separate functions that would allow you to insert and delete elements into/from this array at any arbitrary location.WAP to add and subtract following polynomials 5x2 – 3xy + y, 2x2 – y2 + 5xy – x + y using array.Write a program to create one dimensional, two dimensional and three dimensional arrays in memory and then verify the various address calculation formulae for any arbitrary element of these arrays.Write a program to obtain a sparse matrix representation B for the matrix A given below010000000000-2001000000000000000-30000000001Write a program to create an ordered list L[d1, d2, … dn] where each di is the name of a peripheral device, which is maintained in the alphabetical order. Write functions toInsert a device dk onto the list L.Delete an existing device di from L. In this case the new ordered list should be Lnew = (d1, d2, … di-1, di+1, … dn) with (n – 1) elements.Find the length of L.Update the device dj to dk and print the new list.Write a program to implement a stack in an array and perform PUSH, POP, PEEP and CHANGE operations on it using functions.WAP to convert the following expression to its postfix equivalent using stack((A + B )* D) ^ (E – F)A + (B * C – (D / E ^ F) * G) * HWhere ^: raise to the powerImplement a stack S of n elements using arrays. Write functions to perform PUSH and POP operations. Implement queries using push and pop functions to Retrieve the mth element of the stack S from the top (m < n), leaving the stack without its top m – 1 elements.Retain only the elements in the odd position of the stack and pop out all even positioned elements.Implement a program to evaluate any given postfix expression. Test your program for the evaluation of the equivalent postfix form of the expression ( - (A*B)/D) ↑ C + E – F * H * I for A = 1, B = 2, D = 3, C = 14, E = 110, F = 220, H = 16.78, I = 364.621.WAP to implement linear queue using array and linked list.WAP to implement circular queue using array and linked list.WAP to declare a priority queue using two-dimensional array, store elements and priority. Display the elements according to priority from higher to lower.A deque DQUE is to be implemented using a one dimensional array of size N. Write functions to:Insert and delete elements from DQUE at either ends.Implement DQUE as input restricted deque.Implement DQUE as output restricted deque.Write a menu driven program to perform the following operations on a singly linked list.CreateInsertDeleteDisplayExit.WAP to create a sorted one way linked list with n nodes. Extend the program to insert a new node at appropriate location so that order does not get disturbed.WAP to create a circular list and then count the number of nodes into it.WAP to implement doubly linked list having facilities to insert a node at any position and to delete a node with particular information.Let X = (x1, x2, … xn), Y = (y1, y2, …yn) be two lists with a sorted sequence of elements. Write a program to merge the two lists together as a single list Z with m + n elements. Implement the lists using singly linked list representations.Write a program which will split a circularly linked list P with n nodes into two circularly linked lists P1, P2 with the first n/2 and the last n - n/2 nodes of the list P in them, respectively.Write a menu driven program which will maintain a list of car models, their price, name of the manufacturer, engine capacity etc., as a doubly linked list. The menu should make provisions for inserting information pertaining to new car models, delete obsolete models, and update data such as price besides answering queries such as listing all car models within a price range specified by the user and listing all details given a car model.WAP to evaluate a postfix expression using a linked stack implementation.WAP for creation of binary tree and traverse it in Pre, Post and Inorder. Show the traversal output.WAP to construct an expression tree for a given arithmetic expression, check its correctness by traversing it in inorder.WAP to count the no. of leaf nodes in a binary tree.Write non-recursive functions to perform the inorder, preorder and postorder traversals of a binary tree.Implement a menu driven program to perform the following operations on a binary search tree:Construct a BST (Construction begins from an empty tree)Insert element(s) into a non empty BSTDelete element(s) from a non empty BSTSearch for an element in a BSTRetrieve elements of the BST in the sorted order.WAP to input a graph G = (V, E) as an adjacency matrix. Include functions to Test if G is complete.Obtain the degree of a node u, if G is undirected, and indegree and outdegree of node u if G is directed.WAP to input a graph G = (V, E) as an adjacency list. Include two functions BFT and DFT to undertake breadth first traversal and depth first traversal of the graph.WAP to implement Shell sort, Quick sort and heap sort for any arbitrary set of elements with the help of user defined functions.Implement a binary search on an ordered list. For the list L = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} undertake search for the elements in the list {3, 18, 1, 25}. Compare the number of key comparisons made during the searches.SEMESTER - IIICS 3102JAVA PROGRAMMING LAB ASSIGNMENTSDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRACS & ITDay-1, 2, and 3: Use of Constants, Variables, and Data types; Use of Operators and Expressions; Decision Making and branching; Decision Making and Looping; Strings; Arrays.Note: The questions marked * are for home work. You are expected to solve 4 questions in each regular laboratory session and solutions for 3 home work problems to be shown in the next class. Failing which, the sessional marks for that class will not be considered.Cheating in any form is strictly intolerable.Q-1 The parameter weekday is true if it is a weekday, and the parameter vacation is true if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return true if we sleep in. Q-2 Given two int values, return their sum. Unless the two values are the same, then return double their sum.Q-3 Given an int n, return the absolute difference between n and 21, except return double the absolute difference if n is over 21.*Q-4 Given 2 ints, a and b, return true if one if them is 10 or if their sum is 10. *Q-5 Given 2 int values, return true if one is negative and one is positive. Unless negative is true, then they both must be negative.Q-6 Given a string, return a new string where the first and last chars have been exchanged. frontBack("code") → "eodc" frontBack("a") → "a" frontBack("ab") → "ba"Q-7 Given a string, take the last char and return a new string with the last char added at the front and back, so "cat" yields "tcatt". The original string will be length 1 or more. backAround("cat") → "tcatt" backAround("Hello") → "oHelloo" backAround("a") → "aaa"*Q-8 Given a string, return true if the string starts with "hi" and false otherwise.Q-9 Given three int values, A B C, return the largest.Q-10 Given 2 positive int values, return the larger value that is in the range 10..20 inclusive, or return 0 if neither is in that range.*Q-11 Given a string, return a new string where the last 3 chars are now in upper case. If the string has less than 3 chars, uppercase whatever is there. Note that str.toUpperCase() returns the uppercase version of a string.Q-12 Given n of 1 or more, return the factorial of n, which is n * (n-1) * (n-2) ... 1. Compute the result recursively (without loops).Q-13 The fibonacci sequence is a famous bit of mathematics, and it happens to have a recursive definition. The first two values in the sequence are 0 and 1 (essentially 2 base cases). Each subsequent value is the sum of the previous two values, so the whole sequence is: 0, 1, 1, 2, 3, 5, 8, 13, 21 and so on. Define a recursive fibonacci(n) method that returns the nth fibonacci number, with n=0 representing the start of the sequence.Q-14 Given a non-negative int n, return the sum of its digits recursively (no loops). Note that mod (%) by 10 yields the rightmost digit (126 % 10 is 6), while divide (/) by 10 removes the rightmost digit (126 / 10 is 12).*Q-15 Given a non-negative int n, return the count of the occurrences of 7 as a digit, so for example 717 yields 2. (no loops). Note that mod (%) by 10 yields the rightmost digit (126 % 10 is 6), while divide (/) by 10 removes the rightmost digit (126 / 10 is 12).Q-16 Write a program to find the number of and sum of all integers greater than 200 that are divisible by 7.*Q-17 Given any number, write a program using while loop to reverse the digits of the number.Q-18 Write a program to determine the sum of the following harmonic series for a given value of n: 1+1/2+1/3+ ----- +1/n The value of n should be given interactively through the keyboard.*Q-19 Write a program that computes the area of a triangle. The sides of triangle should be given interactively through the keyboard.*Q-20 Write a program to sort any list of given numbers.*Q-21 Write a program to add two 3 by 3 matrices.Day 4, 5, 6: Inheritance programming techniquesQ-22 Write a java code to find the distance from Ranchi to major cities of India. Hint: Create an String array of major cities and integer array of distances. User gives the city name and the same is searched (use binary search) in the respective array and displays result.Q-23 Write a Patient class which inherits from the Person class. You may also need to use the Money class. The Patient class requires the following: a variable to store the patient number for the patient a variable to store the hospital a variable to store the patient 's year of joining the hospital a variable to store the patient 's address a variable to store the medical fees that the patient pays constructor methods, which initialise the variables methods to set the hospital , year of joining and address methods to get the hospital, year of joining and address a method to calculate the medical fees : It should take a Money object (the basic fee per year) as a parameter and use it to return the basic fee for the patient. A patient should pay the basic fee for the year of R 1200, 50. a toString method Q-24: a. Explain the difference between early and late/dynamic binding. b.?Which keyword can be used to indicate that a method cannot be overridden with a new definition in a derived class? c. Give the code for an abstract method called getArea() that calculates and returns the area of a shape as a double.Q-25: A small company dealing with transportation has just purchased a computer for its new automated reservations system. You have been asked to program the new system. You are to write a program called ReservationSystem to assign seats on a vehicle. Your class also requires the following:?a constructor method, which initialise the variablesa method to assign the capacity of seating.a method for assigning seats. Use a 1-d array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all the seats are empty. As each seat is assigned, set the corresponding elements of the array to 1 to indicate that the seat is no longer available. Your program should, of course never assign a seat that has already been assigned.appropriate mutator and accessor methods The company also needs a program dealing especially with its only plane with each flight having a capacity of 10 seats. Name this class AirlineReservationSystem. This class is a type of ReservationSystem but the way it reserves seats are different.Your program should display the following menu of alternatives for reserving a seat on the flight:Please type 1 for “smoking”Please type 2 for “non-smoking”If the person types 1,then your program should assign a seat in the smoking section(seats 1-5) If the person types 2,then your program should assign a seat in the non-smoking section(seats 6-10). Your program should then print a boarding pass indicating the person’s seat number and whether it is in the smoking or non-smoking section of the plane.When the smoking section is full, your program should ask the person if it is acceptable to be placed in the non-smoking section (and vice versa). If yes, then make the appropriate seat assignment. If no, then print the message “Next flight leaves in 3 hours.”Create a main() method to test the next scheduled flight.Q-26: Create a superclass, Student, and two subclasses, Undergrad and Grad.The superclass Student should have the following data members: name, ID, grade, age, and address.The superclass, Student should have at least one method: boolean isPassed (double grade)The purpose of the isPassed method is to take one parameter, grade (value between 0 and 100) and check whether the grade has passed the requirement for passing a course. In the Student class this method should be empty as an abstract method. The two subclasses, Grad and Undergrad, will inherit all data members of the Student class and override the method isPassed. For the UnderGrad class, if the grade is above 70.0, then isPassed returns true, otherwise it returns false. For the Grad class, if the grade is above 80.0, then isPassed returns true, otherwise returns false.Create a test class for your three classes. In the test class, create one Grad object and one Undergrad object. For each object, provide a grade and display the results of the isPassed method.Q-27: a. How do you use the scope of class members and methods to hide information from other classes?When should you use inheritance programming techniques to solve problems? What are the benefits of using inheritance? To save time? Shorter programs?Java can deal with single inheritance (one superclass with multiple subclasses). How can a class inherit from more than one superclass (multiple inheritances)?Q-28: Create an applet program for Banner; banner text (Your Roll No.) should be passed as parameter. This applet creates a thread that scrolls the message contained in message right to left across the applet's window & also uses status window.Q-29: Create an applet program for Menu demonstration. Menu bar should contain File, Edit, View and its submenus.Q-30: Create Labels (One, Two & Three), add Buttons (Yes, No, Undecided) when user click any button show message regarding user click, add Checkboxes(Windows 98/XP, Windows NT/2000) when user chose any checkbox show message regarding user choice & add text boxes (name, password) and text on these textboxes should be displayed on Panel.Q-31: Draw colour lines, Rectangle, Filled Rectangle, Rounded Rectangle, Filled Rounded Rectangle, Oval, Filled oval, arc, fill arc, & polygon every drawing shape should be in different colour, Write a text “hello everyone” at the center.Q-32: Create an applet program for key events it should recognize normal as well as special keys & should be displayed on the panel.Q-33: Create an applet program for mouse events it should recognize mouse entry, exit, and its coordinates.Tip: When a web page is to be developed, the following are to be planned:Content of the pageAppearance of the pageAppearance of the page is coded in HTML using HTML tags. Q-34: Design a HTML page (web page) describing your profile in one paragraph. Design in such a way that it has a heading, a horizontal rule, three links and a photo of your institution. Also, write three HTML documents for the links. Q-35: Prepare a HTML page listing popular car companies. For each company prepare a sub-list showing various brands of cars it offers. Q-36: Write a HTML document to draw the following table.Prices of flats in Chennai 2006Area Type of house Rate in rupees/sq. ft.Annanagar Ordinary 1800 Delux 1950Adyar Ordinary 2450 Delux 2775Egmore Ordinary 2000 Delux 2125 Q-37: Write a HTML document/page that has 3 frames. The window must be row wise divided into two frames first and the bottom frame is divided into two frames column wise. Q-38: Write a HTML document showing a password field. When password is entered, the asterisk symbols must be displayed in place of password in the input field. Q-39: Design the following form using HTML.Application for AdmissionName DOB O Male O FemaleSUBMIT Q-40: Write HTML/Javascript code for the page showing check boxes, text box and submit button. The user selects the check box(es) and once the user clicks submit button the selected check box items appear in the text box. Q-41: Write HTML/Javascript code for the page showing currency conversion. The user enters the amount in rupees in the text box and selects a patrticular radio button for the currency conversion. On checking it must display the amount in the corresponding currency. Q-42: Write HTML/Javascript code for the page showing a select box and a text box. The select box contains a list of names. When the user selects a name from the select box the corresponding phone number appears in the phone number input box. Q-43: Write HTML/Javascript code for the page having three text boxes and a submit button. The three text boxes are email id, age and name. The email id text box has to contain @ symbol, age should be greater than 1 and less than or equal to 100 and name should not exceed 10 characters. If the email id doesnot contain @ symbol an alert message is fired. Similarly for age and name the corresponfing alert message is fired.SEMESTER IIICS 3104 DIGITAL ELECTRONICS LABORATORYLAB ASSIGNMENTSDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRACOMPULSORY EXPERIMENTS:Design and realization of Parity bit checker using IC 7486Design and realization of 4:2 line encoder using IC 7432Design and realization of 4-bit magnitude comparator using IC 7485Assembling of a seven segment display using IC 7447 and IC 7404Design and testing of SR and JK Flip-flop using IC 7400 & IC 7402Design of a 2-bit binary parallel adder using IC CD4030 and IC CD4081Design of an Astable Multivibrator (using IC 555 Timer) and observe the output waveformsDesign of an Monostable Multivibrator (using IC 555 Timer) and observe the output waveformsDesign and testing of 2:1 multiplexer and CMOS switch using IC CD4066Design of a 4-bit serial in serial out shift register using IC CD4027 and 555 timerDesign of a Modulo-9 ripple counter using IC CD4029 and IC CD4091Design of a Schmitt Trigger Circuit (using IC 741 OPAMP) and observation of the output waveformsOPTIONAL EXPERIMENTS: i. Design and realization of Binary to Gray code converter using IC 7486ii. Design and realization of Gray to Binary code converter using IC 7486Design of an EX-OR gate using minimum number of 2 input NAND gates IC7400Design and realization of an odd parity generator using IC7486Design of a 1-bit half substractor using IC CD4066Design and realization of 4:16 Decoder using 1:4 De-multiplexerDesign of a modulo 256 ripple counter using IC7493Design of a 4 :16 line decoder using IC CD4514Reading 8 specified address location of a programmed IC Intel 2716Storing a nibble in an IC 2114 RAM and read itSEMESTER-IVCS 4103 SCIENTIFIC COMPUTINGLAB ASSIGNMENTDEPARTMENT OF APPLIED MATHEMATICS, B. I. T. MESRAWrite a program to find the n-th root of a number by Newton Raphson method.Write a program to find the real root of the equation Cosx –xex = 0.Write a program to find the real root by bisection method for the equation x3 – 5x +1 = 0.Write a program for solving n equations in n unknowns using Gaussian elimination.Write a program for solving n equations in n unknowns using Gauss Jordan method.Write a program for solving n equations in n unknowns using Gauss Siedel method.Write a program on Newton’s forward difference interpolation formulaWrite a program on Lagrange’s interpolation formula.Write a program to find the approximate value of ∫0 dx/(1+x) by Trapezoidal rule and find the error.Write a program to find the approximate value of ∫0 dx/(1+x) by Simpson’s 1/3rd rule and find the error.Write a program to prepare a frequency table.Write a program to compute A. M., G. M. , H. M. , Median, Mode, Variance, Range, Standard Deviation, Coefficient of Variation of n observations.Write a program to generate n Binomial variates with parameters m and p and sort them in ascending order of magnitude.Write a program to generate n Poisson variates with parameter λ and sort them in ascending order of magnitude.Write a program to generate n Normal variates with parameters μ and σ2 and sort them in ascending order of magnitude.Write a menu driven program to accomplish test of mean for one sample (large or small as per user’s choice).Write a menu driven program on the test of single and two proportions.Write a menu driven program for testing the equality of means for two Normal Populations assuming equal variances (large or small sample as per user’s choice).Write a program for testing the equality of variances of two Normal populations.Write menu driven a program for Chi-Square tests of goodness of fit and pxq contingeny tables.SEMESTER-IVCS 4107OPERATING SYSTEMTUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAIntroduction What are the main purposes of an operating system?In a multiprogramming and time-sharing environment several users share the system simultaneously. This situation can result in various security problems. Explain any two such problems?Can we ensure the same degree of security in a time shared machine as we have in dedicated machine? Explain your answer.Define the essential properties of the following types of operating systems: Batch b. Time sharing c. Real time d. Parallele. DistributedDistinguish between multiprogramming and multi processing. What are the key motivations of development of each?What is the primary advantage of distributed operating system?How does the distinction between monitor mode and user mode function as a rudimentary form of protection system?What are the differences between a trap and an interrupt? What is the use of each function?Which of the following instruction should be privileged and why? Set value of timerf. Load bound registersRead the clockg. Forcibly terminate an I/O operationClear memoryh. Mask off some interruptsTurn off interruptsi. Load a value in a CPU registerSwitch from user to monitor mode 9. The CPU should be in the privileged mode while executing the kernel code and in the user mode (i.e. non-privileged mode) while executing a user program. Explain how this is achieved during operation of an OS.10. Give two reasons why caches are useful, what problems do they solve? What problems do they cause? If a cache can be made as large as the device for which it is caching (for instance, a cache as large as a disk), why not make it that large and eliminate the device?11. What is the purpose of system calls? Explain with an example.12. There are no instructions smaller than microcode instruction. (True/false)File SystemsSome systems automatically delete all user files when a user logs off or a job terminates, unless the user explicitly requests that they be kept; other systems keep all files unless the user explicitly deletes them. Discuss the relative merits of each approach.Why do some systems keep track of the file, while others leave it to the users or simply do not implement multiple file types? Which system is “better”?Some systems provide file sharing by maintaining a single copy of a file; other systems maintain several copies, one for each of the users sharing the file. Discuss the relative merits of each approach.In some systems, a subdirectory can be read and written by an authorized user, just as ordinary files can be.Describe the protection problem that could arise.Suggest a scheme for dealing with each of the protection problems you named in part a.Explain the advantages and disadvantages of contiguous file allocation pare index file allocation to noncontiguous file allocation.Define physical record. Which is better of the following (i) fixed length record (ii) variable length record? What convention should a file system support to minimize the need of lengthy pathnames in a hierarchical file system?Differentiate between soft link and hard pare logical backups and physical backups.How does file system keep track of free spaces? Elaborate how free space management is done?What are the various responsibilities of a file system?CPU SchedulingDescribe the actions taken by the operating system to switch context between processes.Define the difference between preemptive and non-preemptive scheduling. State why strict non-preemptive scheduling is unlikely to be used in a computer center.Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:ProcessBurst time PriorityP1103P211P323P414P552The processes are assumed to have arrived in the order P1, P2 …. P5 all at time 0. Draw four Gantt charts illustrating the execution of these process using FCFS, SJF, a non-preemptive priority, and RR(quantum = 1) scheduling.What is the turnaround time of each process for each of the scheduling algorithms in part a.What is the waiting time of each process for each of the scheduling algorithms in part a.Which of the schedules in part a results in the minimal average waiting time.What advantage is there in having different time quantum sizes on different levels of a multilevel queuing system?Suppose that a scheduling algorithm, (at the level of short-term CPU scheduling) favours those processes that have used the least processor time in the recent past. Why will this algorithm favour I/O bound programs and yet not permanently starve CPU-bound programs.A job running in a system, with variable time quantum per queue, needs 30 milliseconds to run to completion. If the first queue has a time quantum of 5 milliseconds and each queue thereafter has a time quantum that is twice as large as the previous one, how many times will the job be interrupted and on which queue will it finish its execution? Consider a variation of round robin in which a process that has used its full time quantum is returned to the end of the READY queue, while one that has used half of its time quantum is returned to the middle of the queue and one that has used one-forth of its time quantum goes to a place one-forth of the distance away from the beginning of the queue.What is the objective of this scheduling policy?Discuss the advantage and disadvantage of its implementation?Distinguish among the following three levels of scheduler.High level schedulerIntermediate level schedulerDispatcher Distinguish between scheduling policy and scheduling mechanism.Which level of scheduling make a decision on each of the following questions?Which ready process should be assigned a processor when one is available?Which of the series of waiting batch processes that have been spooled to disk should next be initiated?Which process should be temporarily suspended to relieve a short term burden on the processor?Why should process be prohibited from setting the interrupting clock? Give example why FIFO is not appropriate processor scheduling scheme for interactive user?Memory ManagementGiven memory partitions of 100KB, 500KB, 200KB, 300KB and 600KB (in order), how would each of the first-fit, best-fit and worst-fit algorithms place processes of 212KB, 417KB, 112KB and 426KB (in order)? Which algorithm makes the most efficient use of memory?One way to compact memory is to copy all existing jobs to a secondary storage device and then reload them contiguously into man memory, thus creating one free block after all jobs have been recopied and relocated into memory. Is this viable? Could you devise a better way to compact memory? Write your algorithm and explain why it is better.Given the memory configuration in figure, answer the following questions. At this point job 4 arrives requesting a block of 100K.Operating System20KJob 1 (10K)30KJob 2 (15K)50K65KJob 3 (45K)75K120K200K FigureCan job 4 be accommodated? Why or why not?If relocation is used, what are the contents of the bound registers for Job 1, Job 2 and Job 3?What are contents of the bound registers for Job 4 after it has been loaded into memory?The instruction ADDI 4, 10 is a part of Job 1 and originally loaded into memory location 22K. What is the new location after compaction?The instruction MUL 4, NUMBER is a part of Job 2 and originally loaded into memory location 55K. What is the new location after compaction?The instruction MOVE 3, SUM is a part of Job 3 and originally loaded into memory location 80K. What is the new location after compaction?Explain the difference between the following :Logical and physical addressInternal and external fragmentationWhy are segmentation and paging sometimes combined into one scheme? Describe a mechanism by which one segment could belong to the address space of two different processes.Why page sizes are always powers of 2?Consider a logical address space of eight pages of 1,024 words each, mapped onto a physical memory of 32 frames.How many bits are in the logical address?How many bits are in the physical address?Discuss how fragmentation manifests itself in each of the following types of virtual memory system?SegmentationPagingCombined segmentation and pagingDiscuss the benefits of multilevel paging system instead of directly mapped paging system.What is a TLB? How is it useful? As a chief designer of a new virtual memory system you have been given the choice of implementing either paging or segmentation, but not both. Which would you choose and why.Memory ManagementUnder what circumstances do page fault occurs? Describe the actions taken by the operating system when a page fault occurs.Consider the following page replacement algorithms. Rank these algorithms on a five point scale from “bad” to “perfect” according to their page-fault rate. Separate those algorithms that suffer from Belady’s anomaly from those that do not. LRU replacement b. FIFO replacement c. OPT replacementWhat is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem?Suppose the bus between memory and secondary storage is experiencing heavy page traffic. Does this imply thrashing? Explain.Consider the following page-reference string :1,2,3,4,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6.How many page faults would occur for the following replacement algorithms, assuming one, two, three, four, five, six or seven frames? Remember that all these frames are initially empty, so your first unique pages will all cost one fault each.LRU replacementFIFO replacementOptimal replacementJustify which of the following is susceptible to thrashing:Local page replacementGlobal page replacement.Consider a process experiencing large number of page faults. Describe the effect, if any, of increasing this process’s scheduling priority?Given that main memory is composed of three page frames for public use and that a program requests pages in the following order:a b a c a b d b a c dUsing the FIFO page removal algorithm, do a page trace analysis indicating page faults with asterisks (*). Then compute the failure and success ratios.Using the LRU page removal algorithm do a page trace analysis and compute the failure and success ratios.Which is better? Why do you think it’s better? Can you make a general statement from this example? Why or why not?Let’s define “most-recently-used” (MRU) as a page removal algorithm that removes from memory the most recently used page. Do a page trace analysis using the same page requests as before and compute the failure and success ratios.Which of the three page removal algorithm is best, and why do you think so?Compare and contrast Compare and contrast the page fault frequency page replacement strategy and the working set page replacement strategy. Be sure to consider the following ;Execution time overhead.Memory overhead to for holding the information necessary to support the strategy. Disk SchedulingIs disk scheduling, other than FCFS scheduling, useful in a single-user environment? Explain your answer.Explain why SSTF scheduling tends to favor middle cylinders over the innermost and outermost cylinders.Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143 and the previous request was at cylinder 125. The queue of pending requests, in FIFO order is, 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130.Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of following disk-scheduling algorithm? FCFSSSTFSCANLOOKC-SCANDeadlocksConsider a system consisting of four resources of the same type that are shared by three processes, each of which needs at most two resources. Show that the system is deadlock free.What are the major differences between deadlock, starvation and race? Give some “real life” examples (not related to a computer system environment) of deadlock, starvation and race.Consider a system consisting of m resources of the same type, being shared by n processes. Resources can be requested and released by processes only one at a time. Show that the system is deadlock-free if the following two condition hold :The maximum need of each process is between 1 and m resources.The sum of all maximum needs is less than m + n.Consider the directed resources graph shown in figure and answer the following questions:Is this system deadlocked?Are there any blocked processes?What is the resulting graph after reduction by P1?What is the resulting graph after reduction by P2?Both P1 and P2 have requested R2 :What is the status of the system if P2’s request is granted before P1s?What is the status of the system if P1’s request is granted before P2s? P1 R1 R2P2Discuss the consequent of infinite postponement in each of the following types of system:Batch processingTimesharingReal timeIn a system in which it is possible for a deadlock to occur, under what circumstances would you use a dead lock detection algorithm?Explain various deadlock recovery scheme.Process SynchronizationWhat is critical-section problem? How semaphores are helpful in solving this problem?What is race condition?Does Peterson’s solution to mutual exclusion problem work when process scheduling is preemptive. How about when it is non preemptive. Can counting semaphores be implemented using only binary semaphore?Explain the concept of transaction atomicity.Explain how the synchronization is achieved in Solaris 2 and in Windows 2000.SecurityExplain the security problem. What are the levels on which the security measures are to be taken?What are the various methods of authenticating users? Explain.What is Cryptography? What are its uses in OS perspective?SEMESTER-IVCS 4108OPERATING SYSTEMLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAWrite a program that will simulate FCFS, SJF, SRT (shortest remaining tine first), and round robin scheduling algorithm. For each algorithm, the program should compute waiting time, turnaround time of every job as well as the average waiting time and the average turn around time. The average values should be consolidated in a table for easy comparison. You may use the following data to test your program. The time quantum for round robin is 4 ms and the context switching time is zero.Arrival timeCPU cycle(in ms)06325197105123144165177192Table 1Using your program1, change the context switching time to 0.4 ms. Compare outputs from both runs and print which is a better policy.Using the information give in table 2 and table 3 to complete the following programJob listJob stream numberTimeJob Size1557602441903832904220305225506669907889408107409739301066890115658012838201399140141042015102201677540173321018113801999850203361021775402222710238839024559502510760Table2Memory listMemory Block Size19500270003450048500530006900071000855009150010500Table 3At one large batch- processing computer installation the management wants to decide what storage placement strategy will yield the best possible performance. The installation runs a large real storage computer under fixed partition multiprogramming. Each user program runs in a single group of contiguous storage locations. Users state their storage requirements and time units for CPU usage on their job control card. The operating system allocates to each user the appropriate partition and starts up the user’s jobs. The jobs remain in memory until completion. A total of 50,000 memory locations are available, divided into block as indicated in the table above. Write a event driven simulation to help you decide which storage placement strategy should be used at this installation. Your program would use the job stream and memory partitioning as indicate previously. Rum the program until all jobs have been executed with the memory as is (in order by address). This will give you the first fit type performance results. Sort the memory partitions by size and run the program a second time; this will give the best fit performance results. For both parts a. and b. you are investigating the performance of the system using a typical job stream by measuring: throughput ( how many jobs are processed per given time unit)storage utilization (percentage of partitions never used, percentage of partitions heavily used, etc)waiting queue lengthwaiting time in queueinternal fragmentationSuppose your system (as explained in program 3) now has a “ spooler” (storage area in which to temporarily hold jobs) and the job scheduler can choose which will be served from among 25 resident jobs. Suppose also that the FCFS policy is replaced with SJF policy. This would require that a sort by time be performed on the job list before running the program. Dose this make a difference in the results. The program should be run twice to test this new policy with both best fit and first fit.Suppose your “spooler” (as describe in program 4) replace the previous policy with one of “Smallest Job First Served”. This should require that a sort by job size be performed on the job list before running the program. The program should be run twice to test this new policy with both best fit and first fit. Print the result.The following sequence of requests for program words is taken from a 460 word program: 10,11,104,170,73,309,185,245,246,434,458,364. Main memory can hold a total of 200words for this program and the page frame size will match the size of the pages into which the program has been divided. Calculate the page number according to the page size; divide by the page size, and the quotient gives the page number. The number of page frames in memory is the total number, 200, divided by the page size. Find the success frequency for the request list using FIFO replacement algorithm and a page size of 100 words. (There are two page frames).Find the success frequency for the request list using a FIFO replacement algorithm and a page size of 20 words. (10 pages. 0 through 9)Find the success frequency for the request list using FIFO replacement algorithm and a page size of 200 words. Repeat a. through c. above, using a main memory of 400 words. The size of each page frame will again correspond to the size of the page.Optional QuestionsGiven the following information for an assembly language program:Job size = 3126 bytesPage size = 1042 bytesInstruction at memory location 532: LOAD 1, 2098Instruction at memory location 1156: ADD 1, 2087Instruction at memory location 2086: SUB 1, 1052Data at memory location 1052: 015672Data at memory location 2098: 114321Data at memory location 2087: 077435Find the number of pages needed to store the entire job?Compute the page number and displacement for each of the byte addresses where the data is stored.Determine whether the page number and displacements legal for this job.writ a program that will simulate the FCFS, SSTF, LOOK, and C-LOOK seek optimization strategies. Assume that: The disk’s outer track is the 0 track and the disk contains 200 tracks per surface.Each track holds 8 sectors numbered 0 through 7.A seek takes 10+0.1* T ms, where T is the number of tracks of motion from one request to the next, and 10 is movement time constant.One full rotation takes 8 ms.Transfer time is 1ms.Use the data in table 4 to test your program.For comparison purposes, compute the average, variance, standard deviation of time required to accommodate all request under each of the strategies. Consolidate your result into a table.Table 4 Arrival Time Track requestedSector requested045023132625202292313519874517055718038378488735951507SEMESTER-IVCS4109COMPUTER SYSTEM ARCHITECTURETUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRADifferentiate between computer Architecture and computer organisation.Define the term s/w compatibility and h/w compatibility. What role have they played in the evaluation of computers?Explain brief history of computersBriefly explain the architecture of general purpose computer.Write a note on stored program computer.Explain the design process for a digital system.What do you understand by design levels in the design of computer system?Explain top-down design approach.List various register level components.Draw and explain the generic block representation of a register level component.Write a short note on the following: Multiplexer, Decoder, Demultiplexer, Arithmetic elements, Register, PLA.Explain the design process at the register level.List the processor level components.Explain various design aspects in the processor level design.Draw and explain simple queuing model of computer system.Solve the following using 2’s complement arithmetic. Add 46 and 18 (b) Subtract 34 from 52Explain the h/w for implementation of integer addition and subtraction.Write short note on look ahead carry generator.Explain the h/w for implementation of positive number multiplication.Explain the Booth’s algorithm for multiplication.Multiply following using Booth algorithm8 X 15(b) -13 X 14(c) -4 X -9Explain the modified Booth’s algorithm.Explain the h/w for implementation of integer division.Explain restoring and non-restoring algorithm for integer division.Describe the IEEE standards for single precision and double precision floating point numbers.Draw and explain the flow chart for floating point addition and subtraction.Draw and explain the flow chart for floating point division.Explain the various instruction types and format.What do you mean by instruction format? Explain it with the help of example.Explain different addressing modes with the help of one example each.Explain the design of ALU using combinational circuits.Explain the design of ALU using sequential circuits.Draw and explain a generic data path unit with an ALU and a register file.What do you mean by microoperation?Give the microoperation for fetch cycle.Give the microoperation for interrupt cycle.Explain the sequence of operations needed to perform following CPU functionsFetching a word from memoryPerforming an arithmetic or logical operation.What are the basic tasks of control unit?Draw the internal structure of CPU with control signals.Draw and explain typical hardwired control unit.Explain different design approaches for hardwired control.Draw and explain the hardware required for gcd processor.Explain the control unit design for gcd processor using state table method.Explain the control unit design for gcd processor using one hot design method.Write short notes on CPU control unit.What is microprogramming and microprogrammed control unit?Draw and explain the working of control unit.List the advantages and disadvantages of microprogrammed control.What do you mean by instruction pipelining?List the factors affecting the performance of instruction pipelining.Explain the various approaches used to deal with conditional branchingDraw and explain the implementation of two stage instruction pipelining.Draw and explain the implementation of four stage instruction pipelining.Write short notes on pipeline performance.What do you mean by arithmetic pipeline? Discuss.List the different characteristics of memory system.Write a note on memory hierarchy.What are the types of RAMs? Explain them in detailExplain the organisation of DRAM memory.Discuss various access methods used in memory.Give the comparison between serial access and random access memories.Write notes on magnetic disk.Write notes on RAID.Write a short note on magnetic tapes.What is cache memory? Why is it implemented?Define hit rate.Describe the element of cache design.Draw and explain fully associative cache organisation.Draw and explain direct mapped cache organisation.Draw and explain set associative cache organisation.What is cache updating? Why is it necessary? Explain different updating systems.What is cache coherency? Why is it necessary? Explain different approaches for cache coherency.Explain the replacement algorithms for cache memory.What is virtual memory? Why is it necessary to implement virtual memory?Comment on the performance of two level cache systems.Draw and explain bus interconnection scheme.Explain different mechanisms used for bus arbitration.Draw and explain the block diagram of typical DMA controller.Explain various DMA transfer modes.Write short notes on I/O processor.Explain the Flynn’s classification of parallel processing pare and contrast SIMD and MIMD computers. Hence classify a typical IBM PC.Explain the structural difference between shared memory and distributed memory computer with the help of neat pare the processor level and instruction level parallelism.Define speedup and efficiency related to performance of parallel computer.Draw and explain tightly coupled and loosely coupled microprocessor system.Draw and explain typical multiprocessor organisation.Write short notes o on contention problem in multiprocessor system.Draw and explain the various interconnection network structures used in multiprocessor system.Explain various processor characteristics for multiprocessor.SEMESTER-VCS 5101 FORMAL LANGUAGES AND AUTOMATA THEORYTUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAModule-1Q1. What is need for nondeterministic finite automata? What is the deference between NFA and DFA? Q2. Proof the equivalence of NFA and DFA? Write an example, which proof the conversion from NFA to DFA?Q3. Let M= (Q, ∑, δ, qo, F) be finite automation. Let R be the relation in Q. Defined by q1Rq2 if δ (q1,a) = δ(q2,a) for some a ? ∑ and equivalence relation. Q4. Construct the non-deterministic finite automata that accepts {ab, ba}, and use it finite a deterministic automata accepting the same set.Q5. Construct it the DFA equivalent to the NDFA →i)0q00,1q2q11110?q4q3q40 1,0ii) a b q1 q0 a a b b b q2q2iii) 0 1q1q2 0,1q1 0,1Q6. Construct minimum state automata. Equivalent to given automata M whose transition table is given.StateInputa bq0q0q3q1q2q5q6-final stateq2q3q4q3q0q5q4q0q6q5q1q7q6q1q3Q7. Proof the theorem→if L is accepted by NFA with ? transition then L is accepted by an NFA without ? transition. Proof it with example. Q8. A language L is accepted by some DFA if and only if L is accepted by some NFA-proof the theorem. Q9. Construct a Moor machine for mod 3 for binary language. Q10. Equivalence between Moor and Mealy machine-proof with example? Q11. Give DFA’s accepting the following language over the Alphabet {0,1}A set of all string such that each block of five consecutive symbols contains at least two 0’s. The set of all string whose 3rd symbol from the right end is 1.Q12. Given DFA’s accepting the following language over the alphabet {a, b} → A set of all string whose leftmost two and right most two symbols are identical.Q13. DFA that accept the string, which is Divisible by 4.Q14. Design a mealy machine accepting the language consisting a string from ∑={0,1} ending with 2 cosecutive 0’s and 1’s.Q15.Convert NFA with ? move in fig. given below to equivalent NFA without ? move. 2 1 0 q0 q1q2 ? ?Q16. Convert the following ? NFA to DFA. a q2 q0q1 a ? bQ17. Design DFA which accept set of all string which are divisible by 5 for binary alphabet. Q18. Design a DFA that accepting the following languages over alphabet {0,1}The set of strings such that the number of 0’s is divisible by 5, and the number of 1’s divisible by 3. Q19. Give the NFA that accept the following languages-The set of strings of 0’s and 1’s such that there are two 0’s separated by a number of position that is a multiple of 4. Note that 0 is an allowable multiple of 4.Q20. Design € NFA for the following language. Try to use € transition to simplify your design.The set of strings of 0’s and 1’s such that at least one of the last 4 positions is 1. Module –2Q21. Obtain a regular expression to accept a language consisting of strings of a’s and b’s of odd length.Q22.Obtain a regular expression to accept for following language-the strings 0’s and 1’s with atmost one pair of consecutive 1’s.Q23.Obtain NFA for regular expression a*+b*+c*.Q24.Obtain an NFA for the regular expression (a+b)* aa (a+b)*. Q25.Give the English description of the language of the following regular expression.(a) (1+?) (00* 1)* 0* (b)(0+10)*1*Q26. Consider the transition system of given fig. Prove that the string recognized are (a+a(b+aa)*b)*a(b+aa)*a.[Arden’s theorm]. a bq3 q2 q1 a a b aQ27. Consider the F.A equivalent to the regular expression (0+1)*(00+11)(0+1)*.Q28. Represent the following set by regular expression-{an/n is divisible by 2 or 3 or n = 5}Q29.If L=L(A) for some DFA A, then there is regular expression R such that L=L(R).Q30. Convert the regular expression r=(11+0)*(00+1)* to ? move.Q31. Derive the regular expression from this F.A. 1 0 q2q1 1 0 1 q3 0Q32. Prove that any set L accepted by a finite automata M is represented by regular expression.Q33.Give the DFA for the R.E i) aa*+aba*b* ii) ab(a+ab)*(a+aa)Q34. Construct the right linear grammar for the following R.E (aab*ab)*.Q35. Write a regular expression for the following languages:The set of all strings with an equal number of 0’s and 1’s such that no prefix has two more 0’s than 1’s, nor two more 1’s than 0’s.Module-3Q36.Prove that following are regular or not (a) {0n1n/n≥1}(b) {0 n,12n / n≥1}(c) {0i 2 / i≥1}Q37. Prove that following are not regular language-{0n/ n is a perfect cube}.Q38. Prove that following are not regular language-The set of strings of the form 0i1j such that greatest common divisor of i and j is 1.Q39. Show that the regular languages are closed under the following operation-max (L) = {w/ w is in L for no x other than € is wx is in L}.Q40. What is Pumping lemma and what is the closure property of regular set. Prove that regular sets are closed under union, concatenation and Kleen closure.Q41. Find out whether these two F.A’s are equivalent or not- 0,1i)q3 q1 q0 0 1 0,1 0 1 0 q5q4 q2 1 1 0 0ii) 0,1q'2q'1 q'0 0,1 1Module-4:Q42. What is the concept of parse tree in context free grammar? What is parser? How to remove the ambiguities from the grammar. What is inherent ambiguity explain.Q43. Define deviation tree. Find deviation tree a * b+ a*b given that-a*b +a* b is in L(G), where G is given by S→S+S /SS /a /b.Q44. Construed the context free grammar to generate the corresponding language-{ 0m 1m/ 1≤ m ≤n}{al b m cn / l + m =n}.Q45. Consider the following production: S-aB /bA.A-aS/bAA/aB-bS /aBB/bFor the string aaabbabbba,find-1) leftmost derivation2) rightmost derivation3) parse tree.Q46. Show that i) S-aB/ab, A-aAB/a, B-ABb/b ii)S-S+S/ S*S/a/biii) S-aS/X, X-aX/a is ambiguous.Q47.The following grammar generate regular expression with operand X and Y and binary operator. +, -, And *.E→ +EE/ *EE / -EE /x /y.Find leftmost and rightmost deviation, and deviation tree for the string +* - xyxy.Prove that this grammar is unambiguous.Q48. Set of all strings of balanced parenthesis i.e. each left parenthesis has a mattering right parenthesis and a pairs if matching parenthesis are properly nested. Q49. Proof –it is an unambiguous grammar-S-0A/0BA-1A/€B-0B/1Q50. RE (001+1)*(01)*obtain the contex free grammar.Q51. Obtain the grammar to generate language –L={ w/ na(w)=nb(w)}Q52. Obtain a grammar to generate the language-L={wwR /w ? {a,b}*Q53. Obtain a grammar to generate the language-L= {0i 1j /i ≠ j, i≥0 and j≥0}.Q54. Construct grammar generating {xx/x ? {a,b}*}Q55. Construct grammar generating {0n 12n/ n≥ 1}.Q56. Construct grammar generating {ai bj ck / i, j, k ≥1, i≠j=k}Q57. Consider CFG G defines the productions:S-aSbS/ bSaS/€Prove that L(G) is the set of all strings with an equal number of a’s and b’s.Module-6Q58. Reduce the following grammar G to CNF. G is S-aADA→aB/bABB→b. D→d.Q59. Find whether the following language are context free or not.L={a p/p is prime}.{a m bm c n /m ≤ n ≤ 2m}Q60. Find whether the following languages are context free or not{0i1j/ j=i2}Q61. Convert the grammar S→AB, A-BS/bB→SA/a in to GNF.Q62.Show that L= {an b n cn (n≥1) is not context free but context sensitive.Q63. What do your mean by reduce grammar? Find reduce grammar equivalent to the following. Grammar→S→aAa.A→Sb/bcc/DaA.C→abb/DDD→aDA.B→ac.Q64.Find the reduce grammar equivalent to the grammar S-aAa, A-bBB, B-ab, C-aB.Q65.Given the grammar S-AB, A-a, B-c/b, C-D,D-E,E-a, find the equivalent grammar which is reduced and has no unit production.Q66.Reduce the grammar into GNF(a) E→E+T /TT→T*FRF(E)ID(b) S→SSS→0S1S→01.Q67.Find the Regular grammar of the following:S-SSS/a/abS-AAS /ab/aabA-ab/ba/€Q68. Eleminate useless symbol for grammar:i)S-aS/A/CA-aB-aaC-aCbii)S-aS/bAA-aA/€iii)A-0B/1D/0B-1C/0DC-0B/1D/0D-0D/1DQ69.Draw an NFA accepting the language generated by grammar:S-abA/bB/abaA-b/aB/bAB-aB/aAQ70. Begin with the grammarS-ASB/€A-aAS/aB-SbS/ A/ bbAre there any useless production? Eleminate them if so.Eliminate € production.Put the grammar into Chomsky normal form.Module-5:Q71.Convert the grammarS→0S1/AA→1A0/S/ ?to a PDA that accept the same language by empty stack.Q72. (i) Design PDA that accepts.{wcwR /w is in (0+1)*} by empty stack(ii) Design PDA that accepts.{0n 12n/n≥ 1} by empty stackiii)Design PDA that accepts.{a n b n /n ≥0} by empty stack. iv) Design PDA that accepts.{a n b m an+m }Q73.Construt the PDA that accept the language generated by CF G→S→S+S/S* S/id.Q74. Design PDA that accepts{an bm an / m,n ≥ 1}Q75. Design PDA that accept LM?={w/w ? (a,b)* and na(w)=n b(w)}.Q76.Prove that the set accepted by are CFL’sS-aAS-aABC/bB/aB-bC-cQ77. Costruct PDA from language: axbycz/ / x+z=y.Module-7:Q78. Design TM for the following language-{a nbn cn/ n≥1}{wwR /w is any string of O’s and 1’s}.Q79. Design TM for following----------T(x)= {xx, x ? (a,b)*}T(n)= n+1.Q80. (a) Design TM to obtain the reverse string from the given input string over ∑= {a,b}.Design TM to add two integer number.Q81. Design a TM to compute 1’s complement.Q82. If a language L is accepted by TM then L is accepted by two stack TM.SEMESTER-VCS 5103 FUNDAMENTALS OF DATA COMMUNICATIONSTUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAIntroduction1. Describe a simple communication model, with the help of a suitable block diagram.2. What three fundamental characteristics determine the effectiveness of a data communication system?3. Define Distributed processing. Give its advantages.4. Define the term Computer Network. Differentiate between a switched Communication Network & Broadcast communication Network.5. Why are protocols needed?6. Differentiate between cell Relay & Frame Relay.7. What is meant by ISDN? Explain.8. Differentiate betweena) Half duplex transmission & full duplex transmissionb) Internet and internetc) LAN & WANd) Protocols and Standardse) Communication and Transmission9. Draw a hybrid topology with a star backbone & four ring networks.10. What are two types of line configuration?11. What are the advantages of a multipoint connection over a point-to-point Connection?12. Why are standards needed?Protocols & Architecture1. Briefly explain the OSI layered approach in a Computer Communications Architecture.2. What are the main functions of different layers in an OSI approach?3. What is meant by a PDU? Explain briefly how PDUs are exchanged between peer layers?4. What is meant by a service Access Point?5. What is the involvement of a Network layer in the following types of data transfer?(a) Point-to-Point Link(b) Packet switched network(c) LAN(d) Circuit Switched Network6. What is meant by TCP/IP Protocol Suite?7. List out the main differences in approaches between OSI layered Structure and a TCP/IP protocol suit.8. Compare the differences between a hierarchical and a layered approach.9. Differentiate between a port address, a logical address & a physical address.10. Suppose a computer sends a packet at the network layer to another computer somewhere in the Internet. The logical destination address of the packet is corrupted. What happens to the packet? How can the source computer be informed of such situation?11. What is difference between network layer delivery and transport layer delivery and transport layer delivery?12. What is a peer-to-peer process?13. What is protocol architecture?Data Transmission1. Contrast an Analog signal with a digital signal.2. How is the Bandwidth of a signal related to its spectrum? 3. Differentiate between data rate & Baud rate.4. What are the common transmission impairments a signal encounters? Explain each of them.5. What is meant by channel capacity? Mention the factors affecting it?6. What is meant by Eb/No ratio? What is effect of signal strength & data rate on it?7. Distinguish between base band and broadband transmission.8. Differentiate between synchronous & Asynchronous transmission.9. A periodic composite signal contains frequencies from 20-30KHZ, each with amplitude of 8V. Draw the frequency spectrum.10. A line has a signal to noise Ratio of 2000 & a bandwidth of 5000KHZ. What is the maximum data rate supported by this line?11. We have a channel with 5KHZ bandwidth. If we want to send data at 150Kbps, what is the minimum SNRdb? What is SNR?12. What does the Nyquist theorem and Shannon capacity have to do with communication? 13. How can a composite signal be decomposed into its individual frequencies.14. Show the frequency domain of the following signal S (t) = 8+3 sin 1000πt +5sin 200πt15. The attenuation of a signal is –10db. What is the final signal power if it was originally 5W?16. A signal has passed through three cascaded amplifiers, each with a 4db gain? How much is the signal amplified?Transmission Media1. Write short notes on the following, & compare the total data rate capacity & BW criteria of them | Twisted Pair, Co-axial cable & Optical fiber.2. Differentiate between terrestrial microwave & satellite microwave.3. Co-axial cable is a two-wire transmission system. What is the advantage of connecting the quter conductor to ground?4. Why are communication satellites in geosynchronous orbit?5. Mention the factor for evaluating the suitability of a particular transmission media.6. What is the position of the transmission media in the OSI or the internet model?7. Name the advantages of optical fiber optics twisted pair and co-axial cable.8. Explain the significance of twisting in twisted pair.9. Explain the transmission characteristics of fiber optics and terrestrial microwave.10. Write the physical description and applications of satellite microwave.Data Encoding1. What are the popular digital data encoding schemes? Compare their properties with respect to their modulation rate, dc level component synchronizing capability, error detecting capability & immunity to Noise.2. What is meant by differential code? 3. What are advantages of Biphase coding?4. Differentiate among ASK, FSK & PSK. Where they are used? 5. What do you understand by QPSK? How is it used to increase the data rate in a communication link?6. What do you understand by Bandwidth efficiency? Compare the same for ASK, FSK & QPSK.7. Briefly describe a PCM scheme, where is it used?8. What do you understand by Quantization? What is meant by quantization noise?9. What is meant by companding? Where is it employed? What are the advantages of this scheme?10. Write short notes on the following modulation techniques & compare their BW requirements AM, FM, PM.11. Are the modem & the codec functional inverses?12. Differentiate between serial & parallel transmission.13. Define scrambling & give its purpose.14. Distinguish between data rate & signal rate. Compare & contrast PCM & DM.15. What is the maximum data rate of a channel with a bandwidth of 300 KHZ if we use four levels of digital signaling?16. Draw the signal waveforms when 001110011 is transmitted using the following NRZ-L NRZ – I AMI Manchester Differential Manchester17. List and briefly define important factors that can be used in evaluating or comparing the various digital-to-digital encoding techniques.18. What is the sampling rate for PCM if the frequency rangers from 1000 to 4000Hz?19. A signal is sampled. Each signal represents one of four levels. How many bits are needed to represent each sample? If the sampling rate is 8000 samples per second, what is the bit rate?The Data Communication Interface1. Differentiate between synchronous & Asynchronous transmission technique.2. What is meant by Null Modem? Where is it used?3. What are the functions of a DTE? What are the functions of DCE? Give an example of each.4. What standard organizations are involved in DTE-DCE interface standards? Name some popular DTE-DCE standards.5. Compare the frames of transmission for synchronous & asynchronous techniques? What is meant by a preamble & a post-amble in the frame? Why are they required?6. Briefly describe RS232-C standard for interfacing?Data Link Control1. Why is flow control needed? Discuss the use of a buffer at the receiver in flow control.2. What is the mechanism of stop-and-wait flow control? What is the mechanism of sliding window flow control?3. What are the two types of sliding-window ARQ error control? How do they differ from one another?4. In stop and wait ARQ what happens if a NAK is lost in transit? Why is there no need for NAKs to be numbered?5. Which sliding-window ARQ is most popular? Why?6. How does a single bit error differ from a burst error?7. Differentiate between even parity & odd parity8. Discuss CRC method.9. What is the purpose of Hamming code?10. Given a 10 bit sequence 1010011110 & a divisor 1011, find the CRC check your answer.11. Construct a Hamming code for the bit sequence 1001110112. A sender sends 01110001, the receiver receives 01000001. If only VRC is used can receiver detect the error?13. Explain the reason for moving from the stop-and-wait ARQ protocol to the Go-Back-N ARQ protocol.14. Define piggybacking and its usefulness.15. A receiver receives the bit pattern 0111011011. If the system is using odd parity, is the pattern in error?16. A successive repeat ARQ is using 7 bits to represent the sequence numbers. What is the size of the window?MultiplexingDistinguish between synchronous and statistical TDM. Distinguish between multilevel TDM, multiple slots TDM, and pulse-staffed TDM.Define spread spectrum and its goal. List the two spread spectrum techniques.Describe the goal of multiplexing.Explain FDM.How is interference avoided by using FDM?Given the following information, find the maximum bandwidth for each signal source.FDM MultiplexingTotal available Bandwidth = 7900Hz.Three signal sources.A 200-Hz guard band between each signal source. Circuit Switching & Packet SwitchingWhat is TSI and its role in time-division pare space-division and time-division switches.What are two approaches to packet-switching?Compare and contrast a circuit-switched network and a packet switched n/w.List the three traditional switching methods.What is the role of address field in a packet traveling through a datagram n/w and virtual-circuit network?Define blocking in a switched network.List four major components of a packet switch and their functions.Define the need for switching and define a switch.How does frame relay differ from x.25What is the significance of packet size in a packet-switching network?What is difference between in channel and common channel signaling?Asynchronous Transfer Mode How does ATM differ from frame relay?What are relative advantages and disadvantages of ATM compared to frame relay.What is difference between virtual channel and virtual path?What are characteristics of virtual channel connection and virtual path connection?List and briefly explain the fields in an ATM cell.Explain two methods for transmitting ATM cell.List and briefly define the ATM service pare an SVC with PVC.How is an ATM virtual connection identified?Discuss the frame relay physical layer.There are no sequence numbers in frame relay. Why?Differentiate between :Unicast Routing and Multicast RoutingExterior Routing and Interior Routing.Explain Dijkstra’s algorithm in unicast routing.SEMESTER-VCS 5106 SOFT COMPUTINGLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAPART- A (Fuzzy Logic)Note: The question in BOLD are optional and carry more credit1) a) Write a Matlab program (m.file) to calculate union, intersection, complement and difference of two fuzzy sets. b) Write a Matlab program (m.file) to calculate the Demorgan’s Law.2) Find whether the given matrix is (a) reflexive (b) tolerance and (c) transitivity matrix or not.R =1 1 0 0 01 1 0 0 10 0 1 0 00 0 0 1 00 1 0 0 1by writing an M-file.3) Find whether the given matrix is symmetry or notR =1 0.5 0.3 0.6 00.5 1 0.7 0.5 0.90.3 0.7 1 0.6 00.6 0.5 0.6 1 0.50 0.9 0 0.5 1by aMatlab program.4) Find the fuzzy relation between two vectors R and SR =0.70.50.80.4S =0.90.6 0.20.10.70.5Using max–product and max-min method by a Matlab program5) (a)Use Matlab command line commands to display the Gaussian membership function. Given x = 0–10 with increment of 0.1 and Gaussian function is defined between 0.5 and ?5. (b) Use Matlab command line commands to display the triangular membership function. Given x = 0–10 with increment of 0.2 triangular membership function is defined between [3 4 5]6) Illustrate different types of generalized bell membership functions using Matlab program(7) Using Matlab program find the crisp lambda cut set relations for λ = 0.2, the fuzzy matrix is given byR=0.2 0.7 0.8 11 0.9 0.5 0.10 0.8 1 0.60. 0.4 1 0.3(8) Temperature control of the reactor where the error and change in error is given to the controller. Here the temperature of the reactor is controlled by the temperature bath around the reactor thus the temperature is controlled by controlling the flow of the coolant into the reactor. Form the membership function and the rule base using FIS editor.(9) Consider the water tank with following rules1. IF (level is okay) THEN (valve is no_change) (1)2. IF (level is low) THEN (valve is open_fast) (1)3. IF (level is high) THEN (valve is close_fast) (1)Using Mamdani method and max–min method for fuzzification and method of centroid for defuzzification method construct a FIS. Before editing that rules, membership functions must be defined with membership function editor.(10) (a) Form a fuzzy system, which approximates function f, when x [?10, 10].Repeat the same by adding random, normally distributed noise with zero mean and unit variance. (b) Simulate the output when the input is sin(t). Observe what happens to the signal shape at the output.(11) Use Matlab’s Fuzzy Logic Toolbox to model the tip given after a dinner for two, where the food can be disgusting, not good, bland, satisfying, good, or delightful, and the service can be poor, average, or good. To get started, you type fuzzy in a Matlab window. Then use the fuzzy inference system and membership function editors to define and tune your rules.PART B (Neural Network)12. Design networks of McCulloch-Pitts neurons that implement logical NOT, AND and OR gates. Draw each network and label all the weight and threshold values.13. Derive expressions for the weights and thresholds of a McCulloch-Pitts neuron that can compute the following input-output mappings:in1 in2 out0 0 10 1 01 0 01 1 0Write Matlab code for the above ANN.Investigation the use of back-propagation learning using a sigmoidal nonlinearity to achieve one-to-one mapping, as described here:1. f(x) = 1/x,1 ≤ x ≤ 1002. f(x) = log10x,1 ≤ x ≤ 103. f(x) = exp(-x),1 ≤ x ≤ 104. f(x) = sinx,0 ≤ x ≤ π/2for each mapping, do the following:Set up two sets of data, one for network training, and the other for testing.Use the training data set compute the synaptic weights of the network, assumed to have a single hidden layer.Evaluate the computation accuracy of the network by using the test data. Use a single layer but with a variable number of hidden neurons. Investigate how the network performance is affected by varying the size of the hidden layer. 15 The data presented in the Table P4.17 show the weights of eye lenses of wild Australian rabbits as a function of age. No simple analytical function can exactly interpolate these data, because we do not have a single valued function. Instead, we have a nonlinear least squares model of this data set, using a negative exponential, as described byY = 2.33.846(1 – exp(-0.006042x)) + Where is an error term.Using the back- propagation algorithm, design a multiplayer perceptron that provides a nonlinear least-squares approximation to this data set. Compare your result against the least-sequence model described. Table P4.17 Weights of Eye Lenses of Wild Australian RabbitsAges(days)Weights(mg)Ages(days)Weights(mg)Ages(days)Weights(mg)Ages(days)Weights(mg)1521.667594.6218174.18338203.231522.758292.5218173.03347188.381522.385105219173.54354189.71831.2591101.7224178.86357195.312844.7991102.9225177.68375202.632940.5597110227173.73394224.823750.2598104.3232159.98513203.33746.8825134.9232161.29535209.74452.03142130.68237187.07554233.95063.47142140.5826176.13591234.75061.13147155.3258183.4648244.36081147152.2276186.266602316173.09150144.5285189.66705242.46479.09159142.15300186.09723230.776579.51165139.81301186.7756242.576565.31183153.22305186.8768232.127271.9192145.72312195.1860246.77586.1195161.1317216.41PART C (Genetic Algorithm)16. Write a program in Matlab to implement Roulette wheel and ranking selection method.Write a program in Matlab to maximize a function f(x,y)=xsin(4x) + ysin(20x)subject to-3.0 x 12.14.1 y 5.8SEMESTER-VCS 5108 LINUX PROGRAMMINGTUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRA[Questions in bold are optional and carry higher credit]1. Perform the following operation:-Create a file called “text” and store your name, age, sex and address in it.Display the contents of the file “text” on the screen.Make a copy of the file text into another file ”newtext”Create a file “subject” and type any two sentences in bine the contents of the file “text” and “subject” into another file “textsub”, Delete the file “text”.2. Write a program using bc to find factorial value of a number. Enter the number from user.3. Write a program using bc to print squares, cubes and square roots of all numbers from 1 to 50.4. Write a program using bc to print sine and cosine values of all angles from 0 to 360 degrees in steps of 5 degrees.5. Write a program to find the prime factors of a number 218.6. Perform the following operation:-Convert are capital letters in a file in small case letter.Merge and sort the contents of files a,b and c and display the sorted output on the screen.Merge the contents of file”F1” with the input supplied from the keyboard and store the sorted output in a file f2.7. Write pipelines to carry out the following jobs:-(i) List all files beginning with the character ‘p’ on the screen and also store item in a file called ”F1”.(ii) Output of who should be sorted and displayed on the screen along with the total number of users. The same output except the numbers of users should also be stored in a file “F1”.(iii) Merge the contents of the files a.txt, b.txt and c.txt, sort on the screen page by page.8. Raj’s basic salary is input through the keyboard. His DA is 40% of basic salary and house rent allowance is 20% of basic salary. Write a program to calculate the gross salary.9. The distance between the two cities (in Kms.) is input through the keyboard. WAP to convert and print this distance in meters, feet, inches and centimeters.10. Enter a five digit no. and WAP to calculate the sum of its digits.11. Enter a shell script .which will receive either the file name or the filename with pts full path during execution. This script should obtain information about this file as given by ls –l and display it in proper format.12. In a company an employee is paid as below:-If his basic salary is less than Rs. 1500, then HRA is 10% of basic salary and DA is 90% of basic salary. If salary is either equal to or above Rs. 1500 then HRA is Rs. 500 and DA is 98% of basic salary. If the employees salary is input through the keyboard write a program to find his gross salary.13. WAP to convert a string in the reverse order.14. The marks obtained by a student in five different subjects are input through the keyboard. The student gets a division a per the following rules:- (%) age above or equal to 60- first div. (%) age between 50 and 59-second div. (%) age between 40 and 49- third div. (%) age less than 40- fail.WAP to calculate the division obtained by the student.15. If cost price and selling price of an item is input through the keyboard, WAP to determine whether the seller has made profit or incurred loss. Also determine how much profit was made or loss incurred.16. WAP to find whether an integer is even or odd17. WAP to find the year is leap year or not. Year should be inputed through the keyboard.18. Write a shell script which receives two file names as arguments. It should check whether the two files contents are same or not. If they are same the second file should be deleted.19. Write a shell script which gets executed the moment the user log in. It should display message “Good Morning”/”Good Afternoon”/”Good Evening” depending upon the time at which the user log in.20. Write a menu driven program with followed options:-Contents of /etc/passwdList of users who have currently logged inPresent working directoryExitMake use of case statement. The menu should be placed approximately in the center of the screen and should be displayed in bold using the tput statement.21. Enter principal, number of years and rate of interest from the keyboard and WAP to find the simple interest.22. WAP to count and report the number of entries present in each sub-directory mentioned in the path which is supplied as a command line argument.23. WAP to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs.1200 per hour for every hour worked above 40 hrs. Assume that employees do not work for factorial part of an hour.24. Two nos. are entered through the keyboard. WAP a to find the value of one no. raise to the power of another.25. Write a program to generate all combinations of 1,2, and 3 using for loops.26. Write a shell script to identify all zero byte files in the current directory and delete them. Before proceeding with detection the shell script should get a confirmation form the user. Note that for delectation rm – i should not be used since it needs an enter key to be hit after supplying “y” or “n”. 27. WAP using nested loop which show 5 the following.r =1,p =1, s =2 r =1, p =2, s = 3r =2, p =1, s = 3r =2, p =2, s = 4r =3, p =1, s = 4r =3, p =2, s = 528. Enter three digits from user and WAP to find the smallest and largest one.29. Write a shell script which check after every one minute whether an user has logged in or not. The log in name should be supplied to the shell script at command prompt.30. WAP which receives 5 integers and returns the sum, average standard deviation of these nos. 31. Write a shell script to enter five digit positive integer is entered through the keyboard and calculate the sum of digits of the 5 digit no.32. WAP to obtain the first 25 numbers of a fibonacci sequence:-1 1 2 3 5 8 13 21 34 55 89 ….33. Fifteen nos. are entered from the keyboard into an array. Write a shell script to find out how many of them are positive, how may be negative, how many are even and how many odd.SEMESTER-VICS 6101 DESIGN AND ANALYSIS OF COMPUTER ALGORITHMSTUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRA Module 1What do you mean an algorithm. Explain the different design for algorithm.What are the parameters for considering the time complexity of an algorithm.Analyze the problem and justify your answer. If we apply insertion sort on super computer & Quick sort on PC the array of one million numbers in super computer which executes 100 million instrumentation/ second. While the PC executes only one million / second.Give an optimal solution for the problem if (x and y) then a = b;Else if ( not x ) and y ) then a = c;Else if (x and not y ) then a = d;Else a = e;Write the Trade off between Time complexity & Space complexity.What are the basic steps for writing a good algorithm / program.Define the asymptotic notation.Explain how a Binary search tree has a height of [lgn].Write the following algorithm in an improved way.For (I = 1 to n)If (I < j) then Sum = Sum + nums[i];What is Randomized Algorithm?Write the general method for Divide & Conguer. Explain through an example.Order the following functions in their growth rate; N, N, N1.5, N2, NlogN, N2log, 2/N, 2N, 37, N3. If T1(N) = O(f(N)), T2(N) = O(2f(n)) then which one is True.i) T1+ T2 = O(f(N))ii) T1+ T2 = O(3f(N)) iii)T1+ T2 = O(f(3N)) iv) T2 = 2T1What is the worst –case running time of Algorithm?How much time is required to compute f(x) = N z=0 xiHow much time is required to compute a matrix multiplication?What are the factors for analyzing an algorithm?Compare & contrast between all the design of algorithmModule IIWrite the algorithm for Quick Sort & Explain through an example.Analyze all cases of quick sort.Explain & analyze the Marge sort algorithm.Discuss the problem of selection & compare the time complexity of all type.Explain the idea of strassen’s matrix multiplication & write its’s complexity.Write the algorithm for binary search & analyze it.Derive mathematically the time complexity of binary search tree.Illustrate the divide and conquer strategy for finding maximum and minimum from a set of element. Analyze all cases of time complexity for finding maximum and minimum from a set of element. Two sets A and B each. Assume that each element is an integer in the range [0,n100]. These sets are not necessarily sorted. Show how to check whether these two sets are disjoint in O(n) time. Your algorithm should use O(n) space.Sort the follwing list in decending order using quick sort technique and argue upon its running time.L=<1,3,5,6,8,10,13,15>Module IIIWhat do you mean Greedy Method. How it is useful to solve the algorithm.Analyze the time complexing for optimal marge patterns through an example.Write algorithm for job sequencing problem so that all jobs are completed in deadline.Given the character set S=<a,b,c,d,e,f> with the following probability of occurrence P=<1,1,2,3,5,8> build a binary tree according to greedy strategy.Devise an algorithm to a given amount for purchasing a particular item from the shop using least number of coins. Assume that the available coin set is C={1,2,5,20,50,100,200} what is the total number of coins for purchasing the item of total cost 5.96.Machine M can process a number of jobs. Each job has its own completion time devise an algorithm which minimize the time that all jobs spend in queue. Consider three jobs with times t1=5, t2=10 and t3=3. Compute the minimum time for processing all jobs. Write the algorithm for Hulfman code & analyze it.Let G(V,E) be any weighted connected graph. If C is any cycle of G, then show that the heaviest edge of C cannot belong to a minimum-cost spanning tree of G.Find the optimal placement for 13 programs on the three tapes T0, T1 and T2, where the programs are of lengths 12, 5, 8, 32, 7, 5, 18, 26, 4, 3, 11, 10, 6.Write the algorithm for Optimal Storage on tapes & analyze it.What is an MST? Write an algorithm for MST? Analyze it’s Time Complexity.Write Kruskal’s algorithm & analyze it.Module IV &VWrite the general method for Dynamic programming.State the all pairs shortest path problem & analyze its Time & Space complexity.Prove that the time efficiency of Warshall’s algorithm is cubic.Solve the all pairs shortest problem for the diagraph with the weight matrix | 02∞18 | | 6032∞ | | ∞∞04∞ | | ∞∞203 || 3∞∞∞0 | Taking the Traveling saleman problem as case study, suggest an algorithm for this & analyze its time complexity.State the 8-queens problem. Explain a back tracking algorithm for solving it.State and solve 8-puzzle using backtracking.Write an algorithm for sum of subsets & analyze it.Suppose you are given n men and n women and two nxn arrays P and Q such that P(i,j) is the preference of man i for woman j and Q(i, j) is the preference of woman I for man j. Devise an algorithm that finds a pairing of men and women such that the sum of the product of the preference maximized.Let MAZE(1:n, 1:n) be a zero or one valued, two dimensional array that represent a maze. A one means a blocked path whereas zero represents an open position. Develop an algorithm that begin at MAZE(1,1) and tries to find a path to position MAZE(n,n). Use backtracking to find your solution and analyze your algorithm.Prove that the size of the set of all subsets of n elements is 2nLet w={5,7,10,12,15,18,10} and m=35. Find all possible subsets of w that sum to m. Draw the state space tree for it.What is multi stage graph problem. How it can be solved with dynamic programming approach.Show that the computing time for optimal binary search tree is O(n2).Write Dynamic programming method to solve 0/1 knapsack problem.Consider the following instance of the knapsack problem:N=6, (p1,p2, p3, p4, p5, p6)=(w1, w2, w3, w4, w5, w6)=(100, 50, 20, 10, 7, 3) and M=165. Solve the above problem using dynamic programming approarch. Module VIWhat do you mean by Branch & Bonnd & how it is differ from other method.Write difference between FIFO branch and bound and LC branch and bound algorithms.Devise algorithm for the knapsack problem using Branch and Bound Technique.Devise algorithm for the traveling salesman problem using Branch and Bound Technique.Consider the following traveling salesman instance defined by the cost matrix∞731283∞614958∞618935∞11181498∞Obtain the reduced cost matrix.Draw the state space tree generated by LCBB for the following knapsack instances:n=5, (p1,p2,…….,p5)=(10,15, 6, 8, 4), (w1, w2,…….,w5)=(4, 6, 3, 4, 2), and m=12n=5, (p1,p2,…….,p5)=(w1, w2,…….,w5)=(4, 4, 5, 8, 9), and m=15Given a cost matrix for three persons P1,P2 P3 which are assigned following tasks:T1T2T3P1695C= P2483P35116Obtain the minimum total cost of assignment using Branch and Bound Technique, where each person has exactly one task to perform.Module VIIExplain the concept of NP. Explain NP – completeness & satisfiability.Write an algorithm for Random Number Generations & write at least two application of Random Number.What is a non-deterministic Turing machine? State cook’s theorem.Show that the job sequencing with deadlines is NP-hard.Differentiate between NP, NP- complete and NP-hard.Prove that if any NP – complete problem is solvable in polynomial time then all N????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????e is a polynomial time algorithm is available for clique problem, then show that how to use clique solution to determine the maximum clique size of a given graph in polynomial time.What do you mean by polynomial time reducibility. Explain with the help of an example.SEMESTER-VICS 6103 SYSTEM PROGRAMMING TUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAModule-I1. What do you mean by system programming? How is a system program different from an application program?2. Write short notes on subroutines. Distinguish between open and closed sub-routines.3. What is a language translator. Name some language translators?4. Briefly describe the evolution of at least five system softwares .5. What is the function of a compiler? How is it different from interpreter?6. What are the different types of addressing modes. Explain each briefly.7.Describe the architecture of Simplified Instructional computer(SIC).8.Differentiate between RISC & CISC.9.Describe basic architecture of RISC machine with some example.10.Describe basic architecture of CISC machine with some example.Module II & III11. How does a machine level language differ from assembly language?12. Describe briefly the elements of assembly language.13. What are the different types of statements in assembly language programming?14. Explain two ways in which constants can be used in assembly language programming.15. Explain the term LC processing.16. What is backward referencing?17. Define the terms: Fragmentation, Paging, Demand Paging, Relocatable Partitions.18. Define an assembler.19. Without using the opcode MULT (03), write an assembly language program to compute the expression:M / ( 5 + (75 * Y) – 2 ).Give the equivalent machine language program for the program written. Use the mnemonics used for the Simple Instructional Computer.20. Describe two-pass structure of assembler? What are the data structures used in each pass? Explain how forward references are handled.21. Explain variant-I of the intermediate code for the imperative statements.22. Explain variant-II of the intermediate code for the imperative statements.23. Illustrate with examples: ORIGIN, EQU and LTROG24. What do you understand by segment override? Explain.25. What do you mean by analytic operators? Explain.26. What do you mean by synthetic operators? Explain.27. What is LC alignment? Explain.28. What is the purpose of FRT and CRT? How are these tables organized?29. Write the algorithm of the pass 1 of a two pass assembler.30. Describe the different data structures used by the pass 1.31. Compare the different intermediate code variants and discuss their advantages or disadvantages32. The following program. Is fed to the assembler START100ADS3L1LOADB ADDC STOREDDEQUA+1L2PRINTDORIGINA+2CDC'5'ORIGINL2+1STOPBDC'19'END(a) Show that contents of the symbol table at the end of pass 1(b) Explain the significance of EQU and ORIGIN statements in the above program and explain how they are processed by the assembler. 33. Describe how error-listing and error reporting are done in single pass assembly? What are the various problems of single pass assembly and how they are tackled? 34. Present the algorithm of pass-2 of a two pass assembler.35. What are the different machine dependent features of an assembler? Explain.36. What are the different machine independent features of an assembler? Explain37. What is a multi pass assembler?38. Write the advantages and disadvantages of a single pass assembler over a multi pass assembler.Module IV & V39. What is general loader scheme? What are its advantages over ‘compile and Go’ loader scheme?40. Compare and contrast ‘Compile and Go’ loaders and absolute loader.41. Explain direct linking loaders? What is the information that the assembler must provide to the direct linking loader? Explain with examples.42. What is program relocation and how it is performed? In which cases the loader or linker may change the origin of the program.43. What is address-sensitive program? What are the information that the assembler must provide to the linker so that it can perform relocation and liking of the program?44. With the help of an example explain how relocation and linking is performed by the direct linking loader.45. Describe the components of the object module of a program.46. Present the relocation algorithm.47. Present the algorithm for program linking.48. Explaina) Non relocation programsb) Relocation programsc) Self relocation programs 49. What is an overlay structured program? What modifications in the linking algorithm are required for overlays?50. Explain relocation requirements in segmented addressing.51. Explain:(i) Dynamic Loading(ii) Dynamic linking52. What is Binder? Explain.53. What are the different machine dependent features of a Loader? Explain.53. What are the different machine independent features of a Loader? ExplainModule-VI54. Explain the similarities and the differences between macro expansion and subroutine calls.55. Illustrate macro definition with an example.56. Present the macro expansion algorithm.57. Explain what are positional parameters with the help of an example.58. Explain what are keyword parameters with the help of an example.59. Describe nested macro calls with an example.60. Discuss a method for handling nested macro calls.61. What are macro preprocessors? Present the two pass structure of a macro–assembler.62. Explain semantic expansion of macro with the help of an example.63. Write a macro to calculate power of a number.64. With the help of an example show the content of MDT during a macro definition processing.65. Give a brief overview of macro assembler having 3 passes.66. How Macro can be expanded with arguments? Show with example.67. How Macro can be expanded with conditions? Show with example.Module-VII68. What is software engineering? 69. Define a software tool. What are the different categories of tools used in program design, coding, testing and debugging.70. What are functional and non-functional requirements in software engineering?71. What is SRS? 72. What are characteristics of good software design? List some software design tools.73. What do you mean by software maintenance? Distinguish between adaptive maintenance and enhancement.74. How might reverse engineering contribute to effective software maintenance? 75. What are different types of testing? How to design a test case?SEMESTER-VICS 6106 COMPILER DESIGN LAB ASSIGNMENTSDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRA[Questions in bold are optional and carry higher credit]You are permitted to use any of the 3 programming languages – C, C++, Java – unless and until explicitly stated in the problem statement. Programming Assignments1. Consider the following regular expressions:a) (0 + 1)* + 0*1*b) (ab*c + (def)+ + a*d+e)+c) ((a + b)*(c + d)*)+ + ab*c*dWrite separate programs for each of the regular expressions mentioned above.2. Design a Lexical analyzer for identifying different types of token used in C language. [Note that the reserved keywords such as if, else, class, struct etc must be reported as invalid identifiers. C allows identifier names to begin with underscore character too. Further, the real numbers can also be expressed in the form 1.75e-30 which is 1.75 x 10-30. ]3. Given a text-file which contains some regular expressions, with only one RE in each line of the file. Write a program which accepts a string from the user and reports which regular expression accepts that string. If no RE from the file accepts the string, then report that no RE is matched. 4*. Write a program which accepts a regular expression from the user and generates a regular grammar which is equivalent to the R.E. entered by user. The grammar will be printed to a text file, with only one production rule in each line. Also, make sure that all production rules are displayed in compact forms e.g. the production rules: S--> aB, S--> cdS--> PQShould be written as S--> aB | cd | PQAnd not as three different production rules. Also, there should not be any repetition of production rules.5. Write a program to eliminate left recursion.6. Write a program for Recursive Descent Calculator.7. Write a program that recognizes different types of English words.8. Consider the following grammar:S --> ABCA--> abA | abB--> b | BCC--> c | cCFollowing any suitable parsing technique(prefer top-down), design a parser which accepts a string and tells whether the string is accepted by above grammar or not.[This grammar is not as simple as it appears to be. Try to check if the string abbcc is accepted or not. It is accepted, but improper logic of parsing can cause the program to get stuck or go into infinite loop !! The students are permitted to generate an equivalent grammar by removing ambiguities (if any) and immediate left-recursion from the given grammar.]9. Write a program which reads a left-recursive regular grammar, and removes left recursion from the grammar. For example: A possible input grammar is S--> Sa S-->a Its output after removal of left-recursion will be S--> aS S-->a[Extra credit will be given if the code is able to handle production rules of the type S--> Sa | a etc.]10. Write a program which accepts a regular grammar with no left-recursion, and no null-production rules, and then it accepts a string and reports whether the string is accepted by the grammar or not.11. Design a parser which accepts a mathematical expression (containing integers only). If the expression is valid, then evaluate the expression else report that the expression is invalid. [Note: Design first the Grammar and then implement using Shift-Reduce parsing technique. Your program should generate an output file clearly showing each step of parsing/evaluation of the intermediate sub-expressions. ][Extra credit will be given if the program can handle advanced operations such as exponentiation, square-root, cube-root, logarithm etc]12. Implement problem no. 2 using LEX , and problem no. 8 and 11 using YACC .13*. Consider the following sample program written in a hypothetical language. BEGIN PRINT “HELLO” INTEGER A, B, C REAL D, E STRING X, Y A := 2 B := 4 C := 6 D := -3.56E-8 E := 4.567 X := “text1” Y := “hello there” PRINT “Values of integers are [A], [B], [C]” FOR I:= 1 TO 5 STEP +2 PRINT “[I]” PRINT “Strings are [X] and [Y]”ENDOutput of the above hypothetical program isHELLOValues of integers are 2, 4, 6135Strings are text1 and hello there. Develop a grammar for this hypothetical language, and then write a compiler which works as per the following phases.The input is a program in the aforesaid hypothetical language. Filename has the extension as “.hyp” Phase 1: Lexical analysis – checks whether the syntax is correct or not. If correct, proceed to Phase 2, else report the exact line number where the syntax is incorrect, and stop then and there.Phase 2: Generation of symbol table to handle the variables and their types etc. An output file called symtab.sym will be created which will contain the relevant data. This symbol table will be used while generating the intermediate code in next phase for detecting undeclared variables etc, and reporting linker errors appropriately. Phase 3: Using the result of lexical analysis, the input file and the symtab.sym – generate the intermediate code – in C++ or Java. The intermediate code will be generated in a file called _interm.c or _interm.java as the case may be. As explained above, if any undeclared variables, or invalid values for any variable are encountered, then generate a linker error containing the exact variable name, and line number, and stop immediately without generating any intermediate code.The intermediate code must be compiled and run by the appropriate compiler (cc or javac) without any errors.[This is a very open-ended problem. The more features of language taken into consideration, will be given more the marks. Also, check for cases of undeclared variables, assignment of integer value to STRING variables, assigning of real numbers to INTEGERS etc] 14. Develop a parser which accepts a string and reports whether it is a valid SQL query statement or not.15*. Develop an interpreter which understands the assembly language instructions for Intel-8085 microprocessor, and executes the instructions correctly. User should be able to see the values in all relevant “registers” (registers will be implemented through variables) at any time.A sample working of the interpreter is shown belowinput:MVI A, 34Houtput:Valid statement. A = 0x34 = 52input:MOV Aoutput:Invalid statement. No source register specifiedinput:INC Aoutput:Valid statement. A = 0x35 = 53input:MVI B, 10Houtput:Valid statement. B = 0x10 = 16input:ADD A, Boutput:Valid statement. A = 0x45 = 69, B = 0x10 = 16input:LXI H, 1234Houtput:Valid statement. Register pair HL. H = 0x12 = 18, L = 0x34 = 52SEMESTER-VICS 6108 COMPUTER NETWORKSLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAClass -I and II: Familiarization to: Network components such as Modem, Gateways, Routers, Switches, Cables etc.Various network softwares, services and work trouble shooting Techniques: Trouble shooting basic TCP/IP mands like ipconfig, getmac, tracert, pathping, arp, ping, netstat, finger etc.Straight cabling, Cross cabling, Signal testing, T568A and B wiring standards (including hands on practice)Class -III, IV, and V: Program that prints the address of bitmesra.ac.inProgram that prints all the addresses of .inProgram that scans lower ports and prints them.Program to list host names from command line, attempt to open socket to each one and print the remote host, the remote port, the local address and the local port.Class - VI and VII: Program for splitting the URLs entered into command line into component parts.Program to list all the interfaces available on a workstation.Class - VIII and IX: TCP/IP and UDP/IP socket Programming1. Program for “echo” client. The Client enters data to the server, and the server echoes the data back to the clients.2. Program for “echo” Server. The Server listens at the port specified and reads from client and echoes back the result.Class- X and XI: Serial Port programmingProgram to write out “Hello World” to a serial port or to a USB to Serial Converter.Simple RPC Programming. (Introductory level)Text Book:1. Youlu Zheng and Shakil Akhtar, Networks for Computer scientists & Engineers/Labmanual, Oxford Univ. Press2. Douglas er, Hands on Networking with Internet Technologies, PearsonEducationSEMESTER-VICS 6110SOFTWARE ENGINEERINGLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRACompulsoryFor the given case/ problem statement do the following;Prepare a SRS document in line with the IEEE recommended standards.Draw the use case diagram and specify the role of each of the actors. Also state the precondition, post condition and function of each use case.Draw the activity diagram. Identify the classes. Classify them as weak and strong classes and draw the class diagram.Draw the sequence diagram for any two scenarios.Draw the collaboration diagram.Draw the state chart diagram.Draw the component diagram.Perform forward engineering in java.(Model to code conversion)Perform reverse engineering in java.(Code to Model conversion)Draw the deployment diagram.OptionalPerform forward engineering in visual C++.Perform reverse engineering in Visual C++.Perform forward engineering in Visual Basic.Perform reverse engineering in Visual Basic.Write a program of memory leak and test it with rational purify.SEMESTER-VIICP 7101 PRINCIPLES OF PROGRAMMING LANGUAGES TUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAModule IWhat do you understand by principles of programming languages? Why do we need to study them? Give at least 3 reasons.Briefly summarize historical development of programming languages.Write short notes on evolution of software architectures.What are the various programming paradigms? Briefly explain each paradigm with example.What are the attributes of a good programming language?Explain the concept of data abstraction and encapsulation.What are abstract types? Explain with example.What is interface? What is its use?What are the implementation difficulties with multiple inheritances?Design a Counter class, such that each Counter object is to be a counter (i.e. nonnegative integer). Equip your class with operation to zero the counter, and inspect the counter. Implement your class using suitable object oriented language.Module IIWhat is importance of generic abstraction? How we can instantiate generic units to generate ordinary program units?What is strongly typed language?How can we parameterize generic units with respect to values and types?Discuss how generic units are implemented? What are the problems caused by type parameters?Consider the following objects. Develop a class hierarchy for them and define the appropriate set of functions for computing volume, surface-area, and perimeter (as appropriate): box, circle, triangle, polygon, line, point, sphere, square, trapezoid, parallelogram, hexagon, pentagon, pyramid, and cone.What is parametric polymorphism? Discuss its implementation.Distinguish between explicit and implicit type conversion with the help of examples?What is context-independent overloading?Module III & IVWhat is the effect of sequencers on the program’s control flow.What are exceptions and we can use them for handing abnormal conditions?Discuss the problems that are caused by concurrency which do not exist in sequential programs.What do understand by critical reasons? What would be the advantages and disadvantages of using Postscript rather than HTML as the Web display language?How we can use high-level control abstraction for managing concurrency?Discuss the key concepts of imperative pare the disadvantages of using global variables and advantages of data abstraction.Discuss the design issues of any one imperative programming language.Discuss the methods for establishing correspondence between actual parameters and formal parameters.What are the various ways o transmitting parameters?Take one short program that you have written in an imperative language and rewrite it to be applicative.Module VWhat the key features are of object oriented programming.What are the basic differences of c and c++.What do you mean by data abstraction?Why the java implementation employ dynamic linking.What are the extra features added in ADA95.Every java object is heap variable, while a c++ object may be either global or local variable or heap variable. What are the advantages and disadvantages of java’s inflexibility?What are the basic differences between c++ spellchecker, java spellchecker explain with example.Given an example of a feature from each of java and c/c++, which promote or violate the following language design principle: automation, simplicity, security, regularity, portability.Module VI & VIIWhat are the key features of concurrent programming language?Explain the important concurrent control of ADA95.Explain the important concurrent control of java.Show neither the stop method in java, nor interrupt method, enables us to guarantee of rough thread.Modify the Sieve of Eratosthenes example so that all printing is done by printserver; that is a thread that loop through a buffer accepting prime numbers and printing them. Like the other threads, it should terminate when it received the negative number.In java it is not possible to write synchronized block protecting acess to a component of primitive type.Explain whySuggest two ways you might work around this problem.Write an implementation of Banker’s algorithm in java.Why the primitive priority scheduling important? To what extent do ADA95 and java meet this need? Describe the Yeild method in JAVA and say why it is less useful than it might be. Find out the nearest equivalent in ADA 95. Explain priority inversion. Show that many cases of priority can be automatically prevented in ADA. Suggest steps than programmer can take to reduce the risk of priority inversion in JAVA programs. What are the key concepts of functional programming?The C++ expression “E1 && E2 “ Yields true if and only if both E1 and E2 yield true; moreover , evaluation of E2 is short – circuited if E1 yields false. The ADA expression “E1 and then E2 “behaves likewise. Explain why “&&” and “and then” cannot be defined as ordinary operators or functions in their respective languages.(a) Define a HASKELL function cond such that “cond (E1, E2, E3)” has exactly the same effect as the HASKELL expression “if E1 then E2 else E3”. Take advantage of lazy evaluation. (b) Explain why such a function cannot be defined using eager evaluation Consider the function definition “F I= E” and the function call “F A”. Normal - order evaluation might be characterized byF A ≡ E [I = A ]Where E [I = A] is the expression obtained by substituting A for all free occurrences of I in E. (a) Characterize eager evaluation in an analogous fashion. (b) Show that E[I = A] must be defined carefully, because of the possibility of confusing the scopes of an identifier with more than one declaration. For example consider:LetF n = let m = in m * n m = 2 in f (m+1) Draw a diagram similar to Figure 14.2, that show the effect of evaluating “ns1 ++ ns2”, where ns1 is the list [2, 3, 5], ns2 is the list [7, 11, 13, 17], and “++” is the concatenation operator. (a) Define a HASKELL type whose values are binary search trees (BSTs) with integer components. (b) Define a function that inserts a given integer into a BST. (c) Define a function that maps a given unsorted integer list to a BST, using your insertion function. (d) Define a function that maps a BST to an integer list using left –root – right traversal. (e) From the composition of function (c) and (d). What dose it do? Write a Haskell function named element which count the number of elements in a list. It should produce the same result as the length function. (a) Give a recursive definition of the Haskell function length, which compute the number of entries in a list. (b) Prove by induction the following, given your definition of length: length (xs ++ ys)= length(xs)+length(ys).What are the key features of logic programming?Write a Prolog program to find the maximum, minimum and the range of the values in a list of numbers.Consider the Prolog to find the factorial of the number n. Explain the resolution and unification with example. What do you mean by Horn clauses?a) Write the following statements as a series of prolog facts and rules. Mammals have four legs and no arm, or two arms and two legs. A cow is mammal. A cow has no arms. b) Can prolog derive the conclusion that a cow has four legs? Explain.What are the key features of scripting?Consider a spreadsheet used by a small organization to keep track of its finance. Would you classify such spreadsheet as script? Explain your answer.Write the python procedure that neatly tabulates the component of dictionaries.Design and implement how the python spellchecker works.How the python has been used to help implement Web Search Engine.Why is Perl suited for CGI scripts? Why is C a poor choice to use instead of Perl? SEMESTER-VIICS 7104COMPUTER GRAPHICS LAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRA1. Write a program to display two big "M" one carded into the other using the character 'M' without using gotoxy() or other graphics functions.2. Write a program to display the horizontal mirror image of the ‘M’ generated in the above question no. 1. (Axis of reflection is vertical).3. Write a program to display the vertical mirror image of the ‘M’ generated in the above question no. 1. (Axis of reflection is horizontal).4. Write a program to display circles of randomly changing diameters, colors and fill patterns at random positions on the screen.5. Write a program to display triangles of randomly changing shapes, colors and fill patterns at random positions on the screen.6. Plot a graph of sin(x), 0<x<360, using the character ‘*’.7. Write an interactive program that will create a database of marks (out of 50) of 10 students in Computer-Graphics. Then display the marks and its percentile. Finally display the percentile using a 3D-Bar Graph.8. WAP to Using DDA algorithm draw a line from (20, 10) to (30, 15).9. WAP to Using Bresenham’s algorithm draw a line from (5, 7) (10, 10).10. WAP to draw a circle using Mid-Point algorithm.11. WAP to draw an ellipse using Mid-point ellipse algorithm.12. Generate a wheel structure. Rotate it.OPTIONAL13. Plot a graph of cos(x), 0<x<360, using the character ‘*’.14. Draw a Bar chart for monthly sales over a period of one year. Indicate the sales & months.15. Draw a line graph for monthly sales over a period of one year. Indicate the sales & months. 16. Write a program to simulate a Clock. (i) Analog (ii) Digital Give a relevant heading using gothic font.17. An airplane is flying across the screen and a tank is moving on the ground and trying to hit the airplane with bombs. When a bomb strikes the airplane an explosion occurs. Represent this graphically.18. Animate a square that takes the shapes of a circle, triangle, Rectangle and back to square. The axis of rotation is at the center of the square & normal to the screen. SEMESTER-VIICS 7106PARALLEL COMPUTING LAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRA CompulsoryWrite a parallel program to print any input message supplied by user.Write a parallel program to add two one dimensional arrays of size 'n'.Write a parallel program to add two matrices of order n * n.Write a parallel program to multiply two matrices.Write a parallel program to multiply a matrix of order n x n by a vector of size n. Write a parallel Program to count the no. of vowels in a text.Write a parallel program to find the largest element of n elements.Write a parallel program to count no. of characters, words and lines in a file.Write a parallel program to find factorial value of an integer.Write a parallel program to find the transpose of a given Matrix.Write a parallel program to implement ring topology.Write a parallel program to find the largest and the second largest from a list of elements considering minimum no. of comparisons.OPTIONALWrite a parallel program to sort n elements, using any sorting technique.Write a parallel program to solve a set of linear equations using gauss elimination method.Write a parallel program to find the inverse of a given matrix of n*n order.Write a parallel program to find minimal path (minimal cost) in an undirected graph.Write a parallel program to find roots of an equation using N-R method.SEMESTER-VIICS 7108DIGITAL IMAGE PROCESSINGLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRA [Questions in Bold are optional and carry more weightage]Implement basic contrast enhancement using in built Matlab functions. Implement adaptive thresholding of a gray scale image and compare its performance with ordinary thresholding.Implement Floyd Steinberg dithering on a 8 bit gray scale image.Implement bit plane slicing for a gray scale image. Reconstruct the image by joining select bit planes.Implement histogram equalization without the use of Matlab’s in built functions and compare its performance to Matlab’s in built function.Implement local histogram equalization.Implement histogram specification on a 8 bit gray scale image in Matlab.Develop a method to add random noise to an image for user specified parameters without the use of Matlab’s in built functionsImplement order statistic filtering of images. Compare the performance of your own implementations with Matlab’s in built functions.Implement the following noise removal functions on 8 bit gray scale images using your own functionsMax filterMin filterAlpha trimmingContra harmonic filterGeometric mean filterImplement homomorphic filtering in MatlabImplement filtering in the frequency domain for images using Matlab’s in built functions.Implement ILPF, BLPH, IHPF & BHPF for images using your own functions.Perform Weiner and Blind Deconvolution based image restoration using Matlab’s in built functions.Write functions in Matlab to compute the entropy of an image.Generate Huffman codes for a gray scale 8 bit imageImplement IGS on a gray scale imageSimulate JPEG like compression on a gray scale image and report the compression ratio.Write a program in C to read a BMP file and extract its fields.Write a program in C to extract the contents from a TIFF fileSEMESTER-VIIICS 8102ARTIFICIAL INTELLIGENCE AND EXPERT SYSTEMSLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRADescribe the following family tree as series of PROLOG facts.M – Married toC – Child of Anthony – M – Mary | | C HarryHazel – M – TomWrite queries to answer the following:Who is the sister of Harry?Who is the father of Hazel?The following Diagram depicts name of employees and their supervisors.WatsonJohnsonJohnBankerSmitaEvensWAP which contain all the supervisor relationship in diagram and answer the given queries.who is supervisor of evenswhom supervisor is WatsonWrite a PROLOG program that answers about family members and relationships. Include predicates & clauses which define sister, brother, father, mother, Grandchild, grandfather and uncle. The program should be able to answer question such as following.Father (X, bob)Grandson (X, Y)Uncle (bill, Sue)Mother (marry, X)4. Write Prolog Program to Create following database. ------------------------------------------------------- | P_Name | Age | Hobby | Pet | | -----------|---------|-------------------|----------| | Ram | 15 | Football | Dog | |------------|---------|-------------------|----------| | Mohan | 11 | Volleyball | Cat | |------------|---------|-------------------|----------| | Sohan | 25 | Card | Cow | |------------|---------|-------------------|----------| | Mahesh | 30 | Swimming | Dog | |------------|---------|-------------------|----------| | Ravindra | 11 | Football | GOat | |------------|---------|-------------------|----------| | Rakesh | 25 | Volleyball | Cat | |------------|---------|-------------------|----------| | Rajeev | 15 | Swimming | Dog | |------------|---------|-------------------|----------| | Raju | 30 | Swimming | Dog | |------------|---------|-------------------|----------| | Jaichand | 40 | Football | Cow | |------------|---------|-------------------|----------| | Vijay | 30 | Volleyball | Cat | ----------------------------------------------------- Write Query to display P_name and age, P_Name and hobby.Find How many of them are child if age <=15 is child.X will like Y if X & Y are Persons & they are not same in age but they are children & have a common interest then show who likes whom.5. Write a Prolog code for Monkey Banana Problem.6. Write a prolog program for insertion sort and bubble sort.7. a) Write a prolog program to depict the functioning of cuts. b) Write Prolog program to find the sum of numbers in a list. 8. Write a Program to reverse list of names.9. Prove that any planar graph cannot be colored with less than 4 colors in prolog.10. Represent a graph in Prolog and apply Breath first search on it.Optional Programs:Write a program in prolog to implement dfs on water jug problem.Given a 4 - liter jug filled with water & an empty 3 - liter Jug, how can one obtain exactly 2 liters in 4 liters jug. There is no measuring mark on any of them.Solve the 8 puzzle Problem-using A* algorithm in Prolog.Write program for Backward and forward reasoning in PrologWrite a program to implement steepest ascent for 8 puzzle problem.CS 8104SIMULATION AND MODELINGLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRASimulation of a single server queuing system.Simulation of a multi –server queuing system.Simulation of an Inventory system.Simulation of a Multitellor Bank.Simulation of a Manufacturing system.Simulation of a Telephone system and determine what proportion are successfully completed, blocked, or found to be busy calls.Simulation of a simple run of river storage demand system.Student Beer Company is trying to determine the distribution of the breaking strength of ther glass bottles. Twenty five bottles are selected at random and tested for breaking strength, with the following results(in pounds per sq. inch):218.95232.75212.80231.10215.95237.55235.45228.25218.65212.80230.35228.55216.10229.75229.00199.75225.10208.15213.85205.45 208.15198.40238.60219.55Use the chi-square test with equiprobable intervals to test these breaking strengths for normality at a level of significance of α= 0.05 The manufacturing of the bottles says the breaking strengths are normally distributed with μ=200 and σ= 15.. Test the manufacturer’s claim at a level of significance of α= 0.05.The highway between Atlanta, Georgia, and Athens, Georgia, has a high incidence of accidents along its 100km. Public safety officers say that the occurrence of accidents along the highway is randomly distributed, but the news media say otherwise. The Georgia Dept. of Public safety published records for the month of September. These records indicated the point at which 30 accidents involving an injury or death occurred, as follows( the data points represent the distance from the city limits of Atlanta):88.340.736.327.336.891.767.37.045.223.398.890.117.223.797.432.487.869.862.699.720.673.121.66.045.376.673.227.387.687.2Use the K-S Test to determine whether the distribution of location of accidents is uniformly distributed for the month of SeptemberRecords pertaining to the monthly number of job related injuries at an underground coal mine were being studied by a federal agency. The values for the past 100 months were as follows:InjuriesFrequency of Occurrence-------------------------------------------35401306040101-------------------------------------------------Apply the chi-square test to these data to test the hypothesis that the underlying distribution is Poisson. Use level of significance of α= 0.05Apply the chi-square test to these data to test the hypothesis that the distribution is Poisson with mean 1.0 . Use level of significance of α= 0.05What are the differences in parts (a) and (b), and when might each case arise?Use the linear congruential method to generate a sequence of three two-digit random integers. Let Xo= 27, a=8, c=47, and m=100.Do we encounter a problem if X0 = 0 ?Use the multiplicative congruential method to generate a sequence of four three-digit random integers. Let Xo=.117, a=43, and m=1000.The sequence of numbers 0.54, 0.73, 0.98, 0.11, and 0.68 has been generated. Use the K-S. test with α=0.05 to determine if the hypothesis that the numbers are uniformly distributed on the interval [0,1] can be rejected.Write procedure for generating random number using Acceptance-Rejection technique.Write a computer program that will generate 4 digit random numbers using the multiplicative congruential method. Allow the user to input values of X0, a,c, and mDevelop a generator for a triangular distribution with range (1,10) and mode at x=4OPTIONAL Simulate Traffic Control System.Simulate Auto Pilot System.Simulate Railway Reservation System.Simulate Automobile Suspension ProblemSimulation of an Activity Network.SEMESTER-VIIICS 8105 DISTRIBUTED SYSTEMSTUTORIAL SHEETDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAModule I: Characterization of Distributed Systems and System ModelsWhat is a distributed system? Give a few examples of Distributed systems that are in practice.What is the motivation behind the development of distributed system?Enumerate and explain the benefits and challenges in a distributed system compared to its centralized counterpart. You may consider an example scenario to justify the differences.What additional challenges has the nomadic computing added to the existing distributed computing paradigm?What is a middleware? Give few examples of distributed middleware systems in practice.What is utility computing paradigm? How closely it is relevant to distributed computing paradigm and what additional challenges does it pose?What are the homogenous and heterogeneous systems? Give examples.Resource management issue has been talked about a lot in distributed computing paradigm. What are the issues and how those issues are addressed by different resource management systems?What is the Convolution process? How security to jobs executed remotely is provided through convolution process?What is the issue of Scalability? Discuss some of the guiding principles for designing a scalable distributed system.Taking an example middleware (say Globus), explain its functional components.Enumerate and explain in brief the important design issues for a distributed system.What are microkernel model and monolithic kernel models? Explore the suitability of these models in a distributed scenario and justify your answer.What are the two broad categories of operating systems meant for distributed computing systems? Compare them.In what respect are distributed computing systems better than parallel processing systems? Give examples of three applications for which distributed computing systems will be more suitable than parallel processing systems.Enumerate and explain various models used for building distributed computing systems.What are the Synchronous and Asynchronous distributed systems? What are the issues?The Network Time Protocol service can be used to synchronize computer clocks. Explain why, even with this service, no guaranteed bound is given for the difference between two clocks. Define the integrity property of reliable communication and list all the possible threats to integrity from users and from system components. What measures can be taken to ensure the integrity property in the face of each of these sources of threats?Describe possible occurrences of each of the main types of security threats (threats to processes, threats to communication channels, denial of service) that might occur in the Internet.Module II: Networking and InternetworkingWhat is the task of an Ethernet switch? What tables does it maintain?What are Layer 2/3 switches? List out the network components and the specifications needed to build a distributed computing fabric. You might need to consider a problem pare connectionless and connection-oriented communication for the implementation of each of the following application-level or presentation-level protocols: 1. Telnet, 2. FTP, 3. user location, 4. information browsing, 5. RPCWrite a note on any distributed FTP.Write note on ATM networks.Module III: Interprocess CommunicationWhat are the various layers of a middleware? Draw the layered diagram of a distributed system. Explain the functionalities of and services offered at each layer.What are blocking and non-blocking communication primitives? Compare these from their efficiency viewpoint for use in Distributed systems. Justify.With the help of architectural diagram explain CORBA.What is Group communication? When and where it is required? What are the open group and closed groups and how group communication is accomplished?Write the primitives and explain the 4.3BSD UNIX IPC mechanism?What are idempotent and non-idempotent operations? Suggest a mechanism to handle idempotent operations.What is remote method invocation and how it is achieved?What is the main purpose of using an acknowledgment message in an IPC protocol? Are acknowledgment always needed for reliable communication? Give reasons for your answer.Write note on Remote Procedure Calls.Discuss the different types of call semantics used in RPC systems.Module IV: Time and Global States; Coordination and AgreementWhat is the clock synchronization problem? How this has a great bearing on execution of distributed applications?What are External and internal synchronization? State example situations where these might be necessary.Discuss the Christian and Berkley algorithms for clock synchronization. What is the concept of logical and physical clocks? Enumerate the different issues involved in these two approaches.Discuss how it is possible to compensate for clock drift between synchronization points by observing the drift rate over time. Discuss any limitations to your method.Consider the behavior of two machines in a distributed system. Both have clocks that are supposed to tick 1000 times per ms. One of them actually does, but the other ticks only 990 times per ms. If UTC updates come in once a minute, what is the maximum clock skew that will occur?Why mutual exclusion is required in distributed systems? Discuss how it can be achieved in a centralized and distributed setup? Explain the Bully algorithm.Suggest how to adapt the Bully algorithm to deal with temporary network partitions and slow processes.Explain why the algorithm for reliable multicast over IP multicast does not work for open groups. Given any algorithm for closed groups, how, simply, can we derive an algorithm for open groups?Module V: Transactions and Concurrency ControlWhat are ACID properties? Describe the lost update problem.Describe the inconsistent retrieval problem.Explain the distributed deadlock problem. How the problem can be addressed?Describe the concurrency control mechanism. Describe how a non-recoverable situation could arise if write locks are released after the last operation of a transaction but before its commitment.What are the advantages and drawbacks of multiversion timestamp ordering in comparison with ordinary timestamp ordering?Module VI: Distributed TransactionsWhat are Flat and Nested transactions?What are one-phase and two-phase atomic commit protocols?How the two-phase commit protocol works for nested transactions?What are the Flat and Hierarchic two-phase commit protocols?Discuss the recovery of the two-phase commit protocol.Give an example of the interleavings of two transactions that is serially equivalent at each server but is not serially equivalent globally.Extend the definition of two-phase locking to apply to distributed transactions. Explain how this is ensured by distributed transactions using strict two-phase locking locally.Explain how the two-phase commit protocol for nested transactions ensures that if the top-level transaction commits, all the right descendants are committed or aborted.Module VII: ReplicationWhat is active and passive replication? Discuss their role in fault tolerance.What are faults in distributed scenario and how replication helps in dealing with such situations?Discuss the “gossip” architecture in detail.What do you mean by a highly available service?Discuss the Bayou system.Discuss the Coda file system architecture.What are the different replication protocols? Explain.What is a network partition problem? How a replication scheme deals with such situations?Explain the Quorum based protocol.What are the different consistency models?EC 6112: VLSI DESIGN LABORATORYLIST OF EXPERIMENTS:COMPULSORY EXPERIMENTS: Design of a half adder using the block level entries and simulate it on Active HDLDesign of a 3-to-8 decoder using block level entries and simulate it on Active HDL Design of a synchronous counter with the following states and simulate it making the entries through FSM on Active HDL000000011100010001010110101110000111101010010011Writing of Code for Full adder using VHDL and its simulation on Active HDL.Design of a 8:1 Multiplexer and its simulation on Active HDLDesign of a JK flip flop from a D flip flop and its simulation on Active HDL Design of a two input X-OR using CMOS logic (on Cadence Tools) Design of a two input NAND using Pseudo NMOS logic (on Cadence Tools) Design of a Full Adder circuit using TG logic (on Cadence Tools) Design of a common emitter amplifier using an NPN transistor with a gain of 50 plus and offset less than 20% of supply rail (on Cadence Tools) Design of a common source amplifier using an NMOS transistor and active load for a gain of 50 plus and offset less than 20% of supply rail (on Cadence Tools) Design of a difference amplifier with PMOS current mirror and NMOS input transistors for a gain of 50 plus and offset less than 20% of supply rail (on Cadence Tools)EE 5108: DIGITAL SIGNAL PROCESSING LABORATORYLIST OF EXPERIMENTS:COMPULSORY EXPERIMENTS:Familiarization with MATLABGeneration of the following sequence and to plot them using MATLAB:a.?????? Unit Sample Sequence [n]b.????? Unit Step Sequence u[n]c.?????? Ramp Sequence n. u[n]d.????? Exponential Sequencese.?????? Sine / Cosine SequencesVerification of the following general properties using MATLABa.?????? Linearityb.????? Time Shiftingc.?????? Frequency ShiftingComputation of the linear convolution of two finite-length sequences using MATLABObtaining the Partial Fraction Expansion of the Z-Transform expression and to find its Inverse Z-Transforms using MATLABTesting for the stability of given Discrete Time Systems using MATLABTo write a MATLAB program for finding out the output of two Periodic Digital sequences using Circular Convolution. Compare your result with that obtained by theoretical evaluationComputation of N-point DFT of the length-N sequence using MATLABDevelopment of the program for finding out DFT and FFT using TMS 320C6713 DSK ProcessorTo write a program and simulate using C language / assembly language for computation of Linear Convolution using TMS 320C6713 DSK ProcessorTo write a program and simulate using C language / assembly language for computation of Auto/ Cross Correlation using TMS ProcessorTo write a program and simulate using C language / assembly language for designing a Digital Filter (LP/ HP / BP / BR) using TMS 320C6713 DSK Processor OPTIONAL EXPERIMENTS: To develop a MATLAB program to convert Analog to Digital Frequencies using Bilinear TransformationTo design a Butterworth filter using standard design steps (for LP, HP, BP & BR filters), i.e. find out the order of the filter when Pass Band Gain, Sampling frequency and Pass Band and Stop Band Cut-Off frequencies are given. Then find out the Normalized Transfer Function and Actual Transfer FunctionTo design a Chebyshev filter using standard design steps (general programs for LP, HP, BP & BR filter design)To develop a Cascade realization of the given Linear-Phase FIR/ IIR transfer functions using MATLABTo write a MATLAB program to compute the Cross Correlation of two finite-length sequences. Compare your result with that obtained by theoretical evaluationTo write a MATLAB program to compute the Auto Correlation of two finite-length sequences. Compare your result with that obtained by theoretical evaluationTo write a MATLAB program to compute the PSD of two SinusoidsTo write a MATLAB program to compute the Inverse DFTTo write a MATLAB program for transforming an Analog filter into a Digital filter using Impulse invariant techniqueTo develop programs for following Frequency Transformations in the design of Digital filter: LP to Normalized Low Pass Transformations (NLPT); HP to NLPT; BP to NLPT; BR to NLPTTo develop a general program for Non-Recursive (FIR) filter using Rectangular, Hanning, Hamming, Blackman and Kaiser Window techniquesTo implement LMS algorithm using TMS DSK 320C6713 DSK ProcessorDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, BIT MESRATIS 1006 Foundation of Cryptography Lab.: Tutorial SheetMO’ 2017 Dr. (Mrs) Aruna JainWAP to check the strength of a given password.Implement Euclidean Algorithms to find the gcd of given numbers.Implement Extended Euclidean algorithm with suitable example.Find the multiplicative inverse of 23 in Z100.Find the particular and general solution to the equation:25x + 10y = 1540x + 16y = 88What would be the transformation of a message “Good morning” using Rail Fence technique?Consider a plain text message “I am a Hacker”, Encrypt it with the help of the following algorithm: Replace each of the alphabet with its equivalent 7-bit ASCII Code.Add a 0 bit as the leftmost bit to make each of the above bit pattern 8 position long.Swap the first four bits with the last 4 bit for each alphabet.Write the hexadecimal equivalent of every four bits.Encrypt the message “this is an exercise” using one of the following ciphers. Ignore the space between words. Decrypt the message to get the original plaintextAdditive cipher with k = 20Multiplicative cipher with k = 15 Affine cipher with k = (15,20)Use the Vigenere cipher ‘cryptography’ encipher the word using the key house.Use one-letter frequency attack to decipher the following message. Assume that you know it is enciphered using mono alphabetic cipher.ONHOVEJHWOBEVGWOCBWHNUGBLHBGR The encryption key in a transposition cipher is (3, 2, 6, 1, 5, 4) find the decryption key.Implementation DES algorithm.Implementation RSA algorithm.Find 75 mod 119Using this playfair matrixTMPQSZVWXYEOCURFNABDLGHI/JKEncrypt the message:“The enemy must be stopped at all costs. Do whatever is necessary.” Encrypt the message “meet me at the usual place at ten rather than eight clock” using the Hill cipher with the key 9 45 7 . Show your calculations and the result. SEMESTER-IVCS 4108OPERATING SYSTEMLAB ASSIGNMENTDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, B. I. T. MESRAWrite a program that will simulate FCFS, SJF, SRT (shortest remaining tine first), and round robin scheduling algorithm. For each algorithm, the program should compute waiting time, turnaround time of every job as well as the average waiting time and the average turn around time. The average values should be consolidated in a table for easy comparison. You may use the following data to test your program. The time quantum for round robin is 4 ms and the context switching time is zero.Arrival timeCPU cycle(in ms)06325197105123144165177192Table 1Using your program1, change the context switching time to 0.4 ms. Compare outputs from both runs and print which is a better policy.Using the information give in table 2 and table 3 to complete the following programJob listJob stream numberTimeJob Size1557602441903832904220305225506669907889408107409739301066890115658012838201399140141042015102201677540173321018113801999850203361021775402222710238839024559502510760Table2Memory listMemory Block Size19500270003450048500530006900071000855009150010500Table 3At one large batch- processing computer installation the management wants to decide what storage placement strategy will yield the best possible performance. The installation runs a large real storage computer under fixed partition multiprogramming. Each user program runs in a single group of contiguous storage locations. Users state their storage requirements and time units for CPU usage on their job control card. The operating system allocates to each user the appropriate partition and starts up the user’s jobs. The jobs remain in memory until completion. A total of 50,000 memory locations are available, divided into block as indicated in the table above. Write a event driven simulation to help you decide which storage placement strategy should be used at this installation. Your program would use the job stream and memory partitioning as indicate previously. Rum the program until all jobs have been executed with the memory as is (in order by address). This will give you the first fit type performance results. Sort the memory partitions by size and run the program a second time; this will give the best fit performance results. For both parts a. and b. you are investigating the performance of the system using a typical job stream by measuring: throughput ( how many jobs are processed per given time unit)storage utilization (percentage of partitions never used, percentage of partitions heavily used, etc)waiting queue lengthwaiting time in queueinternal fragmentationSuppose your system (as explained in program 3) now has a “ spooler” (storage area in which to temporarily hold jobs) and the job scheduler can choose which will be served from among 25 resident jobs. Suppose also that the FCFS policy is replaced with SJF policy. This would require that a sort by time be performed on the job list before running the program. Dose this make a difference in the results. The program should be run twice to test this new policy with both best fit and first fit.Suppose your “spooler” (as describe in program 4) replace the previous policy with one of “Smallest Job First Served”. This should require that a sort by job size be performed on the job list before running the program. The program should be run twice to test this new policy with both best fit and first fit. Print the result.The following sequence of requests for program words is taken from a 460 word program: 10,11,104,170,73,309,185,245,246,434,458,364. Main memory can hold a total of 200words for this program and the page frame size will match the size of the pages into which the program has been divided. Calculate the page number according to the page size; divide by the page size, and the quotient gives the page number. The number of page frames in memory is the total number, 200, divided by the page size. Find the success frequency for the request list using FIFO replacement algorithm and a page size of 100 words. (There are two page frames).Find the success frequency for the request list using a FIFO replacement algorithm and a page size of 20 words. (10 pages. 0 through 9)Find the success frequency for the request list using FIFO replacement algorithm and a page size of 200 words. Repeat a. through c. above, using a main memory of 400 words. The size of each page frame will again correspond to the size of the page.Optional QuestionsGiven the following information for an assembly language program:Job size = 3126 bytesPage size = 1042 bytesInstruction at memory location 532: LOAD 1, 2098Instruction at memory location 1156: ADD 1, 2087Instruction at memory location 2086: SUB 1, 1052Data at memory location 1052: 015672Data at memory location 2098: 114321Data at memory location 2087: 077435Find the number of pages needed to store the entire job?Compute the page number and displacement for each of the byte addresses where the data is stored.Determine whether the page number and displacements legal for this job.writ a program that will simulate the FCFS, SSTF, LOOK, and C-LOOK seek optimization strategies. Assume that: The disk’s outer track is the 0 track and the disk contains 200 tracks per surface.Each track holds 8 sectors numbered 0 through 7.A seek takes 10+0.1* T ms, where T is the number of tracks of motion from one request to the next, and 10 is movement time constant.One full rotation takes 8 ms.Transfer time is 1ms.Use the data in table 4 to test your program.For comparison purposes, compute the average, variance, standard deviation of time required to accommodate all request under each of the strategies. Consolidate your result into a table.Table 4 Arrival Time Track requestedSector requested045023132625202292313519874517055718038378488735951507 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download