• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE CSE 2023

Question 51

Consider a random experiment where two fair coins are tossed. Let A be the event that denotes HEAD on both the throws, B be the event that denotes HEAD on the first throw, and C be the event that denotes HEAD on the second throw. Which of the following statements is/are TRUE?

  • A and B are independent.

  • A and C are independent.

  • B and C are independent.

  • Prob(B|C) = Prob(B)

Question 52

Consider functions Function 1 and Function 2 expressed in pseudocode as follows:

Function 1	                                      Function 2
while n > 1 do	                                  for i = 1 to 100 ∗ n do 	
  for i=1 to n do
  x=x+1                                             x = x + 1;
   end for                                           end for

n = [n/2];
end while

Let f1(n) and f2(n) denote the number of times the statement “x = x + 1” is executed in Function 1 and Function 2, respectively.

Which of the following statements is/are TRUE?

  • f1(n) ∈ Θ(f2(n))

  • f1(n) ∈ o(f2(n))

  • f1(n) ∈ ω(f2(n))

  • f1(n) ∈ O(n)

Question 53

Let G be a simple, finite, undirected graph with vertex set {v1,..., vn}. Let Δ(G) denote the maximum degree of G and let N = {1, 2,.. .} denote the set of all possible colors. Color the vertices of G using the following greedy strategy:
for i = 1,...,n 
color(vi) ← min{j ∈ N : no neighbor of vi is colored j}
Which of the following statements is/are TRUE?

  • This procedure results in a proper vertex coloring of G.

  • The number of colors used is at most Δ(G)+ 1.

  • The number of colors used is at most Δ(G).

  • The number of colors used is equal to the chromatic number of G.

Question 54

Let U = {1, 2, 3}. Let 2U denote the powerset of U . Consider an undirected graph G whose vertex set is 2U. For any A, B ∈ 2U, (A, B) is an edge in G if and only if (i) A /= B,  and (ii) either A Ç B or B Ç A.  For any vertex A in G,  the set of all possible orderings in which the vertices of G can be visited in a Breadth First Search (BFS) starting from A is denoted by B(A).
If ∅ denotes the empty set, then the cardinality of B(∅) is _______________

  • 5040

  • 2560

  • 1247

  • 3698

Question 55

Consider the following two-dimensional array D in the C programming language, which is stored in row-major order:

int D[128][128];

Demand paging is used for allocating memory and each physical page frame holds 512 elements of the array D. The Least Recently Used (LRU) page-replacement policy is used by the operating system. A total of 30 physical page frames are allocated to a process that executes the following code snippet:

for (int i = 0;  i <  128;  i++) 
for (int j = 0; j < 128; j++)
D[j][i] *= 10;

The number of page faults generated during the execution of this code snippet is

  • 2048

  • 512

  • 4096

  • 1032

Question 56

Consider a computer system with 57-bit virtual addressing using multi-level tree-structured page tables with L levels for virtual to physical address translation. The page size is 4 KB (1 KB = 1024 B) and a page table entry at any of the levels occupies 8 bytes.

The value of L is
 

  • 4

  • 5

  • 6

  • 7

Question 57

Consider a sequence a of elements a0 = 1, a1 = 5, a2 = 7, a3 = 8, a4 = 9, and a5 = 2. 

The following operations are performed on a stack S and a queue Q, both of which are initially empty.
I: push the elements of a from a0 to a5 in that order into S.
II: enqueue the elements of a from a0 to a5 in that order into Q. III: pop an element from S.
IV: dequeue an element from Q. V: pop an element from S.
VI: dequeue an element from Q.
VII: dequeue an element from Q and push the same element into S. VIII: Repeat operation VII three times.
IX: pop an element from S. X: pop an element from S.
The top element of S after executing the above operations is________

  • 6

  • 7

  • 8

  • 9

Question 58

Consider the syntax-directed translation given by the following grammar and semantic rules. Here N, I, F and B are non-terminals. N is the starting non-terminal, and #, 0, and 1 are lexical tokens corresponding to input letters “#”, “0” and “1”, respectively. X.val denotes the synthesized attribute (a numeric value) associated with a non-terminal X. I1 and F1 denote occurrences of I and F on the right-hand side of a production, respectively. For the tokens 0 and 1, 0.val = 0 and 1.val = 1.

N	→	I # F	N.val = I.val + F.val
I	→	I1 B	I.val = (2 I1.val )+ B.val
I	→	B	    I.val = B.val

F	→	B F1	F.val = 2 (B.val + F1.val )
1
F	→	B	F.val = 2 B.val
B	→	0	B.val = 0.val
B	→	1	B.val = 1.val

The value computed by the translation scheme for the input string

10#011

is. (Rounded off to three decimal places)

  • 2.375

  • 6.352

  • 4.750

  • 0.125

Question 59

Consider the following table named Student in a relational database. The primary key of this table is rollNum.

rollNumNameGenderMarks
1NamanM62
2AliyaF70
3AliyaF80
4JamesM82
5SwatiF65

The SQL query below is executed on this database

SELECT *
FROM Student
WHERE gender = ‘F’ AND marks > 65;

The number of rows returned by the query is___________

  • 1

  • 2

  • 3

  • 4

Question 60

Consider the language L over the alphabet {0, 1}, given below:
L = {w ∈ {0, 1}∗ | w does not contain three or more consecutive 1’s}.
The minimum number of states in a Deterministic Finite-State Automaton (DFA) for L is_______

  • 4

  • 5

  • 6

  • 7

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion