The PYQ practice room
GATE CS 2016 Set 1
All 65 solved GATE CS 2016 Set 1 questions in exam order. Open a question, commit to an answer, and learn from the step-by-step solution. One question at a time.
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.Questions
65
Paper marks
100
Question formats
2
MCQ · NAT
Revision mode
Self-paced
No timer. Focus on understanding.
Explore the questions
General Aptitude (GA)
101
Q1MCQ1 markEasyOut of the following four sentences, select the most suitable sentence with respect to grammar and usage.Think it through. Then check your answer.Question
Out of the following four sentences, select the most suitable sentence with respect to grammar and usage.Correct answer
(D) I will not leave the place until the minister meets me.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The word 'until' itself conveys a negative sense (meaning 'up to the time that not'), so using another negative word like 'not' or 'doesn't' after it makes the sentence grammatically incorrect (double negative). Therefore, options (A) and (B) are incorrect.Between (C) and (D), the subject 'the minister' is singular third person, so the verb should be 'meets' (simple present tense). Option (C) uses 'meet', which is incorrect.Thus, option (D) is the correct sentence.2
Q2MCQ1 markEasyA rewording of something written or spoken is a ______________.Think it through. Then check your answer.Question
A rewording of something written or spoken is a ______________.Correct answer
(A) paraphrase
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A paraphrase is a rewording of something written or spoken by someone else.- Paradox: A seemingly absurd or self-contradictory statement or proposition that when investigated or explained may prove to be well founded or true.
- Paradigm: A typical example or pattern of something; a model.
- Paraffin: A flammable, whitish, translucent, waxy solid consisting of a mixture of saturated hydrocarbons.
3
Q3MCQ1 markEasyArchimedes said, “Give me a lever long enough and a fulcrum on which to place it, and I will move the world.” The sentence above is an example of a ___________ statement.Think it through. Then check your answer.Question
Archimedes said, “Give me a lever long enough and a fulcrum on which to place it, and I will move the world.”The sentence above is an example of a ___________ statement.Correct answer
(A) figurative
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Archimedes' statement is not meant to be taken literally (he did not actually intend to move the physical planet Earth with a lever). Instead, it is a figurative expression illustrating the immense mechanical advantage provided by a lever.- Figurative: Departing from a literal use of words; metaphorical.
- Collateral: Something pledged as security for repayment of a loan.
- Literal: Taking words in their usual or most basic sense without metaphor or allegory.
- Figurine: A statuette, especially one of a human form.
4
Q4MCQ1 markEasyIf ‘relftaga’ means carefree, ‘otaga’ means careful and ‘fertaga’ means careless, which of the following could mean ‘aftercare’?Think it through. Then check your answer.Question
If ‘relftaga’ means carefree, ‘otaga’ means careful and ‘fertaga’ means careless, which of the following could mean ‘aftercare’?Correct answer
(C) tagazen
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To solve this, we analyze the structure of the given words:1.Analyze the examples:- relftaga = carefree
- otaga = careful
- fertaga = careless
- All English words contain the root "care".
- All code words contain the suffix "taga".
- Therefore, taga corresponds to care.
- In English: Root + Suffix (e.g., Care + free).
- In Code: Prefix + Root (e.g., relf + taga).
- This indicates a reversal of the components: English Code .
- carefree (Care + free) relftaga (relf + taga). So, relf = free.
- careful (Care + ful) otaga (o + taga). So, o = ful.
- careless (Care + less) fertaga (fer + taga). So, fer = less.
- Structure: After + Care.
- Based on the reversal rule, the code should be: .
- Since , the code must start with taga.
- (A) zentaga: Ends in taga. Incorrect order.
- (B) tagafer: Starts with taga, but ends with "fer". We know from "fertaga" that "fer" means "less". So "tagafer" would mean "lesscare" (or similar). Incorrect.
- (C) tagazen: Starts with taga, followed by "zen". Since "zen" is a new element corresponding to "after", this fits the structure perfectly.
- (D) relffer: Does not contain taga. Incorrect.
5
Q5MCQ1 markMediumA cube is built using 64 cubic blocks of side one unit. After it is built, one cubic block is removed from every corner of the cube. The resulting surface area of the body (in…Think it through. Then check your answer.Question
A cube is built using 64 cubic blocks of side one unit. After it is built, one cubic block is removed from every corner of the cube. The resulting surface area of the body (in square units) after the removal is __________.Correct answer
(D) 96
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A cube built using 64 cubic blocks of side 1 unit forms a cube.
The initial surface area of the cube is square units.When a unit block is removed from a corner:1.Three faces of the corner block that were part of the surface are removed ( sq units).2.However, removing the corner block exposes three inner faces of the adjacent blocks ( sq units).The net change in surface area per corner removed is .
Since there are 8 corners, the total change is .Thus, the surface area remains square units.6
Q6MCQ2 marksMediumA shaving set company sells 4 different types of razors, Elegance, Smooth, Soft and Executive. Elegance sells at Rs. 48, Smooth at Rs. 63, Soft at Rs. 78 and Executive at Rs. 173…Think it through. Then check your answer.Question
A shaving set company sells 4 different types of razors, Elegance, Smooth, Soft and Executive. Elegance sells at Rs. 48, Smooth at Rs. 63, Soft at Rs. 78 and Executive at Rs. 173 per piece. The table below shows the numbers of each razor sold in each quarter of a year.Which product contributes the greatest fraction to the revenue of the company in that year?Quarter \ Product Elegance Smooth Soft Executive Q1 27300 20009 17602 9999 Q2 25222 19392 18445 8942 Q3 28976 22429 19544 10234 Q4 21012 18229 16595 10109 Correct answer
(B) Executive
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We calculate the total sales for each product and then multiply by the price to find the total revenue.Total Units Sold:- Elegance:
- Smooth:
- Soft:
- Executive:
- Elegance:
- Smooth:
- Soft:
- Executive:
7
Q7MCQ2 marksEasyIndian currency notes show the denomination indicated in at least seventeen languages. If this is not an indication of the nation’s diversity, nothing else is. Which of the…Think it through. Then check your answer.Question
Indian currency notes show the denomination indicated in at least seventeen languages. If this is not an indication of the nation’s diversity, nothing else is.Which of the following can be logically inferred from the above sentences?Correct answer
(D) Linguistic pluralism is strong evidence of India’s diversity.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sentence "If this is not an indication of the nation's diversity, nothing else is" is a rhetorical way of emphasizing that the presence of seventeen languages is a very strong proof (indication) of diversity. It does not literally mean there are no other indicators (ruling out B), nor does it specify the exact number of languages in the country (ruling out A). It implies that linguistic pluralism (multiple languages) is strong evidence of diversity.8
Q8MCQ2 marksMediumConsider the following statements relating to the level of poker play of four players P, Q, R and S. I. P always beats Q II. R always beats S III.…Think it through. Then check your answer.Question
Consider the following statements relating to the level of poker play of four players P, Q, R and S.I. P always beats Q
II. R always beats S
III. S loses to P only sometimes
IV. R always loses to QWhich of the following can be logically inferred from the above statements?(i) P is likely to beat all the three other players
(ii) S is the absolute worst player in the setCorrect answer
(D) neither (i) nor (ii)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
From the statements:1.2.3. loses to only sometimes (implies wins or draws against sometimes)4. (since always loses to )Combining the definite relationships: .
However, statement III says loses to only sometimes. This contradicts a strict transitive hierarchy where would always beat . Since can beat or draw with (the top player in the chain), is not the "absolute worst" player (refuting ii). Similarly, since does not always beat , we cannot infer is likely to beat all three other players consistently, especially given the non-transitive nature introduced by statement III. Thus, neither inference is logically sound based strictly on the provided statements.9
Q9MCQ2 marksEasyIf , which of the following is a factor of ?Think it through. Then check your answer.Question
If , which of the following is a factor of ?Correct answer
(B) (x-1)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
According to the Factor Theorem, is a factor of the polynomial if and only if .Let's test the options:
For option (B) , let :Since , is a factor of .10
Q10MCQ2 marksMediumIn a process, the number of cycles to failure decreases exponentially with an increase in load. At a load of 80 units, it takes 100 cycles for failure. When the load is halved, it…Think it through. Then check your answer.Question
In a process, the number of cycles to failure decreases exponentially with an increase in load. At a load of 80 units, it takes 100 cycles for failure. When the load is halved, it takes 10000 cycles for failure. The load for which the failure will happen in 5000 cycles is ________.Correct answer
(B) 46.02
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the relationship between the number of cycles to failure and the load be given by the exponential equation:Given:1.At , .2.When the load is halved, , .Dividing equation (2) by equation (1):Taking natural logarithm on both sides:We need to find the load for which .Dividing equation (2) by equation (3):Taking natural logarithm:Substitute :Since :Using :Thus, the load is 46.02 units.
COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
5511
Q11NAT1 markMediumLet represent the following propositions.
is a composite number is a perfect square is a prime number The…Think it through. Then check your answer.Question
Let represent the following propositions.
is a composite number
is a perfect square
is a prime numberThe integer which satisfies is ________.Correct answer
11 to 11
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We are given the logical expression: Using De Morgan's laws and logical equivalences:
So we need to find an integer that satisfies either or .Case 1: is true.- is true:
- is true: is NOT a composite number. Since , this means is prime.
- Checking the set from : (composite), (composite), (composite), (prime), (composite).
- The only value satisfying both is .
- is true: is a perfect square.
- is true: is a prime number.
- No integer is both a perfect square and a prime number. A perfect square has factors , so it has at least 3 factors (if ) or 1 factor (if ), making it composite or unit, never prime.
12
Q12MCQ1 markEasyLet be the number of -bit strings that do NOT contain two consecutive 1s. Which one of the following is the recurrence relation for ?Think it through. Then check your answer.Question
Let be the number of -bit strings that do NOT contain two consecutive 1s. Which one of the following is the recurrence relation for ?Correct answer
(B) aₙ = aₙ₋₁ + aₙ₋₂
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the number of valid -bit strings without consecutive 1s.A valid string of length can end in either '0' or '1'.1.Ends in '0': The preceding bits can be any valid string of length . The number of such strings is .2.Ends in '1': If the string ends in '1', the bit before it must be '0' (to avoid consecutive 1s). Thus, the string ends in '01'. The preceding bits can be any valid string of length . The number of such strings is .Total number of strings .This is the standard recurrence for Fibonacci numbers (with different initial conditions depending on definition).13
Q13NAT1 markEasy= ______________Think it through. Then check your answer.Question
= ______________Correct answer
1 to 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let .
As , .The limit becomes:This is a standard limit equal to .14
Q14NAT1 markEasyA probability density function on the interval is given by and outside this interval the value of the function is zero. The value of is ________.Think it through. Then check your answer.Question
A probability density function on the interval is given by and outside this interval the value of the function is zero. The value of is ________.Correct answer
0.5 to 0.5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For a function to be a valid probability density function (PDF) on the interval , the integral of the function over the interval must be equal to 1.Given:We set up the integral:Integrating :Applying the limits:Solving for :15
Q15NAT1 markEasyTwo eigenvalues of a real matrix are and . The determinant of is ___________.Think it through. Then check your answer.Question
Two eigenvalues of a real matrix are and . The determinant of is ___________.Correct answer
15 to 15
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Since is a real matrix, complex eigenvalues must occur in conjugate pairs.
Given one eigenvalue is .
Therefore, its conjugate is also an eigenvalue.
The third eigenvalue is given as .The determinant of a matrix is the product of its eigenvalues:16
Q16MCQ1 markEasyConsider the Boolean operator # with the following properties: and . Then is equivalent toThink it through. Then check your answer.Question
Consider the Boolean operator # with the following properties:
and . Then is equivalent toCorrect answer
(A) xy + xy
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the properties of the operator :1.2.3.4.Let's construct the truth table for :- If : . So, and .
- If : . So, and .
This truth table corresponds to the Exclusive OR (XOR) operation ().0 0 0 0 1 1 1 0 1 1 1 0
The Boolean expression for XOR is .Checking the options:
(A) (Matches XOR)
(B)
(C)
(D) (Matches XNOR)Thus, the correct expression is .17
Q17NAT1 markEasyThe 16-bit 2’s complement representation of an integer is 1111 1111 1111 0101; its decimal representation is ________.Think it through. Then check your answer.Question
The 16-bit 2’s complement representation of an integer is 1111 1111 1111 0101; its decimal representation is ________.Correct answer
-11
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given 16-bit number is . Since the Most Significant Bit (MSB) is 1, it is a negative number in 2's complement representation.To find its magnitude, we take the 2's complement of the number:1.Invert all bits:2.Add 1:The magnitude is .
Thus, the decimal representation is .18
Q18NAT1 markHardWe want to design a synchronous counter that counts the sequence 0-1-0-2-0-3 and then repeats. The minimum number of J-K flip-flops required to implement this counter is ________.Think it through. Then check your answer.Question
We want to design a synchronous counter that counts the sequence 0-1-0-2-0-3 and then repeats. The minimum number of J-K flip-flops required to implement this counter is ________.Correct answer
3 to 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The counter sequence is (repeats).The output sequence has length 6. Notice that the output '0' appears three times, but each time it transitions to a different next state (1, 2, or 3). Therefore, the internal states corresponding to these outputs must be distinct to determine the correct next state.The sequence of unique states required is:
(output 0) (output 1) (output 0) (output 2) (output 0) (output 3) Total number of distinct states in the cycle = 6.
To implement a counter with states, the minimum number of flip-flops required is .Number of flip-flops = .19
Q19NAT1 markEasyA processor can support a maximum memory of 4 GB, where the memory is word-addressable (a word consists of two bytes). The size of the address bus of the processor is at least…Think it through. Then check your answer.Question
A processor can support a maximum memory of 4 GB, where the memory is word-addressable (a word consists of two bytes). The size of the address bus of the processor is at least ________ bits.Correct answer
31 to 31
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:
Maximum memory size = 4 GB = bytes = bytes.
Word size = 2 bytes.
The memory is word-addressable.Number of addressable words = words.To address distinct locations, the address bus width must satisfy .
Therefore, bits.20
Q20MCQ1 markEasyA queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT ( refers to the…Think it through. Then check your answer.Question
A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT ( refers to the number of items in the queue)?Correct answer
(A) Both operations can be performed in O(1) time
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A queue implemented using an array can be made efficient by using a circular array (or circular buffer) technique. In a circular array implementation:- ENQUEUE: We insert an element at the
rearindex and updaterear = (rear + 1) % capacity. This takes time. - DEQUEUE: We remove an element from the
frontindex and updatefront = (front + 1) % capacity. This also takes time.
- ENQUEUE: We insert an element at the
21
Q21NAT1 markEasyConsider the following directed graph: [figure] The number of different topological orderings of the vertices of the graph is _______.Think it through. Then check your answer.Question
Consider the following directed graph:The number of different topological orderings of the vertices of the graph is _______.
Correct answer
6 to 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The graph is a Directed Acyclic Graph (DAG). The edges are:
, ,
, , In any topological sort:- Vertex must appear first (in-degree 0).
- Vertex must appear last (out-degree 0, depends on and ).
Due to the edges, must precede , and must precede .
We need to find the number of ways to interleave the sequence and .The number of ways to merge two sequences of lengths and while preserving relative order is given by .
Here, and . So, .The valid orderings are:1.2.3.4.5.6.Total topological orderings = 6.22
Q22MCQ1 markEasyConsider the following C program. [code] Which one of the following expressions, when placed in the blank above, will NOT result in a type checking error?Think it through. Then check your answer.Question
Consider the following C program.Which one of the following expressions, when placed in the blank above, will NOT result in a type checking error?void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; __________ ; // call to f() }Correct answer
(D) f(i, p)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function prototype isvoid f(int, short);. It expects anintand ashortas arguments and returnsvoid.Let's analyze the options:
(A)f(s, *s):sis ashort, so*sis invalid (dereferencing a non-pointer). Error.
(B)i = f(i, s): The function returnsvoid, so assigning the result toi(anint) is invalid. Error.
(C)f(i, *s):sis ashort, so*sis invalid. Error.
(D)f(i, *p):iisint(matches first parameter).pisshort *, so*pisshort(matches second parameter). The return type is ignored in an expression statement. This is valid.Therefore, (D) is the correct answer.23
Q23MCQ1 markEasyThe worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are:Think it through. Then check your answer.Question
The worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are:Correct answer
(D) Θ(n²), Θ(n log n), and Θ(n²)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Insertion Sort: In the worst case (e.g., reverse sorted array), the time complexity is .2.Merge Sort: The recurrence relation is , which solves to in the worst case.3.Quick Sort: In the worst case (e.g., already sorted array with first/last element as pivot), the recurrence is , which solves to .Therefore, the respective worst-case running times are , , and .24
Q24MCQ1 markMediumLet be a weighted connected undirected graph with distinct positive edge weights. If every edge weight is increased by the same value, then which of the following statements…Think it through. Then check your answer.Question
Let be a weighted connected undirected graph with distinct positive edge weights. If every edge weight is increased by the same value, then which of the following statements is/are TRUE?P: Minimum spanning tree of does not change
Q: Shortest path between any pair of vertices does not changeCorrect answer
(A) P only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the original weight of an edge be . After increasing every edge weight by a constant , the new weight becomes .Statement P: Minimum spanning tree (MST) of does not change.
Kruskal's algorithm builds an MST by sorting edges in non-decreasing order of their weights. Since , the relative order of edge weights remains unchanged. Consequently, the set of edges selected for the MST remains the same. Thus, P is TRUE.Statement Q: Shortest path between any pair of vertices does not change.
Consider a path with edges. The total weight of this path increases by . Paths with fewer edges are penalized less than paths with more edges. This can change the shortest path.Example:
Let there be two paths between and :- Path 1: 1 edge with weight 10.
- Path 2: 3 edges with weights 2, 2, 2 (Total = 6).
- Path 1 new weight: .
- Path 2 new weight: .
25
Q25NAT1 markEasyConsider the following C program. [code] The output of the program is ________ .Think it through. Then check your answer.Question
Consider the following C program.The output of the program is ________ .#include<stdio.h> void mystery(int *ptra, int *ptrb) { int *temp; temp = ptrb; ptrb = ptra; ptra = temp; } int main() { int a=2016, b=0, c=4, d=42; mystery(&a, &b); if (a < c) mystery(&c, &a); mystery(&a, &d); printf("%d\n", a); }Correct answer
2016 to 2016
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The functionmysterytakes two integer pointers as arguments. Inside the function, it swaps the values of the local pointer variablesptraandptrb.Since C passes arguments by value,void mystery(int *ptra, int *ptrb) { int *temp; temp = ptrb; ptrb = ptra; ptra = temp; }ptraandptrbinmysteryare copies of the addresses passed frommain. Swapping these local copies does not affect the variables inmain, nor does it affect the values stored at those addresses (because there is no dereferencing involved, i.e., no*ptra = ...).Execution trace:1.int a=2016, b=0, c=4, d=42;initializes the variables.2.mystery(&a, &b);is called. The function swaps its local pointers.aandbinmainremain unchanged.ais still 2016.3.if (a < c)checks if2016 < 4. This is false.4.The statementmystery(&c, &a);inside theifblock is skipped.5.mystery(&a, &d);is called. Again, no change toaord.6.Output: 2016printf("%d\n", a);prints the value ofa, which is 2016.26
Q26MCQ1 markEasyWhich of the following languages is generated by the given grammar?Think it through. Then check your answer.Question
Which of the following languages is generated by the given grammar?Correct answer
(D) \a,b\^
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given grammar is:This is a right-linear grammar.- The production allows generating an 'a' and returning to state .
- The production allows generating a 'b' and returning to state .
- The production allows terminating the string.
- (using )
- (using )
- (using )
- (using )
- (using )
27
Q27MCQ1 markMediumWhich of the following decision problems are undecidable? I. Given NFAs and , is ? II. Given a CFG and a string…Think it through. Then check your answer.Question
Which of the following decision problems are undecidable?I. Given NFAs and , is ?
II. Given a CFG and a string , does ?
III. Given CFGs and , is ?
IV. Given a TM , is ?Correct answer
(C) III and IV only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze each problem:I. Emptiness of Intersection of Regular Languages: Given NFAs and , their languages and are regular. The intersection of two regular languages is regular. The emptiness problem for regular languages is decidable (reachability in the state graph). Thus, this is decidable.II. Membership Problem for CFGs: Given a CFG and string , determining if is the standard parsing problem. The CYK algorithm can solve this in time. Thus, this is decidable.III. Equivalence Problem for CFGs: Determining if for two context-free grammars is a known undecidable problem. (Note: Equivalence is decidable for DCFGs, but not for general CFGs).IV. Emptiness Problem for Turing Machines: Determining if for a TM is undecidable (Rice's Theorem or reduction from the Halting Problem).Therefore, problems III and IV are undecidable.28
Q28MCQ1 markMediumWhich one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?Think it through. Then check your answer.Question
Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?Correct answer
(B) (0+1)^ (00(0+1)^ 11+11(0+1)^ 00)(0+1)^
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem asks for strings containing both "00" and "11" as substrings.Since both substrings must appear, there are two mutually exclusive cases regarding their relative order:1."00" appears before "11". The pattern is: (anything) followed by "00", followed by (anything), followed by "11", followed by (anything).Regex:2."11" appears before "00". The pattern is: (anything) followed by "11", followed by (anything), followed by "00", followed by (anything).Regex: The union of these two cases covers all valid strings.Option (B) combines these:This matches the logic exactly.Why other options are incorrect:- (A) requires "00" and "11" to be immediately adjacent (e.g., "0011" or "1100"). It misses strings like "001011".
- (C) represents strings containing "00" OR "11". The question requires AND.
- (D) forces the string to start with one pattern and end with the other. It misses strings like "100110".
29
Q29NAT1 markMediumConsider the following code segment. [code] The minimum number of total variables required to convert the above code segment to static single assignment form is __________.Think it through. Then check your answer.Question
Consider the following code segment.The minimum number of total variables required to convert the above code segment to static single assignment form is __________.x = u - t; y = x * v; x = y + w; y = t - z; y = x * y;Correct answer
10 to 10
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Static Single Assignment (SSA) form requires that every variable is assigned exactly once. We rename the variables on the left-hand side (LHS) to ensure this property and update the uses on the right-hand side (RHS) to refer to the most recent definition.Let's convert the code line by line:1.x = u - t;x1 = u - t;(First assignment to x)2.y = x * v;y1 = x1 * v;(First assignment to y, uses x1)3.x = y + w;x2 = y1 + w;(Second assignment to x, uses y1)4.y = t - z;y2 = t - z;(Second assignment to y)5.Now, let's count the total distinct variables used in the SSA form:Input variables (read but not written in this block):y = x * y;y3 = x2 * y2;(Third assignment to y, uses x2 and y2)1.u2.t3.v4.w5.New SSA variables (defined in the block):z6.x17.y18.x29.y210.Total variables = 5 (inputs) + 5 (definitions) = 10.y330
Q30MCQ1 markEasyConsider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling…Think it through. Then check your answer.Question
Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?Correct answer
(A) Shortest remaining time first
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The Shortest Job First (SJF) scheduling algorithm is optimal for minimizing the average waiting time for a given set of processes. Shortest Remaining Time First (SRTF) is the preemptive version of SJF. When all processes are submitted at the same time (i.e., they all have an arrival time of 0), SRTF behaves identically to non-preemptive SJF because no new process with a shorter burst time can arrive to preempt the currently running one. Therefore, SRTF will minimize the average waiting time in this scenario.31
Q31MCQ1 markEasyWhich of the following is NOT a superkey in a relational schema with attributes and primary key ?Think it through. Then check your answer.Question
Which of the following is NOT a superkey in a relational schema with attributes and primary key ?Correct answer
(B) VWXZ
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A superkey is a set of attributes within a table whose values can be used to uniquely identify a tuple. A superkey is a superset of a candidate key.Given:- Attributes:
- Primary Key (Candidate Key):
- (A) : Contains and . It is a superkey.
- (B) : Contains but does not contain . Since it does not contain the primary key , and no other functional dependencies are given to imply another key, it is not a superkey.
- (C) : Contains and . It is a superkey.
- (D) : Contains and . It is a superkey (trivial superkey).
32
Q32MCQ1 markEasyWhich one of the following is NOT a part of the ACID properties of database transactions?Think it through. Then check your answer.Question
Which one of the following is NOT a part of the ACID properties of database transactions?Correct answer
(D) Deadlock-freedom
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The ACID properties of database transactions stand for:- **A**tomicity
- **C**onsistency
- **I**solation
- **D**urability
33
Q33MCQ1 markMediumA database of research articles in a journal uses the following schema. …Think it through. Then check your answer.Question
A database of research articles in a journal uses the following schema.
The primary key is and the following functional dependencies exist in the schema.
The database is redesigned to use the following schemas.
Which is the weakest normal form that the new database satisfies, but the old one does not?Correct answer
(B) 2NF
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the original relation be . The primary key is .
The functional dependency is a partial dependency because is a proper subset of the candidate key . Therefore, the original relation is in 1NF but not in 2NF.The decomposed relations are:1. with key . All FDs are full dependencies. It is in BCNF.2. with key . The FD is full. It is in BCNF.The new database design satisfies 2NF, 3NF, and BCNF.
The old database design satisfied 1NF but failed 2NF.
The question asks for the weakest normal form that the new database satisfies but the old one does not. The set of such normal forms is . The weakest among these is 2NF.34
Q34MCQ1 markEasyWhich one of the following protocols is NOT used to resolve one form of address to another one?Think it through. Then check your answer.Question
Which one of the following protocols is NOT used to resolve one form of address to another one?Correct answer
(C) DHCP
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
- DNS (Domain Name System): Resolves Domain Names (e.g., www.google.com) to IP addresses.
- ARP (Address Resolution Protocol): Resolves IP addresses to MAC (hardware) addresses.
- RARP (Reverse Address Resolution Protocol): Resolves MAC addresses to IP addresses.
- DHCP (Dynamic Host Configuration Protocol): Used to dynamically assign IP addresses and other configuration parameters to devices on a network. While it involves addresses, it is a configuration protocol, not primarily an address resolution protocol used to map one address type to another for communication flow like the others.
35
Q35MCQ1 markEasyWhich of the following is/are example(s) of stateful application layer protocols? (i) HTTP (ii) FTP (iii) TCP (iv) POP3Think it through. Then check your answer.Question
Which of the following is/are example(s) of stateful application layer protocols?(i) HTTP
(ii) FTP
(iii) TCP
(iv) POP3Correct answer
(C) (ii) and (iv) only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.HTTP (HyperText Transfer Protocol): It is a stateless protocol because the server does not keep track of the client's state between requests.2.FTP (File Transfer Protocol): It is a stateful protocol. The control connection remains open during the session, maintaining the state of the user (authentication, current directory, etc.).3.TCP (Transmission Control Protocol): While TCP is stateful (connection-oriented), it is a Transport Layer protocol, not an Application Layer protocol.4.POP3 (Post Office Protocol version 3): It is a stateful protocol. The server maintains the state of the user's mailbox (e.g., which messages have been deleted or retrieved) during the session.Thus, the stateful application layer protocols are FTP and POP3.Correct Option: (C)36
Q36NAT2 marksMediumThe coefficient of in is ________.Think it through. Then check your answer.Question
The coefficient of in is ________.Correct answer
10 to 10
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given expression is .
Inside the parenthesis, we have a geometric series with first term and common ratio . The sum of an infinite geometric series is given by .
So, the expression becomes:We need to find the coefficient of in this expansion. Since there is already a factor of , we need to find the coefficient of in the expansion of .The general binomial expansion for is:Here, and we need the coefficient for :Thus, the coefficient of is 10.37
Q37NAT2 marksMediumConsider the recurrence relation . Let . The value of is ________.Think it through. Then check your answer.Question
Consider the recurrence relation . Let . The value of is ________.Correct answer
197.9 to 198.1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The recurrence relation is given by:This holds for . We can express as the sum of these differences plus the initial term. However, let's check if the formula for the difference works for to define a consistent . If , and given , then . Thus, we can write as a summation from to :Using the standard summation formulas and :Factor out :We need to find :Comparing with , we get:38
Q38NAT2 marksHardA function , defined on the set of positive integers , satisfies the following properties:…Think it through. Then check your answer.Question
A function , defined on the set of positive integers , satisfies the following properties:Let be the set of distinct values that takes. The maximum possible size of is __________.Correct answer
2 to 2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function is determined by the recurrence relations. Since for even , the value of depends only on the odd part of . We can restrict our attention to odd integers.For an odd integer , the relation is . Since is odd, is even. Let , where is odd. Then . Thus, the recurrence defines a directed graph on odd integers where an edge exists from to the odd part of .Let's trace the paths for various odd integers:
The condition for a cycle of length 2 () leads to . For non-multiples of 5, this yields the solution .It can be shown that all multiples of 5 eventually reach the fixed point 5, and all non-multiples of 5 eventually reach the cycle .Since there are exactly two disjoint components (basins of attraction) in this functional graph, we can assign a distinct value to each component. For example, let for all in the first component and for all in the second component. If , the range has size 2.Thus, the maximum possible size of is 2.39
Q39NAT2 marksMediumConsider the following experiment. Step 1. Flip a fair coin twice. Step 2. If the outcomes are (TAILS, HEADS) then output and stop. Step 3. If the outcomes are…Think it through. Then check your answer.Question
Consider the following experiment.Step 1. Flip a fair coin twice.
Step 2. If the outcomes are (TAILS, HEADS) then output and stop.
Step 3. If the outcomes are either (HEADS, HEADS) or (HEADS, TAILS), then output and stop.
Step 4. If the outcomes are (TAILS, TAILS), then go to Step 1.The probability that the output of the experiment is is (up to two decimal places)
__________.Correct answer
0.33 to 0.34
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
LetP(Y)be the probability that the output is .
The sample space for two coin flips is , each with probability .- Step 2: Outcome is . Probability is . Output is .
- Step 3: Outcomes are or . Probability is . Output is .
- Step 4: Outcome is . Probability is . The experiment repeats (goes back to Step 1).
P(Y)based on the first round of flips:40
Q40MCQ2 marksMediumConsider the two cascaded 2-to-1 multiplexers as shown in the figure. [figure] The minimal sum of products form of the output isThink it through. Then check your answer.Question
Consider the two cascaded 2-to-1 multiplexers as shown in the figure.The minimal sum of products form of the output is
Correct answer
(D) QR + PQR
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the circuit:First Multiplexer (MUX1):- Select input:
- Input 0:
- Input 1:
- Output
- Select input:
- Input 0: (as indicated by the label on the wire connected to input 0)
- Input 1: Output of MUX1 ()
- Output
41
Q41NAT2 marksMediumThe size of the data count register of a DMA controller is 16 bits. The processor needs to transfer a file of 29,154 kilobytes from disk to main memory. The memory is byte…Think it through. Then check your answer.Question
The size of the data count register of a DMA controller is 16 bits. The processor needs to transfer a file of 29,154 kilobytes from disk to main memory. The memory is byte addressable. The minimum number of times the DMA controller needs to get the control of the system bus from the processor to transfer the file from the disk to main memory is __________.Correct answer
456 to 456
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Data Count Register Size: 16 bits. This implies the maximum number of bytes that can be transferred in a single DMA operation is bytes (assuming the count register specifies the number of bytes and 0 represents the maximum count or similar mechanism). .2.File Size: .3.Calculation: The number of transfers required is the total size divided by the maximum transfer size per cycle.Taking the ceiling, we get 456.Therefore, the DMA controller needs to get control of the system bus 456 times.42
Q42NAT2 marksMediumThe stage delays in a 4-stage pipeline are 800, 500, 400 and 300 picoseconds. The first stage (with delay 800 picoseconds) is replaced with a functionally equivalent design…Think it through. Then check your answer.Question
The stage delays in a 4-stage pipeline are 800, 500, 400 and 300 picoseconds. The first stage (with delay 800 picoseconds) is replaced with a functionally equivalent design involving two stages with respective delays 600 and 350 picoseconds. The throughput increase of the pipeline is __________ percent.Correct answer
33 to 34
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Original Pipeline:- Stage delays: 800, 500, 400, 300 ps.
- Cycle time () is determined by the slowest stage: .
- Throughput () = .
- The 800 ps stage is split into two stages of 600 ps and 350 ps.
- New stage delays: 600, 350, 500, 400, 300 ps.
- New cycle time () is determined by the slowest stage: .
- Throughput () = .
43
Q43MCQ2 marksMediumConsider a carry lookahead adder for adding two -bit integers, built using gates of fan-in at most two. The time to perform addition using this adder isThink it through. Then check your answer.Question
Consider a carry lookahead adder for adding two -bit integers, built using gates of fan-in at most two. The time to perform addition using this adder isCorrect answer
(B) Θ(log(n))
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In a Carry Lookahead Adder (CLA), the carry generation and propagation logic can be computed in constant time if gates with unbounded fan-in are allowed. However, the question specifies that gates have a fan-in of at most two.With a fixed fan-in of 2, the logic to compute the carry for the -th bit requires combining information from all previous bit positions. This forms a tree structure (like a binary tree) of gates. The depth of a binary tree with leaves is proportional to .Therefore, the delay (time) to perform addition grows logarithmically with the number of bits . The time complexity is .44
Q44MCQ2 marksEasyThe following function computes the maximum value contained in an integer arrayp[]of sizen(n >= 1). [code] The missing loop condition isThink it through. Then check your answer.Question
The following function computes the maximum value contained in an integer arrayp[]of sizen(n >= 1).The missing loop condition isint max(int *p, int n) { int a=0, b=n-1; while (__________) { if (p[a] <= p[b]) { a = a+1; } else { b = b-1; } } return p[a]; }Correct answer
(D) b != a
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function uses a two-pointer approach to find the maximum element in the array.1.Initialization:apoints to the start (0) andbpoints to the end (n-1) of the array.2.Logic: In each iteration, we comparep[a]andp[b].- If
p[a] <= p[b], thenp[a]cannot be the unique maximum (sincep[b]is greater or equal), so we incrementato discard it. - If
p[a] > p[b], thenp[b]cannot be the maximum, so we decrementbto discard it.
aandbare distinct indices. Whena == b, only one element remains, which must be the maximum.Therefore, the loop condition should beb != a(ora < b).Checking the options:- (A)
a != n: Incorrect,astops when it meetsb. - (B)
b != 0: Incorrect. - (C)
b > (a + 1): This would stop whenbandaare adjacent, leaving two elements unchecked against each other. - (D)
b != a: Correct. The loop runs untilaandbconverge to the single maximum element.
- If
45
Q45MCQ2 marksMediumWhat will be the output of the following C program? [code]Think it through. Then check your answer.Question
What will be the output of the following C program?void count(int n){ static int d=1; printf("%d ", n); printf("%d ", d); d++; if(n>1) count(n-1); printf("%d ", d); } void main(){ count(3); }Correct answer
(A) 3 1 2 2 1 3 4 4 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's trace the execution.dis a static variable initialized to 1. It retains its value across function calls.1.maincallscount(3):- Prints
n: 3 - Prints
d: 1 -
dbecomes 2. -
n > 1(3 > 1) is true. Callscount(2).
count(2):- Prints
n: 2 - Prints
d: 2 (current value of staticd) -
dbecomes 3. -
n > 1(2 > 1) is true. Callscount(1).
count(1):- Prints
n: 1 - Prints
d: 3 (current value of staticd) -
dbecomes 4. -
n > 1(1 > 1) is false. Recursion stops. - Prints
d: 4 (current value of staticd) - Returns to
count(2).
count(2):- Prints
d: 4 (current value of staticd) - Returns to
count(3).
count(3):- Prints
d: 4 (current value of staticd) - Returns to
main.
- Prints
46
Q46MCQ2 marksMediumWhat will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed? [code]Think it through. Then check your answer.Question
What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed?a=3; void n(x) {x = x * a; print(x);} void m(y) {a = 1; a = y - a; n(a); print(a);} void main() {m(a);}Correct answer
(D) 4, 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's trace the execution with Pass by Reference and Dynamic Scoping.1.Global:a = 3.2.main(): Callsm(a). The globalais passed by reference tom's parametery.-
yis an alias for globala.
m(y):-
a = 1: Since this is pseudo-code andais assigned a value, we assumeais a local variable inm(otherwise, if it modified globala, the output would be 0,0 which is not an option). So,mhas a locala = 1. -
a = y - a:yrefers to globala(3). Localais 1. So, locala = 3 - 1 = 2. -
n(a): Callsnpassing locala(value 2) by reference.
n(x):-
xis an alias form's locala. -
x = x * a: We need to resolve the variablea. - Dynamic Scoping: We look up the call stack. The caller is
m. Doesmhave a variable nameda? Yes,mhas a locala. - So,
ain the expression refers tom's locala(which is 2). -
xalso refers tom's locala(passed by reference). - The statement becomes:
m.a = m.a * m.a=>m.a = 2 * 2 = 4. -
print(x): Prints 4.
m(y):-
print(a): Prints locala. Sincen(x)modified it via reference, localais now 4. - Prints 4.
-
47
Q47MCQ2 marksMediumAn operator for a binary heap data structure is to be designed to delete the item in the -th node. Assume that the heap is implemented in an array and refers to…Think it through. Then check your answer.Question
An operator for a binary heap data structure is to be designed to delete the item in the -th node. Assume that the heap is implemented in an array and refers to the -th index of the array. If the heap tree has depth (number of edges on the path from the root to the farthest leaf), then what is the time complexity to re-fix the heap efficiently after the removal of the element?Correct answer
(B) O(d) but not O(1)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To delete an element at index in a binary heap (implemented as an array):1.Replace the element at index with the last element in the heap (the rightmost leaf at the deepest level).2.Remove the last element.3.Restore the heap property by sifting the new element at index either up or down (heapify).The height of the heap is . The sift operation takes time proportional to the height of the tree, which is .
Since depends on , it is not .
Thus, the time complexity is but not .48
Q48NAT2 marksHardConsider the weighted undirected graph with 4 vertices, where the weight of edge is given by the entry in the matrix .…Think it through. Then check your answer.Question
Consider the weighted undirected graph with 4 vertices, where the weight of edge is given by the entry in the matrix .The largest possible integer value of , for which at least one shortest path between some pair of vertices will contain the edge with weight is _________.Correct answer
12 to 12
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the vertices be 1, 2, 3, 4. The edge weights are:
We want to find the largest integer such that the edge is part of a shortest path between some pair of vertices. The most likely candidate pair is itself.Calculate the shortest path between 3 and 4 using only the other edges:- Path :
- Path :
- Path :
For the direct edge with weight to be a shortest path, we must have .If , the edge is a shortest path (length 12). If , the path is strictly shorter, so would not be used.Check if can be larger for other pairs:- For pair , shortest path is via 2 (length ). Via : . Requires .
- For pair , shortest path is via 1 (length ). Via : . Requires .
49
Q49NAT2 marksMediumLet be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5, and 6. The maximum possible weight that a minimum weight spanning tree of…Think it through. Then check your answer.Question
Let be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5, and 6. The maximum possible weight that a minimum weight spanning tree of can have is _________.Correct answer
7 to 7
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We want to assign the weights to the edges of such that the Minimum Spanning Tree (MST) weight is maximized.Kruskal's algorithm adds edges in increasing order of weight unless they form a cycle.1.Edge with weight 1 is always added (no cycle possible with 1 edge).2.Edge with weight 2 is always added (no cycle possible with 2 edges in a simple graph).Current MST weight = . The MST for 4 vertices must have 3 edges. We need to select one more edge.
We want to force the algorithm to reject smaller weights (3, 4, ...) so that a larger weight is chosen.- Can we reject 3? Yes, if edges 1, 2, and 3 form a triangle (cycle of length 3). Let vertices be . Edges . Edge 3 forms a cycle and is rejected.
- Now we have a connected component and an isolated vertex . We need to connect to the component.
- The available edges connecting to are .
- The remaining weights are . These must be assigned to these three edges.
- Kruskal's algorithm will pick the smallest available edge to connect the components. The smallest remaining weight is 4.
- Edge 4 does not form a cycle (it connects a new vertex). So 4 is added.
50
Q50MCQ2 marksMediumis an undirected simple graph in which each edge has a distinct weight, and is a particular edge of . Which of the following statements about the minimum…Think it through. Then check your answer.Question
is an undirected simple graph in which each edge has a distinct weight, and is a particular edge of . Which of the following statements about the minimum spanning trees (MSTs) of is/are TRUE?I. If is the lightest edge of some cycle in , then every MST of includes
II. If is the heaviest edge of some cycle in , then every MST of excludesCorrect answer
(B) II only
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Statement II is the standard Cycle Property of Minimum Spanning Trees: For any cycle in the graph, the edge with the maximum weight in that cycle is not in the MST (assuming distinct weights). Thus, Statement II is TRUE.Statement I is FALSE. The Cut Property states that if an edge is the minimum weight edge crossing some cut, it is in the MST. However, being the lightest edge in some cycle does not guarantee it is in the MST. Counter-example for I:
Consider a graph with vertices and two paths between them:1.Path : a single edge with weight 100.2.Path : edges with weight 10 and with weight 20.3.Path : edges with weight 200 and with weight 300.Consider the cycle formed by and : edges are . Here, is the lightest edge in cycle .
However, the MST will use path (weights 10, 20) to connect and because they are much smaller than 100. The edge forms a cycle with (edges ) where 100 is the heaviest edge, so is excluded from the MST.Thus, only Statement II is correct.51
Q51NAT2 marksHardLet denote a queue containing sixteen numbers and be an empty stack. returns the element at the head of the queue without removing it from . Similarly…Think it through. Then check your answer.Question
Let denote a queue containing sixteen numbers and be an empty stack. returns the element at the head of the queue without removing it from . Similarly returns the element at the top of without removing it from . Consider the algorithm given below.The maximum possible number of iterations of the while loop in the algorithm is __________.while Q is not Empty do if S is Empty OR Top(S) <= Head(Q) then x := Dequeue(Q); Push(S, x); else x := Pop(S); Enqueue(Q, x); end endCorrect answer
256 to 256
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the number of elements in the queue. The algorithm attempts to move elements from the queue to the stack such that the elements in are in non-decreasing order from top to bottom (which means they will be sorted when popped). If the current element at the head of is greater than or equal to the top of , it is pushed onto . If it is smaller, the top element of is popped and enqueued back to . This behavior is similar to a sorting process where elements are cycled until they can be placed in the correct order.The worst-case scenario for the number of iterations occurs when the input queue is sorted in decreasing order (e.g., ). In this case, the algorithm performs iterations.Let's trace for small :- For (Input: ): 1 iteration.
- For (Input: ):
2. : Pop 2, Enqueue 2 ()
3. Dequeue 1, Push 1 ()
4. : Dequeue 2, Push 2 ()
Total: 4 iterations ().- For (Input: ): Total 9 iterations ().
Given , the maximum number of iterations is:52
Q52MCQ2 marksEasyConsider the following context-free grammars: Which one of…Think it through. Then check your answer.Question
Consider the following context-free grammars:
Which one of the following pairs of languages is generated by and , respectively?Correct answer
(D) \a^m bⁿ m ≥ 0 and n 0\ and \a^m bⁿ m 0 or n 0\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For :
generates one or more 's ().
generates zero or more 's followed by . Thus, generates .
This corresponds to the language .For :
First, generates zero or more 's ().
Next, generates . (Since generates , and allows transitioning to or terminating).
Finally, :- generates . (At least one , any number of 's).
- generates . (At least one , zero 's).
Thus, the condition is or .Matching with options:
This corresponds to Option (D).53
Q53MCQ2 marksMediumConsider the transition diagram of a PDA given below with input alphabet and stack alphabet . is the initial stack symbol. Let denote…Think it through. Then check your answer.Question
Consider the transition diagram of a PDA given below with input alphabet and stack alphabet . is the initial stack symbol. Let denote the language accepted by the PDA.Which one of the following is TRUE?
Correct answer
(D) L = \aⁿ n ≥ 0\ ∪ \aⁿ bⁿ n ≥ 0\ and is deterministic context-free
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given PDA operates as follows:1.Start State: The transition reads an '', pops the initial stack symbol , and pushes . This ensures the string starts with at least one ''.2.Second State: The loop pushes an for every subsequent ''. If there are ''s total, there will be 's on the stack (since the first '' pushed an via ).3.Transition to Third State: The transition reads a '' and pops an . This begins the matching process.4.Third State: The loop continues to pop an for every '' read.5.Final Transition: The transition to the final state is only possible if the stack top is . This happens only when all 's have been popped, meaning the number of ''s equals the number of ''s.Thus, the language accepted is .Analyzing the options:- (A) This option describes the language as (with , which is the standard form, though this specific PDA requires ). Crucially, the language is a Context-Free Language (CFL) but not a Regular Language. Therefore, it cannot be accepted by any finite automata. This statement is TRUE.
- (B) & (D) The PDA does not accept strings of the form (where no ''s follow), so the language is not the union .
- (C) The language is Context-Free, which implies it is Recursive. Any Recursive language is accepted by a Turing Machine that halts on every input.
54
Q54MCQ2 marksMediumLet be a recursive language and be a recursively enumerable but not recursive language. Let and be two languages such that reduces to , and …Think it through. Then check your answer.Question
Let be a recursive language and be a recursively enumerable but not recursive language. Let and be two languages such that reduces to , and reduces to (reduction means the standard many-one reduction). Which one of the following statements is TRUE?Correct answer
(C) W is not recursively enumerable and Z is recursive.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:1. is a recursive language.2. is a recursively enumerable (RE) but not recursive language.3. ( reduces to ).4. ( reduces to ).Analysis of :
Since is recursive, its complement is also recursive (recursive languages are closed under complementation).
We are given .
Property: If and is recursive, then is recursive.
Since is recursive, must be recursive.Analysis of :
We are given that is RE but not recursive. This implies that is undecidable.
Property: A language is recursive if and only if both and are RE.
Since is RE but not recursive, cannot be RE (otherwise would be recursive).
We are given .
Property: If and is RE, then is RE.
Assume is RE. Then must be RE. But we established that is not RE. This is a contradiction.
Therefore, cannot be RE (and consequently, not recursive).Conclusion:
is not recursively enumerable.
is recursive.This matches option (C).55
Q55NAT2 marksMediumThe attributes of three arithmetic operators in some programming language are given below. | Operator | Precedence | Associativity | Arity | | :---: | :---: | :---: | :---: | |…Think it through. Then check your answer.Question
The attributes of three arithmetic operators in some programming language are given below.The value of the expression in this language is ________.Operator Precedence Associativity Arity High Left Binary Medium Right Binary Low Left Binary Correct answer
9 to 9
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The expression is evaluated based on the given precedence and associativity rules.Rules:1. (High Precedence)2. (Medium Precedence, Right Associative)3. (Low Precedence)Expression:Step 1: Evaluate (Highest Precedence)
The operator binds and .Step 2: Evaluate (Medium Precedence)
The expression contains two operators: . Since is defined as Right Associative, it is grouped as .
Note: The operators are evaluated before because has higher precedence than .Step 3: Evaluate (Lowest Precedence)The value of the expression is 9.56
Q56MCQ2 marksMediumConsider the following Syntax Directed Translation Scheme (SDTS), with non-terminals and terminals . …Think it through. Then check your answer.Question
Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals and terminals .
Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:Correct answer
(C) 2 3 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A bottom-up parser performs reductions in the reverse order of a rightmost derivation. Let's find the rightmost derivation for the input string aab:The reductions occur in the following order:1.The handle is reduced to using . Action: print 2.2.The handle is reduced to using . Action: print 3.3.The handle is reduced to using . Action: print 1.Thus, the output sequence is 2 3 1.57
Q57NAT2 marksMediumConsider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table…Think it through. Then check your answer.Question
Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is ________ megabytes.Correct answer
384 to 384
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Virtual Address bits = 40
- Page Size = 16 KB = bytes = bytes
- Page Table Entry (PTE) size = 48 bits = 6 bytes
58
Q58NAT2 marksMediumConsider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder…Think it through. Then check your answer.Question
Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is ________.Correct answer
346 to 346
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Requests: 47, 38, 121, 191, 87, 11, 92, 10
Sorted Requests: 10, 11, 38, 47, 87, 92, 121, 191
Initial Head Position: 63
Direction: Towards larger cylinder numbers (Up)C-LOOK Algorithm Steps:1.Service requests in the current direction (Up) starting from 63:- 63 87 92 121 191
- Movement:
- 191 10
- Movement:
- 10 11 38 47
- Movement:
59
Q59NAT2 marksHardConsider a computer system with ten physical page frames. The system is provided with an access sequence , where each is…Think it through. Then check your answer.Question
Consider a computer system with ten physical page frames. The system is provided with an access sequence , where each is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is ________.Correct answer
1 to 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Number of frames
- Access sequence
- Total requests = 40
- are distinct pages.
LIFO replaces the page that was brought into memory most recently.Pass 1 ():- : 10 page faults. Frames filled: . The most recently added is .
- : Fault. Replaces . Frames: . Most recent: .
- : Fault. Replaces . Frames: . Most recent: .
- ...
- : Fault. Replaces . Frames: . Most recent: .
Memory state: .Pass 2 ():- : Hits (already in memory).
- : Fault. Replaces (most recent). Frames: . Most recent: .
- : Fault. Replaces . Frames: . Most recent: .
- ...
- : Fault. Replaces . Frames: . Most recent: .
Replace the page that will not be used for the longest time.Pass 1 ():- : 10 faults. Frames: .
- : Fault. Look ahead: .
- are needed at indices 21-29.
- is needed at index 30.
- is the furthest. Replace . Frames: .
- : Fault. Look ahead: .
- is needed at index 31.
- needed earlier.
- Replace . Frames: .
- ...
- : Fault. Replace . Frames: .
Memory state: .Pass 2 ():- : Hits.
- : Fault. Look ahead: .
- is needed at index 40.
- are never needed again.
- Replace any of (say ). Frames: .
- : Fault. Replace . Frames: .
- ...
- : Fault. Replace (since not needed, needed). Frames: .
- : Hit.
.60
Q60MCQ2 marksHardConsider the following proposed solution for the critical section problem. There are processes: . In the code, functionpmaxreturns an integer not…Think it through. Then check your answer.Question
Consider the following proposed solution for the critical section problem. There are processes: . In the code, functionpmaxreturns an integer not smaller than any of its arguments. For all ,t[i]is initialized to zero.Code for :Which one of the following is TRUE about the above solution?do { c[i]=1; t[i] = pmax(t[0],...,t[n-1])+1; c[i]=0; for every j != i in {0,...,n-1} { while (c[j]); while (t[j] != 0 && t[j]<=t[i]); } Critical Section; t[i]=0; Remainder Section; } while (true);Correct answer
(A) At most one process can be in the critical section at any time
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The code resembles the Bakery Algorithm but uses the conditiont[j] <= t[i]instead of the lexicographical check(t[j], j) < (t[i], i).1.Deadlock: If two processes and read the samepmaxvalue and assignt[i] = t[j] = k, they will both enter the checking loop. checkst[j] <= t[i](True) and waits. checkst[i] <= t[j](True) and waits. This leads to a deadlock. Thus, (D) is false.2.Progress: Since deadlock is possible (where no process enters the critical section), the progress condition is violated. Thus, (C) is false.3.Bounded Wait: Since processes can deadlock and wait indefinitely, bounded waiting is not satisfied. Thus, (B) is false.4.Mutual Exclusion: The conditiont[j] <= t[i]is stricter than necessary. Iftvalues are distinct, the logic holds. Iftvalues are equal, both wait (deadlock), meaning 0 processes enter the critical section. In all cases, the number of processes in the critical section is . Thus, mutual exclusion is satisfied.61
Q61MCQ2 marksMediumConsider the following two phase locking protocol. Suppose a transaction accesses (for read or write operations), a certain set of objects . This is done…Think it through. Then check your answer.Question
Consider the following two phase locking protocol. Suppose a transaction accesses (for read or write operations), a certain set of objects . This is done in the following manner:Step 1. acquires exclusive locks to in increasing order of their addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.This protocol willCorrect answer
(A) guarantee serializability and deadlock-freedom
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Deadlock-freedom: The protocol requires acquiring locks in a specific global order (increasing order of addresses). This prevents the "circular wait" condition necessary for deadlock. Thus, the system is deadlock-free.2.Serializability: The protocol follows the Two-Phase Locking (2PL) rule (all locks acquired in growing phase, released in shrinking phase). In fact, this is a strict form called Conservative or Static 2PL where all locks are pre-claimed. 2PL ensures conflict serializability.62
Q62MCQ2 marksEasyConsider that B wants to send a message that is digitally signed to A. Let the pair of private and public keys for A and B be denoted by and for ,…Think it through. Then check your answer.Question
Consider that B wants to send a message that is digitally signed to A. Let the pair of private and public keys for A and B be denoted by and for , respectively. Let represent the operation of encrypting with a key and represent the message digest. Which one of the following indicates the CORRECT way of sending the message along with the digital signature to A?Correct answer
(B) \m, K_B^-(H(m))\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A digital signature is used to provide authentication and non-repudiation. It is created by the sender (B) by first computing a hash (message digest) of the message , denoted as , and then encrypting this digest with the sender's private key, . The resulting signature is then sent along with the original message . Therefore, the correct format is .- Option (A) is incorrect because it uses the sender's public key, which anyone can use and thus does not provide authentication.
- Option (C) is incorrect because it uses the receiver's private key, which the sender (B) does not possess.
- Option (D) is incorrect because it encrypts the message with the receiver's public key, which provides confidentiality but does not serve as a digital signature for authentication.
63
Q63NAT2 marksMediumAn IP datagram of size 1000 bytes arrives at a router. The router has to forward this packet on a link whose MTU (maximum transmission unit) is 100 bytes. Assume that the size of…Think it through. Then check your answer.Question
An IP datagram of size 1000 bytes arrives at a router. The router has to forward this packet on a link whose MTU (maximum transmission unit) is 100 bytes. Assume that the size of the IP header is 20 bytes. The number of fragments that the IP datagram will be divided into for transmission is ________.Correct answer
13 to 13
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Identify total data to be transmitted:Total size of IP datagram = 1000 bytes
IP header size = 20 bytes
Payload (data) size = bytes2.Determine maximum payload per fragment:MTU = 100 bytes
IP header per fragment = 20 bytes
Maximum payload per fragment = bytes3.Check for fragmentation constraints:The fragment offset field in the IP header is measured in units of 8 bytes. Therefore, the payload size of all fragments (except the last one) must be a multiple of 8. Since 80 is a multiple of 8 (), we can use 80 bytes of payload per fragment.4.Calculate the number of fragments:Number of fragments =
Number of fragments = .Thus, the datagram will be divided into 13 fragments.64
Q64NAT2 marksMediumFor a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 1 megabyte and the maximum output rate is 20 megabytes per…Think it through. Then check your answer.Question
For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 1 megabyte and the maximum output rate is 20 megabytes per second. Tokens arrive at a rate to sustain output at a rate of 10 megabytes per second. The token bucket is currently full and the machine needs to send 12 megabytes of data. The minimum time required to transmit the data is ________ seconds.Correct answer
1.1 to 1.1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Bucket Capacity () = 1 MB
- Maximum Output Rate () = 20 MB/s
- Token Arrival Rate () = 10 MB/s
- Total Data to send () = 12 MB
During the burst, the bucket is emptied at rate while being filled at rate . The time it takes to empty a full bucket is given by:
seconds2.Calculate data sent during the burst:Data sent = MB3.Calculate remaining data and time:Remaining data = MB
After the bucket is empty, data can only be sent at the token arrival rate MB/s.
Time for remaining data = second4.Calculate total time:Total time = Burst time + Remaining time = seconds.65
Q65NAT2 marksMediumA sender uses the Stop-and-Wait ARQ protocol for reliable transmission of frames. Frames are of size 1000 bytes and the transmission rate at the sender is 80 Kbps (1Kbps = 1000…Think it through. Then check your answer.Question
A sender uses the Stop-and-Wait ARQ protocol for reliable transmission of frames. Frames are of size 1000 bytes and the transmission rate at the sender is 80 Kbps (1Kbps = 1000 bits/second). Size of an acknowledgement is 100 bytes and the transmission rate at the receiver is 8 Kbps. The one-way propagation delay is 100 milliseconds.
Assuming no frame is lost, the sender throughput is __________ bytes/second.Correct answer
2500 to 2500
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:
Frame size, bytes bits bits.
Sender transmission rate (Bandwidth), Kbps bps bps.
Acknowledgement size, bytes bits bits.
Receiver transmission rate, Kbps bps.
Propagation delay, ms s.In Stop-and-Wait ARQ, the total time to send one frame and receive an acknowledgement is:Calculate transmission times:Total cycle time:Throughput is the amount of data sent per unit time: