Choose the closest meaning of “cope with” in the sentence describing how fascinating it is that life forms cope with varied environmental conditions. A: adopt to. B: adapt to. C: adept in. D: accept with.
Your answer
Answer & solution
Official answer: B
1. Method and setup. Interpret the phrase in context: the life forms must adjust to different surroundings. “Adopt” means take up a practice or take someone into a family, whereas “adept” is an adjective meaning skilled. Neither is the verb expressing adjustment.
2. Work through the result and its assumptions. To cope with conditions is to adapt to them. Adopt to and adept in are not the intended verbal construction; accept with does not express adjustment. Thus B.
Fill the blank with the most suitable word: He could not understand the judges awarding her first prize because he thought her performance was quite ____. A: superb. B: medium. C: mediocre. D: exhilarating.
Your answer
Answer & solution
Official answer: C
1. Method and setup. The causal connection is the clue: the speaker doubts the award because his assessment is unfavorable. Test each choice against this contrast; a strongly positive description would undermine the stated reason for his surprise.
2. Work through the result and its assumptions. Mediocre means of unexceptional or poor quality, explaining why the speaker disputes first prize. Superb and exhilarating suggest excellence; medium is not the natural evaluation here. Thus C.
At a press meeting about a recent scam, a minister says “The buck stops here.” What does this convey? A: He wants all the money. B: He will return the money. C: He will assume final responsibility. D: He will resist all enquiries.
Your answer
Answer & solution
Official answer: C
1. Method and setup. Recognize “the buck stops here” as an idiom, rather than interpreting “buck” literally as money. It rejects passing responsibility further along a chain of authority. A statement of accountability does not itself promise repayment or opposition to an investigation.
2. Work through the result and its assumptions. The idiom means that responsibility ends with the speaker, who accepts final responsibility rather than passing blame. Thus C.
1. Method and setup. Apply (u+v)²=u²+2uv+v² with u=z and v=1/z. Their product is 1, so the cross term is exactly 2. There is no need to solve for z; subtracting that cross term directly isolates the requested quantity.
2. Work through the result and its assumptions. Expanding (z+1/z)² gives z²+2+1/z²=98, so the requested sum is 96.
The quadratic ax²+bx+c=0 has real positive roots, with real coefficients. How many real roots does ax²+b|x|+c=0 have? A: none. B: two. C: three. D: four. The printed premise does not state that the original roots are distinct.
Your answer
Answer & solution
Official answer: D
Our answer: D for distinct positive roots; B if the roots coincide
1. Method and setup. Use x²=|x|² and introduce t=|x|≥0. Each distinct positive root t=r corresponds to exactly two real values, r and −r. Counting distinct values rather than algebraic multiplicities exposes the missing distinctness assumption.
2. Work through the result and its assumptions. Put t=|x|. If the original quadratic has distinct positive roots r, s, the solutions are x=±r,±s, four values. The premise does not require distinct roots: (t−1)²=0 instead gives only x=±1. Official D therefore needs distinct roots, or counting multiplicities rather than distinct real solutions.
A passage describes the roughly 30 km Palghat/Palakkad Gap in the southern Western Ghats as lower than the hills on its north and south. Its origin is uncertain. It increases southwest-monsoon rainfall in nearby Tamil Nadu and summer temperatures in nearby Kerala. Which inference follows? A: High rainfall and temperatures caused the gap. B: Nearby Tamil Nadu and Kerala regions are low-lying. C: The gap’s low terrain significantly affects neighboring weather. D: Higher summer temperatures cause higher rainfall near the gap.
Your answer
Answer & solution
Official answer: C
1. Method and setup. Separate what the passage asserts from what it leaves unknown. It gives a terrain-to-weather connection but explicitly leaves the origin unresolved. An inference cannot reverse the causal direction or extend the low elevation of the gap to every neighboring region.
2. Work through the result and its assumptions. The passage explicitly links the low gap to rainfall and temperature changes in neighboring regions. This supports C, not the reversed causal claims A/D or the unstated claim that all neighboring terrain is low.
Geneticists claim they are close to confirming genetic roots of depression and schizophrenia and therefore expect early identification and gene therapy to eradicate these illnesses. Which assumption supports this argument? A: Eradication strategies are available now. B: Certain psychiatric illnesses have a genetic basis. C: Every human disease is attributable to genes and their expression. D: Genetics will become the only relevant field for identifying psychiatric illnesses.
Your answer
Answer & solution
Official answer: B
1. Method and setup. To test a necessary assumption, negate it and see whether the proposed reasoning survives. If none of these illnesses had a genetic basis, the proposed link from genetic identification to gene therapy would fail. The argument needs neither universal genetic causation nor exclusivity.
2. Work through the result and its assumptions. Identification and gene therapy can address these illnesses as proposed only if at least some have a genetic basis. The argument does not require all diseases to be genetic, available eradication today, or genetics to become the only relevant field. Thus B.
A one-way fare is Rs 100 per person. Round trips receive a 10% discount on total fare, and groups of at least four receive an additional 5% discount on total fare. Find the charge in rupees for five people buying round-trip tickets.
Answer & solution
Official answer: 850
Our answer: 850 under additive discounts
1. Method and setup. First count ten one-way journeys, giving a base cost of Rs 1000. The key interpretation applies both percentages to this same base: the two reductions are Rs 100 and Rs 50. Distinguish this from applying the second reduction to an already-discounted price.
2. Work through the result and its assumptions. The undiscounted total is 5×2×100=1000 rupees. Taking both stated discounts on that total gives 1000(1−.10−.05)=850. Sequential discounts would give 855, but the wording specifies both on the total fare, supporting the additive interpretation used by the key.
In a survey of 300 people, the counts for men/women are: car only 40/34, scooter only 30/20, both car and scooter 60/46, no vehicle 20/50. What percentage do not own a scooter? The mutually exclusive table categories sum to 300.
Answer & solution
Official answer: 48
1. Method and setup. Identify the complement of scooter ownership: car-only respondents and respondents with no vehicle. Do not include the “both” category, since those respondents own scooters. As a check, scooter owners total 30+20+60+46=156, and 300−156 equals the complementary count.
2. Work through the result and its assumptions. The mutually exclusive car-only and no-vehicle categories contain 40+34+20+50=144 people. Thus144/300×100=48% do not own a scooter. Both-category respondents do own one.
Join an interior point of a tetrahedron to each of its four vertices by straight segments. How many new internal planes (triangular separating surfaces through the interior point and a tetrahedron edge) are formed?
Answer & solution
Official answer: 6
1. Method and setup. Choose any two of the four corner-to-interior segments. Together with the original edge between their corners they bound one internal triangle. Counting ordered pairs would count every triangle twice, so use unordered pairs of corners.
2. Work through the result and its assumptions. Each pair of the four interior-to-corner segments determines one internal triangular surface with the edge between those two corners. There are C(4, 2)=6 such pairs. These planes are distinct because coincident ones would force the interior point onto a face plane or all four tetrahedron vertices into one plane.
Let glitters(x) mean that x glitters and gold(x) mean that x is gold. Formalize “Not all that glitters is gold.” A: ∀x(glitters(x)⇒¬gold(x)). B: ∀x(gold(x)⇒glitters(x)). C: ∃x(gold(x)∧¬glitters(x)). D: ∃x(glitters(x)∧¬gold(x)).
Your answer
Answer & solution
Official answer: D
1. Method and setup. Start with the universal statement “all glittering things are gold.” Negate the universal quantifier to an existential one, and negate the implication using ¬(P⇒Q)=P∧¬Q. The counterexample must glitter while failing to be gold, not the reverse.
2. Work through the result and its assumptions. Negate ∀x(glitters(x)→gold(x)): the result is ∃x(glitters(x)∧¬gold(x)), D. Not all is existential counterexample, not none.
A unit-length stick is cut once at a uniformly random point. Find the expected length of the shorter piece.
Answer & solution
Official answer: 0.24 to 0.27
Our answer: 0.25
1. Method and setup. Let X be the cut position measured from the left endpoint. The two lengths are X and 1−X. The shorter length is X on [0,1/2] and 1−X on [1/2,1]; the two halves contribute equally to the expectation.
2. Work through the result and its assumptions. For a uniform cut X on[0, 1], the shorter length is min(X, 1−X). Symmetry gives E=2∫₀1/2x dx=1/4, within the accepted range.
For directed G=(V,E), which construction preserves its strongly connected components? A: Keep V and use every ordered pair not in E. B: Keep V and reverse all edges: E₂={(u,v):(v,u)∈E}. C: Keep V and add an edge (u,v) whenever G has a path from u to v of length at most 2. D: Keep E but remove isolated vertices from V. The paper asks for one option.
Your answer
Answer & solution
Official answer: B
Our answer: B and C
1. Method and setup. An SCC is an equivalence class under mutual reachability, so compare reachability rather than individual edges. Reversing paths preserves mutual reachability. Also, shortening existing paths into edges cannot introduce reachability that was absent, while retaining all length-one edges preserves old paths.
2. Work through the result and its assumptions. Reversing every edge reverses paths and preserves mutual reachability, so B preserves every SCC. C also preserves them: it includes every original length 1 edge, and every added edge abbreviates an original path of length≤2. Thus reachability in either graph is equivalent. The official single answer B omits the equally valid C. Deleting isolated vertices loses singleton SCCs; complementing edges need not preserve SCCs.
Find the number of solutions of 3x+2y=1, 4x+7z=1, x+y+z=3, and x−2y+7z=0.
Answer & solution
Official answer: 1
1. Method and setup. Eliminate y and z using y=(1−3x)/2 and z=(1−4x)/7. Substitution into x+y+z=3 gives (9−15x)/14=3, hence x=−11/5. These three equations uniquely determine all variables; the fourth must then be checked for consistency, not treated as an automatic contradiction.
2. Work through the result and its assumptions. The first three equations give x=−11/5, y=19/5, z=7/5 uniquely. Substitution into the fourth gives(−11−38+49)/5=0. Hence the consistent system has exactly one solution.
For a real symmetric positive-definite 4×4 matrix, what is the dot product of eigenvectors associated with any two distinct eigenvalues?
Answer & solution
Official answer: 0
1. Method and setup. Write Au=λu and Av=μv. Symmetry means Aᵀ=A, allowing the matrix to move from one side of an inner product to the other. Positive definiteness ensures positive eigenvalues but is not needed for the orthogonality conclusion; symmetry and λ≠μ are enough.
2. Work through the result and its assumptions. For symmetric A, eigenvectors u, v with distinct eigenvalues λ,μ satisfy λuᵀv=(Au)ᵀv=uᵀAv=μuᵀv. Therefore(λ−μ)uᵀv=0 and their dot product is 0.
For θ∈[π/6,π/3], let f(θ) be the determinant with rows (sin θ, cos θ, tan θ), (sin(π/6),cos(π/6),tan(π/6)), and (sin(π/3),cos(π/3),tan(π/3)). I: There exists θ strictly between the endpoints with f′(θ)=0. II: There exists θ strictly between the endpoints with f′(θ)≠0. Which are true? A: I only. B: II only. C: both. D: neither.
Your answer
Answer & solution
Official answer: C
1. Method and setup. The tangent function has no pole on this interval, so the determinant is continuous on the closed interval and differentiable inside it. At either endpoint two rows coincide, forcing determinant zero. Rolle’s theorem proves I. To establish II, check an interior value is nonzero; endpoint equality alone would not exclude the identically zero function.
2. Work through the result and its assumptions. The determinant vanishes at θ=π/6 and π/3 because two rows coincide, so Rolle’s theorem guarantees an interior derivative zero. It is not identically zero: direct expansion gives f(π/4)=√2(1−1/√3)−1/2≠0. The mean-value theorem between an endpoint and π/4 gives another interior point with nonzero derivative. Both I and II hold, C.
Simplify F(P,Q,R,S)=PQ+P̅QR+P̅QR̅S to a minimal sum of products. A: PQ+QR+QS. B: P+Q+R+S. C: P̅+Q̅+R̅+S̅. D: P̅R+P̅R̅S+P.
Your answer
Answer & solution
Official answer: A
Step through it (11 steps)
1. Method and setup. Factor Q from every term. Then simplify inside the parentheses using absorption X+X̅Y=X+Y twice: first absorb the P̅ factor when P is already present, then simplify R+R̅S. A minimality argument must also show that none of the surviving products is dispensable.
2. Work through the result and its assumptions. Use X+X′Y=X+Y: PQ+P′QR=Q(P+R). Including P′QR′S gives Q[P+P′(R+R′S)]=Q(P+R+S)=PQ+QR+QS. The three products are essential, witnessed by Q=1 with exactly one of P, R, S equal 1. Thus A.
All numerals in the equation (312)/(20)=13.1 use the same unknown base. Determine that base.
Answer & solution
Official answer: 5
Step through it (5 steps)
1. Method and setup. Translate place values before doing arithmetic: 312 means 3b²+b+2, 20 means 2b, and 13.1 means b+3+b⁻¹. The base must be an integer greater than 3 because digit 3 occurs. This restriction removes algebraic roots that are not valid radices.
2. Work through the result and its assumptions. For base b, (3b²+b+2)/(2b)=b+3+1/b. Multiplication gives 3b²+b+2=2b²+6b+2, hence b(b−5)=0. A valid base exceeds the largest digit 3, so b=5.
A machine uses 32-bit words and one-word instructions. It has 64 registers, each 32 bits long. There are 45 instructions, each containing an unsigned immediate and two register operands. Find the largest representable immediate.
Answer & solution
Official answer: 16383
1. Method and setup. Encoding 45 instruction choices needs six bits, since five bits distinguish only 32 choices. Each register identifier also needs six bits; the physical width of a register does not determine the width of its identifier. Allocate opcode and register fields first, then use all remaining bits for the immediate.
2. Work through the result and its assumptions. The opcode needs ceil(log₂45)=6 bits and each of two register fields needs log₂64=6 bits. The32-bit word leaves 32−6−12=14 immediate bits, whose unsigned maximum is 2¹⁴−1=16383.
Consider the C program with stdio included: main(){ int i; int *pi=&i; scanf("%d",pi); printf("%d\n",i+5); }. Which statement is true? A: Compilation fails. B: A runtime error occurs. C: It prints five more than the address of i. D: It prints five more than the integer entered. Interpret the legacy main declaration under the intended historical C convention.
Your answer
Answer & solution
Official answer: D
Our answer: D under the intended C execution assumptions
1. Method and setup. The address operator makes pi point to the existing integer object i. scanf requires precisely such a destination pointer for %d, so this is equivalent to passing &i. printf subsequently evaluates the integer expression i+5; it does not use the pointer’s numeric address.
2. Work through the result and its assumptions. pi is a valid pointer to i, so a successful scanf conversion stores the entered integer in i and printf displays i+5, D. Assume representable input and no signed overflow; the source also uses legacy implicit-int main syntax rather than modern int main(void). These routine source conventions matter for literal compilation.
A graph has n vertices and m edges and is stored as an adjacency matrix. What is the tightest asymptotic upper bound for a complete depth-first search? A: Θ(n). B: Θ(n+m). C: Θ(n²). D: Θ(m²).
Your answer
Answer & solution
Official answer: C
1. Method and setup. For adjacency lists, examining neighbors costs the degree of the current vertex. With a matrix, locating all neighbors requires inspecting n possible entries even for a low-degree vertex. A full DFS forest covers disconnected components too, so all n rows are scanned.
2. Work through the result and its assumptions. DFS scans an entire adjacency-matrix row for each visited vertex. A full traversal visits all n vertices, giving n rows of n entries and Θ(n²) time, C.
A rooted binary tree with n nodes is represented by pointers. The best upper bound for counting rooted subtrees containing exactly four nodes is O(nᵃ logᵇ n). Find a+10b.
Answer & solution
Official answer: 1
1. Method and setup. Use one postorder traversal. When processing a node, both child-subtree sizes are already known; combine them with the current node and count it if the total is four. Store size and count in the recursion result rather than recounting descendants for every possible root.
2. Work through the result and its assumptions. A postorder traversal computes each rooted subtree size as 1+left_size+right_size and increments a counter for size 4. It does constant work per node, Θ(n)=O(n¹log⁰n), so a+10b=1.
A directed graph has vertices P,Q,R,S and exactly the edges P→Q, P→R, R→Q, S→R, S→Q. Which statement holds? A: No topological ordering exists. B: Both PQRS and SRQP are topological orderings. C: Both PSRQ and SPRQ are topological orderings. D: PSRQ is the only topological ordering.
Your answer
Answer & solution
Official answer: C
Step through it (2 orders)
1. Method and setup. Topological order must place the tail of every edge before its head. Initially P and S have indegree zero. Both must precede R, and R must precede Q. There is no edge imposing an order between P and S, so either may appear first.
2. Work through the result and its assumptions. The edges require P and S before R, and R before Q; there is also P→Q and S→Q. P and S may occur in either order, giving exactly PSRQ and SPRQ. Thus C.
Quicksort sorts ascending using the first element as pivot. Let t₁ be its comparison count on [1,2,3,4,5] and t₂ the count on [4,1,5,3,2]. Which holds? A: t₁=5. B: t₁<t₂. C: t₁>t₂. D: t₁=t₂. Use the conventional partitioning comparison model.
Your answer
Answer & solution
Official answer: C
Our answer: C under standard linear partition comparisons
Step through it (2 runs)
1. Method and setup. With the first-element pivot, an already sorted list always selects the smallest remaining value, producing maximally unbalanced recursive subproblems. For the second list, pivot 4 separates three smaller elements from one larger element. Bounding the cost of sorting that three-element side suffices; its exact partition order is unnecessary.
2. Work through the result and its assumptions. Sorted input with first-element pivot repeatedly splits 0 versus n−1, using 4+3+2+1=10 pivot comparisons. The second input first splits 3 versus 1, so its total is 4 plus at most 3 within the three-element side, at most 7. Thus t1>t2, C. This is the usual partition comparison model, not arbitrary redundant implementation tests.
Which language is regular? A: {aⁿbⁿ:n≥0}. B: {aⁿ:n is prime}. C: {w over {a,b}: w contains 3k+1 occurrences of b for some k∈ℕ}. D: {ww:w∈{0,1}*}.
Your answer
Answer & solution
Official answer: C
1. Method and setup. Finite-state memory can retain a count modulo a fixed constant, but cannot in general remember arbitrary equal block lengths, primality of unbounded lengths, or an arbitrary string for exact copying. For C, use states representing residues 0,1,2 of the b-count; a leaves the state unchanged and b advances it cyclically.
2. Work through the result and its assumptions. A DFA can count b symbols modulo 3 while ignoring a, accepting the residue 1 class; if natural k excludes 0, a finite initial-count adjustment still makes it regular. The equal-count language is nonregular by pumping; unary prime lengths are not ultimately periodic. The copy language is nonregular: intersection with 0*1*0*1* yields 0i1j0i1j, whose equal nonadjacent blocks defeat pumping on 0p1p0p1p. Thus only C.
An NFA starts at q₀ and has accepting state q₃. Its transitions are q₀→q₀ on 0 or 1; q₀→q₁ on 1; q₁→q₂ on 0 or 1; q₂→q₂ on 1; q₂→q₃ on 0 or 1. There are no other transitions. Which states are reachable after reading 0011? A: {q₀,q₁,q₂}. B: {q₀,q₁}. C: {q₀,q₁,q₂,q₃}. D: {q₃}.
Your answer
Answer & solution
Official answer: A
1. Method and setup. Track a set of active states after each symbol; an NFA can follow several transitions at once. Each update uses only the states active before that symbol, so a newly reached q₂ cannot immediately take another transition on the very same input symbol. Acceptance is separate from the requested reachable-state set.
2. Work through the result and its assumptions. Starting at{q0}, the two zeros leave{q0}. The first 1 yields{q0, q1}; the second 1 yields{q0, q1, q2}. No q2 was reached early enough to enter q3. Thus A.
Which compiler statement is false? A: A basic block is entered at its beginning and exited at its end. B: Available-expression analysis supports common-subexpression elimination. C: Live-variable analysis supports dead-code elimination. D: Replacing x=4*5 by x=20 is common-subexpression elimination.
Your answer
Answer & solution
Official answer: D
1. Method and setup. Common-subexpression elimination reuses a previously computed expression whose operands have not changed. Here no prior computation is being reused: a constant expression is evaluated during compilation. Available-expression and liveness analyses instead answer whether a value is reusable and whether a computed result will be needed.
2. Work through the result and its assumptions. Replacing the compile-time arithmetic 4×5 by 20 is constant folding, not common-subexpression elimination. The other statements describe standard basic-block and dataflow uses. Thus the false statement is D.
Match models 1 waterfall, 2 evolutionary, 3 component-based software engineering, 4 spiral development to features a incremental specifications, b unavoidable requirement compromises, c explicit recognition of risk, d inflexible project stages. A: 1-a,2-b,3-c,4-d. B: 1-d,2-a,3-b,4-c. C: 1-d,2-b,3-a,4-c. D: 1-c,2-a,3-b,4-d.
Your answer
Answer & solution
Official answer: B
1. Method and setup. Anchor the distinctive matches first: the spiral model organizes work around risk, whereas waterfall divides work into fixed sequential phases. Evolutionary development permits specifications to grow with successive versions. Component reuse may require adapting desired requirements to available components.
2. Work through the result and its assumptions. Waterfall fixes sequential stages(d); evolution permits incremental specifications(a); reusable components can force requirement compromises(b); spiral development explicitly treats risk(c). The mapping 1-d, 2-a, 3-b, 4-c is B.
A disk has cylinders 0 through 200. The arm is at 100, with pending requests 30,85,90,100,105,110,135,145. Under shortest-seek-time-first scheduling, how many requests are serviced before request 90?
Answer & solution
Official answer: 3
1. Method and setup. At each step recompute distances from the current head position; SSTF is not a one-time sort by distance from 100. The request already at the head is a request serviced before any movement. Once at 110, compare the distances to 90 and 135 rather than continuing upward automatically.
2. Work through the result and its assumptions. SSTF first services the zero-distance request 100, then 105, then 110. From110, 90 is 20 cylinders away, closer than 135 at 25. Thus90 is serviced after 3 requests.
Which threading statement is false? A: The kernel does not schedule user-level threads. B: If one user-level thread blocks, all other threads of its process block. C: User-level thread context switching is faster than kernel-level switching. D: Kernel-level threads cannot share the code segment. The usual intended model is many-to-one user threads with blocking system calls.
Your answer
Answer & solution
Official answer: D
Our answer: D under the many-to-one user-thread model
1. Method and setup. Separate a thread’s private execution state, such as registers and stack, from process-wide resources such as code and address space. Kernel scheduling does not imply a separate address space per thread. Statements about all user threads blocking depend on how user threads are mapped to kernel scheduling entities.
2. Work through the result and its assumptions. Kernel threads of one process share its address space, including code, so D is false. The remaining statements use the traditional many-to-one user-level-thread model and blocking kernel calls. A user-runtime wait that schedules another user thread need not block the whole process, and hybrid threading differs; the blanket wording of B needs that model.
For R(E,F,G,H,I,J,K,L,M,N), the functional dependencies are EF→G, F→IJ, EH→KL, K→M, L→N. Which is a candidate key? A: EF. B: EFH. C: EFHKL. D: E.
Your answer
Answer & solution
Official answer: B
Step through it (2 steps)
1. Method and setup. Attributes absent from every dependency’s right side cannot be generated from other attributes. Thus E, F and H must occur in every key. Compute their closure systematically, and distinguish a minimal candidate key from a larger superkey such as EFHKL.
2. Work through the result and its assumptions. E, F, H never occur on a right-hand side, so every key needs all three. Their closure addsG via EF, I, J via F, K, L via EH, then M, N. Thus EFH determines all attributes and is minimal, B.
S1: A foreign-key declaration can always be replaced by an equivalent SQL check assertion. S2: If R(a,b,c) has composite primary key (a,b), then CREATE TABLE S(a INTEGER,d INTEGER,e INTEGER,PRIMARY KEY(d),FOREIGN KEY(a) REFERENCES R) is valid. Choose A: S1 true, S2 false. B: both true. C: S1 false, S2 true. D: both false.
Your answer
Answer & solution
Official answer: D
Our answer: D with full referential-action semantics; A for constraints alone
1. Method and setup. Check S2 structurally: omitting referenced column names means referencing R’s primary key, which has two columns, unlike the one-column foreign key. For S1, distinguish an assertion describing permitted database states from actions performed during an update or deletion. “Always equivalent” is ambiguous unless that distinction is specified.
2. Work through the result and its assumptions. S2 is false: the implicit referenced key is composite(a, b), but the foreign key has only one column. For S1, an SQL ASSERTION can express the allowed-state condition for an ordinary foreign key, including NULL exemptions, so under constraint-only equivalence S1 is true and A follows. An assertion alone cannot implement ON DELETE/UPDATE CASCADE or SET NULL actions; interpreting always as full behavioral equivalence makes S1 false and supports official D. This distinction is unstated; retain the official key and disclose both readings.
For a network with 500 nodes and 4000 links, evaluate these textbook routing statements. S1: Link-state has higher computational overhead than distance-vector. S2: Distance-vector with split horizon avoids persistent routing loops, unlike link-state. S3: After topology change, link-state converges faster than distance-vector. A: all true. B: all false. C: S1,S2 true and S3 false. D: S1,S3 true and S2 false.
Your answer
Answer & solution
Official answer: D
Our answer: D under the standard protocol comparison
1. Method and setup. A link-state router builds a topology view and computes routes locally; distance-vector routers repeatedly exchange route estimates. Split horizon prevents advertising a route back along the interface from which it was learned, but this only directly addresses a two-router pattern, not every multirouter loop.
2. Work through the result and its assumptions. Link-state routing maintains topology and runs a shortest-path computation, conventionally costing more local computation but converging faster than iterative distance-vector updates. Split horizon does not eliminate all loops involving three or more routers, so S2 is false. The textbook comparison is S1/S3 true, D; actual convergence depends on timers, implementation and failure pattern, not the node/link counts alone.
1. Method and setup. Classify algorithms by function rather than by the broad label “security.” A message digest is produced by a hash function. Encryption and public-key operations may be used alongside hashes in protocols, but that does not make the encryption algorithm itself the digest algorithm.
2. Work through the result and its assumptions. SHA-1 and MD5 are message-digest hash functions. RSA is a public-key scheme and DES a block cipher. Thus Q and S, C. This historical identification is not a recommendation to use these now-broken collision-resistant hashes.
Order these actions for a conventional fresh browser/server interaction: 1 send an HTTP webpage request; 2 establish TCP; 3 server sends the webpage using HTTP; 4 resolve the domain via DNS. A: 4,2,1,3. B: 1,2,3,4. C: 4,1,2,3. D: 2,4,1,3.
Your answer
Answer & solution
Official answer: A
1. Method and setup. The browser first needs a destination IP address, then a transport connection, before it can send the application request. The server’s response depends on receiving that request. This is the dependency order for the listed HTTP-over-TCP setup, not a claim about cached or connection-reusing requests or HTTP/3.
2. Work through the result and its assumptions. For a fresh conventional HTTP-over-TCP fetch, resolve the server using DNS, establish TCP, send the HTTP request, then receive the HTTP response: 4, 2, 1, 3, A. Cached DNS or an existing connection can skip steps, but do not change their dependency order when all listed steps occur.
A 2 km token ring has ten stations including a monitoring station. Signals propagate at 2×10⁸ m/s. Token transmission time is ignored, and each station may hold the token for 2 μs. What minimum wait in μs should the monitoring station allow before considering the token lost?
Answer & solution
Official answer: 28 to 30
Our answer: 28 or 30 microseconds by timer origin
1. Method and setup. The return delay contains two distinct components: propagation around the physical ring and permitted holding delays at stations. Convert kilometers to meters before dividing by speed. Whether to include the monitor’s own holding period depends on whether its timer starts when acquiring or releasing the token.
2. Work through the result and its assumptions. Ring propagation is 2000/(2×10⁸)=10μs. After the monitor releases the token, nine other stations may hold it for 18μs, giving 28μs until its return. Counting from acquisition and including the monitor’s own 2μs gives 30μs. Both lie in the official 28 to 30 interval; the timer origin is not explicit.
A TCP connection has congestion window 32 KB when a timeout occurs. RTT is 100 ms and maximum segment size is 2 KB. Under the usual slow-start/congestion-avoidance model, how long in milliseconds until the window returns to 32 KB?
Answer & solution
Official answer: 1100 to 1300
Our answer: 1100 ms in the standard round model
Step through it (13 steps)
1. Method and setup. A timeout does not simply halve the congestion window and continue linearly: classic TCP resets the window to one segment while setting the slow-start threshold to half the previous window. Count exponential-growth rounds up to that threshold, then linear-growth rounds of one segment each.
2. Work through the result and its assumptions. After timeout, take ssthresh=16KB and cwnd=1MSS=2KB. Slow start doubles 2→4→8→16 in 3 RTTs. Congestion avoidance then adds one 2KB MSS each RTT, taking 8 more RTTs to 32KB. Thus11×100=1100ms, accepted by 1100 to 1300. This uses classic loss recovery, fixed RTT, no further loss, and the usual window-per-round accounting; implementation-specific ACK growth can alter timing.
Selective-repeat ARQ sends 1 KB frames over a 1.5 Mbps link with one-way latency 50 ms. For 60% link utilization, what is the minimum number of sequence-number bits?
Answer & solution
Official answer: 5
1. Method and setup. Ignoring acknowledgment transmission time, a window of W frames occupies W frame-transmission times during a cycle of one transmission plus a round-trip propagation delay. Thus utilization is min(1,W·Tframe/(Tframe+2Tprop)). First round the required window upward; then ensure the selective-repeat sequence space is at least twice that window.
2. Work through the result and its assumptions. With1KB=1024 bytes, transmission time is 8192/1.5×10⁶≈5.461ms. Required window W≥.6(1+100/5.461)≈11.586, hence W≥12. Selective repeat needs sequence space at least 2W=24, so ceil(log₂24)=5 bits. Decimal KB also gives 12 frames and 5 bits.
On one item x, which schedule is conflict serializable? Subscripts identify transactions. A: r₁(x);r₂(x);w₁(x);r₃(x);w₂(x). B: r₂(x);r₁(x);w₂(x);r₃(x);w₁(x). C: r₃(x);r₂(x);r₁(x);w₂(x);w₁(x). D: r₂(x);w₂(x);r₃(x);r₁(x);w₁(x).
Your answer
Answer & solution
Official answer: D
Step through it (4 schedules)
1. Method and setup. Build a precedence graph with one vertex per transaction. Add an edge for time-ordered accesses by different transactions to x when at least one is a write; two reads alone create no conflict. The schedule is conflict serializable exactly when this graph is acyclic.
2. Work through the result and its assumptions. A and B each contain conflicting edges 1→2 and 2→1. C likewise has 1→2 from r1 before w2 and 2→1 from r2 before w1. D has edges 2→3, 2→1, 3→1 and no cycle, with serial order T2, T3, T1. Thus D.
S1: Every table with two single-valued attributes is in 1NF, 2NF, 3NF and BCNF. S2: {AB→C,D→E,E→C} is a minimal cover of {AB→C,D→E,AB→E,E→C}. Which holds? A: S1 true, S2 false. B: both true. C: S1 false, S2 true. D: both false.
Your answer
Answer & solution
Official answer: A
Our answer: A under the nonempty-determinant convention
1. Method and setup. For S2, equivalent covers must imply the same dependencies, not merely contain fewer entries. Compute (AB)⁺ under the proposed cover: it contains A,B,C but not E, showing a lost dependency. For S1, single-valuedness addresses 1NF; the stronger forms also depend on the possible functional dependencies and their determinants.
2. Work through the result and its assumptions. For a two-attribute relation, any nontrivial FD with nonempty determinant has a singleton determinant that determines both attributes, so it is a key; hence BCNF and the weaker forms hold. S2 is false because AB→E cannot be derived from the proposed cover. Thus A under the textbook convention. If empty determinants are allowed, ∅→B with varying A violates BCNF and 3NF, so the unconditional S1 needs qualification.
Banker’s algorithm manages resources X,Y,Z for P0,P1,P2. Allocation rows are P0=(0,0,1), P1=(3,2,0), P2=(2,1,1); maximum-demand rows are P0=(8,4,3), P1=(6,2,0), P2=(3,3,3). Available=(3,2,2), and the current state is safe. Consider independent requests: REQ1 P0 asks (0,0,2); REQ2 P1 asks (2,0,0). Which may be granted safely? A: REQ1 only. B: REQ2 only. C: both. D: neither.
Your answer
Answer & solution
Official answer: B
Step through it (2 checks)
1. Method and setup. Compute Need=Max−Allocation. For each request separately, tentatively decrease Available and increase the requester’s Allocation, then try to find a complete safe sequence. Sufficient available resources for the immediate grant is necessary but not sufficient; the updated state must still permit every process to finish.
2. Work through the result and its assumptions. Initial needs are P0=(8, 4, 2), P1=(3, 0, 0), P2=(1, 2, 2). Grant REQ1: available=(3, 2, 0); only P1 can finish, releasing(3, 2, 0) to give(6, 4, 0). Neither remaining process can finish, so unsafe. Grant REQ2: available=(1, 2, 2), P1 need=(1, 0, 0); finish P1 to get(6, 4, 2), then P2 to get(8, 5, 3), then P0. Only REQ2 is safe, B.
Five processes have (arrival time, execution time), in ms: A=(0,6), B=(3,2), C=(5,4), D=(7,6), E=(10,3). Under preemptive shortest-remaining-time-first on one CPU, find the average turnaround time in ms.
Answer & solution
Official answer: 7.2
Step through it (9 steps)
1. Method and setup. Reevaluate the currently running process whenever a new process arrives. Compare remaining execution time, not the original burst length. Record completion time for each process, then subtract its own arrival time; averaging completion times directly would ignore that the processes enter at different times.
2. Work through the result and its assumptions. SRTF executes A0–3, B3–5, A5–8, C8–12, E12–15, D15–21. At10, C has 2 remaining versus E’s3, so it continues. Completion-minus-arrival times are 8, 2, 7, 14, 5. Their mean 36/5=7.2ms.
Three page frames are initially empty. For page references 1,2,3,4,2,1,5,3,2,4,6, how many page faults occur with optimal replacement?
Answer & solution
Official answer: 7
Step through it (13 steps)
1. Method and setup. On a fault with full memory, evict the resident page whose next reference is farthest in the future, treating never-used-again pages as infinitely far away. This uses future knowledge and is an optimal benchmark, not LRU. Mark hits explicitly so that each reference contributes at most one fault.
2. Work through the result and its assumptions. Load1, 2, 3 (three faults). At4 evict 3, whose next use is later than 1/2 (fourth fault). Hits2, 1 follow. At5 evict 1, never used again (fifth). At3 evict 5, never reused (sixth). Then2 and 4 hit; 6 causes the seventh fault. This is Belady’s farthest-future policy.
An LR item set contains S→L·>R and Q→R·. On lookahead/input symbol <, does it contain a conflict? A: both shift-reduce and reduce-reduce. B: shift-reduce only. C: reduce-reduce only. D: neither. The symbol after the first dot is >, while the queried input is <.
Your answer
Answer & solution
Official answer: D
1. Method and setup. A shift is possible only for a terminal immediately after a dot, and a reduction only for a completed item, subject to the parser’s lookahead rules. Do not confuse the literal terminals < and >. There is only one completed item, so no pair of competing reductions is present.
2. Work through the result and its assumptions. The first item has its dot before >, not before <. Thus no shift is enabled on <. Only Q→R. is completed, so at most one reduction is possible on that symbol. There is neither a shift-reduce nor reduce-reduce conflict, D.
Let L̅ be the complement of language L. Which situation is impossible? A: Neither L nor L̅ is recursively enumerable (r.e.). B: One is r.e. but nonrecursive and the other is not r.e. C: Both are r.e. but nonrecursive. D: Both are recursive.
Your answer
Answer & solution
Official answer: C
1. Method and setup. A recognizer may loop forever on a nonmember, whereas a decider must halt on every input. If recognizers exist for both complementary sides, simulate their steps alternately. Every input belongs to exactly one side, so one simulation eventually accepts, allowing a halting membership decision.
2. Work through the result and its assumptions. If both a language and its complement have recognizers, dovetail them on the input; exactly one eventually accepts, deciding membership. Both would therefore be recursive. Hence both being r.e. but nonrecursive is impossible, C. The other possibilities occur, including non-r.e./non-co-r.e. languages.
A two-state DFA over {0,1} starts in nonaccepting state u and has accepting state v. Transitions are u--0→u, u--1→v, v--0→u, v--1→v. Which expressions describe its language? I: 0*1(1+00*1)*. II: 0*1*1+11*0*1. III: (0+1)*1. Here + is union. A: I,II only. B: I,III only. C: II,III only. D: all three.
Your answer
Answer & solution
Official answer: B
1. Method and setup. Read the invariant of the DFA: after any nonempty input, v means the latest symbol was 1, and u means it was 0. The empty word is rejected. Test the expressions against this exact language, not just a few accepted examples; one accepted word missing from II disproves equivalence.
2. Work through the result and its assumptions. The two-state DFA accepts precisely strings ending 1. Expression III states this directly. In I, an initial 0*1 is followed by repetitions of either 1 or a nonempty block of zeros followed by 1, so it describes exactly the same strings. II omits 0101, which the DFA accepts. Thus I and III, B.
Five bags are labeled 1 to 5. Each bag contains coins all weighing either 10 g or 11 g. Take respectively 1,2,4,8,16 coins from the five bags; their total weight is 323 g. Find the product of the labels of the bags with 11 g coins.
Answer & solution
Official answer: 12
1. Method and setup. The powers-of-two sample sizes encode the heavy bags uniquely. Subtract the weight obtained if every selected coin were light; each heavy bag contributes exactly its sampled number of extra grams. The requested product uses bag labels, not the numbers of coins taken.
2. Work through the result and its assumptions. If all selected coins weighed10g, total weight would be 31×10=310g. The extra 13g has binary decomposition 13=1+4+8. Thus bags 1, 3, 4 contain 11g coins, and the product of labels is 1×3×4=12.
Suppose a polynomial-time algorithm finds a largest clique in any graph. Which Venn diagram then describes P, NP and NP-complete (NPC)? A: NP is an outer region containing disjoint P and NPC regions. B: P and NP partially overlap, with NPC in their intersection. C: P=NP is the outer region and NPC is a proper inner subset. D: P=NP=NPC is one region.
Your answer
Answer & solution
Official answer: D
Our answer: C under standard many-one completeness; official D simplifies away trivial languages
1. Method and setup. The optimization algorithm decides whether a clique of size at least k exists, placing the NP-complete decision problem CLIQUE in P. Hence every NP problem becomes polynomial-time decidable. The remaining question is whether all members of P qualify as NP-complete under the chosen reduction convention; trivial languages are the important exception.
2. Work through the result and its assumptions. A polynomial maximum-clique algorithm decides CLIQUE in polynomial time, so NP-completeness implies P=NP. Every nontrivial language in P is then NP-complete: decide an NP source and map yes/no instances to fixed yes/no target strings. But ∅ and Σ* are in P and cannot be NP-hard under many-one reductions because a nontrivial language cannot reduce to either. Thus NPC is a proper subset of P=NP, diagram C. Official D is valid only after excluding these trivial languages or changing the reduction convention; keep this discrepancy explicit.
What is the minimum worst-case number of comparisons needed to find both the minimum and maximum of 100 numbers?
Answer & solution
Official answer: 147.1 to 148.1
Our answer: 148 worst-case comparisons
1. Method and setup. Finding extrema separately takes 99+99 comparisons and wastes information. Pair the elements: one comparison per pair identifies a candidate for the minimum and a candidate for the maximum. Thereafter only the pair-losers need participate in the minimum search and only the pair-winners in the maximum search.
2. Work through the result and its assumptions. Compare50 disjoint pairs. Find the minimum among 50 smaller values in 49 comparisons and maximum among 50 larger values in 49. Total 50+49+49=148. This matches the optimal worst-case lower bound ceil(3n/2)−2; an adversary forces enough first comparisons to classify candidates before eliminating all but one in each class.
A nine-slot hash table uses h(k)=k mod 9 and chaining. Insert keys 5,28,19,15,20,33,12,17,10 in that order. What are the maximum, minimum and average chain lengths over all slots? A: 3,0,1. B: 3,3,3. C: 4,0,1. D: 3,0,2.
Your answer
Answer & solution
Official answer: A
Step through it (11 steps)
1. Method and setup. Compute each key’s remainder, then count keys in each slot. Chaining does not probe or relocate a colliding key to another slot. Include empty slots when finding the minimum and when averaging: average chain length over the table is total keys divided by total slots.
2. Work through the result and its assumptions. The residues modulo 9 are 5, 1, 1, 6, 2, 6, 3, 8, 1. Slot1 has 3 keys; slots 0, 4, 7 are empty; all 9 slots together hold 9 keys, so average length 1. Maximum3, minimum 0, average 1: A.
In C, MyX(int *E,unsigned int size) first sets Y=0 and adds every E[i] to Y. It then loops i=0..size−1 and j=i..size−1, initializes Z=0, sums E[k] for k=i..j, and replaces Y by Z if Z>Y. It returns Y. What does it return? A: Maximum sum of a contiguous subarray. B: Maximum element in a subarray. C: Sum of maximum elements of all subarrays. D: Sum of all array elements.
Your answer
Answer & solution
Official answer: A
1. Method and setup. Each ordered index pair i≤j describes one nonempty contiguous subarray. The innermost loop computes its sum from scratch. The running variable Y retains the largest sum seen; initializing it to the whole-array sum ensures a valid candidate even when every entry is negative, unlike initializing the final maximum to zero.
2. Work through the result and its assumptions. Y starts as the sum of the whole array, itself a valid nonempty contiguous subarray. Every pair i≤j is then enumerated and Z sums exactly E[i..j]; Y is replaced whenever this sum is larger. Thus the final Y is the maximum nonempty subarray sum, A. This assumes a nonempty valid array, representable indices and no signed arithmetic overflow; for an empty array the routine returns 0.
Pseudocode sets D=2, then loops i=1..n, j=i..n, k=j+1..n, performing D=D*3 once per innermost iteration. How many multiplications occur? A: Half the product of three consecutive integers. B: One-third the product of three consecutive integers. C: One-sixth the product of three consecutive integers. D: None of these.
Your answer
Answer & solution
Official answer: C
1. Method and setup. Count valid index triples rather than estimating every loop as n iterations. For a fixed j, index i can take j values and k can take n−j values. Multiplying those independent choices and summing over j gives an exact count; the assignment D=2 performs no multiplication.
2. Work through the result and its assumptions. For each middle index j there are j choices of i and n−j choices of k. The number of multiplications is sum(j=1..n)j(n−j)=n·n(n+1)/2−n(n+1)(2n+1)/6=(n−1)n(n+1)/6, one-sixth the product of three consecutive integers, C.
A perfectly balanced six-stage instruction pipeline has no cycle-time overhead. While an application runs, 25% of its instructions incur two stall cycles each. Find the speedup relative to nonpipelined execution.
Answer & solution
Official answer: 4
1. Method and setup. Measure time in units of one pipeline stage. Without pipelining an instruction consumes six such units; in steady state the pipeline completes one instruction per cycle plus stalls. Weight the stall penalty by the fraction of affected instructions rather than adding two cycles to every instruction.
2. Work through the result and its assumptions. The average cycles per instruction is 1+0.25·2=1.5. A nonpipelined instruction takes six balanced stage times, so steady-state speedup is 6/1.5=4. This ignores fill/drain effects; for a finite N-instruction run with exactly N/2 stall cycles, the usual timing is 6N/(1.5N+5), approaching4.
A cache-block reference sequence has length N and n distinct block addresses. At most k distinct block addresses occur between two consecutive references to the same address. What is the miss ratio for an LRU cache with associativity A≥k? A: n/N. B: 1/N. C: 1/A. D: k/n. The printed inequality is non-strict, and the initial cache state is not specified.
Your answer
Answer & solution
Official answer: A
Our answer: A requires strict A>k and an initially empty cache
1. Method and setup. LRU evicts a block after A other distinct blocks mapped to its set have been accessed. Therefore a guaranteed hit requires the intervening distinct-block count for that set to be strictly less than A. Counting one compulsory miss per distinct address is valid only after establishing that all subsequent references hit and that first references begin uncached.
2. Work through the result and its assumptions. An LRU hit requires fewer than A distinct intervening blocks mapping to the same set. The stated bound k suffices when A>k, but not at A=k. For example, let a direct-mapped cache have A=k=1 and let distinct x, y map to the same set. The sequence x, y, x, y has N=4, n=2 and one distinct intervening block on each reuse, yet all four accesses miss, giving 1 rather than n/N=1/2. Thus the official cold-miss-only answer A needs a strict inequality (or a reuse-distance definition including the reused block) and an initially empty cache.
A 4-to-1 multiplexer has select lines S₁=P and S₀=Q. Data inputs numbered 0,1,2,3 are respectively 0,1,R,R̅, and output is F. Choose the minimal sum of products. A: P̅Q+QR̅+PQ̅R. B: P̅Q+P̅QR̅+PQR̅+PQ̅R. C: P̅QR+P̅QR̅+QR̅+PQ̅R. D: PQR̅.
Your answer
Answer & solution
Official answer: A
1. Method and setup. Enumerate the four select cases 00,01,10,11. Only the last three contribute nonzero outputs: data 1 contributes P̅Q, data R contributes PQ̅R, and data R̅ contributes PQR̅. Simplify this canonical mux expansion, taking care that the select bit order is P then Q.
2. Work through the result and its assumptions. Select inputs are P, Q and data inputs 0, 1, R, R′. Thus F=P′Q+PQ′R+PQR′. The first and third terms combine through P′Q+PQR′=Q(P′+PR′)=P′Q+QR′. Hence F=P′Q+QR′+PQ′R, option A. The minterm P=1, Q=0, R=1 is isolated and requires the three-literal term; the remaining on-set requires two additional implicants, establishing minimality.
For f(x)=x sin x, the identity f″(x)+f(x)+t cos x=0 holds. Find constant t.
Answer & solution
Official answer: -2 to -2
Our answer: −2
1. Method and setup. Differentiate using the product rule twice: first differentiate both x and sin x; then differentiate both terms of the result. Adding f to f″ cancels the x sin x terms. The remaining coefficient of cos x must be zero for the identity to hold for all x.
2. Work through the result and its assumptions. For f=x sin x, f′=sin x+x cos x and f″=2cos x−x sin x. Therefore f″+f+t cos x=(2+t)cos x vanishes identically exactly when t=−2.
A continuous function f on [0,2] satisfies f(0)=f(2)=−1 and f(1)=1. Which must hold? A: Some y∈(0,1) satisfies f(y)=f(y+1). B: Every y∈(0,1) satisfies f(y)=f(2−y). C: The maximum on (0,2) is 1. D: Some y∈(0,1) satisfies f(y)=−f(2−y). The source requests one choice.
Your answer
Answer & solution
Official answer: A
Our answer: Both A and D are guaranteed
1. Method and setup. Turn each claimed equality into a zero of a continuous auxiliary function. A difference handles A, while a sum handles D. Opposite endpoint signs force an interior zero by the intermediate value theorem. Continuity does not impose mirror symmetry or prevent values greater than 1 between the given sample points.
2. Work through the result and its assumptions. For A, define h(y)=f(y)−f(y+1). It is continuous on[0, 1], with h(0)=−2 and h(1)=2, so an interior zero exists. But D also follows: g(y)=f(y)+f(2−y) is continuous, g(0)=−2 and g(1)=2, so an interior zero gives f(y)=−f(2−y). Thus both A and D are necessarily true although the official single-choice key is A. This is a literal nonunique-answer discrepancy, not an assumed symmetry of f.
Four independent fair six-sided dice are rolled. The probability of a total of 22 is X/1296. Find X.
Answer & solution
Official answer: 10
1. Method and setup. There are 6⁴ equally likely ordered outcomes. Because 22 is close to the maximum 24, work with deficits from six rather than enumerating all possible die values. A deficit sum of two can arise as one deficit of two or two deficits of one, providing a quick independent count of 4+6 outcomes.
2. Work through the result and its assumptions. Write each die result as 6−di. Sum22 means d1+d2+d3+d4=2 with nonnegative deficits. The upper bound di≤5 is automatic, so stars and bars gives C(5, 3)=10 outcomes among 64=1296. Hence X=10, assuming independent fair dice.
An n-pennant is an ordered sequence of 1s and 2s whose sum is n. For example (1,1,2) is a 4-pennant, and (1,2) differs from (2,1). There is one 1-pennant and two 2-pennants. How many 10-pennants exist?
Answer & solution
Official answer: 88.9 to 89.1
Our answer: 89
1. Method and setup. Partition all sequences by their first symbol. Removing a leading 1 leaves an (n−1)-pennant; removing a leading 2 leaves an (n−2)-pennant. These classes are disjoint and exhaustive, yielding a Fibonacci-type recurrence without double counting different orders.
2. Work through the result and its assumptions. Let a 0=1 count the empty sequence and a 1=1. Partition sequences by their first entry 1 or 2: an=a(n−1)+a(n−2). The values through n=10 are 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89. Thus there are 89 ten-pennants, inside the published interval.
Let S be the set of functions f:{0,1}⁴→{0,1}. Let N be the number of functions from S to {0,1}. Find log₂(log₂ N).
Answer & solution
Official answer: 16
1. Method and setup. For a function from an m-element domain to {0,1}, each input independently chooses one of two outputs, so there are 2ᵐ functions. Apply this rule twice: first to the sixteen four-bit inputs, then to the resulting set of Boolean functions. Keep the two exponentiation levels distinct before taking logarithms.
2. Work through the result and its assumptions. The domain{0, 1}^4 has 16 elements, so S contains 216 Boolean functions. The number of functions from S to{0, 1} is N=22^16. Therefore log2(log2 N)=16.
A simple undirected graph has vertices (i,j) with 1≤i,j≤12. Two distinct vertices (a,b),(c,d) are adjacent exactly when |a−c|≤1 and |b−d|≤1. Self-loops are excluded. How many edges exist?
Answer & solution
Official answer: 506
1. Method and setup. The adjacency condition permits horizontal, vertical and diagonal neighboring grid points, like king moves on a chessboard. Count each undirected edge in one direction only. There are eleven gaps per row or column and two diagonals per unit square; longer or wrapping moves are not allowed.
2. Work through the result and its assumptions. Count horizontal and vertical nearest-neighbor edges: 12·11 each. Each of the 11·11 unit squares contributes two diagonals. These are all permitted distinct vertex pairs, so E=132+132+242=506; self-loops are excluded.
A nonincreasing tuple is graphic if it is the degree sequence of a simple undirected graph. Which six-tuple is not graphic? A: (1,1,1,1,1,1). B: (2,2,2,2,2,2). C: (3,3,3,1,0,0). D: (3,2,1,1,1,0).
Your answer
Answer & solution
Official answer: C
1. Method and setup. An even sum of degrees is necessary but not sufficient. Zero-degree vertices cannot be used as neighbors. In C only four vertices can have edges, so a degree-three vertex must connect to all the other nonisolated vertices. This forces more incidence on the proposed degree-one vertex than allowed.
2. Work through the result and its assumptions. For C, two zero-degree vertices leave only four nonisolated vertices. Each of the three degree 3 vertices must connect to all other three, forcing the fourth vertex to have degree at least 3 rather than 1. Thus C is impossible. A is three disjoint edges, B a six-cycle, and D is realized by edges 12, 13, 14, 25 with vertex 6 isolated, giving degrees 3, 2, 1, 1, 1, 0.
Which formula expresses exactly two of p,q,r being true? A: ((p↔q)∧r)∨(p∧q∧¬r). B: (¬(p↔q)∧r)∨(p∧q∧¬r). C: ((p→q)∧r)∨(p∧q∧¬r). D: (¬(p↔q)∧r)∧(p∧q∧¬r).
Your answer
Answer & solution
Official answer: B
1. Method and setup. Split on the truth value of r. When r is true, exactly one of p,q must be true, which is exclusive-or, the negation of equivalence. When r is false, both must be true. Combine these alternative cases with OR; AND would require r and ¬r simultaneously.
2. Work through the result and its assumptions. If r is true, exactly two true variables requires exactly one of p, q, namely NOT(p↔q). If r is false, both p and q must be true. The disjoint alternatives combine as[NOT(p↔q) AND r] OR[p AND q AND NOT r], B.
Schemas: employees(emp-id,first-name,last-name,hire-date,dept-id,salary) and departments(dept-id,dept-name,manager-id,location-id). To list last names and hire dates of all latest hires in each department at location 1700, the printed query is SELECT last-name,hire-date FROM employees WHERE (dept-id,hire-date) IN (SELECT dept-id,MAX(hire-date) FROM employees JOIN departments USING(dept-id) WHERE location-id=1700 GROUP BY dept-id). Outcome? A: Executes but incorrect. B: Executes and correct. C: Error because of pairwise comparison. D: Error because GROUP BY cannot accompany joins in a subquery. Hyphens are printed unquoted.
Your answer
Answer & solution
Official answer: B
Our answer: B after identifier syntax repair
1. Method and setup. Read the subquery from its FROM clause onward: join employees to departments, restrict the departments by location, and group to obtain each department’s latest date. The outer predicate must match both department and date, preventing a latest date from one department accidentally selecting a person in another. Separately audit the literal identifier syntax.
2. Work through the result and its assumptions. Treating the hyphenated labels as properly quoted identifiers (or replacing hyphens with underscores), the inner query groups employees by department at location 1700 and returns each latest hire date. The outer row-value IN comparison selects all employees tied at those dates in their departments. Thus the intended result is correct, B; GROUP BY with a join and pairwise IN are valid. Literally, unquoted dept-id, last-name and other hyphenated names are not ordinary SQL identifiers: subtraction is parsed or syntax fails, especially USING(dept-id). The printed query needs identifier quoting/renaming.
Processors P₁ and P₂ execute the same instruction set. For the same program and input under identical conditions, P₂ takes 25% less time but has 20% higher CPI than P₁. If P₁ runs at 1 GHz, what is P₂’s clock frequency in GHz?
Answer & solution
Official answer: 1.6
1. Method and setup. CPU time is instruction count multiplied by cycles per instruction and divided by cycles per second. Convert “25% less time” to a time ratio of 0.75, not a frequency multiplier of 1.25. Under the intended equal-instruction-count assumption, that count cancels when taking the ratio of execution times.
2. Work through the result and its assumptions. For the same instruction count, time=IC·CPI/frequency. Given T2/T1=0.75 and CPI2/CPI1=1.2, 0.75=1.2(f1/f2). Therefore f2=1.6f1=1.6GHz. This assumes the same executed instruction count for the same program/input, as intended.