Questions and Answers in Computer Science. By Yonas Tesfazghi Weldeselassie weldesel

Size: px
Start display at page:

Download "Questions and Answers in Computer Science. By Yonas Tesfazghi Weldeselassie http://www.ictp.trieste.it/ weldesel"

Transcription

1 Questions and Answers in Computer Science By Yonas Tesfazghi Weldeselassie weldesel The Questions in this material are collected from Computer Science Subject Graduate Record Examination Preparation Materials The solutions are explicitly personal and are primarily intended for discussion purposes with people who want to share ideas Neither correctness nor completeness is assumed or implied Do not rely on it Your feedbacks are most welcome!

2 Question 1. Any set of Boolean operators that is sufficient to represent all Boolean expressions is said to be complete. Which of the following is NOT complete? A. {AND, NOT} B. {NOT, OR} C. {AND, OR} D. {NAND} E. {NOR} Solution 1. Recall that the basics of Boolean algebra operators are AND, OR and NOT. These three operators are needed to express any Boolean algebra. So we need to check which of the above alternative sets fails to express these operators. To that end, recall that using AND and NOT, we can express OR, using De Moivre Theorem, as A OR B = A AND B. Similarly, using OR and NOT, we can express AND as A AND B = A OR B. Moreover, NAND can express NOT as the NAND of a boolean variable with itself. Since NAND is negation of AND, it follows that NAND can express AND by simply inverting the result of NAND (i.e. given A and B, A AND B = Negation(A NAND B) = (A NAND B) NAND (A NAND B)). Since it can express AND and NOT, it follows that it can express OR. A similar argument can be applied to NOR. NOR expresses NOT as the NOR of a variable with itself. It follows that it can express OR as the NOR of a result of NOR with itself. Finally De Moivre s Theorem yields the expression to express AND using NOR (i.e. NOT and OR). With AND and OR, we can t express NOT in anyway. Thus the answer is C. Question 2. Which of the following decimal numbers has an exact representation in binary notation? A. 0.1 B. 0.2 C. 0.3 D. 0.4 E. 0.5 Solution 2. 1

3 The only thing we need to remember here is on how to convert decimal numbers to binary. In order to convert integer decimal numbers to binary, divide the number by 2, note the remainder and continue the same operation with the quotient until a quotient of 0 is obtained at which step we need to stop. All the remainders are then written starting from the last to the first resulting the required binary expression. In order to convert a fraction part, as is the case in this question, multiply the fraction by 2, note the integer part of the product, and continue the same operation with the fraction part of the product until a product of 1.0 is obtained. The required binary fraction is then 0.i 1 i 2 i 3... where the i s are the integer parts of the products starting from the first to the last (if the operation stops at some stage). Apply this rule to 0.1 to get the following products 0.2, 0.4, 0.8, 1.6, (take away 1 and continue with 0.6), 1.2, 0.2,... Stop! We had already encountered 0.2 which means we will encounter it again and again if we continue which means this operation will go indefinitely. Thus all the choices A, B, C and D do not have finite (exact) binary notation because all the decimal numbers 0.1, 0.2, 0.3 (which will be 0.6 on the second stage) and 0.4 are encountered in the conversion procedure for 0.1 which did not terminate. The only choice left is E; indeed 0.5 will give 1.0 in the second stage which is the terminating stage resulting the binary 0.1 as its binary representation. Hence the answer is choice E. Question 3. Bob writes down a number between 1 and 1,000. Mary must identify that number by asking yes/no questions to Bob. Mary knows that Bob always tells the truth. If Mary uses an optimal strategy, then she will determine the answer at the end of exactly how many questions in the worst case? A. 1,000 B. 999 C. 500 D. 32 E. 10 Solution 3. The difficult part on this question is to understand what sort of questions Mary should ask Bob. If she asks questions like Is it the number 764?, Is it the number 342?, etc, then surely Mary will need to ask 999 questions in the worst case in order to get the answer. 2

4 The optimal strategy is to ask questions like Is it GREATER THAN 500?, Is it GREATER THAN 250?, etc; each time throwing away half of the interval and working with the remaining half. This is simply binary search method and Mary will need to ask a maximum of log 2 (1000) questions. Hence the answer is choice E. Question 4. If x is a string then x R denotes the reversal of x. If x and y are strings, then (xy) R = A. xy R B. yx R C. y R x D. x R y R E. y R x R Solution 4. The answer can easily be verified to be choice E. [It is similar to transposing a product two matrices which is the product of the transposes in reverse order.] Question 5. A procedure that printed the binary tree B D E in postorder would produce as output 1 A C F A. ABCDEF B. ABDECF C. DBEAFC D. DEBFCA E. DEFBCA 1 Please note that in this tree diagram and the subsequent tree diagrams, some EDGES are drawn with no actual nodes. This is due to the fact that, according to the package I am using to draw trees (parsetree.sty), if one wants to have only one child node, then the node is drawn as middle child (neither right child not left one). So in order to clarify that indeed the child node is either left or right, I am adding additional empty redundant edge. Such edges should be treated as NON-EXISTENT. 3

5 Solution 5. Just remember that Inorder traverses a tree from Left to Root and then to Right. Preorder traverses a tree from Root to Left and then to Right. Postorder traverses a tree from Left to Right and then to Root. All these traversals start at the root node of the tree and perform the operation on each node of the tree recursively. Thus choices A and E refer to nothing, choice B is a result of preorder traversal, choice C is a result of inorder traversal, and choice D is a result of postorder traversal. Hence the answer is choice D. Question 6. Which of the following is not a binary search tree? A D B E C Solution 6. A binary search tree is a binary tree such that for all the nodes in the tree, we have all left children are less than the root which is less than or equal to all the right children. Such trees are used for searching in logarithmic scale time. The answer is choice E. Question 7. Consider the following Pascal-like program fragment. var i, j : integer; procedure P(k, m : integer); begin end k := k - m; m := k + m; k := m - k; 4

6 i := 2; j := 3; P(i, j); If both parameters to P are passed by reference, what are the values of i and j at the end of the program fragment? A. i = 0, j = 2 B. i = 1, j = 5 C. i = 2, j = 3 D. i = 3, j = 2 E. None of the above Solution 7. When parameters, to functions or procedures, pass by reference or pointer (also referred to as by name), the changes made in the function or procedure are reflected in the caller. When parameters pass by value, the change is not reflected. Thus when i and j go with the values 2 and 3 respectively, k and m will get these values in that order and then k will have the value 2-3 = -1, m will have a value = 2, and finally k will have a value = 3. These values are sent back to i and j resulting i = 3 and j = 2. Hence the answer is D. **Observe that the procedure swaps the values of i and j with out using any extra memory. BUT it is very wrong to use such a function in applications which deal with big absolute value numbers. As such suppose that i is assigned the largest positive integer value possible of the programming language under consideration and let j be assigned any negative integer, then the first line in the function will assign k a value above the integer limit resulting to a wrong result! Question 8. A starvation-free job-scheduling policy guarantees that no job waits indefinitely for service. Which of the following job-scheduling policies is starvation-free? A. Round-robin B. Priority queuing C. Shortest job first D. Youngest job first E. None of the above Solution 8. Consider Priority queuing; a policy where the process with the highest priority is executed first irrespective of its arrival. Under such policy, suppose a system is currently executing a process and is in the middle of execution when a process with higher priority arrives. This means the system will suspend the execution of the process which was already executing and will start executing this new process. If this new process needs some resources which are already occupied by the former process then a deadlock occurs as neither the higher priority process will complete execution 5

7 without these resources nor the old process can proceed executing in order to release resources for the new process. Thus there can be a deadlock ( starvation). The same argument applies for shortest job first policy in which case a shortest process might need resources that are occupied by longer processes which were already in the middle of their execution. Youngest process first policy is where the process that arrived last will execute first which again can have starvation. The Round-robin policy which is preemptive scheduling algorithm forces a process if it seems it is holding resource which are required by others thus avoiding starvation. Thus the answer is A. Question 9. Consider a singly linked list of the form where F is a pointer to the first element in the linked list and L is a pointer to the last element in the list. The time of which of the following operations depends on the length of the list? A. Delete the last element of the list B. Delete the first element of the list C. Add an element after the last element of the list D. Add an element before the first element of the list E. Interchange the first two elements of the list Solution 9. Remember that after performing any operation, the structure of the list must remain intact; in other words F and L must point to the first and last elements respectively. Choice B needs only the operation F = F->next; Choice C needs only the operations L->next = new node, L = new node; Choice D needs only the operations new node->next = F, F = new node; Choice E needs only the operations T=F, F=F->next, T->next=F->next, F->next=T; All these do not depend on the length of the list. The answer is therefore A. Indeed in order to delete the last element from the list, we need to first locate the element before the last (which can not be accessed from L). Thus we must parse all the list from the first till the element just before the last after which we can delete the last element and assign L to the one before. Question 10. p := 1; k := 0; while k < n do begin p := 2 * p; 6

8 end; k := k + 1; For the program fragment above involving integers p, k, and n, which of the following is a loop invariant; i.e., true at the beginning of each execution of the loop and at the completion of the loop? A. p = k + 1 B. p = (k + 1) 2 C. p = (k + 1)2 k D. p = 2 k E. p = 2 k+1 Solution 10. Choice E is incorrect even before the loop started hence it is out. When one loop is done, the value of p is 2 and that of k is 1. At this time, we see that both choices B and C are incorrect and thus they are out. Performing one more loop gives p a value 4 and k will have a value 2 at which time choice A becomes incorrect. Hence the answer is choice D. Question 11. Consider an output-producing, deterministic finite automaton (DFA) of the kind indicated in the figure below, in which it is assumed that every state is a final state. Assume that the input is at least four bits long. Which of the following is (are) true? I. The last bit of the output depends on the start state. II. If the input ends with 1100, then the output must end with 1. III. The output can not end with 1 unless the input ends with A. I only B. II only C. I and II only D. II and III only E. I, II, and III Solution 11. 7

9 We start our analysis of the DFA by points II and III. First of all note that a label a/b on an edge denotes that with an input a, we do transition along the edge and produce an output b. Now, if the input ends with 1100, then we can verify, by starting from any of the states, that the last output bit is always a 1. Hence point II is true. To analyze III we proceed as follows. Denote the states (circles in the diagram) by A, B, C, and D starting from the bottom left and going in the clockwise direction. In order to get an output 1 as the last output bit, the last transition must be from state A to state B which is equivalent to say the last input bit was a 0. We can get to state A only from state D which means the second from the last output bit is a 0 and the second from the last input was a 0 too. To get to state D, either we must have come from state D itself or from state C. This means, in any case the third from the last output was a 0 and the third from the last input was a 1. If we had come to state D from itself, then the fourth, from the last, output bit was a 0 and the fourth, from the last, input bit was a 1 ; if on the other hand we had come from state C then we must had come to state C either from state A or from state B in which in any case gives the fourth, from the last, output bit was a 0 and the fourth from the last input bit as a 1. Thus we conclude that in order to get a 1 as the last bit of the output, we must have the last four bits of the input to be Hence III is true. By II and III, we conclude that I is incorrect. Hence the answer is choice D. Question 12. A particular BNF definition for a word is given by the following rules. <word> ::= <letter> <letter><pairlet> <letter><pairdig> <pairlet> ::= <letter><letter> <pairlet><letter><letter> <pairdig> ::= <digit><digit> <pairdig><digit><digit> <letter> ::= a b c... y z <digit> ::= Which of the following lexical entries can be derived from < word >? I. word II. words III. c22 A. None B. I and II only C. I and III only D. II and III only E. I, II, and III Solution 12. Observe that both < letter > and < digit > produce only a single character, both < pairlet > and < pairdig > produce even number of characters; hence < word > produces odd number of characters. Thus I is automatically incorrect. II can be produced with the following chain of rules: <word> = <letter><pairlet> 8

10 = <letter><pairlet><letter><letter> = <letter><letter><letter><letter><letter> = words and III can be produced with the following chain of rules: <word> = <letter><pairdig> = <letter><digit><digit> = c22 Hence the answer is choice D. Question 13. Consider the following C-like program. #include <stdio.h> main() { } float sum = 0.0, j = 1.0, i = 2.0; while (i/j > 0.001) { } j = j + j; sum = sum + i/j; printf("%f\n", sum); How many lines of output does the program produce? A. 0-9 B C D E. More than 39 Solution 13. Since there is one line of output for each loop, we need to determine the number of times the loop executes. Since i is constant, we need to see the growth of j only. Let the initial value of j be denoted by J 1 and the subsequent values by J n for n= 2, 3,... so that J denotes a progression of j. We see that J n = 2J n 1 ; J 1 = 2, which gives J n = 2 n 1, n = 1, 2,... The loop will execute as long as i/j = 2.0/2 n 1 > which gives n < 3log or n < Thus the loop will execute 11 times which is equivalent to say there will be 11 lines of output. Hence the answer is choice B. Question 14. For the C-like code shown above, which of the following is the integer that best approximates the last number printed? A. 0 9

11 B. 1 C. 2 D. 3 E. 4 Solution 14. We need the value of sum at the last loop execution which is = Thus the answer is choice C. Question 15. An integer c is a common divisor of two integers x and y if and only if c is a divisor of x and c is a divisor of y. Which of the following sets of integers could possibly be the set of all common divisors of two integers? A. { 6, 2, 1, 1, 2, 6} B. { 6, 2, 1, 0, 1, 2, 6} C. { 6, 3, 2, 1, 1, 2, 3, 6} D. { 6, 3, 2, 1, 0, 1, 2, 3, 6} E. { 6, 4, 3, 2, 1, 1, 2, 3, 4, 6} Solution 15. Since 0 can not divide any number, we see that choices B and D are out of question. If an integer a is among common divisors of two integers, then surely all divisors of a must also be in the set of common divisors; thus choice A is incorrect since 3 must also be in the set. If both 3 and 4 are among common divisors, then so should be 3 * 4 = 12 by Euclid s lemma ( if we let the two integers x and y, then since 4 x, we must have x = 4q for some integer q and thus 3 4q with gcf(3,4)= 1 = 3 q = q = 3p for some integer p and thus x = 4q = 4 3 p = 12p = 12 x. Similar argument for y.) Thus choice E is incorrect and the correct answer is choice C. Question 16. Consider the following grammar. S ::= AB A ::= a A ::= BaB B ::= bba Which of the following is false? A. The length of every string produced by the grammar is even. B. No string produced by the grammar has an odd number of consecutive b s C. No string produced by the grammar has three consecutive a s D. No string produced by the grammar has four consecutive b s E. Every string produced by the grammar has at least as many b s as a s 10

12 Solution 16. Observe that the length of any substring produced by B is 2 n plus length of substring produced by A for some integer n greater than or equal to 1. Hence the length of substring produced by B is odd if that of A is odd and is even if otherwise. This means both A and B produce same type (either both odd or even) lengths. This implies the length of string produced by S is always even. Alternatively one may reason as follows. The length of substring produced by A is either 1 (which is odd) or is 1 plus twice of the length of B (which is odd again). Hence A produces odd length substrings. B produces substrings of length 2 plus length of substrings produced by A (which is odd). Therefore B produces odd length substrings. Hence S produces odd + odd = even length strings. Thus choice A is true. As to for choice B, it is easy to see that b is always produces in consecutive pairs. Hence choice B is true. Choice C is also true after all A and a can be next to each other only once which gives a maximum of two consecutive a s. The construction S = AB = BaBB = BabbAB = BabbBaBB = BabbbbAaBB already shows that 4 consecutive b s is possible. Hence choice D is False. It is easy to see that B gives two b s and an A which itself gives only an a or as many as b s as a s. Hence choice E is also true. Thus the answer is choice D. Question 17. A particular parallel program computation requires 100 seconds when executed on a single processor. If 40 percent of this computation is inherently sequential (i.e., will not benefit from additional processors), then the theoretically best possible elapsed times for this program running with 2 and 4 processors, respectively, are A. 20 and 10 seconds B. 30 and 15 seconds C. 50 and 25 seconds D. 70 and 55 seconds E. 80 and 70 seconds Solution 17. The computation requires 100 seconds on single processor implies that 40% of the computation takes 40 seconds on any number of processors and the remaining 60% takes 60 #processors seconds on parallel computation which becomes 30 seconds on two processors and 15 seconds on four. Hence, in total, the computation takes = 70 seconds on two processors and = 55 seconds on four processors. Thus the answer is choice D. 11

13 Question 18. The lookup page table shown below is for a job in a page virtual storage system with a page size of 1024 locations. Each virtual address is in the form [p, d] where p and d are the page number and the displacement in that page, respectively. A virtual address of [0, 514] maps to an actual address of A. 514 B C D E. none of the above Solution 18. A virtual page of 0 refers to an actual page of 3. Hence the required actual address is 3 * page size + displacement on that page = 3 * = Hence the answer is choice C. Question 19. If the expression ((2 + 3) * * (6 + 7) * 8) + 9 is evaluated with * having precedence over +, then the value obtained is the same as the value of which of the following prefix expressions? A. + + * * * B. + * * * C. * * * D. * * * E. + * + * * Solution 19. The given expression evaluates to (6 * * 13 * 8) + 9 =

14 Choice A evaluates to + + * 6 4 * * = * = = = 553 Choice B evaluates to + * * * = + * 10 * = + * = = 5209 Choice C evaluates to * * * = * 9 * * = * 9 * = * = 8505 Choice C evaluates to * * * = * + 9 * = * = * = 4761 Choice C evaluates to + * = + * = + * = = 559 We conclude that the only expression that evaluates to the same result as the given expression is that in choice A. Hence the answer is choice A. Question 20. Let P be a procedure that for some inputs calls itself (i.e., is recursive). If P is guaranteed to terminate, which of the following statements must be true? I. P has a local variable. II. P has an execution path where it does not call itself. III. P either refers to a global variable or has at least one parameter. A. I only B. II only C. I and II only D. II and III only E. I, II, and III Solution 20. A recursive procedure may or may not have a local variable. Hence I is incorrect. All recursive procedures have an execution path where they do not call themselves. Hence II is correct. A recursive procedure terminates only its parameter or a global variable is being tested. Hence III is also true. Thus the answer is choice D. Question 21. Consider a computer design in which multiple processors, each with a private cache memory, share global memory using a single bus. This bus is the critical system resource. Each processor can execute one instruction every 500 nanoseconds as long as 13

15 memory references are satisfied by its local cache. When a cache miss occurs, the processor is delayed for an additional 2000 nanoseconds. During half of this additional delay, the bus is dedicated to serving the cache miss. During the other half, the processor cannot continue, but the bus is free to service requests from other processors. On average, each instruction requires 2 memory references. On average, cache misses on 1 percent of references. What proportion of the capacity of the bus would a single processor consume, ignoring delays due to competition from other processors? A. B. C. D E. 1 5 Solution 21. Consider any one processor as it does 100 memory references which is equivalent to say as it executes 50 instructions. Since the cache memory occurs on 1% of references, we see that on average there will be 1 cache miss on these 100 references (50 instructions executions) we are looking at. Thus these 50 instructions will take a total time of (49 * 500) ns + (1 * 500ns ns) which is ( )ns = 27000ns. Also since there is only one cache miss during this entire time, the processor uses the bus for only 1000ns (half of the 2000ns). Thus the required proportion is 1000ns 27000ns = Hence the answer is choice B. Question 22. In multiprogrammed systems it is advantageous if some programs such as editors and compilers can be shared by several users. Which of the following must be true of multiprogrammed systems in order that a single copy of a program can be shared by several users? I. The program is a macro. II. The program is recursive. III. The program is reentrant. A. I only B. II only C. III only 14

16 D. II and III only E. I, II and III Solution 22. Instead of directly answering the question, let me give a very clear definition of the term reentrant (source: searchvb.com) Reentrant is an adjective that describes a computer program or routine that is written so that the same copy in memory can be shared by multiple users. Reentrant code is commonly required in operating systems and in applications intended to be shared in multi-use systems. A programmer writes a reentrant program by making sure that no instructions modify the contents of variable values in other instructions within the program. Each time the program is entered for a user, a data area is obtained in which to keep all the variable values for that user. The data area is in another part of memory from the program itself. When the program is interrupted to give another user a turn to use the program, information about the data area associated with that user is saved. When the interrupted user of the program is once again given control of the program, information in the saved data area is recovered and the program can be reentered without concern that the previous user has changed some instruction within the program. Of course, recursive programs are routines that call themselves from within themselves and hence have nothing to do with this question. Macro is a standard procedure except that it is ready for deployment in a special way and hence has nothing to do with multi programming. Thus the answer is choice C. Question 23. A particular disk unit uses a bit string to record the occupancy or vacancy of its tracks, with 0 denoting vacant and 1 denoting occupied. A 32-bit segment of this string has the hexadecimal value D4F E2003. The percentage of occupied tracks for the corresponding part of the disk, to the nearest percent, is A. 12 B. 25 C. 38 D. 44 E. 62 Solution 23. D4FE2003 in hex = in binary. The number of 1 s is 14 and the total number of bits is 32. Hence the required percentage is 15

17 14 32 = 43.75%. Hence the answer is choice D. Question 24. A program that checks spelling works in the following way. A hash table has been defined in which each entry is a Boolean variable initialized to false. A hash function has been applied to each word in the dictionary, and the appropriate entry in the hash table has been set to true. To check the spelling in a document, the hash function is applied to every word in the document, and the appropriate entry in the table is examined. Which of the following is (are) correct? I. true means the word was int the dictionary. II. false means the word was not in the dictionary. III. Hash table size should increase with document size. A. I only B. II only C. I and II only D. II and III only E. I, II and III Solution 24. We see that Hash table size has nothing to do with a document size and hence III is wrong. Thus choices D and E are incorrect. II is right because we find false if the word being checked was not in the dictionary. I is really confusing as far as I am concerned. On one hand, one may argue that it is correct after all we get true only if we naively think that the word was in the dictionary. BUT think of what happens if we test a word that does not exist in the table, let alone in the dictionary. Will the function return false or true? In my opinion this depends on the implementation. If one initializes the returned value to true, upon testing the word and not finding it on the table nothing will be done and true will be returned. In this case true does not necessarily imply that the word was in the dictionary. Hence the only correct part is II. Observe that false is obtained if the word is not in the dictionary as depicted in II or if the word is not in the table all in all which again means the word is not in the dictionary. Hence in any case II is correct. Thus the answer is choice B. Question 25. The finite automation below recognizes a set of strings of length 6. What is the total number of strings in the set? 16

18 A. 18 B. 20 C. 30 D. 32 E. None of the above Solution 25. This is a little bit difficult problem. Let x ij denote the number of possible paths from a given state of the automaton to another state such that there are i rows and j columns between these two states. We see that the number of possible paths from the start state of the automaton to the final state is x 44. This is equal to 2x 33 + x 24 + x 42 = 2(2x 22 + x 13 + x 31 ) + (x 14 + x 23 ) + (x 32 + x 41 ) = 2( ) + (1 + (x 13 + x 22 )) + (3 + 1) = 12 + (1 + (1 + 2)) + 4 = = 20. Alternatively one can reason in a lengthy but more understandable way as follows. x 44 = x 34 + x 43 = 2x 34 by symmetry. x 34 = x 24 + x 33 = (x 14 + x 23 ) + (x 23 + x 32 ) = 1+3x 23 by symmetry again. x 23 = x 13 +x 22 = 1+(x 12 +x 21 ) = = 3. Thus x 34 = = 10 and this implies x 44 = 2 10 = 20. Again the same result. Hence the answer is choice B. Question 26. Let S be the statement: for i := 1 to N do V [i] := V [i] + 1 Which of the following perform(s) the same changes to V as S? I. i := 0 ; while i < = N do begin i := i + 1 ; V [i] := V [i] + 1 end II. i := 1 ; while i < N do begin V [i] := V [i] + 1 ; i := i + 1 end 17

19 III. i := 0 ; while i < N do begin V [i + 1] := V [i + 1] + 1 ; i := i + 1 end A. I only B. II only C. III only D. II and III only E. I, II and III Solution 26. The given code executes the loop N times. I executes N + 1 times, II executes N - 1 times while III executes N times. Hence the answer is choice C. Question 27. var i, j, x : integer ; read (x) ; i := 1 ; j := 1 ; while i < 10 do begin end j := j * i ; i := i + 1 ; if i = x then exit For the program fragment above, which of the following statements about the variables i and j must be true after execution of the fragment? A. (j = (x 1)!) (i x) B. (j = 9!) (i = 10) C. (j = 10!) (i = 10) D. ((j = 10!) (i = 10)) ((j = (x 1)!) (i = x)) E. ((j = 9!) (i 10)) ((j = (x 1)!) (i = x)) Solution 27. The loop terminates when either i = x < 10 and j = 1 * 1 * 2 * 3 *... * (x-1) = (x-1)! OR i = 10 x and j = 1 * 1 * 2 * 3 *... * 9 = 9! Thus the answer is choice E. Question 28. State 0 is both the starting state and the accepting state 18

20 Each of the following is a regular expression that denotes a subset of the language recognized by the automaton above EXCEPT A. 0 (11) 0 B. 0 1(10 1) 1 C. 0 1(10 1) 10 D. 0 1(10 1)0(100) E. (0 1(10 1) ) Solution 28. Tracing choice D we see that 0 will take us to state 0, then 1 will take us to state 1, then 10 1 will make us stay in the same state, the following 0 will take us to state 2, and finally (100)* will not change the state we are in. Hence we will end up in state 2 which is not an accepting state. All the other choices A, B, C and E can be traced to yield subset of the language recognized by the automaton. Thus the answer is choice D. Question 29. [Questions 29 and 30 are based on the code fragment below] Program Main (input, output); Type Link = $\uparrow$ Cell; Cell = record Info : integer; Next : Link End; If the rest of the program is as follows, (ii) (iii) (iv) var p1, p2 : Link; procedure A; var begin end ; begin (Main) p3 : Link; new (p2); new (p3); new (p3$\uparrow$.next) 19

21 (i) new (p1); A; (v)... end then, at line (v), which of the following allocated Cells is (are) available for reclamation by the garbage collector? A. None B. Only the one allocated by (iii) C. Only the ones allocated by (iii) and (iv) D. Only the ones allocated by (ii), (iii), and (iv) E. Those allocated by (i), (ii), (iii), and (iv) Solution 29. When the execution reaches line (v), all LOCAL memories allocated inside the procedure A are available for reclamation. These are p 3 and p 3 next which were allocated memories by lines (iii) and (iv). Hence the answer is choice C. Question 30. In another program written in a Pascal-like language with the same heading and type declaration, assume that a choice must be made between the following two options. Option P: the procedure Push defined by Procedure Push (n : integer; h : Link); Var p : Link; Begin new(p) ; p$\uparrow$.info := n ; p$\uparrow$.next := h ; h := p end; To be used in the main program using a procedure call of the form: Push (n, Head); Option F: the function Push defined by Function Push (n : integer; h : Link) : Link; var p : Link ; begin new(p) ; p$\uparrow$.info := n; 20

22 end; p$\uparrow$.next := h ; Push := p To be used in the main program using an assignment of the form Head := Push (n, Head); Suppose Head points to the first cell of the list of cells, and a new cell is to be added at the front of the list, leaving Head pointing to the newly added cell. Which of the following implementations will FAIL to accomplish this objective? A. Option P with parameters passed by value B. Option F with parameters passed by value C. Option P with parameters passed by reference D. Option F with parameters passed by reference E. Option P with parameters passed by name Solution 30. It is easy to see that Option P must be able to change h globally and thus needs its parameter h to come by reference or pointer or name BUT not by value. Hence the answer is choice A. Question 31. An XY flip-flop operates an indicated by the following table. Inputs Current State Next State X Y 0 0 Q Q Not(Q) 1 1 Q Q Q Which of the following expresses the next state in terms of the X and Y inputs and the current state Q? A. ( X Q) (Ȳ Q) B. ( X Q) (Ȳ Q) C. (X Q) (Y Q) D. (X Q) (Ȳ Q) E. (X Q) (Ȳ Q) Solution

23 Tracing choice A shows that it fulfils the requirement hence the answer is choice A. Question 32. A black-and-white computer graphics display is divided up into an array of pixels as shown below. pixel Each of the pixels can take on one of the eight gray levels ranging from 0 (white) to 7 (black). In order to prevent sharp discontinuities of shade, the software system that causes pictures to be displayed enforces the rule that the gray levels of two adjacent pixels can not differ by more than two. How many of the 64 possible assignments of gray levels to two adjacent pixels satisfy this rule? A. 24 B. 32 C. 34 D. 40 E. 64 Solution 32. Consider two adjacent pixels and let the gray levels of these pixels be x and y. We need to find the cardinality of the set of all (x, y) such that x, y {0, 1, 2,...7} and x y 2. We see that If y {2, 3, 4, 5} then x can take five different values ranging from y-2 to y+2. If y {0, 7} then x can take three different values ranging from y to y 2. If y {1, 6} then x can take four different values. (why?) Hence there are 4 * * * 4 = 34 possibilities all in all. Thus the answer is choice C. Question 33. A doubly linked list is declared as Element = record Value : integer; Fwd, Bwd : Element; end; Where Fwd and Bwd represent forward and backward links to adjacent elements of the list. 22

24 Which of the following segments of code deletes the element pointed to by X from the doubly linked list, if it is assumed that X points to neither the first nor the last element of the list? A. X.Bwd.F wd := X.F wd; X.F wd.bwd := X.Bwd B. X.Bwd.F wd := X.Bwd; X.F wd.bwd := X.F wd C. X.Bwd.Bwd := X.F wd; X.F wd.f wd := X.Bwd D. X.Bwd.Bwd := X.Bwd; X.F wd.f wd := X.F wd E. X.Bwd := X.F wd; X.F wd := X.Bwd Solution 33. Let the element just before x be y and that just after be z. In order to link y to z, we need x.bwd.f wd := x.f wd and in order to link z to y, we need x.f wd.bwd := x.bwd. Hence the answer is A. Question 34. Processes P 1 and P 2 have a producer-consumer relationship, communicating by the use of a set of shared buffers. P1 : repeat forever obtain an empty buffer fill it return a full buffer P2 : repeat obtain a full buffer empty it return an empty buffer forever Increasing the number of buffers is likely to do which of the following? I. Increase the rate at which requests are satisfied (throughput) II. Decrease the likelihood of deadlock III. Increase the ease of achieving a correct implementation A. I only B. II only C. III only D. II and III only E. I, II and III 23

25 Solution 34. Increasing the memory size increases the rate at which requests are satisfied but can not alter the possibility of deadlock and neither does it play any role in implementation. Hence the only correct statement is I, thus the answer is A. Question 35. Which of the following instruction-set features is NOT generally considered an obstacle to aggressive pipelining of an integer unit? A. Condition codes set by every instruction B. variable-length encoding of instructions C. Instructions requiring widely varying numbers of cycles to execute D. Several different classes (sets) of registers E. Instructions that read several arguments from memory Solution 35. Not answered! Question 36.[Questions refer to the code below] Consider an implementation of an abstract type set of integers by a concrete type IntSet defined as follows. type IntSet = record Last : 0..Max V : array[1..max] of integer end; The add element operation on an object S is implemented by storing the value of the element in S.V [S.Last + 1] and incrementing S.Last, unless Last = Max, in which case an error flag is raised. Note that duplicate values may appear in an object s concrete representation but are hidden in its abstract representation. Let A be the representation function from IntSet into set of integers such that, for each concrete object S of type IntSet, A(S) is the set of integers represented by S. A(S) can be written as A. {i i 1..S.Last} B. {i i S.Last..S.Max} C. {S.V [i] i 1..S.Last} 24

26 D. {S.V [i] i 1..Max} E. {S.V [i] i 1..S.V [S.Last]} Solution 36. The integers represented by S are the S[V [i]] values as i runs on the populated indices which are 1 through S.last. Hence the answer is choice C. Question 37. An advantage of choosing this implementation of set of integers is that adding an element to a set is a contact time operation. Which of the following is a disadvantage of this implementation? A. Adding elements to a very small sets could cause error flags to be raised. B. Deleting elements from very large sets could cause error flags to be raised. C. Determining whether a set is empty will require nonconstant time. D. Constructing the union of two sets will require quadratic time in the size of the set being constructed. E. Deleting an element from a set will require exponential time in the size of the set from which the element is deleted. Solution 37. Since duplicate values are stored in the array, we see that a small set with repeated elements can fill the array in which case adding element will cause error flags. Hence the answer is choice A. Question 38. The following code fragment mutates concrete IntSet objects. Procedure P(var S : IntSet, x : integer); begin end var k : integer; k := 1; while k <= S.Last do begin end if S.V[k] = x then begin end else S.V[k] := S.V[S.Last]; S.Last := S.Last - 1; k := k + 1; Which of the following abstract operations of set of integers does P implement? A. Add x to S 25

27 B. Delete x from S C. Intersect {x} and S D. Union {x} and S E. Make a copy of S Solution 38. It can be easily seen that the procedure deletes all instances of an element x from the array. Hence the answer is choice B. Note also why else is needed to increment k. If the else was not there i.e., if k was incremented without testing for else statement then problem would arise if we have S.V [S.last] equal to x as it wouldn t be deleted. Question 39. To compute the matrix product M 1 M 2, where M 1 2 has p rows and q columns and where M 2 has q rows and r columns, takes time proportional to pqr, and the result is a matrix of p rows and r columns. Consider the product of three matrices N 1 N 2 N 3 that have, respectively, w rows and x columns, x rows and y columns, and y rows and z columns. Under what condition will it take less time to compute the product as (N 1 N 2 )N 3 (.i.e., multiply the first two first) than to compute it as N 1 (N 2 N 3 )? A. There is no such condition; i.e., they will always take the same time B. 1 x + 1 z < 1 w + 1 y C. x > y D. 1 w + 1 x < 1 y + 1 z E. w + x > y + z Solution 39. The product (N 1 N 2 )N 3 takes time proportional to wxy + wyz. While the product N 1 (N 2 N 3 ) takes time proportional to wxz + xyz. Thus have the former takes less time than the later, we must have wxy + wyz < wxz + xyz. Since all x, y, z, w are 1 non negative, multiplying by xyzw, we find that 1 z + 1 x < 1 y + 1 w. Hence the answer is choice A. Question 40. Which of the following is usually NOT represented in a subroutine s activation record frame for a stack-based programming language? A. Values of local variables B. A heap area 26

28 C. The return address D. Stack pointer for the calling activation record E. Information needed to access nonlocal variables Solution 40. Values of local variables are sent to a stack, return address is also sent to stack, also information need to access non-local variables is sent to the stack as the stack is the only way to communicate to the external world, finally a stack pointer for the calling activation record is also needed to be kept in the stack as it is the only way to get back of the subroutine. But heap is not needed in stack based languages. Hence the answer is choice B. Question 41. Let A be a finite nonempty set with cardinality n. The number of subsets S A having odd cardinality is A. n B. 2 n 2 C. 2 n 1 D. 2 n E. not determinable except in terms of whether n is even or odd Solution 41. Recall that a set of n elements has a total of 2 n subsets. This number is even. Therefore, it seems reasonable to guess that half of these subsets have even cardinality and the remaining half have odd cardinality. One may also prove that indeed it the case, for n > 0, by using mathematical induction. For n = 1, we have two subsets: the empty set (even cardinality) and the set itself (odd cardinality). Assume it holds for a set of n elements. Now we deduce, that this implies the relation holds for a set of n + 1 elements as well. As such denote a set of n + 1 elements by a set of n elements union with a set of one element. The subsets of the set of n+1 elements are therefore all the subsets of the set of n elements plus the same subsets with one more element (the extra element). Since, by induction assumption, the set of n elements has 2 n 1 odd cardinality subsets and 2 n 1 even cardinality subsets, it follows that when one element is added to the subsets, all those with even cardinality will have odd cardinality and viceversa. Thus the set of n + 1 elements has in total 2 n n 1 odd cardinality subsets. This gives 2 n subsets, proving the result. Thus the answer is choice C. 27

29 Question 42. A certain algorithm A has been shown to have a running time O(N 2.5 ), where N is the size of the input. Which of the following is NOT true about algorithm A? A. C1,C 2 such that for all N the running time is less than C 1N C 2 seconds B. N, there may be some inputs for which the running time is less than N 2.4 seconds C. N, there may be some inputs for which the running time is less than N 2.6 seconds D. N, there may be some inputs for which the running time is more than N 2.4 seconds E. N, there may be some inputs for which the running time is more than N 2.6 seconds Solution 42. Since the complexity O(N 2.5 ), by definition, denotes the upper bound, there is no input instance whose complexity should be above this upper bound. Hence the answer is choice E. Question 43. A data structure is comprised of nodes each of which has exactly two pointers to other nodes, with no null pointers. The following C program is to be used to count the number of nodes accessible from a given node. It uses a mark field, assumed to be initially zero for all nodes. There is a statement missing from this code. struct test {int info, mark; struct test *p, *q;} int nodecount(struct test *a) { if (a->mark) return 0; return nodecount(a->p) + nodecount(a->q) + 1; } Which statement should be made to make the program work properly? A. Add a->mark = 1; as the first statement. B. Add a->mark = 1; after the if statement. C. Add a->mark = 1; as the last statement. D. Add a->mark = 0; after the if statement. E. Add a->mark = 0; as the last statement. Solution 43. Since the topology or the structure is not given, it might be possible to come back to a node which was already visited through the pointers p and q. Hence to avoid 28

30 counting again, every visited node should be marked by setting its mark field to 1. This is done just before recursively calling the function. Hence the answer is choice B. Question 44. Of the following, which best characterizes computers that use memory-mapped I/O? A. The computer provides special instructions for manipulating I/O ports. B. I/O ports are placed at addresses on the bus and are accessed just like other memory locations. C. To perform an I/O operation, it is sufficient to place the data in an address register and call the channel to perform the operation. D. Ports are referenced only by memory-mapped instructions of the computer and are located at hardwired memory locations. E. I/O can be performed only when memory management hardware is turned on. Solution 44. In memory-mapped I/O, the ports are assigned memory locations and any input/output operation is done just on those memory locations. Hence the answer is choice B. This reminds me my project which dealt specifically with this concept ( weldesel). Question 45. Questions are based on the graph below, which shows measured values of throughput versus multiprogramming level for a particular computer system. ( Throughput is defined as the rate at which requests are satisfied; multiprogramming level is the number of requests competing for system resources.) At lower multiprogramming levels, throughput increases as multiprogramming level increases. This phenomenon is best explained by the fact that as multiprogramming 29

31 level increases A. the system overhead increases B. some system resources begins to saturate (i.e., to be utilized 100%) C. I/O activities per request remains constant D. the average time spent in the system by each request increases E. the potential for concurrent activity among system resources increases Solution 45. At lower multiprogramming levels, the throughput increases because the potential of concurrent activity among system resources increases. Of course system overhead and saturation of resources also increase but these are not the causes for increasing throughput. Hence the answer is choice E. Question 46. At intermediate multiprogramming levels, the rate of increase of throughput with multiprogramming levels decreases. This phenomenon is best explained by the fact that as multiprogramming level increases A. I/O activities per request remains constant B. some system resources begins to saturate (i.e., to be utilized 100%) C. the utilization of memory improves D. the average time spent in the system by each request increases E. the potential for concurrent activity among system resources increases Solution 46. At higher levels of multiprogramming, some resources get saturated. But it is not necessarily true that the average time spent by requests increases. It is true for some requests but not necessarily for all. Hence the answer is choice B. Question 47. If Tree 1 and Tree 2 are the trees indicated below, 30

32 Tree 1 A B C D E F G H I J Tree2 G E I J H F C A D B which traversals of Tree 1 and Tree 2, respectively, will produce the same sequence of node names? A. Preorder, postorder B. Postorder, inorder C. Postorder, postorder D. Inorder, inorder E. Postorder, preorder Solution 47. The only thing to remember here is Pre-order traverses Node, Left, Right; Postorder traverses Left, Right, Node; and In-order traverses Left, Node, Right. Hence we find that the answer is choice B. Question 48. Let A be a finite set with m elements, and let B be a finite set with n elements. The number of distinct functions mapping A into B is A. n m B. C. n! D. n! (n m)! n! (m!(n m)! E. 2 n+m Solution 48. Take one element from set A. It can be mapped to any of the n elements of set B. The same applies to all the elements of set A. Hence there are n n n... n mappings. This gives n m ways. Hence the answer is choice A. 31

33 Question 49. S as b The parsing automaton below is for the context free grammar with the productions indicated above. Each state includes certain items, which are productions with dots in their right sides. The parser using this automaton, with X1X2...Xn on the stack, reduces by production A? if and only if there is a path, labeled X1X2...Xn from the start state to a state that includes the item A?. (note the dot at the right end). Which of the following stack contents causes the parser to reduce by some production? A. a B. aa C. bb D. aas E. ɛ Solution 49. Label the states, starting from top left going clockwise direction, by 1, 2, 3 and 4. Observe that the parser reduces as required only in the states 3 and 4. Now, if the stack contents are either a or aa, then we end up in state 2 hence the parser does not reduce as required. If the stack content is bb then the machine will hang as the second b will create ambiguity. The empty string will end at state 1 hence no reduction again. If the stack content is aas, then the first a will take the machine to state 2, the second a will keep it in state 2 and the S will take it to state 3 which includes the item S as. which is the required criteria for reduction. Thus the parser reduces as required. Hence the answer is choice D. 32

34 Question 50. Let k 2. Let L be the set of strings in {0, 1} such that x L if and only if the number of 0 s in x is divisible by k and the number of 1 s in x is odd. The minimum number of states in a deterministic finite automaton (DFA) that recognizes L is A. k + 2 B. 2k C. klogk D. k 2 E. 2 k Solution 50. I really don t know the answer to this question. I have never come across such a question. But we can try some trial and error tricks. Let s take a particular k and try to find a DFA with minimum number of states that fulfils the requirement. To that end, we may pick k = 2. However, problem will arise as all the choices (k + 2, 2k, k 2, and 2 k ) will evaluate to the same value for k = 2. So we better kick off k = 3. In order to see how many states we need to construct a DFA that recognizes strings over {0, 1} with odd number of ones and a multiple of 3 zeros, we proceed as follows: Obviously we must have a start state. Denote it by S Start. With a one, we must go to a final state, hence there should be a second state which is a final state. Denote it by S F inal. At this step, if a one comes we may go back to the start state so as to ensure that with an odd number of ones, we can always come from the start state to the final state. Hence, our next job should be to ensure that we are at the start state if and only if we have already traced a multiple of 3 zeros. So, suppose that we encounter a zero, when we are at the start state; what should be done? Obviously we can not go to the final state; neither can we stay in the start state. Hence we should have another state, denote it by S 1, to which we should make a transition. If another zero is encountered when we are in state S 1, then we should make a transition to non of the aforementioned states. Hence there should be yet another state, denote it by S 2 to which we should make a transition. Once we are in state 2, if a zero is encountered, we can transit to the start state because we have made a multiple of 3 zeros in total after which the start state can take us to the final state with odd number of ones. So far so good with FOUR states. But what should be done if a one is encountered when we are in state S 1? We can go to none of the states again. Hence we need to add a state, call it S 3 which will bring us back to S 1 if a one is encountered again. The same applies to state S 2 which must go to a new state, call it S 4, whenever a one is encountered and will come back to S 2 if a one is encountered again. This means we will arrive in state S 1 after 3x + 1 (for some integer x) zero and even number of ones, in state S 2 after 3x + 2 zeros and 33

2) Write in detail the issues in the design of code generator.

2) Write in detail the issues in the design of code generator. COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage

More information

DATA STRUCTURES USING C

DATA STRUCTURES USING C DATA STRUCTURES USING C QUESTION BANK UNIT I 1. Define data. 2. Define Entity. 3. Define information. 4. Define Array. 5. Define data structure. 6. Give any two applications of data structures. 7. Give

More information

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The

More information

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

More information

5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes. 1. The advantage of.. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists. [A] Lists [B] Linked Lists [A] Trees [A] Queues 2. The

More information

Data Structure [Question Bank]

Data Structure [Question Bank] Unit I (Analysis of Algorithms) 1. What are algorithms and how they are useful? 2. Describe the factor on best algorithms depends on? 3. Differentiate: Correct & Incorrect Algorithms? 4. Write short note:

More information

Data Structure with C

Data Structure with C Subject: Data Structure with C Topic : Tree Tree A tree is a set of nodes that either:is empty or has a designated node, called the root, from which hierarchically descend zero or more subtrees, which

More information

The following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2).

The following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2). CHAPTER 5 The Tree Data Model There are many situations in which information has a hierarchical or nested structure like that found in family trees or organization charts. The abstraction that models hierarchical

More information

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test Math Review for the Quantitative Reasoning Measure of the GRE revised General Test www.ets.org Overview This Math Review will familiarize you with the mathematical skills and concepts that are important

More information

[Refer Slide Time: 05:10]

[Refer Slide Time: 05:10] Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture

More information

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

More information

Binary Trees and Huffman Encoding Binary Search Trees

Binary Trees and Huffman Encoding Binary Search Trees Binary Trees and Huffman Encoding Binary Search Trees Computer Science E119 Harvard Extension School Fall 2012 David G. Sullivan, Ph.D. Motivation: Maintaining a Sorted Collection of Data A data dictionary

More information

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1. MATH10212 Linear Algebra Textbook: D. Poole, Linear Algebra: A Modern Introduction. Thompson, 2006. ISBN 0-534-40596-7. Systems of Linear Equations Definition. An n-dimensional vector is a row or a column

More information

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

More information

Questions 1 through 25 are worth 2 points each. Choose one best answer for each.

Questions 1 through 25 are worth 2 points each. Choose one best answer for each. Questions 1 through 25 are worth 2 points each. Choose one best answer for each. 1. For the singly linked list implementation of the queue, where are the enqueues and dequeues performed? c a. Enqueue in

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Fall 25 Alexis Maciel Department of Computer Science Clarkson University Copyright c 25 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

Reading 13 : Finite State Automata and Regular Expressions

Reading 13 : Finite State Automata and Regular Expressions CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

More information

root node level: internal node edge leaf node CS@VT Data Structures & Algorithms 2000-2009 McQuain

root node level: internal node edge leaf node CS@VT Data Structures & Algorithms 2000-2009 McQuain inary Trees 1 A binary tree is either empty, or it consists of a node called the root together with two binary trees called the left subtree and the right subtree of the root, which are disjoint from each

More information

Converting a Number from Decimal to Binary

Converting a Number from Decimal to Binary Converting a Number from Decimal to Binary Convert nonnegative integer in decimal format (base 10) into equivalent binary number (base 2) Rightmost bit of x Remainder of x after division by two Recursive

More information

VISUAL ALGEBRA FOR COLLEGE STUDENTS. Laurie J. Burton Western Oregon University

VISUAL ALGEBRA FOR COLLEGE STUDENTS. Laurie J. Burton Western Oregon University VISUAL ALGEBRA FOR COLLEGE STUDENTS Laurie J. Burton Western Oregon University VISUAL ALGEBRA FOR COLLEGE STUDENTS TABLE OF CONTENTS Welcome and Introduction 1 Chapter 1: INTEGERS AND INTEGER OPERATIONS

More information

Positional Numbering System

Positional Numbering System APPENDIX B Positional Numbering System A positional numbering system uses a set of symbols. The value that each symbol represents, however, depends on its face value and its place value, the value associated

More information

If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C?

If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C? Problem 3 If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C? Suggested Questions to ask students about Problem 3 The key to this question

More information

Binary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( B-S-T) are of the form. P parent. Key. Satellite data L R

Binary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( B-S-T) are of the form. P parent. Key. Satellite data L R Binary Search Trees A Generic Tree Nodes in a binary search tree ( B-S-T) are of the form P parent Key A Satellite data L R B C D E F G H I J The B-S-T has a root node which is the only node whose parent

More information

Chapter 13: Query Processing. Basic Steps in Query Processing

Chapter 13: Query Processing. Basic Steps in Query Processing Chapter 13: Query Processing! Overview! Measures of Query Cost! Selection Operation! Sorting! Join Operation! Other Operations! Evaluation of Expressions 13.1 Basic Steps in Query Processing 1. Parsing

More information

Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction

Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction Lecture 11 Dynamic Programming 11.1 Overview Dynamic Programming is a powerful technique that allows one to solve many different types of problems in time O(n 2 ) or O(n 3 ) for which a naive approach

More information

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D.

1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D. 1. The memory address of the first element of an array is called A. floor address B. foundation addressc. first address D. base address 2. The memory address of fifth element of an array can be calculated

More information

Parallelization: Binary Tree Traversal

Parallelization: Binary Tree Traversal By Aaron Weeden and Patrick Royal Shodor Education Foundation, Inc. August 2012 Introduction: According to Moore s law, the number of transistors on a computer chip doubles roughly every two years. First

More information

Glossary of Object Oriented Terms

Glossary of Object Oriented Terms Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction

More information

The Trip Scheduling Problem

The Trip Scheduling Problem The Trip Scheduling Problem Claudia Archetti Department of Quantitative Methods, University of Brescia Contrada Santa Chiara 50, 25122 Brescia, Italy Martin Savelsbergh School of Industrial and Systems

More information

10CS35: Data Structures Using C

10CS35: Data Structures Using C CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions - a conventional tool for handling a

More information

Automata and Formal Languages

Automata and Formal Languages Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,

More information

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA 90405 rkennedy@ix.netcom.

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA 90405 rkennedy@ix.netcom. Some Polynomial Theorems by John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA 90405 rkennedy@ix.netcom.com This paper contains a collection of 31 theorems, lemmas,

More information

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B KITCHENS The equation 1 Lines in two-dimensional space (1) 2x y = 3 describes a line in two-dimensional space The coefficients of x and y in the equation

More information

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

More information

CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 Solutions CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

More information

Magic Word. Possible Answers: LOOSER WINNER LOTTOS TICKET. What is the magic word?

Magic Word. Possible Answers: LOOSER WINNER LOTTOS TICKET. What is the magic word? Magic Word Question: A magic word is needed to open a box. A secret code assigns each letter of the alphabet to a unique number. The code for the magic word is written on the outside of the box. What is

More information

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by SUBGROUPS OF CYCLIC GROUPS KEITH CONRAD 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by g = {g k : k Z}. If G = g, then G itself is cyclic, with g as a generator. Examples

More information

Sample Questions Csci 1112 A. Bellaachia

Sample Questions Csci 1112 A. Bellaachia Sample Questions Csci 1112 A. Bellaachia Important Series : o S( N) 1 2 N N i N(1 N) / 2 i 1 o Sum of squares: N 2 N( N 1)(2N 1) N i for large N i 1 6 o Sum of exponents: N k 1 k N i for large N and k

More information

Notes on Factoring. MA 206 Kurt Bryan

Notes on Factoring. MA 206 Kurt Bryan The General Approach Notes on Factoring MA 26 Kurt Bryan Suppose I hand you n, a 2 digit integer and tell you that n is composite, with smallest prime factor around 5 digits. Finding a nontrivial factor

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity. 7 Catalan Numbers Thomas A. Dowling, Department of Mathematics, Ohio State Uni- Author: versity. Prerequisites: The prerequisites for this chapter are recursive definitions, basic counting principles,

More information

Memory Systems. Static Random Access Memory (SRAM) Cell

Memory Systems. Static Random Access Memory (SRAM) Cell Memory Systems This chapter begins the discussion of memory systems from the implementation of a single bit. The architecture of memory chips is then constructed using arrays of bit implementations coupled

More information

Integer Factorization using the Quadratic Sieve

Integer Factorization using the Quadratic Sieve Integer Factorization using the Quadratic Sieve Chad Seibert* Division of Science and Mathematics University of Minnesota, Morris Morris, MN 56567 seib0060@morris.umn.edu March 16, 2011 Abstract We give

More information

MACM 101 Discrete Mathematics I

MACM 101 Discrete Mathematics I MACM 101 Discrete Mathematics I Exercises on Combinatorics, Probability, Languages and Integers. Due: Tuesday, November 2th (at the beginning of the class) Reminder: the work you submit must be your own.

More information

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge, cheapest first, we had to determine whether its two endpoints

More information

CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions CS 2112 Spring 2014 Assignment 3 Data Structures and Web Filtering Due: March 4, 2014 11:59 PM Implementing spam blacklists and web filters requires matching candidate domain names and URLs very rapidly

More information

Linear Codes. Chapter 3. 3.1 Basics

Linear Codes. Chapter 3. 3.1 Basics Chapter 3 Linear Codes In order to define codes that we can encode and decode efficiently, we add more structure to the codespace. We shall be mainly interested in linear codes. A linear code of length

More information

Regular Expressions and Automata using Haskell

Regular Expressions and Automata using Haskell Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions

More information

Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC

Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC Levent EREN levent.eren@ieu.edu.tr A-306 Office Phone:488-9882 1 Number Systems Representation Positive radix, positional number systems A number with radix r is represented by a string of digits: A n

More information

You know from calculus that functions play a fundamental role in mathematics.

You know from calculus that functions play a fundamental role in mathematics. CHPTER 12 Functions You know from calculus that functions play a fundamental role in mathematics. You likely view a function as a kind of formula that describes a relationship between two (or more) quantities.

More information

Useful Number Systems

Useful Number Systems Useful Number Systems Decimal Base = 10 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Binary Base = 2 Digit Set = {0, 1} Octal Base = 8 = 2 3 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7} Hexadecimal Base = 16 = 2

More information

Approximation Algorithms

Approximation Algorithms Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms

More information

CSI 333 Lecture 1 Number Systems

CSI 333 Lecture 1 Number Systems CSI 333 Lecture 1 Number Systems 1 1 / 23 Basics of Number Systems Ref: Appendix C of Deitel & Deitel. Weighted Positional Notation: 192 = 2 10 0 + 9 10 1 + 1 10 2 General: Digit sequence : d n 1 d n 2...

More information

Polynomials. Dr. philippe B. laval Kennesaw State University. April 3, 2005

Polynomials. Dr. philippe B. laval Kennesaw State University. April 3, 2005 Polynomials Dr. philippe B. laval Kennesaw State University April 3, 2005 Abstract Handout on polynomials. The following topics are covered: Polynomial Functions End behavior Extrema Polynomial Division

More information

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 4 Nancy Lynch Today Two more models of computation: Nondeterministic Finite Automata (NFAs)

More information

6.3 Conditional Probability and Independence

6.3 Conditional Probability and Independence 222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted

More information

Symbol Tables. Introduction

Symbol Tables. Introduction Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The

More information

The Goldberg Rao Algorithm for the Maximum Flow Problem

