The PYQ practice room
GATE CS 2023 Set 1
All 65 solved GATE CS 2023 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
3
MCQ · NAT · MSQ
Revision mode
Self-paced
No timer. Focus on understanding.
Explore the questions
General Aptitude (GA)
101
Q1MCQ1 markEasyWe reached the station late, and _______ missed the train.Think it through. Then check your answer.Question
We reached the station late, and _______ missed the train.Correct answer
(B) nearly
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sentence requires an adverb to modify the verb 'missed'. 'Nearly' is an adverb meaning 'almost', which fits the context that they arrived late and almost missed the train.- 'Near' is typically an adjective or preposition.
- 'Utterly' means completely or totally, which is too strong and doesn't fit the context of a close call.
- 'Mostly' means for the most part, which doesn't make sense here.
2
Q2MCQ1 markEasyKind : _______ : : Often : Frequently (By word meaning)Think it through. Then check your answer.Question
Kind : _______ : : Often : Frequently
(By word meaning)- A.Mean
- B.Type
- C.Cruel
- D.Kindly
Answer checking is unavailable for this question. You can review the published solution without a score.
Correct answer
(MTA)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The analogy is based on word meanings (synonyms).- Often and Frequently are synonyms.
- We need to find a synonym for the word Kind.
- (A) Mean: This is an antonym (opposite) of 'kind' when used as an adjective.
- (B) Type: This is a synonym of 'kind' when used as a noun (e.g., "What kind/type of music do you like?").
- (C) Cruel: This is an antonym of 'kind' when used as an adjective.
- (D) Kindly: This is an adverbial form, not a direct synonym for the noun or adjective 'kind'.
- A.
3
Q3MCQ1 markEasyA series of natural numbers obeys for all integers . If , and , then what is…Think it through. Then check your answer.Question
A series of natural numbers obeys for all integers .If , and , then what is ?Correct answer
(A) 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the recurrence relation for , we can work backwards from the given values:1.2.3.4.5.Thus, .4
Q4MCQ1 markEasyA survey for a certain year found that of pregnant women received medical care at least once before giving birth. Of these women, received medical care from doctors,…Think it through. Then check your answer.Question
A survey for a certain year found that of pregnant women received medical care at least once before giving birth. Of these women, received medical care from doctors, while received medical care from other healthcare providers.Given this information, which one of the following statements can be inferred with certainty?Correct answer
(A) More than half of the pregnant women received medical care at least once from a doctor.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the total number of pregnant women be .
According to the survey:1.Women who received medical care = of .2.Of these women, received care from doctors.Therefore, the number of women who received care from doctors = of .Since is of the total population , it is more than half (). The premise states these women received care "at least once", so we can conclude that more than half of the pregnant women received medical care at least once from a doctor. Thus, statement (A) is correct.5
Q5MCQ1 markEasyLooking at the surface of a smooth 3-dimensional object from the outside, which one of the following options is TRUE?Think it through. Then check your answer.Question
Looking at the surface of a smooth 3-dimensional object from the outside, which one of the following options is TRUE?Correct answer
(C) The surface of the object may be concave in some places and convex in other places.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A smooth 3-dimensional object is one where the surface is continuous and differentiable, meaning it has no sharp edges or corners.- A sphere is a smooth object that is convex everywhere.
- A torus (donut shape) is a smooth object that has regions of positive Gaussian curvature (convex) on the outer part and regions of negative Gaussian curvature (concave) on the inner part when viewed from the outside.
6
Q6MCQ2 marksEasyThe country of Zombieland is in distress since more than of its working population is suffering from serious health issues. Studies conducted by competent health experts…Think it through. Then check your answer.Question
The country of Zombieland is in distress since more than of its working population is suffering from serious health issues. Studies conducted by competent health experts concluded that a complete lack of physical exercise among its working population was one of the leading causes of their health issues. As one of the measures to address the problem, the Government of Zombieland has decided to provide monetary incentives to those who ride bicycles to work.Based only on the information provided above, which one of the following statements can be logically inferred with certainty?Correct answer
(D) The Government of Zombieland believes that riding bicycles is a form of physical exercise.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The passage establishes a link between health issues and a lack of physical exercise. To address this, the government introduces incentives for riding bicycles to work. This policy choice directly implies that the government views bicycle riding as a form of physical exercise that can help solve the problem identified by the experts.- (A) is not certain because incentives do not guarantee universal adoption.
- (B) is not certain because exercise is only "one of the leading causes," not the only cause, and cycling may not eliminate all health issues.
- (C) is not mentioned; the text only discusses incentives, not mandatory orders or specific expert suggestions for cycling.
7
Q7MCQ2 marksEasyConsider two functions of time (), where . Now consider the following two statements: (i) For some , .…Think it through. Then check your answer.Question
Consider two functions of time (),where .Now consider the following two statements:
(i) For some , .
(ii) There exists a , such that for all .Which one of the following options is TRUE?Correct answer
(C) both (i) and (ii) are correct
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given functions are and for .Statement (i):
Since , this inequality holds for . For example, at , and , so . Thus, statement (i) is correct.Statement (ii): for all
Since , this holds for . Thus, there exists such that for all , . Thus, statement (ii) is correct.Since both statements are correct, the correct option is (C).8
Q8MCQ2 marksEasyWhich one of the following sentence sequences creates a coherent narrative? (i) Once on the terrace, on her way to her small room in the corner, she notices the man right away.…Think it through. Then check your answer.Question
Which one of the following sentence sequences creates a coherent narrative?(i) Once on the terrace, on her way to her small room in the corner, she notices the man right away.
(ii) She begins to pant by the time she has climbed all the stairs.
(iii) Mina has bought vegetables and rice at the market, so her bags are heavy.
(iv) He was leaning against the parapet, watching the traffic below.Correct answer
(D) (iii), (ii), (i), (iv)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To create a coherent narrative, we look for logical connections between the sentences:1.Sentence (iii) introduces the character Mina and the situation: she has heavy bags from the market. This is a natural starting point.2.Sentence (ii) follows logically: because her bags are heavy, she is panting as she climbs the stairs.3.Sentence (i) describes what happens after she finishes climbing the stairs and reaches the terrace: she notices a man.4.Sentence (iv) provides more detail about the man she just noticed: he was leaning against the parapet.The logical sequence is (iii) (ii) (i) (iv), which corresponds to option (D).9
Q9MCQ2 marksMediumand are functions of and , respectively, and for all real values of and . Which one of the following options is necessarily TRUE…Think it through. Then check your answer.Question
and are functions of and , respectively, and for all real values of and . Which one of the following options is necessarily TRUE for all and ?Correct answer
(B) f(x) = g(y) = constant
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given that for all real values of and .Let's fix at some value . Then for all . Since is a fixed real number, must be a constant function.
Similarly, let's fix at some value . Then for all . Since is a fixed real number, must be a constant function.Since for all , they must both be equal to the same constant value.
Therefore, is necessarily true.- Option (A) is a special case where the constant is 0, but it's not necessarily true for all such functions.
- Option (C) contradicts the finding that they must be constants.
- Option (D) simplifies to , which is also only true if the constant is 0.
10
Q10MCQ2 marksEasyWhich one of the options best describes the transformation of the 2-dimensional figure P to Q, and then to R, as shown? [figure]Think it through. Then check your answer.Question
Which one of the options best describes the transformation of the 2-dimensional figure P to Q, and then to R, as shown?
Correct answer
(A) Operation 1: A clockwise rotation by 90^ about an axis perpendicular to the plane of the figure Operation 2: A reflection along a horizontal line
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Analyze Operation 1 (P to Q): In figure P, the longest point of the star is pointing to the left. In figure Q, this longest point is pointing upwards. Moving from the left (9 o'clock) to the top (12 o'clock) corresponds to a clockwise rotation about an axis perpendicular to the plane of the figure.2.Analyze Operation 2 (Q to R): In figure Q, the longest point is at the top. In figure R, the longest point is at the bottom. The figure has been flipped vertically across its horizontal axis. This transformation is a reflection along a horizontal line.Combining these observations, Operation 1 is a clockwise rotation and Operation 2 is a reflection along a horizontal line. This matches option (A).
Computer Science and Information Technology (CS)
5511
Q11MCQ1 markEasyConsider the following statements regarding the front-end and back-end of a compiler. S1: The front-end includes phases that are independent of the target hardware. S2:…Think it through. Then check your answer.Question
Consider the following statements regarding the front-end and back-end of a compiler.
S1: The front-end includes phases that are independent of the target hardware.
S2: The back-end includes phases that are specific to the target hardware.
S3: The back-end includes phases that are specific to the programming language used in the source code.Identify the CORRECT option.Correct answer
(B) Only S1 and S2 are TRUE.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
- S1 is TRUE: The front-end of a compiler (lexical analysis, syntax analysis, semantic analysis, and intermediate code generation) is designed to be independent of the target machine's architecture.
- S2 is TRUE: The back-end (code optimization and code generation) is responsible for generating machine-specific code and performing optimizations that depend on the target hardware's registers, instruction set, etc.
- S3 is FALSE: The back-end operates on the Intermediate Representation (IR) produced by the front-end. It is generally independent of the source programming language, allowing the same back-end to be used for different languages if they share a common IR.
12
Q12MCQ1 markEasyWhich one of the following sequences when stored in an array at locations forms a max-heap?Think it through. Then check your answer.Question
Which one of the following sequences when stored in an array at locations forms a max-heap?Correct answer
(B) 23, 17, 14, 7, 13, 10, 1, 5, 6, 12
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A max-heap must satisfy the property and for all valid indices .- Option (A): . Its left child is . Since , it violates the max-heap property.
- Option (B):
- (True)
- (True)
- (True)
- (True)
- (True)
- Option (C): (Violation). Also (Violation).
- Option (D): (Violation).
13
Q13MCQ1 markEasyLetSLLdelbe a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, letDLLdelbe another…Think it through. Then check your answer.Question
LetSLLdelbe a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, letDLLdelbe another function that deletes a node in a doubly-linked list given a pointer to the node and a pointer to the head of the list.
Let denote the number of nodes in each of the linked lists. Which one of the following choices is TRUE about the worst-case time complexity ofSLLdelandDLLdel?Correct answer
(D) SLLdel is O(n) and DLLdel is O(1)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In a singly linked list, to delete a node given its pointer, we must update thenextpointer of its predecessor. Since we only have a pointer to the node itself and the head, we must traverse the list from the head to find the predecessor, which takes time in the worst case. In a doubly linked list, each node contains a pointer to its predecessor (prev), allowing us to update the links in time without traversal.14
Q14MCQ1 markMediumConsider the Deterministic Finite-state Automaton (DFA) shown below. The DFA runs on the alphabet , and has the set of states , with …Think it through. Then check your answer.Question
Consider the Deterministic Finite-state Automaton (DFA) shown below. The DFA runs on the alphabet , and has the set of states , with being the start state and being the only final state.Which one of the following regular expressions correctly describes the language accepted by ?
Correct answer
(C) 1(0 + 11)^
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Analyzing the DFA transitions:1.From start state , an input of '0' leads to state , which is a dead state (self-loops on 0 and 1 with no path to final state ). Thus, all accepted strings must start with '1'.2., where is the final state.3.From , an input of '0' stays in ().4.From , an input of '1' goes to . From , another '1' returns to . This forms the pattern '11'.5.From , an input of '0' leads to the dead state .Combining these, once the initial '1' is consumed, the machine accepts any combination of '0's and '11's. The regular expression is .15
Q15MCQ1 markEasyThe Lucas sequence is defined by the recurrence relation: with and . Which one of the options given is…Think it through. Then check your answer.Question
The Lucas sequence is defined by the recurrence relation:with and .
Which one of the options given is TRUE?Correct answer
(A) Lₙ = (1 + √(5)2)ⁿ + (1 - √(5)2)ⁿ
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The characteristic equation for the recurrence is . The roots are and .
The general solution is .
Using initial conditions:
For :
For :
Since and , we have:
.
Substituting into the equation:
.
Then .
Thus, .16
Q16MCQ1 markEasyWhich one of the options given below refers to the degree (or arity) of a relation in relational database systems?Think it through. Then check your answer.Question
Which one of the options given below refers to the degree (or arity) of a relation in relational database systems?Correct answer
(A) Number of attributes of its relation schema.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In relational database theory, the degree (also known as arity) of a relation is defined as the number of attributes (columns) in its schema.- The number of tuples (rows) is called the cardinality.
- The number of entries would be the total count of data values (cardinality degree).
- Distinct domains refer to the set of allowed values for attributes, not the count of attributes themselves.
17
Q17MCQ1 markEasySuppose two hosts are connected by a point-to-point link and they are configured to use Stop-and-Wait protocol for reliable data transfer. Identify in which one of the…Think it through. Then check your answer.Question
Suppose two hosts are connected by a point-to-point link and they are configured to use Stop-and-Wait protocol for reliable data transfer. Identify in which one of the following scenarios, the utilization of the link is the lowest.Correct answer
(B) Longer link length and higher transmission rate
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The efficiency (utilization) of the Stop-and-Wait protocol is given by:where .- (Propagation Delay) . Thus, longer link length increases .
- (Transmission Delay) . Thus, higher transmission rate decreases .
18
Q18MCQ1 markEasyLet and…Think it through. Then check your answer.Question
LetandLet and denote the determinants of the matrices and , respectively.
Which one of the options given below is TRUE?Correct answer
(B) det(B) = -det(A)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the rows of matrix be .Comparing this with matrix :Matrix is obtained from matrix by swapping row 1 () and row 3 ().
A fundamental property of determinants is that swapping any two rows (or columns) of a matrix multiplies the determinant by .
Therefore, .19
Q19MCQ1 markEasyConsider the following definition of a lexical token id for an identifier in a programming language, using extended regular expressions: letter [A-Za-z]…Think it through. Then check your answer.Question
Consider the following definition of a lexical token id for an identifier in a programming language, using extended regular expressions:letter [A-Za-z]
digit [0-9]
id letter (letter | digit).Which one of the following Non-deterministic Finite-state Automata with -transitions accepts the set of valid identifiers? (A double-circle denotes a final state)Correct answer
(C) [figure]
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The regular expression for the identifier is given as . To construct an NFA with -transitions for this expression:1.Initial Transition: The automaton must first consume aletter. This is shown in options (B), (C), and (D).2.Kleene Star and Union: The part requires a structure that can handle zero or more occurrences of either aletteror adigit.3.Thompson Construction:- The union is represented by two parallel paths.
- The Kleene star is represented by a loop that allows returning to the start of via an -transition and a skip path that allows bypassing entirely via an -transition.
- It starts with a
lettertransition. - It then enters a sub-structure for , where parallel paths for
letteranddigitare enclosed in -transitions that provide both the looping (repetition) and the skip (zero occurrences) functionality.
20
Q20MCQ1 markEasyAn algorithm has to store several keys generated by an adversary in a hash table. The adversary is malicious who tries to maximize the number of collisions. Let be the number…Think it through. Then check your answer.Question
An algorithm has to store several keys generated by an adversary in a hash table. The adversary is malicious who tries to maximize the number of collisions. Let be the number of keys, be the number of slots in the hash table, and .Which one of the following is the best hashing strategy to counteract the adversary?Correct answer
(C) Universal hashing method.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In a scenario where an adversary can choose keys to intentionally cause collisions, deterministic hashing functions like the Division or Multiplication methods are vulnerable because the adversary can pre-calculate which keys will collide. Universal Hashing counteracts this by choosing a hash function randomly from a carefully designed family of functions at runtime. Because the specific function is not known to the adversary beforehand, they cannot reliably pick keys that will collide, ensuring that the expected number of collisions for any set of keys remains small ().21
Q21MCQ1 markEasyThe output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure. Match the functional equivalence of this circuit to one of the following…Think it through. Then check your answer.Question
The output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure.Match the functional equivalence of this circuit to one of the following options.
Correct answer
(B) D Latch
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The characteristic equation for a 2-to-1 multiplexer with inputs and select line is:From the given circuit diagram:1.Input is connected to the output (feedback).2.Input is connected to an external data signal, let's call it .3.Select line acts as an enable signal, let's call it .Substituting these into the equation:This is the characteristic equation of a D Latch. When , the output follows the input (, transparent mode). When , the output maintains its previous state (, hold mode).22
Q22MSQ1 markMediumWhich one or more of the following need to be saved on a context switch from one thread () of a process to another thread () of the same process?Think it through. Then check your answer.Question
Which one or more of the following need to be saved on a context switch from one thread () of a process to another thread () of the same process?Correct answer
(B) Stack pointer; (C) Program counter; (D) General purpose registers
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In a multi-threaded process, all threads share the same virtual address space, which means they share the same page table. Therefore, the Page table base register does not need to be saved or restored during a context switch between threads of the same process. However, each thread has its own execution context to allow independent execution. This context includes its own Stack pointer, Program counter, and General purpose registers, all of which must be saved and restored during a context switch.23
Q23MSQ1 markMediumWhich one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?Think it through. Then check your answer.Question
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?Correct answer
(C) Page Fault; (D) System Call
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A transition from user mode to kernel mode occurs when the CPU needs to handle an event that requires privileged access to hardware or OS services.- Function Call: A standard function call within a program's own code executes entirely in user mode.
- malloc Call:
mallocis a library function that manages a memory pool in user space. It only makes a system call (likebrkorsbrk) when it needs to request more memory from the OS. Thus, it does not guarantee a transition every time it is called. - Page Fault: This is a hardware-generated exception (trap) that occurs when a process attempts to access a memory page not currently in RAM. It forces an immediate transition to kernel mode so the OS can handle the fault.
- System Call: This is an explicit request by a user program for an OS service, which always involves a transition to kernel mode via a software interrupt or specialized instruction.
24
Q24MSQ1 markEasyWhich of the following statements is/are CORRECT?Think it through. Then check your answer.Question
Which of the following statements is/are CORRECT?Correct answer
(A) The intersection of two regular languages is regular.; (C) The intersection of two recursive languages is recursive.; (D) The intersection of two recursively enumerable languages is recursively enumerable.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Closure properties under intersection for various language families are as follows:- Regular Languages: Closed under intersection. (Statement A is correct)
- Context-Free Languages (CFLs): NOT closed under intersection. For example, and are both CFLs, but their intersection is not a CFL. (Statement B is incorrect)
- Recursive Languages: Closed under intersection. (Statement C is correct)
- Recursively Enumerable (RE) Languages: Closed under intersection. (Statement D is correct)
25
Q25MSQ1 markMediumWhich of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet?Think it through. Then check your answer.Question
Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet?Correct answer
(A) OSPF implements Bellman-Ford algorithm to find shortest paths.; (C) OSPF is used as an inter-domain routing protocol.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
OSPF (Open Shortest Path First) is a link-state routing protocol.1.It uses Dijkstra's algorithm to find the shortest path, not the Bellman-Ford algorithm (which is used by distance-vector protocols like RIP). Thus, statement (A) is INCORRECT.2.It is an Interior Gateway Protocol (IGP), meaning it is used for intra-domain routing within an Autonomous System (AS). BGP is used for inter-domain routing. Thus, statement (C) is INCORRECT.3.Statement (B) is correct as OSPF uses Dijkstra's algorithm.4.Statement (D) is correct as OSPF supports hierarchical routing through the use of areas (Area 0 as backbone).26
Q26MSQ1 markMediumGeetha has a conjecture about integers, which is of the form where is a statement about integers, and is a statement about…Think it through. Then check your answer.Question
Geetha has a conjecture about integers, which is of the formwhere is a statement about integers, and is a statement about pairs of integers. Which of the following (one or more) option(s) would imply Geetha’s conjecture?Correct answer
(B) ∀ x ∀ y Q(x, y); (C) ∃ y ∀ x (P(x) ⇒ Q(x, y))
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Geetha's conjecture is .- Option (B): . Since is a tautology, if is true for all , then is also true for all . Thus, (B) implies .
- Option (C): . Let this be . Then is true. For any , if is true, then is true, which means is true. Thus, is true. So (C) implies .
- Options (A) and (D) are existential statements about and cannot imply a universal statement about all .
27
Q27MSQ1 markMediumWhich one or more of the following CPU scheduling algorithms can potentially cause starvation?Think it through. Then check your answer.Question
Which one or more of the following CPU scheduling algorithms can potentially cause starvation?- A.First-in First-Out
- B.Round Robin
- C.Priority Scheduling
- D.Shortest Job First
Answer checking is unavailable for this question. You can review the published solution without a score.
Correct answer
(A) First-in First-Out; (C) Priority Scheduling; (D OR C); (D) Shortest Job First
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Starvation occurs when a process is perpetually denied necessary resources (like CPU time).- (A) First-in First-Out: Every process that enters the queue will eventually reach the front and be executed. No starvation.
- (B) Round Robin: Every process gets a fixed time quantum in a cyclic manner. No starvation.
- (C) Priority Scheduling: A low-priority process may never execute if higher-priority processes keep arriving. This causes starvation.
- (D) Shortest Job First: A long process may never execute if shorter jobs keep arriving. This causes starvation.
- A.
28
Q28MSQ1 markEasyLet be a real-valued function. Which of the following statements is/are TRUE?Think it through. Then check your answer.Question
Letbe a real-valued function.Which of the following statements is/are TRUE?Correct answer
(B) f(x) has a local maximum.; (D) f(x) has a local minimum.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the local extrema of the function , we first find its first derivative:
.Setting gives critical points at and .Next, we find the second derivative to test for local maxima and minima:
.Evaluating the second derivative at the critical points:1.At : . Since the second derivative is negative, has a local maximum at .2.At : . Since the second derivative is positive, has a local minimum at .Therefore, has both a local maximum and a local minimum. Statements (B) and (D) are TRUE.29
Q29MSQ1 markEasyLet and be functions of natural numbers given by and . Which of the following statements is/are TRUE?Think it through. Then check your answer.Question
Let and be functions of natural numbers given by and . Which of the following statements is/are TRUE?Correct answer
(A) f ∈ O(g); (C) f ∈ o(g)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given and :1.Big-O (): if there exist constants and such that for all . This is true for . Thus, (A) is TRUE.2.Little-o (): if . Here, . Thus, (C) is TRUE.3.Big-Omega (): if there exist constants and such that for all . This is false because grows strictly faster than . Thus, (B) is FALSE.4.Big-Theta (): if and . Since is false, (D) is FALSE.Therefore, statements (A) and (C) are TRUE.30
Q30NAT1 markMediumLet be the adjacency matrix of the graph with vertices {1, 2, 3, 4, 5}. [figure] Let , and be the five eigenvalues of…Think it through. Then check your answer.Question
Let be the adjacency matrix of the graph with vertices {1, 2, 3, 4, 5}.Let , and be the five eigenvalues of . Note that these eigenvalues need not be distinct.The value of .
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 sum of the eigenvalues of a square matrix is equal to the trace of the matrix, which is the sum of its diagonal elements:In an adjacency matrix of a graph, the diagonal element represents the number of self-loops at vertex . Looking at the provided graph:- Vertex 1 has no self-loop ().
- Vertex 2 has no self-loop ().
- Vertex 3 has one self-loop ().
- Vertex 4 has one self-loop ().
- Vertex 5 has no self-loop ().
31
Q31NAT1 markEasyThe value of the definite integral is ________. (Rounded off to the nearest integer)Think it through. Then check your answer.Question
The value of the definite integralis ________. (Rounded off to the nearest integer)Correct answer
0 to 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To evaluate the integral :1.Evaluate the innermost integral with respect to :2.Evaluate the middle integral with respect to :3.The outermost integral becomes:Alternatively, observe that is an odd function of and is an odd function of . Integrating an odd function over a symmetric interval around zero results in zero. Thus, the entire integral evaluates to 0.32
Q32NAT1 markEasyA particular number is written as 132 in radix-4 representation. The same number in radix-5 representation is ________.Think it through. Then check your answer.Question
A particular number is written as 132 in radix-4 representation. The same number in radix-5 representation is ________.Correct answer
110 to 110
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Convert the number from radix-4 to decimal (radix-10):.2.Convert the decimal number 30 to radix-5:- with remainder 0
- with remainder 1
- with remainder 1
33
Q33NAT1 markEasyConsider a 3-stage pipelined processor having a delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for the first, second, and the third stages, respectively. Assume that there is no…Think it through. Then check your answer.Question
Consider a 3-stage pipelined processor having a delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for the first, second, and the third stages, respectively. Assume that there is no other delay and the processor does not suffer from any pipeline hazards. Also assume that one instruction is fetched every cycle.The total execution time for executing 100 instructions on this processor is ________ ns.Correct answer
2040 to 2040
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Determine the cycle time (): In a pipeline, the cycle time is determined by the slowest stage.ns.2.Calculate total execution time (): For instructions in a -stage pipeline, the total time is given by:3.Substitute the values:- stages
- instructions
- ns
34
Q34NAT1 markMediumA keyboard connected to a computer is used at a rate of 1 keystroke per second. The computer system polls the keyboard every 10 ms (milli seconds) to check for a keystroke and…Think it through. Then check your answer.Question
A keyboard connected to a computer is used at a rate of 1 keystroke per second. The computer system polls the keyboard every 10 ms (milli seconds) to check for a keystroke and consumes 100 s (micro seconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes an additional 200 s to process the keystroke. Let denote the fraction of a second spent in polling and processing a keystroke.In an alternative implementation, the system uses interrupts instead of polling. An interrupt is raised for every keystroke. It takes a total of 1 ms for servicing an interrupt and processing a keystroke. Let denote the fraction of a second spent in servicing the interrupt and processing a keystroke.The ratio is ________. (Rounded off to one decimal place)Correct answer
10.2 to 10.2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Step 1: Calculate the total time spent in polling per second.
Polling interval = 10 ms, so there are polls per second.
Time for each poll = 100 s.
Total polling time = .Step 2: Calculate the time spent processing keystrokes in the polling method.
Keystroke rate = 1 per second.
Processing time per keystroke = 200 s.
Total processing time = .Step 3: Calculate (fraction of a second).
.Step 4: Calculate for the interrupt method.
Interrupt servicing and processing time = 1 ms = 1,000 s.
Since there is 1 keystroke per second, total time spent = 1,000 s.
.Step 5: Calculate the ratio.
Ratio .35
Q35NAT1 markEasyThe integer value printed by the ANSI-C program given below is ________. [code]Think it through. Then check your answer.Question
The integer value printed by the ANSI-C program given below is ________.#include<stdio.h> int funcp(){ static int x = 1; x++; return x; } int main(){ int x,y; x = funcp(); y = funcp()+x; printf("%d\n", (x+y)); return 0; }Correct answer
7 to 7
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Step 1: Trace the first call tofuncp().static int xis initialized to 1.x++increments it to 2. The function returns 2.
Inmain, the local variablexis assigned the value 2.Step 2: Trace the second call tofuncp().
The static variablexretains its value of 2 from the previous call.x++increments it to 3. The function returns 3.Step 3: Calculateyinmain.y = funcp() + x = 3 + 2 = 5.Step 4: Calculate the final output.printfprintsx + y, which is2 + 5 = 7.36
Q36MCQ2 marksEasyConsider the following program: [code] Which one of the following options represents the activation tree corresponding to the main function?Think it through. Then check your answer.Question
Consider the following program:Which one of the following options represents the activation tree corresponding to the main function?int main() { f1(); f2(2); f3(); return(0); } int f1() { return(1); } int f2(int X) { f3(); if (X==1) return f1(); else return (X*f2(X-1)); } int f3() { return(5); }Correct answer
(A) [figure]
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The activation tree tracks the sequence and nesting of function calls:1.mainstarts and callsf1(). Afterf1returns,maincallsf2(2).2.Insidef2(2),f3()is called first. Then, since , it recursively callsf2(1).3.Insidef2(1),f3()is called first. Then, since , it callsf1().4.AfterThis hierarchy is:f2(2)returns,maincallsf3().main(f1,f2,f3). Underf2(2), we have (f3,f2(1)). Underf2(1), we have (f3,f1). This matches the structure in option (A).37
Q37MCQ2 marksHardConsider the control flow graph shown. Which one of the following choices correctly lists the set of live variables at the exit point of each basic block? [figure]Think it through. Then check your answer.Question
Consider the control flow graph shown.Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?
Correct answer
(D) B1: \a, i, j\, B2: \a, j\, B3: \a, j\, B4: \a, i, j\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Live variable analysis is performed backwards. A variable is live at a point if there is a path to a use of that variable that does not redefine it.Let and be the set of live variables at the entry and exit of block , respectively.
From the graph:- (Note: the loop back to B2 entry means is a successor of and )
- B1:
- B2:
- B3:
- B4:
1.2.3.4.5.6.Testing option (D):- . (Consistent with )
- . (Consistent with )
- .
- . (Consistent with )
- . (Consistent with )
38
Q38MCQ2 marksHardConsider the two functionsincranddecrshown below. [code] [code] There are 5 threads each invokingincronce, and 3 threads each invokingdecronce, on the same shared…Think it through. Then check your answer.Question
Consider the two functionsincranddecrshown below.incr(){ wait(s); X = X+1; signal(s); }There are 5 threads each invokingdecr(){ wait(s); X = X-1; signal(s); }incronce, and 3 threads each invokingdecronce, on the same shared variable . The initial value of is 10.Suppose there are two implementations of the semaphore , as follows:I-1: is a binary semaphore initialized to 1.I-2: is a counting semaphore initialized to 2.Let , be the values of at the end of execution of all the threads with implementations I-1, I-2, respectively.Which one of the following choices corresponds to the minimum possible values of , , respectively?Correct answer
(C) 12, 7
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Implementation I-1 (Binary Semaphore init 1): This acts as a mutex, ensuring mutual exclusion. All 5 increments and 3 decrements are executed atomically. The final value is .2.Implementation I-2 (Counting Semaphore init 2): Up to two threads can enter the critical section simultaneously, leading to race conditions. To minimize the final value :- Let thread enter, read , and be preempted.
- Let thread enter, read , and be preempted.
- All other 4 increment threads ( to ) run to completion: becomes .
- resumes, increments its local 10 to 11, and writes .
- Now . The remaining 2 decrement threads () run to completion: becomes .
- resumes, decrements its local 10 to 9, and writes .
- Thus, the minimum value for is 7.
39
Q39MCQ2 marksMediumConsider the context-free grammar below where and are…Think it through. Then check your answer.Question
Consider the context-free grammar belowwhere and are non-terminals, and and are terminal symbols. The starting non-terminal is .Which one of the following statements is CORRECT?Correct answer
(B) The language generated by G is a^ (a + b)b^
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Analyze non-terminal :
This grammar for is regular. It generates strings of the form where . Specifically, generates , which is equivalent to . This can be written as .2.Analyze non-terminal :
This generates strings of the form for .
Let and . Since and :- If , we can choose .
- If , we can choose .
- If , we can choose (so ).
L(G)consists of all strings such that . This is exactly the language , which is represented by the regular expression . Since the language is regular, option (D) is false and option (B) is correct.40
Q40MCQ2 marksMediumConsider the pushdown automaton (PDA) below, which runs on the input alphabet , has stack alphabet , and has three states , with being…Think it through. Then check your answer.Question
Consider the pushdown automaton (PDA) below, which runs on the input alphabet , has stack alphabet , and has three states , with being the start state. A transition from state to state , labelled , where is an input symbol or , is a stack symbol, and is a string of stack symbols, represents the fact that in state , the PDA can read from the input, with on the top of its stack, pop from the stack, push in the string on the stack, and go to state . In the initial configuration, the stack has only the symbol in it. The PDA accepts by empty stack.Which one of the following options correctly describes the language accepted by ?
Correct answer
(A) \a^m bⁿ 1 ≤ m and n < m\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Analyze State : The transitions and push an 'A' for every 'a' read. Thus, after 'a's, the stack contains . Since there is no transition for or from when the stack is just , we must have .2.Analyze Transitions to and :- From , we can go to by reading a 'b' and popping an 'A' ().
- From , we can go directly to by popping an 'A' on input (). This corresponds to .
4.Analyze State : The transitions and allow emptying the stack completely.5.Conclusion: The PDA accepts strings of the form where and .41
Q41MCQ2 marksMediumConsider the given C-code and its corresponding assembly code, with a few operands U1–U4 being unknown. Some useful information as well as the semantics of each unique assembly…Think it through. Then check your answer.Question
Consider the given C-code and its corresponding assembly code, with a few operands U1–U4 being unknown. Some useful information as well as the semantics of each unique assembly instruction is annotated as inline comments in the code. The memory is byte-addressable.//C-code int a[10], b[10], i; // int is 32-bit for (i=0; i<10;i++) a[i] = b[i] * 8;Which one of the following options is a CORRECT replacement for operands in the position (U1, U2, U3, U4) in the above assembly code?;assembly-code (; indicates comments) ;r1-r5 are 32-bit integer registers ;initialize r1=0, r2=10 ;initialize r3, r4 with base address of a, b L01: jeq r1, r2, end ;if(r1==r2) goto end L02: lw r5, 0(r4) ;r5 <- Memory[r4+0] L03: shl r5, r5, U1 ;r5 <- r5 << U1 L04: sw r5, 0(r3) ;Memory[r3+0] <- r5 L05: add r3, r3, U2 ;r3 <- r3+U2 L06: add r4, r4, U3 L07: add r1, r1, 1 L08: jmp U4 ;goto U4 L09: endCorrect answer
(B) (3, 4, 4, L01)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.U1: The C-code performs* 8. In binary, multiplying by 8 is equivalent to a left shift by 3 bits (). Thus,U1 = 3.2.U2 and U3: The array elements areint, which are 32-bit (4 bytes). Since memory is byte-addressable, to move to the next element in arraysaandb, the pointersr3andr4must be incremented by 4. Thus,U2 = 4andU3 = 4.3.U4: The loop must jump back to the condition check at the start of the loop. The label for the condition check isL01. Thus,U4 = L01.4.Result: The tuple is , which matches option (B).42
Q42MCQ2 marksMediumA 4 kilobyte (KB) byte-addressable memory is realized using four 1 KB memory blocks. Two input address lines (IA4 and IA3) are connected to the chip select (CS) port of these…Think it through. Then check your answer.Question
A 4 kilobyte (KB) byte-addressable memory is realized using four 1 KB memory blocks. Two input address lines (IA4 and IA3) are connected to the chip select (CS) port of these memory blocks through a decoder as shown in the figure. The remaining ten input address lines from IA11–IA0 are connected to the address port of these blocks. The chip select (CS) is active high.The input memory addresses (IA11–IA0), in decimal, for the starting locations (Addr=0) of each block (indicated as X1, X2, X3, X4 in the figure) are among the options given below. Which one of the following options is CORRECT?
Correct answer
(C) (0, 8, 16, 24)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Address Mapping: The total address space is 12 bits (IA11 to IA0). IA4 and IA3 are used for block selection via the decoder. The other 10 bits (IA11-IA5 and IA2-IA0) are used as the internal address (Addr) for each 1 KB block.2.Starting Locations: For the starting location of any block, the internal address must be 0. This means .3.Block Selection:- X1 is selected when . Full address: .
- X2 is selected when . Full address: .
- X3 is selected when . Full address: .
- X4 is selected when . Full address: .
43
Q43MCQ2 marksMediumConsider a sequential digital circuit consisting of flip-flops and flip-flops as shown in the figure. CLKIN is the clock input to the circuit. At the beginning, ,…Think it through. Then check your answer.Question
Consider a sequential digital circuit consisting of flip-flops and flip-flops as shown in the figure. CLKIN is the clock input to the circuit. At the beginning, , and have values 0, 1 and 1, respectively.Which one of the given values of (, , ) can NEVER be obtained with this digital circuit?
Correct answer
(A) (0, 0, 1)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The state of the circuit is represented by . From the circuit diagram, the input equations for the flip-flops are:- (output of the NOT gate)
1.Initial: . Next state: .2.State . Next state: .3.State . Next state: .4.State . Next state: .5.State . Next state: .6.State . Next state: .7.State . Next state: . (Cycle repeats)The sequence of states is: .
Comparing with the options, is never obtained.44
Q44MCQ2 marksMediumA Boolean digital circuit is composed using two 4-input multiplexers (M1 and M2) and one 2-input multiplexer (M3) as shown in the figure. are the inputs of the…Think it through. Then check your answer.Question
A Boolean digital circuit is composed using two 4-input multiplexers (M1 and M2) and one 2-input multiplexer (M3) as shown in the figure. are the inputs of the multiplexers M1 and M2 and could be connected to either 0 or 1. The select lines of the multiplexers are connected to Boolean variables , and as shown.Which one of the following set of values of will realise the Boolean function ?
Correct answer
(C) (1, 1, 0, 1, 1, 1, 0, 0)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The output of the circuit is .
From the diagram:
Expanding to include and :
Comparing this with :1.2.Thus, the required set of values is , which corresponds to option (B).45
Q45MCQ2 marksMediumConsider the IEEE-754 single precision floating point numbers and . Which one of the following corresponds to the product of these numbers (i.e.,…Think it through. Then check your answer.Question
Consider the IEEE-754 single precision floating point numbers and . Which one of the following corresponds to the product of these numbers (i.e., ), represented in the IEEE-754 single precision format?Correct answer
(C) 0xC15C2EF4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Decode :- Binary:
- Sign (negative)
- Exponent . Bias-adjusted exponent .
- Mantissa .
- .
- Binary:
- Sign (positive)
- Exponent . Bias-adjusted exponent .
- Mantissa .
- .
- Sign: Negative Positive = Negative ().
- Exponent: . Bias-adjusted .
- Mantissa: .
- Sign .
- Exponent .
- Mantissa bits: .
- IEEE-754 Binary:
- Hex: .
46
Q46MCQ2 marksEasyLet be a priority queue for maintaining a set of elements. Suppose is implemented using a max-heap data structure. The operation EXTRACT-MAX() extracts and deletes…Think it through. Then check your answer.Question
Let be a priority queue for maintaining a set of elements. Suppose is implemented using a max-heap data structure. The operation EXTRACT-MAX() extracts and deletes the maximum element from . The operation INSERT() inserts a new element in . The properties of a max-heap are preserved at the end of each of these operations.When contains elements, which one of the following statements about the worst case running time of these two operations is TRUE?Correct answer
(B) Both EXTRACT-MAX (A) and INSERT (A, key) run in O(log(n)).
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In a max-heap of size :1.EXTRACT-MAX(): This operation involves removing the root element (the maximum), replacing it with the last leaf, and then performing a 'heapify-down' (or sink) operation to restore the heap property. The height of the heap is , so the worst-case time complexity is .2.INSERT(): This operation involves adding the new element as a leaf at the end of the heap and then performing a 'heapify-up' (or swim) operation to restore the heap property. Similarly, the worst-case time complexity is .Therefore, both operations run in .47
Q47MCQ2 marksMediumConsider the C functionfooand the binary tree shown. [code] [figure] Whenfoois called with a pointer to the root node of the given binary tree, what will it print?Think it through. Then check your answer.Question
Consider the C functionfooand the binary tree shown.typedef struct node { int val; struct node *left, *right; } node; int foo(node *p) { int retval; if (p == NULL) return 0; else { retval = p->val + foo(p->left) + foo(p->right); printf("%d ", retval); return retval; } }When
foois called with a pointer to the root node of the given binary tree, what will it print?Correct answer
(C) 3 8 16 13 24 50
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The functionfoocalculates the sum of all node values in the subtree rooted atp. It uses a post-order traversal (Left, Right, Root) because it recursively calls itself on the left and right children before calculatingretvaland printing it.Let's trace the execution:1.foo(3):retval = 3 + 0 + 0 = 3. Prints "3 ". Returns 3.2.foo(8):retval = 8 + 0 + 0 = 8. Prints "8 ". Returns 8.3.foo(5):retval = 5 + foo(3) + foo(8) = 5 + 3 + 8 = 16. Prints "16 ". Returns 16.4.foo(13):retval = 13 + 0 + 0 = 13. Prints "13 ". Returns 13.5.foo(11):retval = 11 + foo(NULL) + foo(13) = 11 + 0 + 13 = 24. Prints "24 ". Returns 24.6.The sequence of printed values is: 3 8 16 13 24 50.foo(10):retval = 10 + foo(5) + foo(11) = 10 + 16 + 24 = 50. Prints "50 ". Returns 50.48
Q48MCQ2 marksMediumLet , where is a large positive integer greater than 1000. Let be a positive integer less than . Let be subsets of with…Think it through. Then check your answer.Question
Let , where is a large positive integer greater than 1000. Let be a positive integer less than . Let be subsets of with and . We say that a permutation of separates from if one of the following is true.- All members of appear in the permutation before any of the members of .
- All members of appear in the permutation before any of the members of .
Correct answer
(D) 2 n2k (n - 2k)! (k!)²
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the number of permutations of that separate from :1.First, choose positions out of available positions in the permutation for the elements of . This can be done in ways.2.The remaining elements of can be arranged in the remaining positions in ways.3.Now, we arrange the elements of and elements of in the chosen positions such that they are separated.- Case 1: All elements of before all elements of . The first positions among the chosen must be filled by elements of ( ways) and the next positions by elements of ( ways). Total: ways.
- Case 2: All elements of before all elements of . Similarly, the first positions are for and the next for . Total: ways.
49
Q49MSQ2 marksMediumLet be an onto (or surjective) function, where and are nonempty sets. Define an equivalence relation on the set as…Think it through. Then check your answer.Question
Let be an onto (or surjective) function, where and are nonempty sets. Define an equivalence relation on the set aswhere . Let be the set of all the equivalence classes under . Define a new mapping asWhich of the following statements is/are TRUE?Correct answer
(B) F is an onto (or surjective) function.; (C) F is a one-to-one (or injective) function.; (D) F is a bijective function.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine which statements are true, we analyze the properties of the mapping defined by .1.Well-definedness: A mapping is well-defined if for any , implies .- By the definition of the equivalence relation , .
- Since and , we have .
- Thus, is well-defined. Statement (A) is false.
- We are given that is onto. Therefore, for any , there exists such that .
- For this , the equivalence class is in , and .
- Thus, is onto. Statement (B) is true.
- .
- By the definition of , .
- .
- Thus, is one-to-one. Statement (C) is true.
- Since is both one-to-one and onto, it is a bijective function. Statement (D) is true.
50
Q50MSQ2 marksHardSuppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with Round Trip Time of 150…Think it through. Then check your answer.Question
Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with Round Trip Time of 150 milliseconds and the maximum segment lifetime of 2 minutes.Which of the following is/are valid lengths of the Sequence Number field in the myTCP header?Correct answer
(B) 32 bits; (C) 34 bits; (D) 36 bits
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To ensure that sequence numbers do not wrap around within the Maximum Segment Lifetime (MSL), the sequence number space must be large enough to uniquely identify every byte sent during that duration.1. Calculate the data rate in bytes per second:
Bandwidth () = 100 Mbps = bits per second.
in bytes/sec = bytes/sec.2. Calculate the total bytes sent during the MSL:
Maximum Segment Lifetime () = 2 minutes = 120 seconds.
Total bytes = bytes.3. Determine the required number of bits ():
The sequence number space must be greater than or equal to the total bytes sent to avoid wrap-around.Evaluating powers of 2:
Any length is a valid length for the sequence number field to prevent wrap-around within the MSL.- (A) 30 bits: Invalid ()
- (B) 32 bits: Valid ()
- (C) 34 bits: Valid ()
- (D) 36 bits: Valid ()
51
Q51MSQ2 marksMediumLet be a set and denote the powerset of . Define a binary operation on as follows: Let .…Think it through. Then check your answer.Question
Let be a set and denote the powerset of .
Define a binary operation on as follows:Let . Which of the following statements about is/are correct?Correct answer
(A) H is a group.; (D) For every A ∈ 2^X, the inverse of A is A.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine if is a group, we check the group axioms for the symmetric difference operation :1.Closure: For any , is also a subset of , so .2.Associativity: It is a known property of symmetric difference that for all .3.Identity Element: Let be the empty set. For any :.
Similarly, . Thus, is the identity element.4.Inverse Element: For any , we look for such that :.
Thus, every element is its own inverse ().Evaluating the options:- (A) is correct: satisfies all group axioms.
- (B) is incorrect: Since is a group.
- (C) is incorrect: The inverse of is itself. The symmetric difference of and its complement is . This is only the identity if .
- (D) is correct: As shown above, , so the inverse of is .
52
Q52MSQ2 marksHardSuppose in a web browser, you click on thewww.gate-2023.inURL. The browser cache is empty. The IP address for this URL is not cached in your local host, so a DNS lookup is…Think it through. Then check your answer.Question
Suppose in a web browser, you click on thewww.gate-2023.inURL. The browser cache is empty. The IP address for this URL is not cached in your local host, so a DNS lookup is triggered (by the local DNS server deployed on your local host) over the 3-tier DNS hierarchy in an iterative mode. No resource records are cached anywhere across all DNS servers.Let denote the round trip time between your local host and DNS servers in the DNS hierarchy. The round trip time between the local host and the web server hostingwww.gate-2023.inis also equal to . The HTML file associated with the URL is small enough to have negligible transmission time and negligible rendering time by your web browser, which references 10 equally small objects on the same web server.Which of the following statements is/are CORRECT about the minimum elapsed time between clicking on the URL and your browser fully rendering it?Correct answer
(C) 9 RTT s, in case of non-persistent HTTP with 5 parallel TCP connections.; (D) 6 RTT s, in case of persistent HTTP with pipelining.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.DNS Lookup Time:The DNS lookup is iterative over a 3-tier hierarchy (Root, TLD, and Authoritative servers). Since no records are cached, the local DNS server (on the local host) must perform three separate queries. Each query takes .
Total DNS time = s.2.HTML Retrieval Time:- TCP connection setup: .
- HTTP request and response for the HTML file: .
3.Object Retrieval Time:- Case 1: Non-persistent HTTP with 5 parallel TCP connections:
- Batch 1 (5 objects): (TCP setup) + (Request/Response) = s.
- Batch 2 (5 objects): (TCP setup) + (Request/Response) = s.
Total elapsed time = (DNS) + (HTML) + (Objects) = s. (Option C is correct)- Case 2: Persistent HTTP with pipelining:
- Request/Response for all 10 objects: .
53
Q53MSQ2 marksMediumConsider a random experiment where two fair coins are tossed. Let be the event that denotes HEAD on both the throws, be the event that denotes HEAD on the first throw, and…Think it through. Then check your answer.Question
Consider a random experiment where two fair coins are tossed. Let be the event that denotes HEAD on both the throws, be the event that denotes HEAD on the first throw, and be the event that denotes HEAD on the second throw.
Which of the following statements is/are TRUE?Correct answer
(C) B and C are independent.; (D) Prob(B C) = Prob(B)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sample space for tossing two fair coins is . The total number of outcomes is 4.Define the events:- : HEAD on both throws = . .
- : HEAD on first throw = . .
- : HEAD on second throw = . .
.
.
.
Since , and are not independent.Option (B): and
.
.
.
Since , and are not independent.Option (C): and
.
.
.
Since , and are independent.Option (D):
By definition of conditional probability, .
From above, and .
.
Since , the statement holds true. (This is also a direct property of independent events).Thus, options (C) and (D) are correct.54
Q54MSQ2 marksMediumConsider functions Function_1 and Function_2 expressed in pseudocode as follows: Function 1 [code] Function 2 [code] Let and denote the number of…Think it through. Then check your answer.Question
Consider functions Function_1 and Function_2 expressed in pseudocode as follows:Function 1Function 2while n > 1 do for i = 1 to n do x = x + 1; end for n = floor(n/2); end whileLet and denote the number of times the statement "" is executed in Function_1 and Function_2, respectively.Which of the following statements is/are TRUE?for i = 1 to 100 * n do x = x + 1; end forCorrect answer
(A) f₁(n) ∈ Θ(f₂(n)); (D) f₁(n) ∈ O(n)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let us analyze the time complexity of both functions by counting the number of times the statement is executed.For Function 1:
The outer loop runs while , and in each iteration, is halved ().
The inner loop runs times in the current iteration.
The total number of executions is the sum of the geometric series:This is a geometric series with sum .
Thus, .For Function 2:
The loop runs from to .
The statement is executed exactly times.
Thus, .Evaluating the options:
(A) : Since both and are , this is TRUE.
(B) : Little-o notation denotes strictly smaller growth. Since both grow linearly, this is FALSE.
(C) : Little-omega notation denotes strictly larger growth. Since both grow linearly, this is FALSE.
(D) : Since , it implies . This is TRUE.Therefore, the correct options are (A) and (D).55
Q55MSQ2 marksMediumLet be a simple, finite, undirected graph with vertex set . Let denote the maximum degree of and let denote…Think it through. Then check your answer.Question
Let be a simple, finite, undirected graph with vertex set . Let denote the maximum degree of and let denote the set of all possible colors. Color the vertices of using the following greedy strategy:Which of the following statements is/are TRUE?for i = 1, ..., n color(v_i) ← min{j ∈ N : no neighbour of v_i is colored j}Correct answer
(A) This procedure results in a proper vertex coloring of G.; (B) The number of colors used is at most Δ(G) + 1.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given procedure is the standard Greedy Coloring Algorithm.1.Proper Coloring (Statement A): The algorithm assigns the smallest color index such that no neighbor of is already colored with . This explicitly ensures that no two adjacent vertices share the same color. Thus, it always produces a proper vertex coloring. (A is TRUE)2.Number of Colors (Statement B): When the algorithm considers vertex , it has some number of already-colored neighbors. The number of neighbors is at most . In the worst case, all neighbors have distinct colors . Even then, the color will be available. Therefore, the algorithm never uses a color index greater than . (B is TRUE)3.At most (Statement C): This is false. Consider a complete graph . The maximum degree is . The greedy algorithm (and any proper coloring) requires colors. Since , it is not bounded by . (C is FALSE)4.Chromatic Number (Statement D): The number of colors used by the greedy algorithm depends heavily on the vertex ordering. While there exists an ordering that achieves the chromatic number , an arbitrary ordering (like ) does not guarantee minimality. For example, a bipartite graph () can be colored with many colors if the ordering is poor. (D is FALSE)56
Q56NAT2 marksHardLet . Let denote the powerset of . Consider an undirected graph whose vertex set is . For any , is an edge in if and…Think it through. Then check your answer.Question
Let . Let denote the powerset of . Consider an undirected graph whose vertex set is . For any , is an edge in if and only if (i) , and (ii) either or . For any vertex in , the set of all possible orderings in which the vertices of can be visited in a Breadth First Search (BFS) starting from is denoted by .If denotes the empty set, then the cardinality of is ________.Correct answer
5040 to 5040
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The set has . The vertex set of the graph is the power set , which contains vertices.The edges are defined by the strict subset relation: an edge exists between and if one is a proper subset of the other ( or ).We perform a BFS starting from the empty set .
Since the empty set is a proper subset of every non-empty set, is connected to all other vertices in the graph. Specifically, for any , we have , so is an edge.In a BFS traversal:1.The start vertex is visited first (Level 0).2.All neighbors of are discovered and added to the queue. Since is connected to all other vertices, all these 7 vertices are neighbors and belong to Level 1.3.The order in which these 7 neighbors are visited depends on the order they are added to the BFS queue. Since the definition of BFS allows visiting neighbors in any arbitrary order, any permutation of these 7 vertices constitutes a valid BFS ordering.4.Once these 7 vertices are in the queue, they are processed one by one. Since there are no remaining unvisited vertices (total vertices = 8), the traversal completes.Thus, the number of valid BFS orderings is the number of permutations of the 7 non-empty subsets:57
Q57NAT2 marksHardConsider the following two-dimensional array D in the C programming language, which is stored in row-major order: [code] Demand paging is used for allocating memory and each…Think it through. Then check your answer.Question
Consider the following two-dimensional array D in the C programming language, which is stored in row-major order: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 which executes the following code snippet:int D[128][128];The number of page faults generated during the execution of this code snippet is ________.for (int i = 0; i < 128; i++) for (int j = 0; j < 128; j++) D[j][i] *= 10;Correct answer
4096 to 4096
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Array and Page Parameters:- Array size: integers.
- Page size: 512 integers.
- Number of rows per page: rows per page.
- Total number of pages for the array: pages.
- Let the pages be . contains rows 0–3, contains rows 4–7, and so on.
- The array is stored in row-major order.
- The code uses a nested loop where the outer loop iterates over columns () and the inner loop iterates over rows (). This is a column-major access pattern.
- For a fixed column , the inner loop accesses .
- This sequence touches every page in order: (for ), then (for ), ..., up to (for ).
- Total physical frames available = 30.
- Total distinct pages accessed in one full iteration of the inner loop = 32.
- In the first iteration of the outer loop ():
- Accessing to fills the 30 frames (30 faults).
- Accessing causes a fault and evicts (LRU).
- Accessing causes a fault and evicts (LRU).
- Total faults for is 32.
- In subsequent iterations of the outer loop ():
- The loop starts by requesting . Since was evicted during the previous column's processing, it results in a fault.
- Because the reuse distance (32 pages) is greater than the number of frames (30), every transition to a new page block in the inner loop will result in a page fault.
- Number of page faults per column = 32.
- Total page faults = .
58
Q58NAT2 marksMediumConsider 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…Think it through. Then check your answer.Question
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 __________.Correct answer
5 to 5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Here is the step-by-step calculation to find the number of levels (L) in the page table structure:1.Given data:- Virtual Address (VA) size = 57 bits
- Page Size (PS) = 4 KB = Bytes = Bytes = Bytes
- Page Table Entry (PTE) size = 8 Bytes = Bytes
The page offset is determined by the page size. It represents the address within a page.
Number of Page Offset bits = bits.3.Calculate Virtual Page Number (VPN) bits:The virtual address is split into the Virtual Page Number (VPN) and the Page Offset.
Number of VPN bits = Total VA bits - Page Offset bits
Number of VPN bits = bits.
These 45 bits are used to index the multi-level page tables.4.Calculate the number of entries per page table:In a multi-level paging system, each page table must fit within a single physical page frame.
Number of PTEs per page = entries.5.Calculate the number of bits required per level:Each level of the page table uses a part of the VPN to index into its table. The number of bits required to index 512 entries is:
Bits per level = bits.6.Calculate the number of levels (L):The total 45 bits of the VPN are distributed among the L levels of the page table structure. Since each level requires 9 bits for indexing, we can find L by dividing the total VPN bits by the bits per level.
L = .Therefore, the value of L is 5.59
Q59NAT2 marksEasyConsider a sequence of elements and . The following operations are performed on a stack and a queue , both of…Think it through. Then check your answer.Question
Consider a sequence of elements and . The following operations are performed on a stack and a queue , both of which are initially empty.I: push the elements of from to in that order into .
II: enqueue the elements of from to in that order into .
III: pop an element from .
IV: dequeue an element from .
V: pop an element from .
VI: dequeue an element from .
VII: dequeue an element from and push the same element into .
VIII: Repeat operation VII three times.
IX: pop an element from .
X: pop an element from .The top element of after executing the above operations is _______.Correct answer
8 to 8
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's trace the operations step-by-step:1.Sequence : .2.Operation I: push to into . (where 2 is the top).3.Operation II: enqueue to into . (where 1 is at the front).4.Operation III: pop from . Popped element is 2. .5.Operation IV: dequeue from . Dequeued element is 1. .6.Operation V: pop from . Popped element is 9. .7.Operation VI: dequeue from . Dequeued element is 5. .8.Operation VII: dequeue from (7) and push to . , .9.Operation VIII: Repeat VII three times. This moves the remaining 3 elements from to in order:- Dequeue 8, push to : ,
- Dequeue 9, push to : ,
- Dequeue 2, push to : ,
11.Operation X: pop from . Popped element is 9. .After all operations, the stack is . The top element is 8.60
Q60NAT2 marksMediumConsider the syntax directed translation given by the following grammar and semantic rules. Here and are non-terminals. is the starting non-terminal, and…Think it through. Then check your answer.Question
Consider the syntax directed translation given by the following grammar and semantic rules. Here and are non-terminals. is the starting non-terminal, and and are lexical tokens corresponding to input letters "#", "0" and "1", respectively. denotes the synthesized attribute (a numeric value) associated with a non-terminal . and denote occurrences of and on the right hand side of a production, respectively. For the tokens and , and .The value computed by the translation scheme for the input stringis _______. (Rounded off to three decimal places)
Correct answer
2.374 to 2.376
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The input string is . The grammar splits this into an integer part (before ) and a fractional part (after ).1. Evaluating the Integer Part () for string "10":
The production rules for are:- The derivation is .
- First, reduce to : .
- Reduce this to : .
- Next, reduce to : .
- Finally, reduce to : .
The production rules for are:- The derivation is .
- We evaluate from right to left (bottom-up recursion):
- Last digit : .
- Middle digit : .
- First digit : .
.The value rounded to three decimal places is .61
Q61NAT2 marksEasyConsider the following table namedStudentin a relational database. The primary key of this table isrollNum. | rollNum | name | gender | marks | | ------ | ------ |…Think it through. Then check your answer.Question
Consider the following table namedStudentin a relational database. The primary key of this table isrollNum.The SQL query below is executed on this database.rollNum name gender marks 1 Naman M 62 2 Aliya F 70 3 Aliya F 80 4 James M 82 5 Swati F 65 The number of rows returned by the query is __________.SELECT * FROM Student WHERE gender = 'F' AND marks > 65;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 SQL query selects rows from theStudenttable that satisfy two conditions simultaneously:1.gendermust be 'F'.2.Let's evaluate each row in the table:marksmust be strictly greater than 65.- Row 1 (Naman):
gender= 'M'. Condition fails. - Row 2 (Aliya):
gender= 'F' (True),marks= 70 > 65 (True). Selected. - Row 3 (Aliya):
gender= 'F' (True),marks= 80 > 65 (True). Selected. - Row 4 (James):
gender= 'M'. Condition fails. - Row 5 (Swati):
gender= 'F' (True),marks= 65. The conditionmarks > 65is False (65 is not greater than 65). Condition fails.
- Row 1 (Naman):
62
Q62NAT2 marksMediumConsider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary key occupies 15…Think it through. Then check your answer.Question
Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary key occupies 15 bytes. The data file is block-aligned in that each data record is fully contained within a block. The database is indexed by a primary index file, which is also stored as a block-aligned ordered file. The figure below depicts this indexing scheme.Suppose the block size of the file system is 1024 bytes, and a pointer to a block occupies 5 bytes. The system uses binary search on the index file to search for a record with a given key. You may assume that a binary search on an index file of blocks takes block accesses in the worst case.Given a key, the number of block accesses required to identify the block in the data file that may contain a record with the key, in the worst case, 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
To find the number of block accesses required to identify the block in the data file, we follow these steps:1.Calculate records per block in the data file ():Given block size bytes and record size bytes.
Since the file is block-aligned, records per block.2.Calculate the number of blocks in the data file ():Total records .
blocks.3.Calculate the size of an index entry ():A primary index entry consists of the primary key and a block pointer.
Key size = 15 bytes, Pointer size = 5 bytes.
bytes.4.Calculate index entries per block ():entries per block.5.Calculate the number of blocks in the index file ():A primary index has one entry for every block in the data file.
Number of index entries .
blocks.6.Calculate worst-case block accesses for binary search on the index file:As given, accesses = .
Since and , .Thus, the number of block accesses required to identify the block in the data file is 6.63
Q63NAT2 marksMediumConsider the language over the alphabet , given below: The minimum number…Think it through. Then check your answer.Question
Consider the language over the alphabet , given below:The minimum number of states in a Deterministic Finite-State Automaton (DFA) for is ________.Correct answer
4 to 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the minimum number of states in a DFA for the language that does not contain '111' as a substring:1.Identify the states needed: We need states to track the count of consecutive 1s seen so far.- State : 0 consecutive 1s (Initial state). This state is reached after a '0' or at the start.
- State : Exactly 1 consecutive 1 seen.
- State : Exactly 2 consecutive 1s seen.
- State : 3 or more consecutive 1s seen (Trap/Dead state).
- ,
- ,
- ,
- ,
64
Q64NAT2 marksMediumAn 8-way set associative cache of size () is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX, and…Think it through. Then check your answer.Question
An 8-way set associative cache of size () is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX, and BLOCK OFFSET.The number of bits in the TAG is ____________.Correct answer
19 to 19
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the number of bits in the TAG, we first determine the total number of bits used for the INDEX and BLOCK OFFSET.Given:- Cache Size () =
- Associativity () = 8-way =
- Address Size = 32 bits
1.Number of block offset bits () =2.Number of sets () =3.Number of index bits () =The total number of bits for the INDEX and BLOCK OFFSET combined is:Note that this sum is independent of the actual block size .The number of TAG bits () is the remaining bits in the 32-bit address:Therefore, the number of bits in the TAG is 19.65
Q65NAT2 marksMediumThe forwarding table of a router is shown below. | Subnet Number | Subnet Mask | Interface ID | | :--- | :--- | :--- | | 200.150.0.0 | 255.255.0.0 | 1 | | 200.150.64.0 |…Think it through. Then check your answer.Question
The forwarding table of a router is shown below.A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID __________.Subnet Number Subnet Mask Interface ID 200.150.0.0 255.255.0.0 1 200.150.64.0 255.255.224.0 2 200.150.68.0 255.255.255.0 3 200.150.68.64 255.255.255.224 4 Default 0 Correct answer
3 to 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine the correct interface, we perform a bitwise AND operation between the destination IP address (200.150.68.118) and each subnet mask in the table. If the result matches the corresponding subnet number, it is a potential match. If multiple matches exist, the router selects the one with the longest prefix (most specific mask).1.Interface 1: . Match. Prefix length is 16 bits.2.Interface 2: . Match. Prefix length is 19 bits (, so ).3.Interface 3: . Match. Prefix length is 24 bits.4.Interface 4: . No match. ().Comparing the matching prefixes (/16, /19, and /24), the longest prefix match is Interface 3 (/24).