theory quali er: spring 2010

48
Theory Qualifier: Spring 2010 120 Points Total Part I: Foundations (28 Points) Question 1 (6 Points): Given six tags numbered 1, 2, 2, 5, 5, and 6, how many distinct three-digit numbers can be formed by selecting three tags, with the additional requirement that two of the digits in the number are the same? Question 2 (6 Points): We are going to make passwords be of the form of 4 letters (all lower case) followed by n decimal digits. How big does n have to be to guarantee that there are at least 10 million (10 7 ) distinct passwords?

Upload: others

Post on 25-Apr-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Theory Quali er: Spring 2010

Theory Qualifier: Spring 2010120 Points Total

Part I: Foundations (28 Points)

Question 1 (6 Points): Given six tags numbered 1, 2, 2, 5, 5, and 6, how many distinctthree-digit numbers can be formed by selecting three tags, with the additional requirementthat two of the digits in the number are the same?

Question 2 (6 Points): We are going to make passwords be of the form of 4 letters (alllower case) followed by n decimal digits. How big does n have to be to guarantee that thereare at least 10 million (107) distinct passwords?

Page 2: Theory Quali er: Spring 2010

Question 3 (4 Points): Consider a Boolean formula f over a certain number of variables.Assume that f has the standard Boolean operators ∧ (conjunction/and), ∨ (disjunc-tion/or) and ¬ (not). Let g be any formula in Conjunctive Normal Form (CNF) that isequivalent to f (A formula is said to be in CNF if it is a conjunction of clauses where eachclause is a disjunction of literals, i.e., variables or their negations). Suppose n, m are thelengths of f and g respectively. The value of m is(a) O(2n) (b) O(n) (c) O(n2) (d) O(n3).

Question 4 (8 Points): Consider the following statement: “It is not the case that allComputer Science PhD’s are good programmers”

For each of the following, state whether it can be concluded from the above?(a) Every bad programmer has a PhD in computer science.(b) Some good programmers do not have PhD’s in computer science.(c) Some computer science PhD’s are bad programmers.(d) Having a PhD in computer science is a sufficient condition for being a bad programmer.

Question 5 (4 Points): There are two bugs in a gallon of jar. Every minute the numberof bugs doubles. If the jar is filled in 30 minutes with bugs, how long did it take for the jarto be half filled with bugs?

Page 3: Theory Quali er: Spring 2010

Part II: Data Structures and Algorithms (52 pts)

Question 1 (20 Points): Briefly describe an efficient algorithm for checking whether agiven undirected graph is bipartite or not. What is the complexity of the algorithm? (Anundirected graph G = (V, E) is bipartite if its vertex set V can be partitioned in to twodisjoint sets V1, V2 such that all the edges in E connect some vertex in V1 with some othervertex in V2.) (Hint: Use one of the standard graph traversal algorithms)

Page 4: Theory Quali er: Spring 2010

Question 2 (10 Points): Answer True or False or chose not to answer. A correctanswer to each question fetches 2 points, a wrong answer feteches −2 points and a no answerfetches 0 points.

T F If an algorithm runs O(n) on the worst case input then it runs O(n) on everyinput.

T F If two algorithms both run in Θ(n2) time then they will take exactly the sameamount of time to run on any input.

T F If a language X is polynomial time reducible to language Y and X is in P,then Y is also in P. (Note that P is the class of languages for which there isan algorithm of polynomial time complexity that decides the language).

T F A divide-and-conquer algorithm can always be written as a recursive algorithm.

T F All sorting algorithms must make at least one comparison between two inputelements.

Question 3 (4 Points): The FUBAR problem is a new decision problem that you havejust begun to study. So far you have been able to show the following two things about theFUBAR problem:

• There is a polynomial-time reduction from the Satisfiability problem (“Is a givenBoolean formula satisfiable?”) to the FUBAR problem.

• You have a non-deterministic method that solves the FUBAR problem and that neverconsumes more than a polynomial amount of space.

What do you know for sure about the FUBAR problem given current knowledge? (Recallthat NP and P are the classes of problems solvable in non-deterministic polynomial time,and in deterministic polynomial time, respectively)

(a) It is NP complete(b) It is in the complexity class NP(c) It is NP-hard(d) It is not in P.

Page 5: Theory Quali er: Spring 2010

Question 4 (18 Points): Devise a dynamic programming based algorithm, of time com-plexity O(n3), for finding a longest common sub-sequence between three sequences

A = 〈a1, a2, ..., ak〉,B = 〈b1, b2, ..., bl〉,C = 〈c1, c2, ..., cm〉,where n = k + l + m(Note that u is a sub-sequence of s if elements of u occur in s in the same order as in u,

but they need not occur consecutively).

Page 6: Theory Quali er: Spring 2010

Part III: Theory of Computation (40 pts)

Answer either question 1 or question 2, and question 3

Question 1 (25 Points): Write down a CFG for the following language:

L = {w ∈ {a ∪ b}∗ | w has at least as many a’s as b’s}

Note that the strings in L may contain the a’s and b’s in arbitrary order.Briefly provide a justification for your answer.

Page 7: Theory Quali er: Spring 2010

Question 2 (25 Points): For any integer k > 0, give the construction ofa non-deterministic finite state automaton, with minimum number of states,that accepts exactly those strings over the alphabet {0, 1} that have 1 in thekth position from the end (Note that the last symbol is at position 1 fromthe end). What is minimum number of states of a deterministic automatonrecognizing the same language?

Page 8: Theory Quali er: Spring 2010

Question 3 (15 Points): By <M> we denote the encoding of a machineM . Let L′ be some given regular language (and thus accepted by a DFA).Let L be the following language:

L = {<M> | M is a DFA and M does not accept any string in L′}

Show that L is decidable. In other words, you need to design a TuringMachine (TM) of the following type. The TM takes (the encoding of) anyDFA M as input. It accepts and halts if the DFA does not accept any stringin L′; otherwise, it rejects and halts. There is no need to give too muchdetails of a Turing machine; a very high level description is fine. If you need,you may assume the following:

• The intersection of two DFA’s is a DFA and it is possible to design aTM to compute the intersection.

• It is possible to design a TM that can decide if a given DFA accepts theempty set or not.

Page 9: Theory Quali er: Spring 2010

Spring 2010 Quals: Software Systems

Instructions:

1. Please do not write your name or ID number in your answer booklet.

2. Choose any three areas among the following four areas: Programming Languages, Compiler Design,Software Engineering and Databases. (You are free to attempt all 4 areas, from which we will choosethe best 3 scores).

Page 10: Theory Quali er: Spring 2010
Page 11: Theory Quali er: Spring 2010

Programming Languages

Instructions:

1. Please do not write your name or ID number.

2. Answer all questions.

Points Table:

Question Points Score

1 24

2 10

3 16

Total: 50

Page 2

Page 12: Theory Quali er: Spring 2010

1. (24 points) Define the following two concepts:

1. scope of an identifier

2. lifetime (or extent) of an object

Now consider the following three kinds of identifiers. For each kind of identifier, define (1) the scopethat identifier and (2) the lifetime of the object bound to that identifier:

1. An identifier denoting a parameter either of a function foobar() in C/C++ or, equivalently, of aJava method mem1().

2. An identifier denoting a static field x in a Java class Class1 (or, equivalently, a static data memberx in a C++ class Class1 ).

3. A file-scope identifier y (i.e., an identifier defined in a file, but not within a function, method orclass) in either C or C++.

2. (10 points) In object-oriented languages, such as Java, messages roughly correspond to function calls instructured languages, such as ANSI C. Please answer the questions below about messages and functioncalls.

1. What are the similarities and differences between messages and function calls?

2. How are function calls typically implemented by programming languages? How are messages typi-cally implemented by programming languages supporting messages?

3. (16 points) Define the concept of recursion in programming languages. What is an advantage and adisadvantage of recursion?

Using your favorite programming language with recursion (e.g., C, C++, Java, and LISP) write arecursive function list for listing all the values stored a binary search tree (BST). Assume that each treenode stores an integer value. Function list takes as input a BST and lists (i.e., outputs) all the valuesstored in the tree. You may choose pre-order, in-order or post-order for listing tree nodes; however, youshould state explicitly which strategy you chose. (Hint: Recall that a BST is organized as follows. First,an integer value is associated with each node. Second, each node can have at most two children, a leftchild and a right child. Third, given a node n, the values of all nodes in the left subtree of n are lessthan the value of n, and the values of all nodes in the right subtree of n are greater than the value of n.)

Page 3

Page 13: Theory Quali er: Spring 2010

Compiler Design

Instructions:

1. Please do not write your name or ID number.

2. Answer all questions.

Points Table:

Question Points Score

4 20

5 10

6 20

Total: 50

Page 4

Page 14: Theory Quali er: Spring 2010

Notes:

• There are three questions, numbered 4 through 6.

• For all the questions below, give precise answers. Do not produce verbose answers that are difficultto grade. In most cases, short answers in bullet lists will be preferred.

• The exam is for 50 points and you are expected to spend about 50 minutes for this section. Planto spend approximately one minute for each point.

4. Assume that you have a C program P. It is possible to reformat P to a program P’. This reformattingperforms a variety of changes that include the following., adding or deleting spaces tabs or line breaks;systematically re-ordering variables (e.g., sum to total), re-ordering the definition of variables andfunctions, splitting a source file into several files, merging several source files into one.

Although P and P’ may look different, they are in fact equivalent.

(a) (10 points) How could a C compiler be modified to compare two programs and detect if they areequivalent (or very similar)? Describe your changes to various parts of the compiler precisely.

(b) (2 points) Give two practical instances in which the modified compiler tool will be useful.

(c) (8 points) Describe two transformations that would change an arbitrary program P to a programP’, such that P and P’ are equivalent, but cannot be detected by the tool in Part (a) above.

5. (10 points) Consider a language C-Strict that adds one additional restriction on C programs. In a C-Strict program, variables can never be uninitialized. Every variable declared in C-Strict is considereduninitialized first when it is declared. Subsequently, a variable must be given a value in an assignmentstatement when it is considered initialized. An uninitialized variable can never occur in an expressionor print statement. All C programs that satisfy this restriction are considered to be part of C-strict.

Given a compiler for C, how will you modify it to produce a compiler for C-strict? Specifically, whatphase(s) of the compiler will change? What changes will be required to this phase? Explain the ideasthat will enable you to implement these changes.

6. Consider the following language L of arithmetic infix expressions involving identifiers (represented byid, numbers (represented by num), the operators +, * and parenthesis (). Examples of strings in thislanguage are id + id, id * (id + id), id * num, (num + num) * id and so on.

The precedence of the operators *, + , () are as usual. The + operator has the lowest precedence,followed by * , which is followed by () which has the highest precedence.

(a) (15 points) Give a context free grammar for L. Your grammar must structure the parse trees suchthat they respect the above precedence. Your grammar could associate expressions either left orright.(Hint: start with a grammar for just * and () with numbers and literals, and then add the +).

(b) (5 points) Show the leftmost derivation of the string id + id *id using the grammar of part (a).

Page 5

Page 15: Theory Quali er: Spring 2010

Software Engineering

Instructions:

1. Please do not write your name or ID number.

2. Answer all questions.

Points Table:

Question Points Score

7 20

8 15

9 15

Total: 50

Page 6

Page 16: Theory Quali er: Spring 2010

7. (20 points) This question is on proving the correctness of a program. Consider the following programwhich takes one input integer argument x and computes blog xc in the variable i.

A loop invariant of a while loop, is a condition, on the variables, that holds when ever the control is atthe while loop, i.e., this condition holds when the “while” statement is encountered for the first timeand holds subsequently after each iteration.

i := 0;y := 1;while y < x

y := 2× y;i := i + 1;

end of while

1. Identify all the following conditions that are loop invariants of the while loop in the above program,assuming that x > 0. Note ∧ is the conjunction operation.(a) y ≤ x (b) 0 < y < 2x ∧ i = log y (c) y < x ∧ i ≥ 0 (d) 0 < y < 2x (e) false.

2. Assuming that x > 0, which of the loop invariants, identified above, can be used to prove that theprogram computes blog(x)c in the variable i after it terminates?

3. Obtain as a function of x, the maximum number of iterations with in which the loop of the programterminates. This function should be as tight as possible. Briefly argue that the loop terminateswith in that many iteraions.

8. (15 points) Define the concept of Non-Functional Requirement (NFR). How are NFRs different fromfunctional requirements? Name and discuss at least 4 kinds of requirements that are typically consideredNFRs.

9. This question is about software testing.

(a) (7 points) Define the concepts of unit, integration and system testing. How is each kind of testingtypically conducted?

(b) (8 points) Now discuss at lest two different strategies for conducting integration testing.

Page 7

Page 17: Theory Quali er: Spring 2010

Database Systems

Instructions:

1. Please do not write your name or ID number.

2. Answer all questions.

Points Table:

Question Points Score

10 15

11 15

12 20

Total: 50

Page 8

Page 18: Theory Quali er: Spring 2010

10. Given the relational schema R = {A, B, C,D, E}, where A, B,C, D and E are attributes of R and thefollowing functional dependencies:

A→ BC; CD → E; B → D; E → A

(a) (10 points) Compute all functional dependencies which hold in this relational schema. Show yourderivations step by step.

(b) (5 points) Find all candidate keys of this relational schema.

11. (15 points) A transaction can contain a set of items (e.g., {milk, bread, coffee}). Devise an algorithmto find the frequently occurring sets of items in the transaction database, where a frequently occurringitem set is an item set whose number of occurrences among the transactions exceeds a given threshold.For example, if the item set {milk, bread} occurs in 50 transactions and the threshold is 40, then {milk,bread} is considered to be a frequent item set. When designing the algorithm, you should assume thatthe transaction database cannot be contained in primary memory, and that the number of distinct itemsis in the order of millions. There is no repeated occurrence of an item in a transaction, that is, there isno occurrence {milk, milk, bread}, and the transaction size is small (say less than 10).

12. (a) (5 points) Explain the notion of serializability.

(b) (5 points) Is there a polynomial-time algorithm that determines whether or not a given schedule oftransactions is view-serializable? Explain your answer.

(c) (5 points) What protocols that ensure serializability are you familiar with? Briefly describe eachone.

(d) (5 points) Describe the tree protocol for concurrency control. What are its advantages and disad-vantages compared to two-phase-locking?

Page 9

Page 19: Theory Quali er: Spring 2010

Human-Centered Computing Area Exam – Winter 2010

HCC Exam Instructions The Human-Centered Computing Exam consists of three areas:

Artificial Intelligence (AI) Computer Graphics (CG) Human Computer Interaction (HCI)

To pass this exam you need to show competence In two of the three areas. Please answer each area in a separate booklet.

Page 20: Theory Quali er: Spring 2010
Page 21: Theory Quali er: Spring 2010

Human-Centered Computing Area Exam – Winter 2010

Exam for Artificial Intelligence Notes:

1. The expectation is that you solve 4 questions out of 5, i.e., you aim at a score of 100 points. You can of course solve 5 questions if you wish. If you do, only the 4 best scores will be used to compute your total.

2. Please provide concise, clear explanations every time you are asked for one.

3. If you are in doubt about what a question means (hopefully you won’t) clearly state your assumptions.

AI Question 1 – Search (25 points): In best-first search, what are the similarities and differences between greedy best-first search and A* search? Can you think of an A* search that is guaranteed to work for any search problem? Do you consider Dijkstra’s Algorithm (shortest path) a greedy best-first search or an A* search algorithm, and why?

AI Question 2 – Logic 1 (25 points)

1. (10 points) Consider the sentence White bears live at the North Pole. Consider one possible representation:

∀x WhiteBear(x) ⇒ Live(x,NorthPole)

What is wrong, and why, with using the predicate WhiteBear(x) to represent this sentence?

2. (15 points) Represent the following sentence in First Order Logic – don’t

overlook “only” in “only one”:

Only one student who took CS101 passed it

Page 22: Theory Quali er: Spring 2010

Human-Centered Computing Area Exam – Winter 2010

AI Question 3 – Logic 2 (25 points) Suppose we put into a logical database a segment of the US census data listing the age and city of residence for every person, using their social security number as the identifying constant for each person. i.e., for George (445-53-3218) and Mary (745-73-3227) we would have: Age(445-53-3218,35) Resides(445-53-3218,Chicago) Age(745-73-3227,18) Resides(745-73-3227,OakPark) Note that the association between SSN and Name is kept elsewhere. Assuming normal backward chaining, consider the following indexing schemes S1-S3 and the queries Q1-Q3 below. Explain for which of those queries, if any, each indexing scheme enables an efficient solution. S1: an index for each first argument S2: an index for each predicate atom (i.e., ground clause) S3: an index for each combination of predicate and first argument Q1: Age(445-53-3218, x) Q2: Resides(x,Wilmette) Q3: Age(x,35) AND Resides(x,Chicago) Note: the question is not asking you to build 9 backchaining proofs! but to explain why indexing schemes may or may not work, given the way backchaining works.

Page 23: Theory Quali er: Spring 2010

Human-Centered Computing Area Exam – Winter 2010

AI Question 4 – Planning (25 points): We will help a little robot, called Shakey, get hold of a box sitting on a high shelf (this exercise is inspired by the first robot to use planning).

1. (20 points) Use the operators and initial and final states described on the next page to build a partial order plan that represents how Shakey can get hold of Box2. Lowercase arguments are variables, capitalized arguments are constants. Note that At(x,b) means that x is close to b distance wise but not necessarily height wise, i.e., initially Shakey is close to Box2 but not as high.

You only need to represent the final plan, not all the intermediate stages of planning.

Clearly mark causal links and temporal links, and for each link, where it starts and ends.

2. (5 points) The operator ClimbOn(x,b,c) does not appeal to our intuition of

what climbing on an object means. Why? What’s the purpose of writing it this way?

Page 24: Theory Quali er: Spring 2010

Human-Centered Computing Area Exam – Winter 2010

AI Question 5 – Learning (25 points): Given the following dataset with two classes, yes and no, we have already selected the root node to be the attribute “Age” for our decision tree. Can you use the information gain criterion to compute the gain value for attribute “Own_House” for the tree branch Age = middle. Give the detailed computation.

Page 25: Theory Quali er: Spring 2010

Human-Centered Computing Area Exam – Winter 2010

Exam for Computer Graphics CG Question 1 – 33 points: To the right is a picture of a flat shaded sphere.

1. Explain what flat shading means. 2. Explain two ways in which the sphere

can be made to appear less segmented / more “spherical”.

CG Question 2 – 33 points: Give and explain the illumination equation for lighting that includes ambient light, diffuse reflection, and specular reflection, and the three reflection coefficients. Include three diagrams, one for ambient, one for diffuse, and one for specular, to explain the various vectors and angles involved in the equation, and to highlight the differences between the three illumination models. CG Question 3 – 33 points: A Perspective projection that uses a canonical viewing volume involves a number of matrix operations performed on the data points. Draw a diagram to help explain your answers. 1) How must the canonical viewing volume matrix [Nper] affect the data points

[Di] so that we can use the perspective projection matrix [Mper]. [given in the book] [7pts]

Where Pi = Nper * Mper * Di where Pi is the result from the perspective transform all data point; all points are in homogeneous coordinates.

2) List the series of matrix operations that are necessary and in what order must they be applied to form the canonical viewing volume matrix. [6pts]

3) Explain what each of the matrix operations do and how they affect the vertices in the original database. [10pts]

4) List all the parameters used in developing a canonical viewing volume matrix and explain what each of them represent. [10pts]

kenyon
Cross-Out
Page 26: Theory Quali er: Spring 2010
Page 27: Theory Quali er: Spring 2010

Human-Centered Computing Area Exam – Winter 2010

Exam for Human Computer Interaction

HCI Question 1 – 50 points: A company has developed a word processing application, WiggleWord, for a new tablet computer that accepts multi-touch finger inputs, much like an iPhone. In other words, users are expected to use their fingers to provide all inputs to the 10 inch by 8 inch device, even using an on-screen keyboard to type. The company has developed a completely new way for users to create tables in their WiggleWord application. To create a table, one needs to specify the number of rows and columns. Here is an example table with 2 rows and 4 columns:

Cell 1 This is row 1 This is column 4 This is column 5 This is row 2 This is column 3

The old version of the word processing software, OldWord, was intended to be used with standard desktop computer keyboard and mouse peripherals, and asked users to create tables by using pop-up configuration menus, which asked users to specify the number of rows and columns in a table:

On the left: the OldWord method of creating a table. On the right, top: the finger-drawn input to WiggleWord, which gets automatically converted into a table (right, bottom image). WiggleWord will allow users to specify the number of rows and columns by drawing tables directly on the screen with their fingertips – these finger “sketches” will then be automatically converted into tables (see image at right, bottom). The WiggleWord user interface designer wanted to discover if creating tables in WiggleWord is as easy as creating tables as OldWord. To test this, the designer wanted to find test subjects who had never used either OldWord or WiggleWord to create an 8 row by 5 column table in OldWord, and then to create an 8 row by 5 column table in WiggleWord. Because OldWord was such a popular application, the designer could only find 5 subjects who had never used OldWord before. The designer first gave the 5 subjects a survey that asked them which interface they preferred. Then the designer recorded how long each person took to make a table in each version of the software. None of the subjects knew how to trigger the popup table menu in OldWord, so the designer had to give them step-by-step instructions during the experiment. When examining the survey results, the designer found that 3 of the 5 subjects preferred the OldWord software. When looking at the timing data, the designer found that all of the subjects took more time to make the table in OldWord. Because of the contradiction, the designer couldn’t decide if OldWord or WiggleWord was a better application for making tables. Describe at least three changes to the experiment design that could help the designer answer this question, and for each change explain in a sentence or two why the change is needed.

Page 28: Theory Quali er: Spring 2010

Human-Centered Computing Area Exam – Winter 2010

HCI Question 2 – 50 points: Contemporary menu systems typically "gray out" items that are not selectable in the current application context (Figure 1). An alternative approach would be to "squeeze out" non-selectable items (Figure 2). 1. Briefly discuss the advantages and disadvantages of each approach, including:

(i) speed of menu selection (ii) users' awareness of application affordances (iii) standardization (iv) computational overhead.

2. Suggest modifications to the "squeeze out" method (Figure 2) that might enhance users' awareness of application affordances. (Note: you may not choose the "gray out" method for your modification.) How would your change impact factors (i), (iii), and (iv)?

Figure  1.  Screen  snapshot  of  File  menu  in  the  Apple  Safari  browser  

Figure  2.  Hypothetical  modification  of  File  menu  shown  in  Figure  1,  with  non-­selectable  

items  deleted.  

Page 29: Theory Quali er: Spring 2010

UIC CS Systems Qualifying ExamComputer Architecture

February 2010

Instructions

Answer all questions. Please do not put any identifying information on any sheet other than the cover sheet(not this page!) Give your answer to each question in the space provided below the question. If more spaceis needed, use the reverse side of the sheet, and indicate clearly which question you are answering.

The exam has 5 questions, for a total of 40 points.

Question: 1 2 3 4 5 Total

Points: 10 12 4 6 8 40

Score:

Page 30: Theory Quali er: Spring 2010

UIC CS Systems Qualifying ExamComputer Architecture Exam number:

Computer Architecture1. (10 points) Assume we are comparing memory systems

• a direct mapped cache

• a 4-way set associative cache

both have 16 byte blocks(lines), a total capacity of 4KB, is byte addressble and use an LRU replacementscheme.

(a) (4 points) Detail the number of bits in the tag, index, and offset for both organizations

(b) (4 points) Given the following memory access stream determine whether they result in a hit or miss:

address direct map set associative

0x10004

0x23000

0x10000

0x1200C

0x78004

0x4100E

0x1000A

0x78002

(c) (2 points) You decide that both orgs provide insufficient performance. You are now given the optionto either double the cache size or double the associativity. Which do you choose and why (feel freeto use the example address stream above to help your example).

Points earned: out of a possible 10 points

Page 31: Theory Quali er: Spring 2010

UIC CS Systems Qualifying ExamComputer Architecture Exam number:

2. (12 points) (4 points each part)

(a) what is a forwarding path with regards to a pipelined processor?

(b) Detail the pipelined operation for the following set of code, assuming a classic MIPS 5-stage pipelineIF, ID, EX, M, WB. (without any forwarding paths).

lw r1, 0(r5)

add r8, r1, r3

add r9, r7, r8

lw r2, 0(r8)

lw r4, 0(r2)

sub r12, r6, r3

sw r12, 0(r2)

add r5, r1, r6

(c) Solve the same problem with forwarding paths.

Points earned: out of a possible 12 points

Page 32: Theory Quali er: Spring 2010

UIC CS Systems Qualifying ExamComputer Architecture Exam number:

3. (4 points) Consider a 3-bit integer using two’s complement representation. For each of the bit vectorsbelow, give the decimal equivalent.

010

100

101

111

Points earned: out of a possible 4 points

Page 33: Theory Quali er: Spring 2010

UIC CS Systems Qualifying ExamComputer Architecture Exam number:

4. (6 points) Devise a combinational circuit which increments a 3-bit integer in two’s complement form.You may use AND, OR, NAND, NOR, INV gates. Your circuit need not be minimized. If thereis a block which you want to re-use (e.g., a half-adder or full-adder), you may include such blocks butmust show it’s implementation using the above gates.

Points earned: out of a possible 6 points

Page 34: Theory Quali er: Spring 2010

UIC CS Systems Qualifying ExamComputer Architecture Exam number:

5. (8 points) Consider an operation that we’ll called a PLIP which executes in three machine instructionson a given CPU design. Assume that on the CPU, PLIP operations account for p% of all instructionsexecuted in a typical workload (e.g., if there are 100 instructions which perform 10 PLIP operations, thismeans that 30% of instructions are devoted to PLIPs).

You can add a special PLIP instruction to your ISA to perform the entire operation. So in the aboveexample with p = 30%, your instruction count would go from 100 to 80 (30 instructions replaced with10). However, supporting this instruction will increase your cycle time by 20%.

How large does p have to be so that this modification results in a 50% speedup on this workload?

Assume that, on average, both designs complete one instruction per cycle.

Points earned: out of a possible 8 points

Page 35: Theory Quali er: Spring 2010

UIC CS Systems Qualifying ExamOperating Systems

February 2010

Instructions

Answer all questions. Please do not put any identifying information on any sheet other thanthe cover sheet (not this page!) Give your answer to each question in the space providedbelow the question. If more space is needed, use the reverse side of the sheet, and indicateclearly which question you are answering.

The exam has 7 questions, for a total of 40 points.

Question: 1 2 3 4 5 6 7 Total

Points: 9 6 6 4 5 4 6 40

Score:

Page 36: Theory Quali er: Spring 2010

Operating Systems Section1. I/O System calls. For the following system calls, describe the sequence of actions

that occur when the system call is invoked. Include the blocking behavior. Assume eachsystem call operates on a file.

(a) (3 points) What happens on a write system call?

(b) (3 points) What happens on a read system call, if the portion of the file to be readis not in memory?

(c) (3 points) What happens on an open system call?

Points earned: out of a possible 9 points

Page 37: Theory Quali er: Spring 2010

2. Demand paging.

(a) (3 points) What is demand paging?

(b) (3 points) What are the architectural (hardware) requirements to support demandpaging?

Points earned: out of a possible 6 points

Page 38: Theory Quali er: Spring 2010

3. Processes.

(a) (3 points) Can a process affect anything outside the process’s address space withoutfirst invoking the kernel? Explain.

(b) (3 points) What mechanism for invoking the kernel—other than system calls—isnecessary to support the process abstraction. Explain.

Points earned: out of a possible 6 points

Page 39: Theory Quali er: Spring 2010

4. (4 points) Scheduling. Assuming a sufficient stream of both CPU-bound processesand I/O-bound processes, which type of process is likely to have higher priority for CPUscheduling in a time-shared, multiprogrammed system? Clearly explain your answer.

5. (5 points) Memory hierarchy performance. The memory access time of a computeris 75 nanoseconds. It takes 25 milliseconds to read or write a page to/from disk. Duringsteady-state operation, there is a probability of 25% that the page to be replaced hasits write/modify bit set. For the memory system to have an effective access time of atmost 100 nanoseconds, what is the maximum acceptable page fault rate?

Points earned: out of a possible 9 points

Page 40: Theory Quali er: Spring 2010

6. (4 points) Virtual memory. Suppose that we have a computer system using a 44-bitvirtual (logical) address, a page size of 64K, and 8 GB of physical memory. How manypages are in the virtual address space for any process? Clearly justify your answer.

7. Synchronization. We are developing an application that involves six shared resources(R1 . . . R6), each to be used in a mutually exclusive manner, and fourteen concurrentprocesses (P1 . . . P14). One design requirement is that a process should block when, andonly when, it attempts to access a resource that is currently being used by anotherprocess. Assume that for the specific application of concern, we know that two of theprocesses will never need access to resource R3, and we know that process P5 will neverrequire simultaneous access to both R1 and R2.

(a) (3 points) If you want to use semaphores to implement the application, how manysemaphores are needed? Explain.

(b) (3 points) If you want to use monitors to implement the application, how manymonitors are needed? Explain.

Points earned: out of a possible 10 points

Page 41: Theory Quali er: Spring 2010

UIC CS Systems Qualifying ExamNetworksFebruary 2010

Instructions

Answer all questions. Please put no identifying information anywhere except on the cover page (not thispage). Give your answer to each question in the space provided below the question. If more space is needed,use the reverse side of the sheet, and indicate clearly which question you are answering.

The exam has 9 questions, for a total of 40 points.

Question: 1 2 3 4 5 6 7 8 9 Total

Points: 4 4 4 9 6 4 4 2 3 40

Score:

Page 42: Theory Quali er: Spring 2010

1. IP host configuration and IPv6

(a) (2 points) A /29 network has its default gateway on IP address 138.28.3.254. You connect yourlaptop to the network, and manually set the IP address to 138.28.3.240, with netmask 255.255.255.0and gateway 138.28.3.254. What two things are wrong with this setup?

(b) (2 points) List the 4 most important differences between IP v4 and IP v6.

Points earned: out of a possible 4 points

Page 43: Theory Quali er: Spring 2010

2. (4 points) Two Internet users, connected to two different WiFi access points, are both using the IPaddress 192.168.1.101. This is a very common occurrence in today’s Internet. Name the mechanism thatmakes this possible, and describe the main benefits and drawbacks of this mechanism?

3. (a) (1 point) What is the main purpose of the domain name service (DNS)?

(b) (1 point) There exist many types of DNS resource records, including A, NS, CNAME, MX andPTR. What is the purpose of the MX record type?

(c) (2 points) There are 12 “virtual” root servers, each of which is actually replicated in several loca-tions. However, even if a powerful network conspiracy was to somehow disable every root server,including all their clones, most Internet users wouldn’t notice a thing, at least for a while. Why isthat, and what users would be immediately affected?

Points earned: out of a possible 8 points

Page 44: Theory Quali er: Spring 2010

4. Consider the following pseudocode for the reliable send() function of a reliable transport layer.

reliable_send (socket, packet) {timeout = 1 seconddo {unreliable_send(socket, packet)} while(!receive_ack(socket, timeout));

}

(a) (2 points) Assuming there are no packet losses, very briefly describe a scenario in which this protocolwould achieve close to optimal bandwidth utilization.

(b) (2 points) In your scenario from part (a), let approximately 1% of packets be lost due to transmis-sion errors, resulting in very poor throughput. How can we change reliable send() to avoid the dropin throughput? Give a high-level description, not pseudocode.

(c) (1 point) Still using the same transport layer, let the sender be in Chicago, and the receiver beyour boss in New Zealand, let the maximum capacity of the route between the two be 10 Mbps,with no packet losses, no competing traffic, and a maximum packet size of 1250 bytes.Your boss is unhappy with his download speeds, and tells you to upgrade the route capacity to 1Gbps. How much faster will your pointy-haired kiwi boss get his spreadsheets?

(d) (4 points) What common transport protocol technique could you have used instead to improvethe Chicago-New Zealand download speeds? Estimate the throughput you would achieve with andwithout this technique. If you can’t calculate the throughput based on the parameters given above,then give a symbolic expression.

Points earned: out of a possible 9 points

Page 45: Theory Quali er: Spring 2010

5. You are configuring a router and a number of machines in the network topology described below:

54.10.9.7

gateway router

internet

Your ISP has assigned you the the address range 54.10.8.0/28 for use in your network. However, in yourcase, your boss has deemed it desirable to have two separate IP subnets, as indicated by the dashedovals.

(a) (4 points) Design a feasible addressing scheme for the network given the above constraints. Foreach interface indicate its address. Indicating the last (least significant) octet of the address isenough.

(b) (2 points) List a suitable prefix and netmask for each subnet.

Points earned: out of a possible 6 points

Page 46: Theory Quali er: Spring 2010

6. Multiple Access Protocols

(a) (2 points) Under what conditions may a time division multiple access (TDMA)-based solution bepreferable over a random access protocol? Motivate your answer.

(b) (2 points) When analyzing and simulating Slotted Aloha, we find that link utilization went to e−1

as the number of nodes went to infinity, or an abysmal 37%. What is the cause of this poor linkutilization in slotted Aloha, and what is a common mechanism that modern random access protocolsuse to improve link utilization beyond this limit?

Points earned: out of a possible 4 points

Page 47: Theory Quali er: Spring 2010

7. Network Address Translation (NAT) Assume that you have a private (non-routable) IP addressbehind a NAT router.

(a) (2 points) Suppose you can write programs, using only Networking APIs, for your desktop and apublicly accessible server. Describe (i.e., do not write a program) how the desktop could learn therouter’s public address?

(b) (2 points) Suppose your laptop was behind a NAT router over which you have no control. Describea scheme which could allow someone on the other side of the NAT router to initiate a download fromyour laptop. You may propose changes to the laptop’s software, introduce additional computersbehind the NAT or elsewhere in the Internet, or other mechanisms that do not modify or bypassthe NAT gateway.

Points earned: out of a possible 4 points

Page 48: Theory Quali er: Spring 2010

8. (2 points) For a proposed flow specification at the network layer, the max packet size is 800 bytes,the token bucket rate is 8 million bytes/sec, the token bucket size is 800,000 bytes, and the maximumtransmission rate is 32 million bytes/sec. How long can a burst at maximum speed last with this trafficshaping policy?

9. Consider a 100 Mbps CSMA/CD (IEEE 802.3) LAN network. The cable is 2km long and the signalspeed on the cable is 200,000 km/sec.

(a) (2 points) What is the minimum frame size?

(b) (1 point) If the cable gets upgraded to 1Gbps speed, how should the cable length be changed inorder to manitain the same minimum frame size?

Points earned: out of a possible 5 points