The Goldberg Rao Algorithm for the Maximum Flow Problem The Goldberg Rao Algorithm for the Maximum Flow Problem COS 528 class notes October 18, 2006 Scribe: Dávid Papp Main idea: use of the blocking flow paradigm to achieve essentially O(min{m 2/3, n 1/2 }

More information

Exercise 4 Learning Python language fundamentals

Exercise 4 Learning Python language fundamentals Exercise 4 Learning Python language fundamentals Work with numbers Python can be used as a powerful calculator. Practicing math calculations in Python will help you not only perform these tasks, but also

More information

The Set Data Model CHAPTER 7. 7.1 What This Chapter Is About

The Set Data Model CHAPTER 7. 7.1 What This Chapter Is About CHAPTER 7 The Set Data Model The set is the most fundamental data model of mathematics. Every concept in mathematics, from trees to real numbers, is expressible as a special kind of set. In this book,

More information

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 17 Shannon-Fano-Elias Coding and Introduction to Arithmetic Coding

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithms and Data Structures Part 2: Data Structures PD Dr. rer. nat. habil. Ralf-Peter Mundani Computation in Engineering (CiE) Summer Term 2016 Overview general linked lists stacks queues trees 2 2

More information

Lecture 3: Finding integer solutions to systems of linear equations

Lecture 3: Finding integer solutions to systems of linear equations Lecture 3: Finding integer solutions to systems of linear equations Algorithmic Number Theory (Fall 2014) Rutgers University Swastik Kopparty Scribe: Abhishek Bhrushundi 1 Overview The goal of this lecture

More information

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Why? A central concept in Computer Science. Algorithms are ubiquitous. Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

More information

CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e.

CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e. CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e. This chapter contains the beginnings of the most important, and probably the most subtle, notion in mathematical analysis, i.e.,

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a

More information

Computing Cubic Fields in Quasi-Linear Time

Computing Cubic Fields in Quasi-Linear Time Computing Cubic Fields in Quasi-Linear Time K. Belabas Département de mathématiques (A2X) Université Bordeaux I 351, cours de la Libération, 33405 Talence (France) belabas@math.u-bordeaux.fr Cubic fields

More information

NUMBER SYSTEMS. William Stallings

NUMBER SYSTEMS. William Stallings NUMBER SYSTEMS William Stallings The Decimal System... The Binary System...3 Converting between Binary and Decimal...3 Integers...4 Fractions...5 Hexadecimal Notation...6 This document available at WilliamStallings.com/StudentSupport.html

More information

6.852: Distributed Algorithms Fall, 2009. Class 2

6.852: Distributed Algorithms Fall, 2009. Class 2 .8: Distributed Algorithms Fall, 009 Class Today s plan Leader election in a synchronous ring: Lower bound for comparison-based algorithms. Basic computation in general synchronous networks: Leader election

More information

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite ALGEBRA Pupils should be taught to: Generate and describe sequences As outcomes, Year 7 pupils should, for example: Use, read and write, spelling correctly: sequence, term, nth term, consecutive, rule,

More information

. 0 1 10 2 100 11 1000 3 20 1 2 3 4 5 6 7 8 9

. 0 1 10 2 100 11 1000 3 20 1 2 3 4 5 6 7 8 9 Introduction The purpose of this note is to find and study a method for determining and counting all the positive integer divisors of a positive integer Let N be a given positive integer We say d is a

More information

AP Computer Science AB Syllabus 1

AP Computer Science AB Syllabus 1 AP Computer Science AB Syllabus 1 Course Resources Java Software Solutions for AP Computer Science, J. Lewis, W. Loftus, and C. Cocking, First Edition, 2004, Prentice Hall. Video: Sorting Out Sorting,

More information

Chapter 13 File and Database Systems

Chapter 13 File and Database Systems Chapter 13 File and Database Systems Outline 13.1 Introduction 13.2 Data Hierarchy 13.3 Files 13.4 File Systems 13.4.1 Directories 13.4. Metadata 13.4. Mounting 13.5 File Organization 13.6 File Allocation

More information

Chapter 13 File and Database Systems

Chapter 13 File and Database Systems Chapter 13 File and Database Systems Outline 13.1 Introduction 13.2 Data Hierarchy 13.3 Files 13.4 File Systems 13.4.1 Directories 13.4. Metadata 13.4. Mounting 13.5 File Organization 13.6 File Allocation

More information

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92.

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) 3 4 4 7 5 9 6 16 7 8 8 4 9 8 10 4 Total 92. Name: Email ID: CSE 326, Data Structures Section: Sample Final Exam Instructions: The exam is closed book, closed notes. Unless otherwise stated, N denotes the number of elements in the data structure

More information

A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions

A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions Marcel B. Finan Arkansas Tech University c All Rights Reserved First Draft February 8, 2006 1 Contents 25

More information

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory. 1 Topics Machine Architecture and Number Systems Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Decimal to Binary Major Computer Components

More information

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook. Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

More information

Chapter 11 I/O Management and Disk Scheduling

Chapter 11 I/O Management and Disk Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ 2008, Prentice Hall I/O Devices Roadmap Organization

More information

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the

More information

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit Data Structures Page 1 of 24 A.1. Arrays (Vectors) n-element vector start address + ielementsize 0 +1 +2 +3 +4... +n-1 start address continuous memory block static, if size is known at compile time dynamic,

More information

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share. LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.

More information

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case. Algorithms Efficiency of algorithms Computational resources: time and space Best, worst and average case performance How to compare algorithms: machine-independent measure of efficiency Growth rate Complexity

More information

Quotient Rings and Field Extensions

Quotient Rings and Field Extensions Chapter 5 Quotient Rings and Field Extensions In this chapter we describe a method for producing field extension of a given field. If F is a field, then a field extension is a field K that contains F.

More information

arxiv:1112.0829v1 [math.pr] 5 Dec 2011

arxiv:1112.0829v1 [math.pr] 5 Dec 2011 How Not to Win a Million Dollars: A Counterexample to a Conjecture of L. Breiman Thomas P. Hayes arxiv:1112.0829v1 [math.pr] 5 Dec 2011 Abstract Consider a gambling game in which we are allowed to repeatedly

More information

Analysis of Algorithms, I

Analysis of Algorithms, I Analysis of Algorithms, I CSOR W4231.002 Eleni Drinea Computer Science Department Columbia University Thursday, February 26, 2015 Outline 1 Recap 2 Representing graphs 3 Breadth-first search (BFS) 4 Applications

More information

OPRE 6201 : 2. Simplex Method

OPRE 6201 : 2. Simplex Method OPRE 6201 : 2. Simplex Method 1 The Graphical Method: An Example Consider the following linear program: Max 4x 1 +3x 2 Subject to: 2x 1 +3x 2 6 (1) 3x 1 +2x 2 3 (2) 2x 2 5 (3) 2x 1 +x 2 4 (4) x 1, x 2

More information

PES Institute of Technology-BSC QUESTION BANK

PES Institute of Technology-BSC QUESTION BANK PES Institute of Technology-BSC Faculty: Mrs. R.Bharathi CS35: Data Structures Using C QUESTION BANK UNIT I -BASIC CONCEPTS 1. What is an ADT? Briefly explain the categories that classify the functions

More information

3. Mathematical Induction

3. Mathematical Induction 3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

More information

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives 6 EXTENDING ALGEBRA Chapter 6 Extending Algebra Objectives After studying this chapter you should understand techniques whereby equations of cubic degree and higher can be solved; be able to factorise

More information

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015 CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Linda Shapiro Today Registration should be done. Homework 1 due 11:59 pm next Wednesday, January 14 Review math essential

More information

PGR Computing Programming Skills

PGR Computing Programming Skills PGR Computing Programming Skills Dr. I. Hawke 2008 1 Introduction The purpose of computing is to do something faster, more efficiently and more reliably than you could as a human do it. One obvious point

More information

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Module No. # 01 Lecture No. # 05 Classic Cryptosystems (Refer Slide Time: 00:42)

More information

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics* IE 680 Special Topics in Production Systems: Networks, Routing and Logistics* Rakesh Nagi Department of Industrial Engineering University at Buffalo (SUNY) *Lecture notes from Network Flows by Ahuja, Magnanti

More information

Computer Science 217

Computer Science 217 Computer Science 217 Midterm Exam Fall 2009 October 29, 2009 Name: ID: Instructions: Neatly print your name and ID number in the spaces provided above. Pick the best answer for each multiple choice question.

More information

APPENDIX 1 USER LEVEL IMPLEMENTATION OF PPATPAN IN LINUX SYSTEM

APPENDIX 1 USER LEVEL IMPLEMENTATION OF PPATPAN IN LINUX SYSTEM 152 APPENDIX 1 USER LEVEL IMPLEMENTATION OF PPATPAN IN LINUX SYSTEM A1.1 INTRODUCTION PPATPAN is implemented in a test bed with five Linux system arranged in a multihop topology. The system is implemented

More information

Binary Heap Algorithms

Binary Heap Algorithms CS Data Structures and Algorithms Lecture Slides Wednesday, April 5, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks CHAPPELLG@member.ams.org 2005 2009 Glenn G. Chappell

More information

The Basics of Graphical Models

The Basics of Graphical Models The Basics of Graphical Models David M. Blei Columbia University October 3, 2015 Introduction These notes follow Chapter 2 of An Introduction to Probabilistic Graphical Models by Michael Jordan. Many figures

More information

Summation Algebra. x i

Summation Algebra. x i 2 Summation Algebra In the next 3 chapters, we deal with the very basic results in summation algebra, descriptive statistics, and matrix algebra that are prerequisites for the study of SEM theory. You

More information