The word "until" functions as a negative conditional conjunction. Using another negative term like "does not" or "doesn't" would create a double negative, which is grammatically incorrect in this context. The subject, "the minister," is a third-person singular noun, so the verb must take the singular form "meets." Thus, the grammatically correct and most suitable sentence is the one using "until the minister meets me."
Q2GATE 0MCQ1MGeneral Aptitude
The man who is now Municipal Commissioner worked as _____________
This question tests the correct usage of articles. The role "security guard" is being introduced for the first time in a non-specific sense, so the indefinite article "a" is appropriate. The location "university" is treated as a specific place in the context of the sentence, warranting the use of the definite article "the". Therefore, "a security guard at the university" is the grammatically correct phrase. The PDF solution confirms this choice.
Q3GATE 0MCQ1MGeneral Aptitude
Nobody knows how the Indian cricket team is going to cope with the difficult and seamer-friendly wickets in Australia. Choose the option which is closest in meaning to the underlined phrase in the above sentence.
The phrasal verb "cope with" means to deal effectively with something difficult or challenging. Among the given options, "put up with" is the closest synonym. It means to tolerate or endure a difficult situation or person. The solution in the PDF directly equates "cope with" to "put up with" in this context.
Q4GATE 0MCQ1MGeneral Aptitude
Find the odd one in the following group of words. mock, deride, praise, jeer
The words "mock," "deride," and "jeer" are all synonyms. They share the negative meaning of ridiculing or making fun of someone in a contemptuous manner. In contrast, the word "praise" has a positive meaning: to express warm approval or admiration. As its meaning is opposite to the other three words, "praise" is the odd one out in the group.
The first three options follow a consistent pattern. If the letters in each string are reordered according to the positional sequence 2-4-1-3-5, they form a consecutive alphabetical sequence.
C. XVYWZ → V(pos 2), W(pos 4), X(pos 1), Y(pos 3), Z(pos 5) → VWXYZ
Option D, ONPMQ, breaks this pattern. Its reordered sequence is N-M-O-P-Q, which is not alphabetical.
Q6GATE 0MCQ1MGeneral Aptitude
In a quadratic function, the value of the product of the roots (alpha,beta) is 4. Find the value of fracalphan+betanalpha−n+beta−n
The given expression is α−n+β−nαn+βn. The denominator can be rewritten using the property x−n=xn1.
So, α−n+β−n=αn1+βn1.
Finding a common denominator, this becomes (αβ)nβn+αn.
Substituting this back into the original expression gives: (αβ)nαn+βnαn+βn
The term (αn+βn) cancels out, leaving (αβ)n.
Given that the product of the roots αβ=4, the final value is 4n.
Q7GATE 0MCQ2MGeneral Aptitude
Among 150 faculty members in an institute, 55 are connected with each other through Facebook and 85 are connected through Whatsapp. 30 faculty members do not have Facebook or Whatsapp accounts. The numbers of faculty members connected only through Facebook accounts is _______.
There are 150 total faculty members. Since 30 members use neither Facebook nor WhatsApp, the number of members using at least one of these services is 150−30=120. This is the total number of members in the union of the Facebook and WhatsApp sets, n(F∪W)=120.
The number of members connected only through Facebook can be found by taking the total in the union and subtracting the number of members who use WhatsApp.
Number of members only on Facebook = n(F∪W)−n(W)=120−85=35.
Q8GATE 0MCQ2MGeneral Aptitude
Computers were invented for performing only high-end useful computations. However, it is no understatement that they have taken over our world today. The internet, for example, is ubiquitous. Many believe that the internet itself is an unintended consequence of the original invention. With the advent of mobile computing on our phones, a whole new dimension is now enabled. One is left wondering if all these developments are good or, more importantly, required. Which of the statement(s) below is/are logically valid and can be inferred from the above paragraph? (i) The author believes that computers are not good for us. (ii) Mobile computers and the internet are both intended inventions.
The provided paragraph questions the impact of recent technological developments but does not explicitly state that computers are "not good," making statement (i) an invalid inference. The text mentions that "Many believe that the internet itself is an unintended consequence of the original invention," which directly contradicts statement (ii) that the internet was an intended invention. Since neither statement can be logically derived from the passage, the correct choice is that neither (i) nor (ii) is valid.
Q9GATE 0MCQ2MGeneral Aptitude
All hill-stations have a lake. Ooty has two lakes. Which of the statement(s) below is/are logically valid and can be inferred from the above sentences? (i). Ooty is not a hill-station. (ii). No hill-station can have more than one lake.
The premise "All hill-stations have a lake" means that if a place is a hill-station, it must have at least one lake. It does not set a maximum limit on the number of lakes.
(i) "Ooty is not a hill-station" is an invalid inference. Since Ooty has two lakes, it satisfies the condition of having at least one lake, so it can be a hill-station.
(ii) "No hill-station can have more than one lake" is also an invalid inference. The premise only establishes a minimum of one lake, not a maximum. Therefore, a hill-station could have multiple lakes.
Q10GATE 0MCQ2MGeneral Aptitude
In a 2x4 rectangle grid shown below, each cell is rectangle. How many rectangles can be observed in the grid?
A rectangle is formed by selecting two distinct horizontal lines and two distinct vertical lines from the grid. A 2x4 grid of cells is constructed from 3 horizontal lines and 5 vertical lines.
The number of ways to choose 2 horizontal lines from the 3 available is given by the combination formula (23)=3.
The number of ways to choose 2 vertical lines from the 5 available is (25)=25×4=10.
The total number of possible rectangles is the product of these two values: 3×10=30.
CSE55 questions
Q11GATE 0NAT1MDiscrete Mathematics
Consider the following expressions: (i) false (ii) Q (iii) true (iv) P∨Q (v) ¬Q∨P The number of expressions given above that are logically implied by P∧(P⇒Q) is ________.
The expression P∧(P⇒Q) is logically equivalent to P∧(¬P∨Q). Using the distributive law, this becomes (P∧¬P)∨(P∧Q), which simplifies to F∨(P∧Q), or just P∧Q.
We now check which of the given expressions are logically implied by P∧Q:
P∧Q⇒Q (True)
P∧Q⇒true (True)
P∧Q⇒P∨Q (True)
P∧Q⇒(¬Q∨P) (True, as this is equivalent to P∧Q⇒(Q⇒P))
Thus, four expressions-(ii), (iii), (iv), and (v)-are logically implied.
Q12GATE 0NAT1MEngineering Mathematics
Let f(x) be a polynomial and g(x) = f'(x) be its derivative. If the degree of (f(x)+ f(-x)) is 10, then the degree of (g(x)-g(-x)) is ________.
Let the degree of the polynomial f(x) be n. The expression f(x)+f(−x) consists of only the even-powered terms of f(x). Since the degree of f(x)+f(−x) is given as 10, the degree of f(x) must be n=10.
The derivative g(x)=f′(x) will have a degree of n−1=9.
The expression g(x)−g(−x) consists of only the odd-powered terms of g(x). Since the highest power in g(x) is 9 (an odd number), this term will not be cancelled out. Therefore, the degree of g(x)−g(−x) is 9.
Q13GATE 0NAT1MDiscrete Mathematics
The minimum number of colours that is sufficient to vertex-colour any planar graph is _________.
This question relates to the Four Color Theorem, a fundamental concept in graph theory. The theorem states that any planar graph-a graph that can be drawn on a plane without any edges crossing-can be vertex-colored with at most four colors. This ensures that no two adjacent vertices share the same color. Therefore, four colors are always sufficient for vertex-coloring any planar graph.
Q14GATE 0MCQ1MEngineering Mathematics
Consider the systems,each consisting of m linear equations in n variables. I. If m < n, then all such systems have a solution II. If m > n, then none of these systems has a solution III. If m = n, then there exists a system which has a solution Which one of the following is CORRECT?
Let's analyze each statement:
I. "If m<n, then all such systems have a solution" is false. A system can be inconsistent. For example, x+y+z=1 and x+y+z=2 has no solution, with m=2,n=3.
II. "If m>n, then none of these systems has a solution" is false. A system can have redundant equations and be consistent. For example, x+y=2 and 2x+2y=4 and x−y=0 has a solution x=1,y=1, with m=3,n=2.
III. "If m=n, then there exists a system which has a solution" is true. We can easily construct such a system, for example, x=1,y=2 is a system with m=n=2 that has a solution.
Q15GATE 0NAT1MEngineering Mathematics
Suppose that the eigen values of matrix A are 1, 2, 4. The determinant of (A−1)T is _________.
The determinant of a matrix is the product of its eigenvalues.
Given the eigenvalues of matrix A are 1, 2, and 4.
So, the determinant of A is det(A)=1×2×4=8.
Consider an eight-bit ripple-carry Combinational Circuit for computing the sum of A and B, where A and B are integers represented in 2's complement form. If the decimal value of A is one, the decimal value of B that leads to the longest latency for the sum to stabilize is ________.
The longest latency in a ripple-carry adder occurs when a carry signal must propagate through the maximum number of full-adder stages. We are given A = 1, which is 00000001 in 8-bit 2's complement. To force a carry to ripple through all 8 stages, we need to choose B such that each bit position i generates a carry-out. This happens if B is 11111111, which is the 2's complement representation of -1. The addition 00000001 + 11111111 causes a carry to be generated and propagated from the least significant bit to the most significant bit.
Q17GATE 0MCQ1MDigital Logic
Let, x1⊕x2⊕x3⊕x4=0 where x1,x2,x3,x4 are Boolean variables, and ⊕ is the XOR operator. Which one of the following must always be TRUE?
The given equation is x1⊕x2⊕x3⊕x4=0. The XOR operation is associative and commutative. We can manipulate the equation using the property that a⊕a=0. By XORing both sides of the original equation with (x2⊕x4), we get: (x1⊕x2⊕x3⊕x4)⊕(x2⊕x4)=0⊕(x2⊕x4)
Rearranging the terms: x1⊕x3⊕(x2⊕x2)⊕(x4⊕x4)=x2⊕x4
This simplifies to x1⊕x3=x2⊕x4.
Q18GATE 0NAT1MDigital Logic
Let X be the number of distinct 16-bit integers in 2's complement representation. Let Y be the number of distinct 16 bit integers in sign magnitude representation. Then X-Y is ________.
For a 16-bit number, there are 216 possible bit patterns.
In 2's complement representation (X), every bit pattern maps to a unique integer. Therefore, the number of distinct integers is X = 216.
In sign-magnitude representation (Y), there are two representations for zero: +0 (a sign bit of 0 followed by all 0s) and -0 (a sign bit of 1 followed by all 0s). Since both represent the same value, the number of distinct integers is one less than the total number of patterns. Thus, Y = 216−1.
The difference is X - Y = 216−(216−1)=1.
Q19GATE 0NAT1MComputer Organization
A processor has 40 distinct instructions and 24 general purpose registers. A 32-bit instruction word has an opcode, two register operands and an immediate operand. The number of bits available for the immediate operand field is _______ .
The total instruction word size is 32 bits.
To represent 40 distinct instructions, the opcode field requires ⌈log240⌉=6 bits, since 25<40<26.
To address one of 24 general-purpose registers, each register operand field requires ⌈log224⌉=5 bits, since 24<24<25.
Since there are two register operands, they consume a total of 2×5=10 bits.
The total bits used by the opcode and register fields are 6+10=16 bits.
The remaining bits available for the immediate operand are 32−16=16 bits.
Q20GATE 0NAT1MAlgorithm
Breadth First Search(BFS) is started on a binary tree beginning from the root vertex. There is a vertex t at a distance four from the root. If t is the n-th vertex in this BFS traversal, then the maximum possible value of n is______ .
Breadth-First Search (BFS) visits nodes level by level. A vertex at a distance of 4 from the root is at level 4 (assuming the root is at level 0). To maximize the traversal order n for a vertex at this level, we need to maximize the number of nodes visited before it. This occurs when the binary tree is a complete binary tree up to level 4, and the vertex t is the last node visited at that level.
The total number of nodes in a complete binary tree up to level k is ∑i=0k2i=2k+1−1.
For level 4, the total number of nodes is 24+1−1=31.
Q21GATE 0NAT1MC Programming
The value printed by the following program is .
void f(int*p, int m) {
m =m+5;
*p =*p+m;
return;
}
In the main function, f(&i, j) is called. The variable i is passed by reference (its address is sent), while j is passed by value (a copy of its value is sent). Inside function f, the local variable m is assigned j's value (10) and then incremented to 15. This change does not affect j in main. The pointer p points to i, so *p = *p + m; updates i's value to 5 + 15 = 20. The final printf statement prints the sum i + j, which is 20 + 10 = 30.
Q22GATE 0NAT1MEngineering Mathematics
Let f(x) be a polynomial and g(x) = f'(x) be its derivative. If the degree of (f(x)+ f(-x)) is 10, then the degree of (g(x)-g(-x)) is ________.
Let the degree of the polynomial f(x) be n. The expression f(x)+f(−x) cancels all terms with odd powers. Since the degree of f(x)+f(−x) is given as 10 (an even number), the degree of the original polynomial f(x) must be n=10.
The derivative, g(x)=f′(x), will have a degree of n−1=9. The expression g(x)−g(−x) cancels all terms with even powers from g(x). Since the highest power in g(x) is 9 (an odd number), this term will not be cancelled. Therefore, the degree of g(x)−g(−x) is 9.
Q23GATE 0MCQ1MAlgorithm
Assume that the algorithms considered here sort the input sequences in ascending order. If the input is already in ascending order, which of the following are TRUE? I. Quicksort runs in Θ(n2) time II. Bubblesort runs in Θ(n2) time III. Merge sort runs in Θ(n) time IV. Insertion sort runs in Θ(n) time
Let's analyze the time complexity for each algorithm on an already sorted input sequence.
I. Quicksort: When the input is sorted, Quicksort consistently picks the worst pivot, leading to highly unbalanced partitions. This is the worst-case scenario for Quicksort, resulting in a Θ(n2) runtime. Thus, statement I is TRUE.
III. Merge Sort: Merge sort's performance is independent of the initial order of the input. It always divides the array and merges, resulting in a Θ(nlogn) runtime. The statement says Θ(n), so it is FALSE.
IV. Insertion Sort: When the input is already sorted, Insertion sort performs only one comparison per element, which is its best-case scenario. This results in a Θ(n) runtime. Thus, statement IV is TRUE.
Based on this, statements I and IV are true.
Q24GATE 0MCQ1MAlgorithm
The Floyd-Warshall algorithm for all-pair shortest paths computation is based on
The Floyd-Warshall algorithm is a classic example of the dynamic programming paradigm. It solves the all-pairs shortest path problem by building up a solution iteratively. It computes the shortest paths by considering all possible intermediate vertices for each pair of source and destination vertices. The solution for a problem with k intermediate vertices is built upon the solution for k−1 vertices, which is the fundamental characteristic of dynamic programming.
Q25GATE 0MCQ1MData Structure
N items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations on the list in this order: Θ(N)delete , O(logN)insert , O(logN)find , and Θ(N)decrease−key . What is the time complexity of all these operations put together?
The total time complexity is the sum of the time taken for all operations.
Θ(N) delete operations: A pointer to the node is given, so each deletion is Θ(1). Total time: Θ(N)×Θ(1)=Θ(N).
O(logN) insert operations: To maintain a sorted list, finding the insertion point takes O(N). Total time: O(logN)×O(N)=O(NlogN).
O(logN) find operations: Searching a linked list requires a linear scan, taking O(N). Total time: O(logN)×O(N)=O(NlogN).
Θ(N) decrease-key operations: After decreasing the key (at a given pointer), the node must be re-inserted in the correct sorted position, which takes O(N). Total time: Θ(N)×O(N)=Θ(N2).
The overall complexity is dominated by the most expensive set of operations, which is the decrease-key operations. Thus, the total time complexity is O(N2).
Q26GATE 0NAT1MTheory of Computation
The number of states in the minimum sized DFA that accepts the language defined by the regular expression (0+1)* (0+1)(0+1)* is _______.
The regular expression is (0+1)∗(0+1)(0+1)∗. The component (0+1)∗ represents any string of 0s and 1s (including the empty string), while (0+1) represents a single character. The combination requires at least one character, effectively defining the language of all non-empty strings over the alphabet {0,1}. A minimal DFA for this language requires two states: a non-accepting start state (to handle the empty string, which is not in the language) and a single accepting state for all strings of length one or more.
Q27GATE 0MCQ1MTheory of Computation
Language L1 is defined by the grammar: S1→aS1b∣ε Language L2 is defined by the grammar: S2→abS2∣ε Consider the following statements: P: L1 is regular Q: L2 is regular Which one of the following is TRUE?
The grammar for L1, S1→aS1b∣ε, generates the language {anbn∣n≥0}. This is a classic context-free language that is not regular because it requires a memory (like a stack) to ensure the number of 'a's equals the number of 'b's. Therefore, statement P is false. The grammar for L2, S2→abS2∣ε, generates the language {(ab)n∣n≥0}, which can be described by the regular expression (ab)∗. Since it has a regular expression, L2 is a regular language. Therefore, statement Q is true.
Q28GATE 0MCQ1MTheory of Computation
Consider the following types of languages: L1 :Regular, L2 :Context-free, L3 :Recursive, L4 :Recursively enumerable. Which of the following is/are TRUE? I. Lˉ3∪L4 is recursivelyenumerable II. Lˉ2∪L3 is recursive III. L1∗∪L2 is context-free IV. L1∪Lˉ2 is context-free
This question tests closure properties of language classes.
I. L3 is Recursive (REC), so its complement Lˉ3 is also REC. L4 is Recursively Enumerable (RE). The union of a REC language and an RE language is RE. So, Lˉ3∪L4 is RE. Statement I is true.
II. L2 is Context-Free (CFL), which is a subset of REC. REC languages are closed under complement, so Lˉ2 is REC. The union of two REC languages (Lˉ2 and L3) is REC. Statement II is true.
III. L1 is Regular, so its Kleene star L1∗ is also Regular. L2 is CFL. The union of a Regular language and a CFL is a CFL. Statement III is true.
This question matches concepts from compiler design phases with their corresponding techniques or artifacts.
(P) Lexical analysis involves scanning the input text and grouping characters into tokens. This process is modeled using regular expressions.
(Q) Top-down parsing, such as LL parsing, constructs a parse tree from the root down, which corresponds to a leftmost derivation of the string.
(R) Semantic analysis checks for meaning-related errors, a key part of which is type checking to ensure operators are applied to compatible operands.
(S) Runtime environments manage the program's execution state, using activation records (stack frames) for function calls.
This corresponds to P-iii, Q-i, R-ii, S-iv.
Q30GATE 0MCQ1MOperating System
In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?
The phenomenon where increasing the number of allocated memory frames leads to an increase in the page fault rate is known as Belady's Anomaly. Among the standard page replacement algorithms, only the First-In, First-Out (FIFO) algorithm is susceptible to this issue. Other algorithms like LRU and OPT do not suffer from Belady's Anomaly, as their performance generally improves or stays the same with more frames.
A B+ tree is defined as a balanced tree because the path length from the root to every leaf node is identical. This structural property ensures that all leaf nodes reside at the same depth or level. Consequently, the time taken to access any record is uniform and predictable, as it avoids the performance degradation that can occur in unbalanced trees where some branches are much longer than others.
Q32GATE 0MCQ1MDatabase Management System
Suppose a database schedule S involves transactions T1,...,Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?
A schedule is conflict-serializable if its precedence graph, which shows dependencies between conflicting operations of transactions, is acyclic. If the graph is acyclic, a topological sort of its vertices (the transactions) can be performed. This topological ordering provides a valid serial schedule that is conflict-equivalent to the original concurrent schedule. Therefore, a topological order is guaranteed to yield a correct serial schedule.
Q33GATE 0MCQ1MComputer Network
Anarkali digitally signs a message and sends it to Salim. Verification of the signature by Salim requires
Digital signatures rely on asymmetric cryptography. The sender, Anarkali, creates a signature by using her own private key. To verify the authenticity of this signature, the receiver, Salim, must use the sender's corresponding public key. This process confirms that the message was indeed signed by Anarkali and has not been altered in transit. Therefore, Salim requires Anarkali's public key for verification.
Q34GATE 0MCQ1MComputer Network
In an Ethernet local area network,which one of the following statements is TRUE?
In an Ethernet network that uses CSMA/CD, collisions can occur when multiple stations transmit simultaneously. After a collision is detected, the involved stations use the exponential backoff algorithm. This mechanism requires each station to wait for a random amount of time before retransmitting. The range of possible wait times increases exponentially with each subsequent collision, which reduces the probability of another collision during retransmission.
Q35GATE 0MCQ1MComputer Network
Identify the correct sequence in which the following packets are transmitted on the network by a host when a browser requests a webpage from a remote server,assuming that the host has just been restarted.
When a host requests a webpage, it must first resolve the server's domain name (e.g., www.example.com) into an IP address. This is done via a DNS query. Once the IP address is obtained, a reliable connection must be established with the server using the TCP protocol, which starts with a TCP SYN packet (the first step of the three-way handshake). Only after the TCP connection is established can the browser send the HTTP GET request to fetch the webpage content.
Q36GATE 0MCQ2MDiscrete Mathematics
A binary relation R on N×N is defined as follows: (a,b)R(c,d) if a≤c or b≤d . Consider the following propositions: P: R is reflexive Q: R is transitive Which one of the following statements is TRUE?
A relation R is reflexive if for every element x, (x)R(x). For the given relation on N×N, we check if (a,b)R(a,b). This condition is true if a≤a or b≤b. Since a≤a is always true, the relation is reflexive. Thus, proposition P is true.
A relation is transitive if (a,b)R(c,d) and (c,d)R(e,f) implies (a,b)R(e,f). Consider the counterexample: (2,4)R(3,2) is true because 2≤3. Also, (3,2)R(1,3) is true because 2≤3. However, (2,4)R(1,3) is false because neither 2≤1 nor 4≤3 is true. Therefore, the relation is not transitive, and proposition Q is false.
Q37GATE 0MCQ2MEngineering Mathematics
Which one of the following well-formed formulae in predicate calculus is NOT valid?
The formula in option D, ∀x(p(x)∨q(x))⇒(∀xp(x)∨∀xq(x)), is not universally valid. The antecedent ∀x(p(x)∨q(x)) states that for every x, at least one of p(x) or q(x) is true. The consequent (∀xp(x)∨∀xq(x)) states that either p(x) is true for all x, or q(x) is true for all x.
Consider a counterexample where the domain is the set of integers. Let p(x) be "x is even" and q(x) be "x is odd". The antecedent is true, as every integer is either even or odd. However, the consequent is false because it's not true that all integers are even, nor is it true that all integers are odd. Since the antecedent can be true while the consequent is false, the implication is not valid.
Q38GATE 0MCQ2MDiscrete Mathematics
Consider a set U of 23 different compounds in a Chemistry lab. There is a subset S of U of 9 compounds, each of which reacts with exactly 3 compounds of U. Consider the following statements: I. Each compound in U \ S reacts with an odd number of compounds. II. At least one compound in U \ S reacts with an odd number of compounds. III. Each compound in U n S reacts with an even number of compounds. Which one of the above statements is ALWAYS TRUE?
This problem can be modeled using graph theory. Let the 23 compounds be vertices and a reaction between two compounds be an edge. The degree of a vertex is the number of compounds it reacts with. We are given that 9 vertices (compounds in set S) have a degree of 3, which is an odd number.
A fundamental theorem in graph theory states that the number of vertices with an odd degree in any graph must be even. Since we already have 9 vertices with an odd degree, there must be at least one more vertex with an odd degree among the remaining 14 vertices (in U \ S) to make the total count of odd-degree vertices even. Therefore, at least one compound in U \ S must react with an odd number of compounds. This makes statement II always true.
Q39GATE 0NAT2MEngineering Mathematics
The value of the expression 1399 (mod 17), in the range 0 to 16, is _________.
To evaluate 1399(mod17), we can use Fermat's Little Theorem, which states that if p is a prime number, then for any integer a not divisible by p, we have ap−1≡1(modp).
Here, p = 17 (a prime) and a = 13. The theorem applies, so 1317−1≡1316≡1(mod17).
Now, we can rewrite the exponent 99 in terms of 16: 99=16×6+3
So, 1399=1316×6+3=(1316)6⋅133.
Taking the modulus: (1316)6⋅133(mod17)≡(1)6⋅133(mod17)≡133(mod17).
Finally, we calculate 133=2197. Dividing 2197 by 17 gives a remainder of 4. 2197=17×129+4.
Thus, 1399(mod17)=4.
Q40GATE 0NAT2MComputer Organization
Suppose the functions F and G can be computed in 5 and 3 nano seconds by functional units UF and UG , respectively. Given two instances of UF and two instances of UG , it is required to implement the computation F(G(Xi)) for 1≤i≤10 . Ignoring all other delays, the minimum time required to complete this computation is ________ nanoseconds.
The computation F(G(Xi)) can be viewed as a two-stage pipeline. Stage 1 is the computation of G (3 ns) and Stage 2 is the computation of F (5 ns). We have two units for each function, which means we have two identical, parallel pipelines.
The 10 computations can be split between the two pipelines, with each pipeline handling 5 tasks. The total time will be the time taken by one pipeline to complete its 5 tasks.
For a single pipeline, the time to get the first result is the sum of stage delays: 3+5=8 ns.
Subsequent results emerge at a rate determined by the slowest stage, which is 5 ns.
The total time for one pipeline to process 5 tasks is:
Time = (Time for 1st task) + (Number of remaining tasks) × (Slowest stage time)
Time = 8 ns+(5−1)×5 ns=8+20=28 ns.
Since both pipelines run in parallel, the total time is 28 ns.
Q41GATE 0NAT2MComputer Organization
Consider a processor with 64 registers and an instruction set of size twelve. Each instruction has five distinct fields, namely, opcode, two source register identifiers, one destination register identifier, and a twelve-bit immediate value. Each instruction must be stored in memory in byte-aligned fashion. If a program has 100 instructions, the amount of memory(in bytes) consumed by the program text is _____ .
To determine the memory consumed, we first find the size of a single instruction in bits.
The number of bits for the opcode field is ⌈log212⌉=4 bits.
The number of bits for each register identifier is ⌈log264⌉=6 bits.
The total bits per instruction are:
4 (opcode) + 6 (src reg 1) + 6 (src reg 2) + 6 (dest reg) + 12 (immediate) = 34 bits.
Due to byte-alignment, each instruction must occupy a whole number of bytes. 34 bits requires 5 bytes (40 bits).
For 100 instructions, the total memory is 100×5=500 bytes.
Q42GATE 0NAT2MComputer Organization
The width of the physical address on a machine is 40 bits. The width of the tag field in a 512KB 8-way set associative cache is ________ bits.
The physical address is composed of Tag, Set, and Offset bits. The total width is 40 bits.
The number of bits for the Set and Offset fields combined depends on the cache size, not the block size.
Total Cache Size = (Number of Sets) × (Associativity) × (Block Size)
In terms of bits: log2(Cache Size)=log2(Num Sets)+log2(Associativity)+log2(Block Size) 19=Set bits+3+Offset bits
This gives: Set bits + Offset bits = 19−3=16 bits.
The Tag bits are the remaining bits of the physical address:
Tag bits = Physical Address bits - (Set bits + Offset bits) = 40−16=24 bits.
Q43GATE 0NAT2MComputer Organization
Consider a 3GHz (gigahertz) processor with a three-stage pipeline and stage latencies τ1 , τ2 , and τ3 such that τ1=3τ2/4=2τ3 . If the longest pipeline stage is split into two pipeline stages of equal latency, the new frequency is _____GHz, ignoring delays in the pipeline registers.
The initial processor frequency is 3 GHz, so the initial clock period Told=1/3 ns. The clock period is determined by the longest pipeline stage. Let the stage latencies be τ1,τ2,τ3. From the given relations τ1=3τ2/4 and τ1=2τ3, we can see that τ2 is the longest stage. Thus, Told=τ2.
The longest stage, τ2, is split into two stages of equal latency, τ2/2. The new pipeline has four stages with latencies τ1,τ2/2,τ2/2,τ3. In terms of τ2, these are 3τ2/4,τ2/2,τ2/2,3τ2/8. The new longest stage is τ1=3τ2/4.
The new clock period is Tnew=3τ2/4=(3/4)Told.
The new frequency is Fnew=1/Tnew=(4/3)Fold=(4/3)×3 GHz=4 GHz.
Q44GATE 0NAT2MData Structure
A complete binary min-heap is made by including each integer in [1,1023] exactly once. The depth of a node in the heap is the length of the path from the root of the heap to that node. Thus, the root is at depth 0. The maximum depth at which integer 9 can appear is_____. .
In a min-heap, any node's value must be greater than or equal to its parent's value. The question asks for the maximum possible depth for the integer 9. The root is at depth 0.
To maximize the depth of the node containing 9, we must place the 8 smaller integers {1, 2, 3, 4, 5, 6, 7, 8} on the path from the root to that node.
This creates a path where each node is the parent of the next integer in the sequence:
1 (root, depth 0) → 2 (depth 1) → 3 (depth 2) →⋯→ 8 (depth 7).
The integer 9 can then be a child of 8, placing it at depth 8. This structure is valid as the min-heap property is maintained along this path.
Q45GATE 0MCQ2MC Programming
The following function computes XY for positive integers X and Y.
int exp(int X,int Y) {
int res=1, a=X, b=Y;
while (b!=0) {
if(b%2==0) {
a=a*a;
b=b/2;
} else {
res=res*a;
b=b-1;
}
}
return res;
}
Which one of the following conditions is TRUE before every iteration of the loop?
The question asks for a loop invariant, which is a condition that holds true at the beginning of every loop iteration. Let's test the condition XY=res×ab.
Initialization: Before the loop, res = 1, a = X, b = Y. The condition is XY=1×XY, which is true.
Maintenance (b is even):res is unchanged, a becomes a2, b becomes b/2. The expression is res×(a2)b/2=res×ab. The invariant is maintained.
Maintenance (b is odd):res becomes res*a, a is unchanged, b becomes b-1. The expression is (res×a)×ab−1=res×ab. The invariant is maintained.
Since the condition is true at the start and is preserved through each step, it is the correct loop invariant.
Q46GATE 0MCQ2MData Structure
Consider the following New-order strategy for traversing a binary tree: Visit the root; Visit the right sub tree using New-order; Visit the left sub tree using New-order; The New-order traversal of the expression tree corresponding to the reverse polish expression 3 4 * 5 - 2 ^ 6 7 * 1 + - is given by:
To find the New-order traversal, we first construct the expression tree from the given reverse polish (postfix) expression: 3 4 * 5 - 2 ^ 6 7 * 1 + -. The resulting tree has - as the root. Its left child corresponds to 3 4 * 5 - 2 ^ and its right child corresponds to 6 7 * 1 +.
The New-order traversal is defined as: (1) Visit Root, (2) Visit Right Subtree, (3) Visit Left Subtree.
Applying this to the expression tree:
Visit Root: -
Traverse Right Subtree (+ 1 * 7 6): +, then 1, then * 7 6.
Traverse Left Subtree (^ 2 - 5 * 4 3): ^, then 2, then - 5 * 4 3.
Combining these gives the sequence: - + 1 * 7 6 ^ 2 - 5 * 4 3.
Q47GATE 0NAT2MC Programming
Consider thefollowingprogram:
int f(int*p, int n) {
if (n<=1)return0;
else returnmax(f(p+1,n-1),p[0]-p[1]);
}
int main() {
int a[]= {
3,5,2,6,4
}
;
printf("%d", f(a,5));
}
Note: max(x,y) returns the maxi mumof x and y. The value printed by this program is____________ .
The program calculates a value by recursively calling the function f(p, n). Let's trace the execution with the input array a = {3, 5, 2, 6, 4} and size n=5.
f(a+4, 1) is the base case (n <= 1), so it returns 0.
Unwinding the recursion:
The call f(a+3, 2) returns max(0, 2) = 2.
The call f(a+2, 3) returns max(2, -4) = 2.
The call f(a+1, 4) returns max(2, 3) = 3.
Finally, the initial call f(a, 5) returns max(3, -2) = 3.
The value printed is 3.
Q48GATE 0NAT2MAlgorithm
Let A1,A2,A3, and A4 be four matrices of dimensions 10x5, 5x20, 20x10, and 10x5, respectively. The minimum number of scalar multiplications required to find the product A1A2A3A4 using the basic matrix multiplication method is __________.
This is a matrix chain multiplication problem. We need to find the parenthesization that minimizes the number of scalar multiplications. The dimensions are A1:10×5, A2:5×20, A3:20×10, A4:10×5.
Let's evaluate the cost of the parenthesization A1((A2A3)A4):
Cost of (A2A3): Dimensions are (5×20) and (20×10). Multiplications = 5×20×10=1000. The resulting matrix, let's call it M1, has dimensions 5×10.
Cost of (M1A4): Dimensions are (5×10) and (10×5). Multiplications = 5×10×5=250. The resulting matrix, M2, has dimensions 5×5.
Cost of A1(M2): Dimensions are (10×5) and (5×5). Multiplications = 10×5×5=250.
Total multiplications = 1000+250+250=1500. This is the minimum possible cost among all parenthesizations.
Q49GATE 0NAT2MAlgorithm
The given diagram shows the flowchart for a recursive function A(n). Assume that all statements, except for the recursive calls,have O(1) Asymptotic Notation. If the worst case Asymptotic Notation of this functionis O(nα) , then the least possible value(accurate upto two decimal positions) of α is .
The flowchart describes a recursive function A(n). In the worst-case scenario, the function makes five recursive calls to A(n/2) and performs a constant amount of work, which is O(1). This can be represented by the recurrence relation: T(n) = 5T(n/2) + O(1)
We can solve this using the Master Theorem, T(n) = aT(n/b) + f(n). Here, a=5, b=2, and f(n) = O(1).
We compare f(n) with n^(log_b a). n^(log_b a) = n^(log_2 5)
Since f(n) = O(1) is asymptotically smaller than n^(log_2 5), this corresponds to Case 1 of the Master Theorem. The complexity is T(n) = O(n^(log_2 5)).
The question states the complexity is O(nα), so α=log25≈2.32.
Q50GATE 0NAT2MData Structure
The number of ways in which the numbers 1,2,3,4,5,6,7 can be inserted in an empty binary search tree, such that the resulting tree has height 6, is _____. Note: The height of a tree with a single node is 0.
In an adjacency list representation of an undirected simple graph G = (V,E), each edge (u,v) has two adjacency list entries: [v] in the adjacency list of u, and [u] in the adjacency list of v. These are called twins of each other. A twin pointer is a pointer from an adjacency list entry to its twin. If |E|=m and |V|=n, and the memory size is not a constraint, what is the Asymptotic Notation of the most efficient algorithm to set the twin pointer in each entry in each adjacency list?
To efficiently set the twin pointers in an adjacency list, a Breadth-First Search (BFS) traversal of the graph can be used. BFS systematically explores the graph by visiting each vertex and all its adjacent edges. When traversing an edge (u, v), we can set the twin pointers for the corresponding entries in the adjacency lists of both u and v. The time complexity of a BFS algorithm on a graph represented by an adjacency list is a function of its vertices (n) and edges (m), which is Θ(n+m).
Q52GATE 0MCQ2MTheory of Computation
Consider the following two statements: I. If all states of an NFA are accepting states then the language accepted by the NFA is ∑∗ . II. There exists a regular language A such that for all languages B, A ∩ B is regular. Which one of the following is CORRECT?
Statement I is false. If all states of an NFA are accepting, it does not guarantee that the language accepted is Σ∗. For example, if some states are unreachable from the start state, strings that would require reaching those states will not be accepted.
Statement II is true. We can choose a regular language A to be the empty language, A=∅. For any language B, the intersection A∩B is ∅∩B=∅. The empty language is regular. Thus, there exists such a regular language A.
Q53GATE 0MCQ2MTheory of Computation
Consider the following languages: L1={anbmcn+m:m,n≥1}L2={anbnc2n:n≥1} Which one of the following is TRUE?
For language L1={anbmcn+m∣m,n≥1}, a pushdown automaton (PDA) can be constructed. The PDA can push a symbol onto the stack for each 'a', then push another symbol for each 'b'. Subsequently, for each 'c' it reads, it pops one symbol from the stack. The string is accepted if the stack is empty after all characters are read. Thus, L1 is context-free.
For language L2={anbnc2n∣n≥1}, a PDA cannot be constructed. A PDA can verify one dependency (like n 'a's followed by n 'b's) but cannot simultaneously verify a second dependent count (that the number of 'c's is twice the number of 'a's). Therefore, L2 is not context-free.
Q54GATE 0MCQ2MTheory of Computation
Consider the following languages. L1 = { < M > |M takes at least 2016 steps on some input}, L2 = { < M > | M takes at least 2016 steps on all inputs} and L3 = { < M|M accepts ε }, where for each Turing machine M, < M > denotes a specific encoding of M. Which one of the following is TRUE?
For L1 and L2, membership can be decided by a Turing Machine that always halts. We can simulate the machine M for a finite number of steps on a finite set of inputs to check if it runs for at least 2016 steps. This simulation is guaranteed to terminate, making L1 and L2 recursive languages.
L3 is the language of Turing Machines that accept the empty string, ε. This is a well-known undecidable problem, meaning it is not recursive. Although it is recursively enumerable, it is not recursive. Therefore, L1 and L2 are recursive, but L3 is not.
Q55GATE 0MCQ2MTheory of Computation
Which one of the following grammars is free from left recursion?
A grammar is free from left recursion if no non-terminal can derive a string that starts with itself.
Grammar A has direct left recursion: A→Aa∣b.
Grammar C has indirect left recursion: S⇒Aa⇒Sca....
Grammar D has indirect left recursion: A⇒Bd⇒Aed....
Grammar B has no productions where a non-terminal derives a string starting with itself, either directly or through a series of derivations. Therefore, it is free from left recursion.
Q56GATE 0MCQ2MCompiler Design
A student wrote two context-free grammars G1 and G2 for generating a single C-like array declaration. The dimension of the array is at least one. For example, int a[10][3]; The grammars use D as the start symbol,and use six terminal symbols int ;id[]num. Which of the grammars correctly generate the declaration mentioned above?
Both grammars, G1 and G2, can correctly generate the specified C-like array declaration. For a declaration like int a[10][3];, both grammars can derive the string using their production rules.
Grammar G1 uses recursion on the right (E -> num] [E) to generate multiple dimensions.
Grammar G2 uses left recursion (E -> E[num]) to achieve the same result.
Since both grammars can produce valid multi-dimensional array declarations of at least one dimension, both are correct.
Q57GATE 0NAT2MOperating System
Consider the following processes, with the arrival time and the length of the CPU burst given in milli seconds.The scheduling algorithm used is preemptive shortest remaining-time first. The average turn around time of these processes is milliseconds.
This solution uses a turn variable for synchronization, which enforces strict alternation between Process 0 and Process 1.
Mutual Exclusion: Satisfied. If turn == 0, only Process 0 can enter its critical section.
Bounded Waiting: Satisfied. A process waits for at most one entry by the other process.
Progress: Violated. If Process 0 wants to enter its critical section but turn == 1, it must wait, even if Process 1 is in its remainder section and has no interest in entering its critical section. This dependency on a non-interested process violates the progress condition.
Q59GATE 0NAT2MOperating System
Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S) increments S. During an execution, 20 P(S) operations and 12V(S) operations are issued in some order. The largest initial value of S for which at least one P(S) operation will remain blocked is ________.
Let Sinitial be the initial value of the semaphore. There are 20 P operations (requests) and 12 V operations (signals). The total number of available signals throughout the execution is Sinitial+12.
For at least one P operation to remain blocked, the total number of requests must be greater than the total number of available signals. 20>Sinitial+12 Sinitial<20−12 Sinitial<8
The largest integer value for Sinitial that satisfies this condition is 7.
Q60GATE 0NAT2MComputer Organization
A file system uses an in-memory cache to cache disk blocks.The miss rate of the cache is shown in the figure. The latency to read a block from the cache is 1 ms and to read a block from the disk is 10ms. Assume that the cost of checking whether a block exists in the cache is negligible. Available cache sizes are in multiples of 10MB. The smallest cache size required to ensure an average read latency of less than 6ms is_________ MB.
For 30 MB cache: Miss Rate ≈ 40% (0.4). Hit Rate = 60% (0.6).
Avg Latency = (0.6 × 1) + (0.4 × 10) = 0.6 + 4 = 4.6 ms. (Less than 6 ms)
Therefore, 30 MB is the smallest cache size that meets the requirement.
Q61GATE 0MCQ2MDatabase Management System
Consider the following databases chedule with two transactions, T1 and T2. S=r2(X);r1(X);r2(Y);w1(X);r1(Y);w2(X);a1;a2 where ri(Z) denotes a read operation by transaction Ti on avariable Z, wi(Z) denotes a write operation by Ti on avariable Z and ai denotes an abort by transaction Ti . Which one of the following statements about the above schedule is TRUE?
A schedule is considered cascadeless if it avoids dirty reads, meaning no transaction is allowed to read data that has been written by another uncommitted transaction. In the given schedule S, we examine the read operations. Transaction T2 reads X and Y, but T1 has not written to them before these reads. Transaction T1 reads Y, which was not written by T2. Although T1 writes to X, T2 does not read X after this write. Since no transaction reads uncommitted data from another, the schedule is cascadeless.
Q62GATE 0NAT2MDatabase Management System
Consider the following database table named water_schemes : The number of tuples returned by the following SQL query is __________.
The query first calculates the total capacity for each district using a common table expression (CTE) named total.
Ajmeer: 20
Bikaner: 10 + 10 + 20 = 40
Churu: 10 + 20 = 30
Dungargarh: 10
Next, a second CTE total_avg computes the average of these summed capacities: (20+40+30+10)/4=25.
The final SELECT statement returns the names of districts where the total capacity is greater than or equal to the average capacity (25). The districts meeting this condition are Bikaner (40) and Churu (30). Thus, the query returns 2 tuples.
Q63GATE 0NAT2MComputer Network
A network has a data transmission bandwidth of 20×106 bits per second. It uses CSMA/CD in the MAClayer. The maximum signal propagation time from one node to another node is 40 microseconds. The minimum size of a frame in the network is ______ bytes.
For CSMA/CD to function correctly, the minimum frame transmission time (Tt) must be at least twice the maximum signal propagation time (Tp). This ensures a station can detect a collision before it finishes transmitting the frame. The condition is Tt≥2Tp.
The minimum frame size (L) is calculated as L=2×Tp×Bandwidth.
Given:
Bandwidth = 20×106 bits/second
Tp=40μs=40×10−6 seconds L=2×(40×10−6)×(20×106)=1600 bits.
To convert this to bytes, we divide by 8: 1600/8=200 bytes.
Q64GATE 0MCQ2MComputer Network
For the IEEE802.11 MAC protocol for wireless communication,which of the following statements is/are TRUE? I. At least three non-overlapping channels are available for transmissions. II. The RTS-CTS mechan is misused for collision detection. III. Unicast frames are ACKed.
Let's analyze the statements regarding the IEEE 802.11 protocol:
I. In the commonly used 2.4 GHz band, channels 1, 6, and 11 are designed to be non-overlapping. Therefore, at least three non-overlapping channels are available. This statement is TRUE.
II. The RTS-CTS (Request to Send/Clear to Send) mechanism is part of the collision avoidance (CSMA/CA) strategy, not collision detection. Wireless devices typically cannot detect collisions while transmitting. This statement is FALSE.
III. To ensure reliable delivery, all unicast frames sent to a specific destination require an acknowledgment (ACK) from the receiver. This statement is TRUE.
Therefore, only statements I and III are true.
Q65GATE 0NAT2MComputer Network
Consider a 128×103 bits/second satellite communication link with one way propagation delay of 150 milliseconds. Selective retransmission(repeat) protocol is used on this link to send data with a frame size of 1 kilobyte. Neglect the transmission time of acknowledgement. The minimum number of bits required for the sequence number field to achieve 100% utilization is ________.
To achieve 100% utilization, the sender's window size (W) must be large enough to transmit continuously for one full round-trip time. The number of frames needed is W≥1+2a, where a=Tp/Tt.
First, calculate the transmission time (Tt): Tt=BandwidthFrame Size=128×103 bps1 KB×8 bits/byte=128000 bps8192 bits≈64 ms.
Now, calculate a: a=TtTp=64 ms150 ms≈2.34.
The required window size is W=1+2(2.34)=5.68. Since we must send whole frames, we need a window of at least ⌈5.68⌉=6.
For Selective Repeat, the window size (W) and the number of sequence bits (n) are related by 2W≤2n. 2×6≤2n⇒12≤2n.
The smallest integer n that satisfies this is 4, as 24=16.