Question 1 of 65
The statement is logically equivalent to which of the statements below?
I.
II.
III.
IV.
Mock test · GATE marking
You have submitted this test.See your result
This browser is not letting the page save anything. The test will work, but a refresh would lose your answers, and the result cannot be shown after you submit.
The clock starts when you press Start and does not stop. An answer counts only after Save & Next or Mark for Review & Next.
The statement is logically equivalent to which of the statements below?
I.
II.
III.
IV.
Consider the first-order logic sentence . Assuming non-empty logical domains, which of the sentences below are implied by ?
I.
II.
III.
IV.
Let be scalars, not all zero, such that where are column vectors in . Consider the set of linear equations
where and . The set of equations has
Consider the following functions from positive integers to real numbers:
The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:
Consider the following table:
| Algorithm | Design Paradigm |
|---|---|
| (P) Kruskal | (i) Divide and Conquer |
| (Q) Quicksort | (ii) Greedy |
| (R) Floyd-Warshall | (iii) Dynamic Programming |
Match the algorithms to the design paradigms they are based on.
Let be a binary search tree with 15 nodes. The minimum and maximum possible heights of are:
Note: The height of a tree with a single node is 0.
The -bit fixed-point representation of an unsigned real number uses bits for the fraction part. Let . The range of decimal values for in this representation is
Consider the C code fragment given below.
typedef struct node {
int data;
struct node* next;
} node;
void join(node* m, node* n) {
node* p = n;
while (p->next != NULL) {
p = p->next;
}
p->next = m;
}
Assuming that and point to valid NULL-terminated linked lists, invocation of join will
When two 8-bit numbers and in 2's complement representation (with and as the least significant bits) are added using a ripple-carry adder, the sum bits obtained are and the carry bits are . An overflow is said to have occurred if
Consider the following context-free grammar over the alphabet with as the start symbol:
Which one of the following represents the language generated by the above grammar?
Consider the C struct defined below:
struct data {
int marks[100];
char grade;
int cnumber;
};
struct data student;
The base address of student is available in register R1. The field student.grade can be accessed efficiently using
Consider the following intermediate program in three address code:
p = a - b
q = p * c
p = u * v
q = p + q
Which one of the following corresponds to a static single assignment form of the above code?
Consider the following C code:
#include <stdio.h>
#include <stdlib.h>
int *assignval(int *x, int val) {
*x = val;
return x;
}
void main() {
int *x = malloc(sizeof(int));
if (NULL == x) return;
x = assignval(x, 0);
if (x) {
x = (int *)malloc(sizeof(int));
if (NULL == x) return;
x = assignval(x, 10);
}
printf("%d\n", *x);
free(x);
}
The code suffers from which one of the following problems:
Consider a TCP client and a TCP server running on two different machines. After completing data transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server. Server-side TCP responds by sending an ACK, which is received by the client-side TCP. As per the TCP connection state diagram (RFC 793), in which state does the client-side TCP connection wait for the FIN from the server-side TCP?
A sender S sends a message to receiver R, which is digitally signed by S with its private key. In this scenario, one or more of the following security violations can take place.
(I) S can launch a birthday attack to replace with a fraudulent message.
(II) A third party attacker can launch a birthday attack to replace with a fraudulent message.
(III) R can launch a birthday attack to replace with a fraudulent message.
Which of the following are possible security violations?
The following functional dependencies hold true for the relational schema :
Which of the following is irreducible equivalent for this set of functional dependencies?
Consider the following grammar:
What is ?
Threads of a process share
Let be a Gaussian random variable with mean 0 and variance . Let where is the maximum of and . The median of is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Let be a tree with 10 vertices. The sum of the degrees of all the vertices in is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Consider the Karnaugh map given below, where X represents "don't care" and blank represents 0.
Assume for all inputs , the respective complements are also available. The above logic is implemented using 2-input NOR gates only. The minimum number of gates required is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Consider the language given by the regular expression over the alphabet . The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Consider a database that has the relation schema . An instance of the schema EMP and a SQL query on it are given below.
| EmpId | EmpName | DeptName |
|---|---|---|
| 1 | XYA | AA |
| 2 | XYB | AA |
| 3 | XYC | AA |
| 4 | XYD | AA |
| 5 | XYE | AB |
| 6 | XYF | AB |
| 7 | XYG | AB |
| 8 | XYH | AC |
| 9 | XYI | AC |
| 10 | XYJ | AC |
| 11 | XYK | AD |
| 12 | XYL | AD |
| 13 | XYM | AE |
SELECT AVG(EC.Num)
FROM EC
WHERE (DeptName, Num) IN
(SELECT DeptName, COUNT(EmpId) AS EC(DeptName, Num)
FROM EMP
GROUP BY DeptName)
The output of executing the SQL query is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below:
| Process | Arrival time | Burst time |
|---|---|---|
| P1 | 0 | 7 |
| P2 | 3 | 3 |
| P3 | 5 | 5 |
| P4 | 6 | 2 |
If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is ______ milliseconds.
A number: digits, one decimal point and an optional minus sign at the start.
Consider a two-level cache hierarchy with L1 and L2 caches. An application incurs 1.4 memory accesses per instruction on average. For this application, the miss rate of L1 cache is 0.1; the L2 cache experiences, on average, 7 misses per 1000 instructions. The miss rate of L2 expressed correct to two decimal places is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Let be any connected undirected edge-weighted graph. The weights of the edges in are positive and distinct. Consider the following statements:
(I) Minimum Spanning Tree of is always unique.
(II) Shortest path between any two vertices of is always unique.
Which of the above statements is/are necessarily true?
A multithreaded program executes with number of threads and uses number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock , then it cannot re-acquire lock without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of and the minimum value of together for which execution of can result in a deadlock are:
The value of
Let , and be propositions and the expression be a contradiction. Then, the expression is
Let and be two vectors in whose Euclidean norms satisfy . What is the value of such that bisects the angle between and ?
Let be an real valued square symmetric matrix of rank 2 with . Consider the following statements:
(I) One eigenvalue must be in
(II) The eigenvalue with the largest magnitude must be strictly greater than 5
Which of the above statements about eigenvalues of is/are necessarily CORRECT?
A computer network uses polynomials over for error checking with 8 bits as information bits and uses as the generator polynomial to generate the check bits. In this network, the message 01011011 is transmitted as
Consider a combination of T and D flip-flops connected as shown below. The output of the D flip-flop is connected to the input of the T flip-flop and the output of the T flip-flop is connected to the input of the D flip-flop.
Initially, both and are set to 1 (before the 1st clock cycle). The outputs
If is a grammar with productions
where is the start variable, then which one of the following strings is not generated by ?
Consider the following two functions.
void fun1(int n) {
if (n == 0) return;
printf("%d", n);
fun2(n - 2);
printf("%d", n);
}
void fun2(int n) {
if (n == 0) return;
printf("%d", n);
fun1(++n);
printf("%d", n);
}
The output printed when fun1(5) is called is
Consider the C functions foo and bar given below:
int foo(int val) {
int x = 0;
while (val > 0) {
x = x + foo(val--);
}
return val;
}
int bar(int val) {
int x = 0;
while (val > 0) {
x = x + bar(val - 1);
}
return val;
}
Invocations of foo(3) and bar(3) will result in:
Consider the context-free grammars over the alphabet given below. and are non-terminals.
The language is
Consider the following languages over the alphabet .
Let and .
Which of the following are context-free languages?
I.
II.
Let and be finite alphabets and let # be a symbol outside both and . Let be a total function from to . We say is computable if there exists a Turing machine which given an input in , always halts with on its tape. Let denote the language . Which of the following statements is true:
Recall that Belady's anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:
S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly
S2: LRU page replacement algorithm suffers from Belady's anomaly
Which of the following is CORRECT?
Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus.
(I)
(II)
(III)
Which of the above queries are safe?
In a database system, unique timestamps are assigned to each transaction using Lamport's logical clock. Let and be the timestamps of transactions and respectively. Besides, holds a lock on the resource , and has requested a conflicting lock on the same resource . The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp.
if TS(T1) < TS(T2) then
T1 is killed
else
T1 waits
Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?
Consider the following grammar:
stmt -> if expr then expr else expr; stmt | 0
expr -> term relop term | term
term -> id | number
id -> a | b | c
number -> [0-9]
where relop is a relational operator (e.g., ), 0 refers to the empty statement, and if, then, else are terminals.
Consider a program following the above grammar containing ten if terminals. The number of control flow paths in is ______.
For example, the program
if e1 then e2 else e3
has 2 control flow paths, and .
A number: digits, one decimal point and an optional minus sign at the start.
In a RSA cryptosystem, a participant A uses two prime numbers and to generate her public and private keys. If the public key of A is 35, then the private key of A is ______.
A number: digits, one decimal point and an optional minus sign at the start.
The values of parameters for the Stop-and-Wait ARQ protocol are as given below:
Assume that there are no transmission errors. Then, the transmission efficiency (expressed in percentage) of the Stop-and-Wait ARQ protocol for the above parameters is ______ (correct to 2 decimal places).
A number: digits, one decimal point and an optional minus sign at the start.
Consider a database that has the relation schema . An instance of the schema CR is as given below.
| StudentName | CourseName |
|---|---|
| SA | CA |
| SA | CB |
| SA | CC |
| SB | CB |
| SB | CC |
| SC | CA |
| SC | CB |
| SC | CC |
| SD | CA |
| SD | CB |
| SD | CC |
| SD | CD |
| SE | CD |
| SE | CA |
| SE | CB |
| SF | CA |
| SF | CB |
| SF | CC |
The following query is made on the database:
The number of rows in is ______.
A number: digits, one decimal point and an optional minus sign at the start.
The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or 7 is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Let be an array of 31 numbers consisting of a sequence of 0's followed by a sequence of 1's. The problem is to find the smallest index such that is 1 by probing the minimum number of locations in . The worst case number of probes performed by an optimal algorithm is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Consider a RISC machine where each instruction is exactly 4 bytes long. Conditional and unconditional branch instructions use PC-relative addressing mode with Offset specified in bytes to the target location of the branch instruction. Further the Offset is always with respect to the address of the next instruction in the program sequence. Consider the following instruction sequence:
If the target of the branch instruction is , then the decimal value of the Offset is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Instruction execution in a processor is divided into 5 stages: Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Execute (EX), and Write Back (WB). These stages take 5, 4, 20, 10, and 3 nanoseconds (ns) respectively. A pipelined implementation of the processor requires buffering between each pair of consecutive stages with a delay of 2 ns. Two pipelined implementations of the processor are contemplated:
(i) a naive pipeline implementation (NP) with 5 stages and
(ii) an efficient pipeline (EP) where the OF stage is divided into stages OF1 and OF2 with execution times of 12 ns and 8 ns respectively.
The speedup (correct to two decimal places) achieved by EP over NP in executing 20 independent instructions with no hazards is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Consider a 2-way set associative cache with 256 blocks and uses LRU replacement. Initially the cache is empty. Conflict misses are those misses which occur due to contention of multiple blocks for the same cache set. Compulsory misses occur due to first time access to the block. The following sequence of accesses to memory blocks:
is repeated 10 times. The number of conflict misses experienced by the cache is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Consider the expression . Let be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture, in which (i) only load and store instructions can have memory operands and (ii) arithmetic instructions can have only register or immediate operands. The value of is ______.
A number: digits, one decimal point and an optional minus sign at the start.
Consider the following C program.
#include <stdio.h>
#include <string.h>
void printlength(char *s, char *t) {
unsigned int c = 0;
int len = ((strlen(s) - strlen(t)) > c) ? strlen(s) : strlen(t);
printf("%d\n", len);
}
void main() {
char *x = "abc";
char *y = "defgh";
printlength(x, y);
}
Recall that strlen is defined in string.h as returning a value of type size_t, which is an unsigned int. The output of the program is ______.
A number: digits, one decimal point and an optional minus sign at the start.
A cache memory unit with capacity of words and block size of words is to be designed. If it is designed as a direct mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as a 16-way set-associative cache, the length of the TAG field is ______ bits.
A number: digits, one decimal point and an optional minus sign at the start.
The output of executing the following C program is ______.
#include <stdio.h>
int total(int v) {
static int count = 0;
while (v) {
count += v & 1;
v >>= 1;
}
return count;
}
void main() {
static int x = 0;
int i = 5;
for (; i > 0; i--) {
x = x + total(i);
}
printf("%d\n", x);
}A number: digits, one decimal point and an optional minus sign at the start.
After Rajendra Chola returned from his voyage to Indonesia, he __________ to visit the temple in Thanjavur.
Research in the workplace reveals that people work for many reasons __________
Rahul, Murali, Srinivas and Arul are seated around a square table. Rahul is sitting to the left of Murali. Srinivas is sitting to the right of Arul. Which of the following pairs are seated opposite each other?
Find the smallest number such that is a perfect cube.
The probability that a -digit number does NOT contain the digits 0, 5, or 9 is
"The hold of the nationalist imagination on our colonial past is such that anything inadequately or improperly nationalist is just not history."
Which of the following statements best reflects the author's opinion?
Six people are seated around a circular table. There are at least two men and two women. There are at least three right-handed persons. Every woman has a left-handed person to her immediate right. None of the women are right-handed. The number of women at the table is
The expression is equal to
Arun, Gulab, Neel and Shweta must choose one shirt each from a pile of four shirts coloured red, pink, blue and white respectively. Arun dislikes the colour red and Shweta dislikes the colour white. Gulab and Neel like all the colours. In how many different ways can they choose the shirts so that no one has a shirt with a colour he or she dislikes?
A contour line joins locations having the same height above the mean sea level. The following is a contour plot of a geographical region. Contour lines are shown at 25 m intervals in this plot. If in a flood, the water level rises to 525 m, which of the villages P, Q, R, S, T get submerged?
Not saved yet. Press Save & Next (or Mark for Review & Next) to record this selection.
M
Your answers are being marked.
The result page did not open. Your answers are saved in this browser.Open the result