The PYQ practice room
GATE CS 2024 Set 2
All 65 solved GATE CS 2024 Set 2 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 · MSQ · NAT
Revision mode
Self-paced
No timer. Focus on understanding.
Explore the questions
General Aptitude (GA)
101
Q1MCQ1 markEasyIf ‘’ denotes increasing order of intensity, then the meaning of the words [walk jog sprint] is analogous to [bothered ________ daunted]. Which one of…Think it through. Then check your answer.Question
If ‘’ denotes increasing order of intensity, then the meaning of the words
[walk jog sprint] is analogous to [bothered ________ daunted].
Which one of the given options is appropriate to fill the blank?Correct answer
(C) fazed
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sequence [walk jog sprint] represents physical activities in increasing order of intensity. Similarly, the second sequence should represent states of mental disturbance/worry in increasing order of intensity.1.Bothered: Mildly worried or annoyed.2.Fazed: Disturbed or disconcerted (stronger than bothered).3.Daunted: Intimidated or overcome with fear/worry (stronger than fazed).The other options do not fit the context:- Phased: Carried out in stages.
- Phrased: Expressed in words.
- Fused: Joined together.
2
Q2MCQ1 markEasyTwo wizards try to create a spell using all the four elements, water, air, fire, and earth. For this, they decide to mix all these elements in all possible orders. They…Think it through. Then check your answer.Question
Two wizards try to create a spell using all the four elements, water, air, fire, and earth. For this, they decide to mix all these elements in all possible orders. They also decide to work independently. After trying all possible combination of elements, they conclude that the spell does not work.How many attempts does each wizard make before coming to this conclusion, independently?Correct answer
(A) 24
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem states that the wizards mix all four elements (water, air, fire, earth) in all possible orders. This implies finding the number of permutations of 4 distinct items.The number of permutations of distinct items is given by .
Here, .Since each wizard works independently and tries all possible orders, each wizard makes 24 attempts.3
Q3MCQ1 markEasyIn an engineering college of 10,000 students, 1,500 like neither their core branches nor other branches. The number of students who like their core branches is …Think it through. Then check your answer.Question
In an engineering college of 10,000 students, 1,500 like neither their core branches nor other branches. The number of students who like their core branches is of the number of students who like other branches. The number of students who like both their core and other branches is 500.The number of students who like their core branches isCorrect answer
(A) 1,800
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the set of students who like their core branches, and be the set of students who like other branches.
Total students .
Students who like neither: .Therefore, the number of students who like at least one branch is:Let . The problem states that the number of students who like their core branches is of those who like other branches. Thus, , which implies .We are given the number of students who like both branches:Using the principle of inclusion-exclusion:So, the number of students who like their core branches is .4
Q4MCQ1 markEasyFor positive non-zero real variables and , if then, the value of isThink it through. Then check your answer.Question
For positive non-zero real variables and , ifthen, the value of isCorrect answer
(C) 2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given equation:Using logarithmic properties and :Taking antilog on both sides:Squaring both sides:We need to find the value of . Since :5
Q5MCQ1 markEasyIn the sequence 6, 9, 14, , 30, 41, a possible value of isThink it through. Then check your answer.Question
In the sequence 6, 9, 14, , 30, 41, a possible value of isCorrect answer
(B) 21
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the differences between consecutive terms in the sequence:
The differences are increasing odd numbers: 3, 5, ...
Assuming the pattern continues with the next odd numbers 7, 9, 11:
(Matches)
(Matches)The sequence of differences is 3, 5, 7, 9, 11.
Thus, .6
Q6MCQ2 marksEasySequence the following sentences in a coherent passage. P: This fortuitous geological event generated a colossal amount of energy and heat that resulted in the rocks rising to an…Think it through. Then check your answer.Question
Sequence the following sentences in a coherent passage.P: This fortuitous geological event generated a colossal amount of energy and heat that resulted in the rocks rising to an average height of 4 km across the contact zone.Q: Thus, the geophysicists tend to think of the Himalayas as an active geological event rather than as a static geological feature.R: The natural process of the cooling of this massive edifice absorbed large quantities of atmospheric carbon dioxide, altering the earth’s atmosphere and making it better suited for life.S: Many millennia ago, a breakaway chunk of bedrock from the Antarctic Plate collided with the massive Eurasian Plate.Correct answer
(C) SPRQ
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.S introduces the subject and the initial event: the collision of the Antarctic Plate chunk with the Eurasian Plate.2.P describes the immediate result of that collision (the "fortuitous geological event"): the generation of energy/heat and the rising of rocks (formation of the Himalayas).3.R discusses the subsequent effect of the formation of this "massive edifice" (the Himalayas mentioned in P): cooling and absorbing CO2.4.Q provides a concluding thought or inference drawn by geophysicists based on the nature of this event.The logical flow is Event (S) Immediate Consequence (P) Secondary Process (R) Conclusion (Q).
Therefore, the sequence is SPRQ.7
Q7MCQ2 marksEasyA person sold two different items at the same price. He made 10% profit in one item, and 10% loss in the other item. In selling these two items, the person made a total ofThink it through. Then check your answer.Question
A person sold two different items at the same price. He made 10% profit in one item, and 10% loss in the other item. In selling these two items, the person made a total ofCorrect answer
(C) 1% loss
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the selling price (SP) of each item be .
For the first item, there is a 10% profit:For the second item, there is a 10% loss:Total Selling Price =
Total Cost Price = Since Total CP () > Total SP (), there is a loss.
Loss = Total CP - Total SP = Loss Percentage =
Alternatively, for two items sold at the same price with profit and loss, the net result is always a loss of .
Here , so Loss .8
Q8MCQ2 marksEasyThe pie charts depict the shares of various power generation technologies in the total electricity generation of a country for the years 2007 and 2023. [figure] The renewable…Think it through. Then check your answer.Question
The pie charts depict the shares of various power generation technologies in the total electricity generation of a country for the years 2007 and 2023.The renewable sources of electricity generation consist of Hydro, Solar and Wind. Assuming that the total electricity generated remains the same from 2007 to 2023, what is the percentage increase in the share of the renewable sources of electricity generation over this period?
Correct answer
(D) 62.5%
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to calculate the share of renewable sources (Hydro, Solar, Wind) for both years.Year 2007:- Hydro: 30%
- Solar: 5%
- Wind: 5%
- Hydro: 35%
- Solar: 20%
- Wind: 10%
The question asks for the percentage increase in the share.9
Q9MCQ2 marksEasyA cube is to be cut into 8 pieces of equal size and shape. Here, each cut should be straight and it should not stop till it reaches the other end of the cube. The minimum number…Think it through. Then check your answer.Question
A cube is to be cut into 8 pieces of equal size and shape. Here, each cut should be straight and it should not stop till it reaches the other end of the cube.The minimum number of such cuts required isCorrect answer
(A) 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To cut a cube into pieces with minimum cuts, we should distribute the cuts as evenly as possible across the three dimensions (x, y, z).
Let be the number of cuts along the three axes. The total number of pieces is given by .We want .
To minimize the total number of cuts , the factors should be as close to each other as possible.
Since , we can set:
Total cuts .
These 3 mutually perpendicular cuts passing through the center of the cube will divide it into 8 smaller cubes of equal size and shape.10
Q10MCQ2 marksMediumIn the array shown below, each cell of the first three rows has either a cross (X) or a number. [figure] The number in a cell represents the count of the immediate…Think it through. Then check your answer.Question
In the array shown below, each cell of the first three rows has either a cross (X) or a number.The number in a cell represents the count of the immediate neighboring cells (left, right, top, bottom, diagonals) NOT having a cross (X). Given that the last row has no crosses (X), the sum of the four numbers to be filled in the last row is
Correct answer
(A) 11
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the cells in the last row (Row 4) be denoted as . We are given that the last row has no crosses, so all cells in Row 4 contain numbers. A number in a cell represents the count of neighbors (horizontal, vertical, diagonal) that do not contain 'X'.Grid Context:
Row 3:
Row 4: (All are numbers, i.e., not X)Calculating (Corner):
Neighbors: (Not X), , (Not X).
Count of non-X neighbors = 2.
Calculating (Edge):
Neighbors: (Not X), (Not X), , (Not X), (Not X).
Count of non-X neighbors = 4.
Calculating (Edge):
Neighbors: (Not X), , (Not X), , (Not X).
Count of non-X neighbors = 3.
Calculating (Corner):
Neighbors: (Not X), (Not X), .
Count of non-X neighbors = 2.
Sum:
Sum = .
Computer Science and Information Technology
5511
Q11MCQ1 markMediumConsider a computer with a 4 MHz processor. Its DMA controller can transfer 8 bytes in 1 cycle from a device to main memory through cycle stealing at regular intervals. Which one…Think it through. Then check your answer.Question
Consider a computer with a 4 MHz processor. Its DMA controller can transfer 8 bytes in 1 cycle from a device to main memory through cycle stealing at regular intervals. Which one of the following is the data transfer rate (in bits per second) of the DMA controller if 1% of the processor cycles are used for DMA?Correct answer
(C) 25,60,000
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Processor Speed: .2.DMA Usage: 1% of processor cycles.DMA cycles per second = .3.Data per Cycle: 8 bytes.4.Transfer Rate (Bytes):.5.Transfer Rate (Bits):.Result: 25,60,000 bits/sec.12
Q12MCQ1 markEasyLet and be the following propositions: : Fail grade can be given. : Student scores more than 50% marks. Consider the statement: "Fail grade cannot be given when…Think it through. Then check your answer.Question
Let and be the following propositions:
: Fail grade can be given.
: Student scores more than 50% marks.Consider the statement: "Fail grade cannot be given when student scores more than 50% marks."Which one of the following is the CORRECT representation of the above statement in propositional logic?Correct answer
(A) q arrow ¬ p
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The statement is "Fail grade cannot be given when student scores more than 50% marks."This can be rephrased as an implication: "If a student scores more than 50% marks, then a fail grade cannot be given."- "Student scores more than 50% marks" corresponds to proposition .
- "Fail grade can be given" corresponds to proposition .
- "Fail grade cannot be given" corresponds to .
13
Q13MCQ1 markMediumConsider the following C program. Assume parameters to a function are evaluated from right to left. [code] Which one of the following options is the CORRECT output of the above C…Think it through. Then check your answer.Question
Consider the following C program. Assume parameters to a function are evaluated from right to left.Which one of the following options is the CORRECT output of the above C program?#include <stdio.h> int g(int p) { printf("%d", p); return p; } int h(int q) { printf("%d", q); return q; } void f(int x, int y) { g(x); h(y); } int main() { f(g(10),h(20)); }Correct answer
(A) 20101020
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem specifies that function parameters are evaluated from right to left. In themainfunction, the call isf(g(10), h(20)).1.Evaluate arguments off(Right to Left):- First,
h(20)is evaluated. It executesprintf("%d", 20), printing 20, and returns 20. - Next,
g(10)is evaluated. It executesprintf("%d", 10), printing 10, and returns 10. - At this point, the output sequence is 2010.
f(10, 20):- Inside
f,g(x)is called withx=10. It prints 10. - Then,
h(y)is called withy=20. It prints 20.
- First,
14
Q14MCQ1 markMediumThe format of a single-precision floating-point number as per the IEEE 754 standard is: [figure] Choose the largest floating-point number among the following options.Think it through. Then check your answer.Question
The format of a single-precision floating-point number as per the IEEE 754 standard is:Choose the largest floating-point number among the following options.
Correct answer
(B) [figure]
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In the IEEE 754 single-precision floating-point standard, the value of a normalized number is represented as:where is the sign bit, is the biased exponent, and is the fractional part of the mantissa.Let's evaluate the options:- Option (A): , , .
- Option (B): , , .
- Option (C): , , .
- Option (D): , , .
15
Q15MCQ1 markMediumLet be the recurrence relation defined as follows: , , and for . Which one of the following statements is TRUE?Think it through. Then check your answer.Question
Let be the recurrence relation defined as follows:,
, and
for .Which one of the following statements is TRUE?Correct answer
(A) T(n) = Θ(2ⁿ)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given recurrence relation is a linear homogeneous recurrence relation with constant coefficients: .1.Find the characteristic equation:The characteristic equation is .2.Solve for the roots:.3.Write the general solution:.4.Use initial conditions to find constants:- For :
- For :
From the first equation, .
Substitute into the second: .
Then .5.Final expression for :.6.Determine asymptotic complexity:Since , it follows that .Thus, option (A) is correct.16
Q16MCQ1 markMediumLet be a continuous function from to such that Which one of the following options is the CORRECT value of…Think it through. Then check your answer.Question
Let be a continuous function from to such thatWhich one of the following options is the CORRECT value of ?Correct answer
(B) 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the functional equation:Let .
Using the property of definite integrals , we substitute with :Adding the two expressions for :Substituting :Thus, the value of the integral is 1.17
Q17MCQ1 markMediumLet be the adjacency matrix of a simple undirected graph . Suppose is its own inverse. Which one of the following statements is always TRUE?Think it through. Then check your answer.Question
Let be the adjacency matrix of a simple undirected graph . Suppose is its own inverse. Which one of the following statements is always TRUE?Correct answer
(B) G is a perfect matching
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the adjacency matrix of a simple undirected graph . Since is simple, the diagonal entries of are all 0 (). Since is undirected, is symmetric ().Given that is its own inverse, we have , which implies (the identity matrix).The diagonal entries of represent the degree of each vertex in the graph. Specifically:Since , . Thus, is the sum of the entries in row , which is the degree of vertex .Since , we must have for all . Therefore, every vertex in has a degree of exactly 1.A graph where every vertex has a degree of 1 is a collection of disjoint edges covering all vertices, which corresponds to a perfect matching.18
Q18MCQ1 markEasyWhen six unbiased dice are rolled simultaneously, the probability of getting all distinct numbers (i.e., 1, 2, 3, 4, 5, and 6) isThink it through. Then check your answer.Question
When six unbiased dice are rolled simultaneously, the probability of getting all distinct numbers (i.e., 1, 2, 3, 4, 5, and 6) isCorrect answer
(B) (5)/(324)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
When rolling 6 dice, the total number of possible outcomes is .For the numbers to be all distinct (i.e., getting exactly one 1, one 2, ..., one 6), we are looking for the number of permutations of the set .
The number of favorable outcomes is (6 factorial).The probability is:Simplifying the fraction:Dividing numerator and denominator by 24:Thus, .19
Q19MCQ1 markEasyOnce the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on…Think it through. Then check your answer.Question
Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is calledCorrect answer
(A) durability
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The property described is Durability. Durability ensures that once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors.- Atomicity ensures that all operations within a work unit are completed successfully; otherwise, the transaction is aborted at the point of failure and previous operations are rolled back.
- Consistency ensures that the database properly changes states upon a successfully committed transaction.
- Isolation enables transactions to operate independently of and transparent to each other.
20
Q20MCQ1 markEasyIn the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?Think it through. Then check your answer.Question
In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?Correct answer
(A) The weak entity set MUST have total participation in the identifying relationship
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In an Entity-Relationship (ER) model:- A weak entity set is an entity set that does not have a primary key of its own and depends on the existence of a strong entity set (owner entity set) for its identification.
- The relationship associating the weak entity set with the owner entity set is called the identifying relationship.
- A weak entity set must have total participation in the identifying relationship because a weak entity cannot exist without its owner entity.
- The owner entity set does not necessarily need to have total participation in the identifying relationship (it can exist without the weak entity).
21
Q21MCQ1 markEasyConsider the following two sets: | Set X | Set Y | | :--- | :--- | | P. Lexical Analyzer | 1. Abstract Syntax Tree | | Q. Syntax Analyzer | 2. Token | | R. Intermediate Code…Think it through. Then check your answer.Question
Consider the following two sets:Which one of the following options is the CORRECT match from Set X to Set Y?Set X Set Y P. Lexical Analyzer 1. Abstract Syntax Tree Q. Syntax Analyzer 2. Token R. Intermediate Code Generator 3. Parse Tree S. Code Optimizer 4. Constant Folding Correct answer
(B) P – 2; Q – 3; R – 1; S – 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The correct mapping between the compiler phases and their associated concepts is:- P. Lexical Analyzer: Reads the source program character by character and groups them into meaningful sequences called lexemes, producing Tokens (2).
- Q. Syntax Analyzer: Takes tokens as input and generates a Parse Tree (3) (or Concrete Syntax Tree) checking for syntax errors.
- S. Code Optimizer: Improves the intermediate code. Constant Folding (4) is a standard optimization technique where constant expressions are evaluated at compile time.
- R. Intermediate Code Generator: Generates an intermediate representation. While Syntax Analysis produces the Parse Tree, the Abstract Syntax Tree (AST) (1) is often considered a high-level intermediate representation or the output of a syntax analyzer used for intermediate code generation. Given the options, R maps to 1.
- P 2
- Q 3
- R 1
- S 4
22
Q22MCQ1 markMediumWhich one of the following regular expressions is equivalent to the language accepted by the DFA given below? [figure]Think it through. Then check your answer.Question
Which one of the following regular expressions is equivalent to the language accepted by the DFA given below?
Correct answer
(A) 0^ 1(0 + 10^ 1)^
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The DFA has two states. Let the start state be and the accepting state be .
Transitions:1.To reach from for the first time, we must read any number of 0s followed by a 1: .2.Once in , we can stay in by reading 0s () or by going back to and returning to . The path corresponds to reading a 1, then any number of 0s (loop at ), then a 1. So, the cycle is .3.Therefore, from , we can loop any number of times using either or . This corresponds to .Combining these, the total regular expression is the concatenation of the initial path and the loop:
This matches option (A).23
Q23MSQ1 markMediumNode X has a TCP connection open to node Y. The packets from X to Y go through an intermediate IP router R. Ethernet switch S is the first switch on the network path between X and…Think it through. Then check your answer.Question
Node X has a TCP connection open to node Y. The packets from X to Y go through an intermediate IP router R. Ethernet switch S is the first switch on the network path between X and R. Consider a packet sent from X to Y over this connection.Which of the following statements is/are TRUE about the destination IP and MAC addresses on this packet at the time it leaves X?Correct answer
(B) The destination IP address is the IP address of Y
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
When a packet is sent from a source host (X) to a destination host (Y) on a different network (implied by the presence of intermediate router R):1.Destination IP Address: The IP header contains the logical address of the final destination. Therefore, the destination IP address is the IP address of Y.2.Destination MAC Address: The Ethernet frame header contains the physical address of the next hop device. Since X is connected to R (via switch S), and R is the gateway/router to reach Y, X will resolve the MAC address of R's interface. The switch S is a Layer 2 device and is transparent to IP routing; it does not change the MAC addresses and is not the destination MAC (unless the frame is management traffic for S, which is not the case here). Therefore, the destination MAC address is the MAC address of Router R.Evaluating the options:
(A) False. Destination IP is Y.
(B) True. Destination IP is Y.
(C) False. Destination MAC is R, not S.
(D) False. Destination MAC is R, not Y (since Y is not on the local link).Thus, only statement (B) is true.24
Q24MSQ1 markMediumWhich of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?Think it through. Then check your answer.Question
Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?Correct answer
(B) Translate a virtual address to a physical address using the page table; (C) Raise a trap when a virtual address is not found in the page table; (D) Raise a trap when a process tries to write to a page marked with read-only permission in the page table
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The Memory Management Unit (MMU) is a hardware component responsible for handling memory accesses requested by the CPU.(A) False: Allocating a new page table is a memory management task performed by the Operating System kernel when a process is created. The MMU uses the page table but does not create/allocate it.
(B) True: The primary function of the MMU is to translate virtual addresses to physical addresses at runtime using the page table (and TLB).
(C) True: If a translation is not present (valid bit is 0) in the page table (or TLB), the MMU raises a hardware exception (trap), commonly known as a page fault, so the OS can handle it.
(D) True: The MMU checks access permissions (Read/Write/Execute bits) present in the page table entries. If a process attempts an operation that violates these permissions (e.g., writing to a read-only page), the MMU raises a protection fault/trap.25
Q25MSQ1 markMediumConsider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running…Think it through. Then check your answer.Question
Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?Correct answer
(A) P makes a blocking system call to read a block of data from the disk; (B) P tries to access a page that is in the swap space, triggering a page fault
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A context switch that moves process P to a non-running state (Blocked or Ready) occurs when P cannot continue execution or is preempted.(A) TRUE: When P makes a blocking system call (like reading from disk), it must wait for the I/O to complete. The OS moves P to the Blocked state and switches to another process.
(B) TRUE: When P accesses a page in swap space, a page fault occurs. The OS must fetch the page from disk, which is a slow I/O operation. P is moved to the Blocked state, and a context switch occurs.
(C) FALSE: When an interrupt occurs for another process, the CPU pauses P to run the Interrupt Service Routine (ISR). After the ISR, the scheduler decides which process to run. If P still has the highest priority (or its time slice hasn't expired), P may resume running immediately. Thus, a context switch to a non-running state is not guaranteed.
(D) FALSE: A timer interrupt typically signals the end of a time slice. While this often leads to preemption (moving P to Ready), it is not always guaranteed. For example, if P is the only runnable process, the scheduler may immediately select P again, or in non-preemptive systems, P might continue. Therefore, it does not "always" result in a move to a non-running state in the context of a switch to a different process.26
Q26MSQ1 markMediumWhich of the following file organizations is/are I/O efficient for the scan operation in DBMS?Think it through. Then check your answer.Question
Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?Correct answer
(A) Sorted; (B) Heap
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A scan operation involves retrieving all records in the relation.(A) TRUE: In a Sorted file organization, records are stored sequentially. Scanning involves reading blocks contiguously, which is very I/O efficient.
(B) TRUE: In a Heap file organization, records are stored in data blocks without any specific order. Scanning simply requires reading all the data blocks sequentially, which is I/O efficient.
(C) FALSE: An Unclustered tree index stores pointers to data records. Scanning via the index requires traversing the leaf nodes and then fetching each record from the data file. Since the data file is not sorted by the index key, this leads to random I/O for every record, which is very inefficient.
(D) FALSE: An Unclustered hash index is designed for point queries. Scanning requires iterating through buckets and following pointers to data records, resulting in random I/O, which is inefficient.27
Q27MSQ1 markMediumWhich of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?Think it through. Then check your answer.Question
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?Correct answer
(A) 2PL permits only serializable schedules; (C) With 2PL, once a lock is released on any data item inside a transaction, no more locks on any data item can be obtained inside that transaction; (D) A deadlock is possible with 2PL
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
(A) TRUE: The Two Phase Locking (2PL) protocol guarantees conflict serializability. Any schedule allowed by 2PL is serializable.
(B) FALSE: This statement describes a locking strategy that does not follow the two-phase rule. In 2PL, a transaction must acquire all necessary locks (Growing Phase) before it releases any lock. It cannot release a lock "just after the operation" if it intends to acquire more locks later.
(C) TRUE: This is the definition of the Shrinking Phase in 2PL. Once a transaction releases a lock, it enters the shrinking phase and cannot acquire any new locks.
(D) TRUE: 2PL does not prevent deadlocks. Transactions can wait for each other in a cycle (e.g., T1 holds A and waits for B, T2 holds B and waits for A) while adhering to 2PL rules.28
Q28MSQ1 markEasyWhich of the following statements about IPv4 fragmentation is/are TRUE?Think it through. Then check your answer.Question
Which of the following statements about IPv4 fragmentation is/are TRUE?Correct answer
(B) The fragmentation of an IP datagram is performed at any IP router which finds that the size of the datagram to be transmitted exceeds the MTU; (C) The reassembly of fragments is performed only at the destination of the datagram
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In IPv4, fragmentation can be performed by the source host or by any intermediate router if the packet size exceeds the Maximum Transmission Unit (MTU) of the outgoing link. Therefore, statement (A) is false and (B) is true. Reassembly of these fragments is performed only at the final destination to avoid the overhead of reassembling and potentially re-fragmenting at every intermediate hop. Thus, statement (C) is true and (D) is false.29
Q29MSQ1 markMediumWhich of the following statements is/are FALSE?Think it through. Then check your answer.Question
Which of the following statements is/are FALSE?Correct answer
(B) The attributes in a L-attributed definition cannot always be evaluated in a depth-first order; (D) All L-attributed definitions based on LR(1) grammar can be evaluated using a bottom-up parsing strategy
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Statement (A) is true; it is the standard definition of an attribute grammar. Statement (B) is FALSE because L-attributed definitions are specifically defined such that their attributes can be evaluated in a single depth-first (left-to-right) traversal. Statement (C) is true because synthesized attributes depend only on children nodes, which are available during a bottom-up (post-order) traversal. Statement (D) is FALSE because not all L-attributed definitions can be evaluated during a single bottom-up pass; while techniques like marker non-terminals exist to handle inherited attributes, they can transform an grammar into one that is no longer .30
Q30MSQ1 markEasyFor a Boolean variable , which of the following statements is/are FALSE?Think it through. Then check your answer.Question
For a Boolean variable , which of the following statements is/are FALSE?Correct answer
(B) x + 1 = x; (C) x · x = 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Evaluating each Boolean identity:
(A) : This is the Identity Law, which is TRUE.
(B) : In Boolean algebra, . This statement is FALSE.
(C) : In Boolean algebra, (Idempotent Law). This statement is FALSE.
(D) : This is the Complement Law, which is TRUE.
Thus, statements (B) and (C) are FALSE.31
Q31MSQ1 markEasyAn instruction format has the following structure: Instruction Number: Opcode destination reg, source reg-1, source reg-2 Consider the following sequence of instructions to be…Think it through. Then check your answer.Question
An instruction format has the following structure:Instruction Number: Opcode destination reg, source reg-1, source reg-2Consider the following sequence of instructions to be executed in a pipelined processor:I1: DIV R3, R1, R2
I2: SUB R5, R3, R4
I3: ADD R3, R5, R6
I4: MUL R7, R3, R8Which of the following statements is/are TRUE?Correct answer
(A) There is a RAW dependency on R3 between I1 and I2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the dependencies based on the instruction format: Opcode dest, src1, src2.Instructions:- I1:
DIV R3, R1, R2Writes , Reads - I2:
SUB R5, R3, R4Writes , Reads - I3:
ADD R3, R5, R6Writes , Reads - I4:
MUL R7, R3, R8Writes , Reads
- I1 writes .
- I2 reads .
- Since I2 follows I1 and reads the value written by I1, this is a RAW (Read-After-Write) dependency.
- This statement is TRUE.
- I1 writes .
- I3 writes .
- This is a WAW (Write-After-Write) dependency (Output dependency), not WAR.
- This statement is FALSE.
- I2 reads .
- I3 writes .
- This is a WAR (Write-After-Read) dependency (Anti-dependency), not RAW.
- This statement is FALSE.
- I3 writes .
- I4 reads .
- This is a RAW (Read-After-Write) dependency, not WAW.
- This statement is FALSE.
- I1:
32
Q32MSQ1 markMediumWhich of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?Think it through. Then check your answer.Question
Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?Correct answer
(C) Time to Live (TTL); (D) Header Checksum
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
When a router forwards an IPv4 packet, it performs the following steps regarding the header:1.Time to Live (TTL): The router decrements the TTL field by at least one. This is done to prevent packets from circulating indefinitely in the network. Thus, the TTL is always modified.2.Header Checksum: Since the TTL field is part of the IP header and its value changes, the checksum (which verifies the integrity of the header) becomes invalid. The router must recompute the checksum with the new TTL value and update the Header Checksum field. Thus, the Header Checksum is always modified.The Source IP Address and Protocol fields are generally preserved by standard routers (unless Network Address Translation (NAT) is being performed, which is a specific function and not the general definition of a router's forwarding behavior).Therefore, both Time to Live (TTL) and Header Checksum are always modified.33
Q33MSQ1 markMediumConsider the following C function definition. [code] Which of the following statements is/are TRUE?Think it through. Then check your answer.Question
Consider the following C function definition.Which of the following statements is/are TRUE?int fX(char *a){ char *b = a; while(*b) b++; return b - a;}Correct answer
(A) The function call fX("abcd") will always return a value; (B) Assuming a character array c is declared as char c[] = "abcd" in main(), the function call fX(c) will always return a value; (D) Assuming a character pointer c is declared as char c = "abcd" in main(), the function call fX(c) will always return a value
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function is a standard implementation of the string length function (strlen). It operates as follows:1.It initializes a pointer to the start of the string .2.It iterates through the memory using awhileloop until it encounters the null terminator (\0).3.It returns the difference between the final pointer position and the initial pointer position (), which corresponds to the number of characters in the string.Evaluating the options:- Option (A):
"abcd"is a string literal. In C, string literals are stored in a read-only data segment and are automatically null-terminated. Passing this to is valid, and the function will return 4. Thus, it will always return a value. - Option (B):
char c[] = "abcd"declares a local character array and initializes it with the characters 'a', 'b', 'c', 'd', and '\0'. This is a valid null-terminated string. Passing it to will return 4. Thus, it will always return a value. - Option (C): The code is syntactically correct C. It uses valid pointer arithmetic and standard control flow. It will compile without errors.
- Option (D):
char *c = "abcd"makes point to the first character of the null-terminated string literal"abcd". Passing this pointer to will return 4. Thus, it will always return a value.
- Option (A):
34
Q34NAT1 markMediumLet be the partial order defined on the set as follows The number of total orders on…Think it through. Then check your answer.Question
Let be the partial order defined on the set as followsThe number of total orders on that contain 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
A total order (or linear extension) containing must satisfy all the relations in . The given relations (excluding reflexivity) are:1.2.3.We need to find the number of permutations of that satisfy these conditions.Let's analyze the constraints:- must precede both and . Thus, must be placed before and in the sequence.
- must precede .
Since must be before and , can be at the 1st or 2nd position. It cannot be at the 3rd or 4th position because it needs at least two elements after it ( and ).Case 1: is at the 1st position.
Sequence:
Remaining elements to place: .
Constraint remaining: .
We need to arrange such that appears before . The total permutations of 3 elements is . In exactly half of them, appears before . So, valid permutations.
Alternatively, listing them:- Total order:
- Total order:
- Total order:
So, there are 3 valid orders starting with .Case 2: is at the 2nd position.
Sequence:
For to be second, the first element must be something that doesn't require to be before it. The only element that doesn't require before it is (since and require before them). So, the first element must be .
Sequence:
Remaining elements to place: .
Constraints remaining: None between and . The constraints , , are all satisfied by the positions relative to and .
Possible arrangements for :- Total order:
- Total order:
(from Case 1) + (from Case 2) = .The 5 valid total orders are:1.2.3.4.5.35
Q35NAT1 markMediumLet be an array containing integer values. The distance of is defined as the minimum number of elements in that must be replaced with another integer so that the…Think it through. Then check your answer.Question
Let be an array containing integer values. The distance of is defined as the minimum number of elements in that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array is ___________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 minimize the number of replacements required to make the array sorted in non-decreasing order, we should keep the maximum number of elements from the original array that already form a non-decreasing subsequence. The remaining elements will be replaced.Let be the length of the array. The minimum number of replacements is given by:The given array is . The length .Let's find the Longest Non-Decreasing Subsequence:1.Start with the first element:2.Next is 5 ():3.Next is 3. It breaks the order with 5. We can form (replacing 5 in the active list of potential end values).4.Next is 1. It breaks the order with 2. We can form .5.Next is 4 ():6.Next is 2. It breaks the order with 3. We can form .7.Next is 6 ():The length of the LNDS is 4. One such subsequence is (indices 0, 2, 4, 6).Therefore, the minimum number of replacements is:36
Q36MCQ2 marksMediumWhat is the output of the following C program? [code]Think it through. Then check your answer.Question
What is the output of the following C program?#include <stdio.h> int main() { double a[2]={20.0, 25.0}, *p, *q; p = a; q = p + 1; printf("%d,%d", (int)(q - p), (int)(*q - *p)); return 0;}Correct answer
(B) 1,5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Pointer Arithmetic: The arrayais initialized with twodoublevalues:a[0] = 20.0anda[1] = 25.0. The pointerpis assigned the base address of the array (p = a), so it points toa[0]. The pointerqis assignedp + 1, so it points to the next element,a[1].2.Pointer Subtraction: In C, when you subtract two pointers of the same type (q - p), the result is the number of elements of that type between the two addresses. Sinceqpoints to the element immediately followingp,q - pis . Casting this to(int)gives .3.Value Subtraction:*qdereferences to the value , and*pdereferences to . The expression*q - *pcalculates the difference between these values: . Casting this result to(int)gives .4.Final Output: Theprintffunction uses the format string"%d,%d", resulting in the output1,5.37
Q37MCQ2 marksMediumConsider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value…Think it through. Then check your answer.Question
Consider a single processor system with four processes A, B, C, and D, represented as given below, where for each process the first value is its arrival time, and the second value is its CPU burst time.A (0, 10), B (2, 6), C (4, 3), and D (6, 7).Which one of the following options gives the average waiting times when preemptive Shortest Remaining Time First (SRTF) and Non-Preemptive Shortest Job First (NP-SJF) CPU scheduling algorithms are applied to the processes?Correct answer
(B) SRTF = 6, NP-SJF = 7.5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We calculate the average waiting time for both algorithms.1. Preemptive Shortest Remaining Time First (SRTF):Processes: A(0, 10), B(2, 6), C(4, 3), D(6, 7)- t=0: A arrives (burst 10). A starts.
- t=2: B arrives (burst 6). A has run for 2 units, remaining 8. B(6) < A(8), so preempt A. B starts.
- t=4: C arrives (burst 3). B has run for 2 units, remaining 4. C(3) < B(4), so preempt B. C starts.
- t=6: D arrives (burst 7). C has run for 2 units, remaining 1. C(1) < D(7), so continue C.
- t=7: C finishes. Remaining: A(8), B(4), D(7). Shortest is B(4). B resumes.
- t=11: B finishes. Remaining: A(8), D(7). Shortest is D(7). D starts.
- t=18: D finishes. Remaining: A(8). A resumes.
- t=26: A finishes.
- C: 7
- B: 11
- D: 18
- A: 26
- A:
- B:
- C:
- D:
- A:
- B:
- C:
- D:
- t=0: A arrives. Only A is available. A starts.
- t=10: A finishes. Available processes: B(2, 6), C(4, 3), D(6, 7). Shortest is C(3). C starts.
- t=13: C finishes. Available: B(2, 6), D(6, 7). Shortest is B(6). B starts.
- t=19: B finishes. Available: D(6, 7). D starts.
- t=26: D finishes.
- A: 10
- C: 13
- B: 19
- D: 26
- A:
- B:
- C:
- D:
- A:
- B:
- C:
- D:
38
Q38MCQ2 marksEasyWhich one of the following CIDR prefixes exactly represents the range of IP addresses 10.12.2.0 to 10.12.3.255?Think it through. Then check your answer.Question
Which one of the following CIDR prefixes exactly represents the range of IP addresses 10.12.2.0 to 10.12.3.255?Correct answer
(A) 10.12.2.0/23
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The range of IP addresses is from 10.12.2.0 to 10.12.3.255.Let's look at the binary representation of the third octet, as the first two octets (10.12) are constant.- 2 in binary:
00000010 - 3 in binary:
00000011
10.12.2.0/24and10.12.3.0/24.Comparing the binary of the third octet:0000001000000011The first 7 bits are identical (0000001).Total prefix length = 8 (1st octet) + 8 (2nd octet) + 7 (3rd octet) = 23 bits.The network address is the lowest address in the block: 10.12.2.0.Thus, the CIDR prefix is 10.12.2.0/23.- 2 in binary:
39
Q39MCQ2 marksMediumYou are given a set of distinct integers. A binary search tree is created by inserting all elements of one by one, starting with an empty tree. The tree follows…Think it through. Then check your answer.Question
You are given a set of distinct integers. A binary search tree is created by inserting all elements of one by one, starting with an empty tree. The tree follows the convention that, at each node, all values stored in the left subtree of the node are smaller than the value stored at the node. You are not aware of the sequence in which these values were inserted into , and you do not have access to .Which one of the following statements is TRUE?Correct answer
(A) Inorder traversal of T can be determined from V
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A fundamental property of a Binary Search Tree (BST) is that its inorder traversal yields the keys in sorted (non-decreasing) order.Since we are given the set of distinct integers, we can simply sort the elements of in ascending order. This sorted sequence corresponds exactly to the inorder traversal of the BST , regardless of the insertion order or the resulting structure of the tree.The root node, preorder traversal, and postorder traversal all depend on the specific structure of the tree, which is determined by the order in which elements are inserted. Since the insertion sequence is unknown, these cannot be determined uniquely from the set alone.40
Q40MCQ2 marksMediumConsider the following context-free grammar where the start symbol is and the set of terminals is . …Think it through. Then check your answer.Question
Consider the following context-free grammar where the start symbol is and the set of terminals is .The following is a partially-filled LL(1) parsing table.Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?Note: In the options, "blank" denotes that the corresponding cell is empty.(1) (2) (3) (4) Correct answer
(A) (1) S arrow AaAb (2) S arrow BbBa (3) A arrow ε (4) B arrow ε
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine the entries in the LL(1) parsing table, we first compute the First and Follow sets for the non-terminals.1. Compute First Sets:- (from )
- (from )
- :
- For : .
- For : .
- Thus, .
- includes (start symbol).
- From :
- The first is followed by , so .
- The second is followed by , so .
- Therefore, .
- From :
- The first is followed by , so .
- The second is followed by , so .
- Therefore, .
- Cell (1) for : Since , the entry is .
- Cell (2) for : Since , the entry is .
- Cell (3) for : Since and is a production, the entry is .
- Cell (4) for : Since and is a production, the entry is .
(1)
(2)
(3)
(4) This corresponds to Option (A).41
Q41MCQ2 marksMediumLet be the 5-state NFA with -transitions shown in the diagram below. [figure] Which one of the following regular expressions represents the language accepted by ?Think it through. Then check your answer.Question
Let be the 5-state NFA with -transitions shown in the diagram below.Which one of the following regular expressions represents the language accepted by ?
Correct answer
(B) 0^ + (1 + 0(00)^)(11)^
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
States 2 and 5 are accepting; state 1 is the start state.Strings accepted at state 2. From 1 we reach 2 by . The only way to return to 2 is , so state 2 accepts .Strings accepted at state 5. State 5 can be entered in two ways:- via the top: , then , then , giving (an odd number of 0s);
- via the bottom: , giving .
- (A) misses (accepted via ). Incorrect.
- (B) equals . Correct.
- (C) misses and wrongly contains . Incorrect.
- (D) misses (state 2 is reachable by ) and . Incorrect.
42
Q42MCQ2 marksHardConsider an array that contains positive integers. A subarray of is defined to be a sequence of array locations with consecutive indices. The C code snippet given…Think it through. Then check your answer.Question
Consider an array that contains positive integers. A subarray of is defined to be a sequence of array locations with consecutive indices.The C code snippet given below has been written to compute the length of the longest subarray of that contains at most two distinct integers. The code has two missing expressions labelled and .Which one of the following options gives the CORRECT missing expressions?(Hint: At the end of the -th iteration, the value ofint first=0, second=0, len1=0, len2=0, maxlen=0; for (int i=0; i < n; i++) { if (X[i] == first) { len2++; len1++; } else if (X[i] == second) { len2++; len1 = (P) ; second = first; } else { len2 = (Q) ; len1 = 1; second = first; } if (len2 > maxlen) { maxlen = len2; } first = X[i]; }len1is the length of the longest subarray ending withX[i]that contains all equal values, andlen2is the length of the longest subarray ending withX[i]that contains at most two distinct values.)Correct answer
(B) (P) 1 (Q) len1+1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The code maintains two lengths:1.len1: The length of the current run of identical elements ending at .2.Let's analyze the cases in the loop:len2: The length of the current subarray ending at containing at most two distinct elements.- Case 1:
len1andlen2increment by 1. This is correctly handled in the code.- Case 2:
len2increments by 1 because it's still within the two-distinct-element limit.- Since , a new run of identical elements starts with . Thus,
len1must be reset to 1. So, . - The variable
secondis updated to the previousfirstto prepare for the next iteration. - Case 3: is a new distinct element
firstnorsecond. To maintain at most two distinct elements, the new window must start from the beginning of the previous run of identical elements (first) and include the current element .- The length of this new window is the count of the previous identical elements (
len1) plus the current element. Thus,len2 = len1 + 1. So, . len1is reset to 1 for the new run starting at .
43
Q43MCQ2 marksMediumConsider the following expression: . The following sequence shows the list of triples representing the given expression, with entries missing for…Think it through. Then check your answer.Question
Consider the following expression: . The following sequence shows the list of triples representing the given expression, with entries missing for triples (1), (3), and (6).Which one of the following options fills in the missing entries CORRECTLY?(0) + (1) (2) uminus (1) (3) (4) / (5) + (3) (4) (6) (7) = (6) (5) Correct answer
(A) (1) =[] s i; (3) (0) (2); (6) []= x i
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Build the triples bottom-up for :- (0)
+ p rcomputes . - (1)
=[] s iis the array load (indexed read). - (2)
uminus (1)computes . - (3)
* (0) (2)computes ; the operator is multiplication, so options (B) and (D), which use , are wrong. - (4)
/ u wcomputes . - (5)
+ (3) (4)computes the right-hand side. - (6)
[]= x iis the array store location ; it is indexed by , not by (5). Triple (7)= (6) (5)then assigns the value of (5) to that location.
- (0)
44
Q44MCQ2 marksMediumLet and be random variables, not necessarily independent, that take real values in the interval . Let and let the mean values of be…Think it through. Then check your answer.Question
Let and be random variables, not necessarily independent, that take real values in the interval . Let and let the mean values of be , respectively. Which one of the following statements is TRUE?Correct answer
(D) z ≤ x
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We are given that .
We want to compare with .
Since , we have .
Since , is non-negative ().
Multiplying the inequality by (which is non-negative) preserves the inequality:
Taking the expectation on both sides (expectation is a linear and monotonic operator):
Substituting the given notation:
Why other options are incorrect:
(A) is true only if and are uncorrelated (e.g., independent). The problem states they are "not necessarily independent".
(B) & (C) The relationship between and depends on the covariance . If are positively correlated, . If negatively correlated, . Since the correlation is unknown, neither inequality holds universally.45
Q45MCQ2 marksHardThe relation schema,Person(pid, city), describes the city of residence for every person uniquely identified bypid. The following relational algebra operators are available:…Think it through. Then check your answer.Question
The relation schema,Person(pid, city), describes the city of residence for every person uniquely identified bypid. The following relational algebra operators are available:selection,projection,cross product, andrename.To find the list of cities where at least 3 persons reside, using the above operators, the minimum number ofcross productoperations that must be used isCorrect answer
(B) 2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find cities with at least 3 persons, we need to find three distinct persons such that they all live in the same city.
In relational algebra, this is achieved by joining thePersonrelation with itself. Since onlycross product(Cartesian product) is available (along with selection and projection), we perform the join manually.We need 3 instances of thePersonrelation, say .1.Perform . This is the 1st cross product.2.Perform . This is the 2nd cross product.After obtaining , we applyselectionto ensure:projectionto get the city.
Since we need to combine 3 tables, we require cross product operations.46
Q46MSQ2 marksMediumConsider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also share a global…Think it through. Then check your answer.Question
Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also share a global variable x (initialized to 0). The threads execute the code shown below.// code of T1 wait(s1); x = x+1; print(x); wait(s2); signal(s1);Which of the following outcomes is/are possible when threads T1 and T2 execute concurrently?// code of T2 wait(s1); x = x+1; print(x); signal(s2); signal(s1);Correct answer
(B) T2 runs first and prints 1, T1 runs next and prints 2; (C) T1 runs first and prints 1, T2 does not print anything (deadlock)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The semaphore s1 acts as a mutex protecting the critical sections of both threads. s2 is a synchronization semaphore.Case 1: T1 executes first.1.T1 executeswait(s1). s1 becomes 0. T1 enters its critical section.2.T1 increments x to 1 and prints 1.3.T1 executeswait(s2). Since s2 is 0, T1 blocks and waits for s2 to be signaled. T1 still holds s1 (s1=0).4.T2 tries to executewait(s1). Since s1 is 0, T2 blocks and waits for s1.5.Result: T1 is waiting for s2 (signaled by T2), and T2 is waiting for s1 (signaled by T1). This is a deadlock. T1 has printed 1, T2 has printed nothing. This corresponds to option (C).Case 2: T2 executes first.1.T2 executeswait(s1). s1 becomes 0. T2 enters its critical section.2.T2 increments x to 1 and prints 1.3.T2 executessignal(s2). s2 becomes 1.4.T2 executessignal(s1). s1 becomes 1.5.T2 finishes.6.Now T1 can executewait(s1). s1 becomes 0.7.T1 increments x to 2 and prints 2.8.T1 executeswait(s2). Since s2 is 1 (signaled by T2), s2 becomes 0 and T1 proceeds.9.T1 executessignal(s1).10.Result: T2 prints 1, then T1 prints 2. This corresponds to option (B).Option (A) is impossible because if T1 runs first, it deadlocks and never releases s1, so T2 cannot run to print 2.
Option (D) is impossible because if T2 runs first, it releases s1 and signals s2, allowing T1 to complete, so no deadlock occurs.Thus, both (B) and (C) are possible outcomes.47
Q47MSQ2 marksMediumLet be an matrix over the set of all real numbers . Let be a matrix obtained from by swapping two rows. Which of the following statements…Think it through. Then check your answer.Question
Let be an matrix over the set of all real numbers . Let be a matrix obtained from by swapping two rows. Which of the following statements is/are TRUE?Correct answer
(A) The determinant of B is the negative of the determinant of A; (B) If A is invertible, then B is also invertible
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze each statement:(A) TRUE: A fundamental property of determinants is that swapping any two rows of a square matrix multiplies the determinant by . Therefore, .(B) TRUE: A matrix is invertible if and only if its determinant is non-zero. Since , if , then . Thus, if is invertible, is also invertible.(C) FALSE: Swapping rows generally destroys symmetry. For example, let , which is symmetric. Swapping the two rows results in . Since and , is not symmetric.(D) FALSE: The trace is the sum of the diagonal elements. Swapping rows changes which elements are on the diagonal. For example, let . Trace() . Swapping the rows gives . Trace() .48
Q48MSQ2 marksHardLet S1 and S2 be two stacks. S1 has capacity of 4 elements. S2 has capacity of 2 elements. S1 already has 4 elements: 100, 200, 300, and 400, whereas S2 is empty, as shown below.…Think it through. Then check your answer.Question
Let S1 and S2 be two stacks. S1 has capacity of 4 elements. S2 has capacity of 2 elements. S1 already has 4 elements: 100, 200, 300, and 400, whereas S2 is empty, as shown below.Only the following three operations are available:
PushToS2: Pop the top element from S1 and push it on S2.PushToS1: Pop the top element from S2 and push it on S1.GenerateOutput: Pop the top element from S1 and output it to the user.
Correct answer
(B) 200, 300, 400, 100; (C) 400, 200, 100, 300; (D) 300, 200, 400, 100
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The initial state of Stack S1 is where is at the top. Stack S2 is empty with capacity . S1 has capacity .Let's analyze each option:(A) 100, 200, 400, 300
To output first, we must pop from S1 and store them in S2. This requires S2 to hold elements. Since S2 capacity is , this is impossible.(B) 200, 300, 400, 1001.PushToS2(400). S1: , S2: .2.PushToS2(300). S1: , S2: . (S2 is full).3.GenerateOutput(200). Output: 200. S1: .4.PushToS1(300). S1: , S2: .5.GenerateOutput(300). Output: 300. S1: .6.PushToS1(400). S1: , S2: .7.GenerateOutput(400). Output: 400. S1: .8.This sequence is possible.(C) 400, 200, 100, 300GenerateOutput(100). Output: 100. S1: .1.GenerateOutput(400). Output: 400. S1: .2.PushToS2(300). S1: , S2: .3.GenerateOutput(200). Output: 200. S1: .4.GenerateOutput(100). Output: 100. S1: .5.PushToS1(300). S1: , S2: .6.This sequence is possible.(D) 300, 200, 400, 100GenerateOutput(300). Output: 300. S1: .1.PushToS2(400). S1: , S2: .2.GenerateOutput(300). Output: 300. S1: .3.GenerateOutput(200). Output: 200. S1: .4.PushToS1(400). S1: , S2: .5.GenerateOutput(400). Output: 400. S1: .6.This sequence is possible.Thus, options (B), (C), and (D) can be generated.GenerateOutput(100). Output: 100. S1: .49
Q49MSQ2 marksEasyWhich of the following is/are EQUAL to in radix- (i.e., base-) notation?Think it through. Then check your answer.Question
Which of the following is/are EQUAL to in radix- (i.e., base-) notation?Correct answer
(A) 64 in radix- 10; (B) 100 in radix- 8; (D) 121 in radix- 7
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine which options are equivalent to , we first convert it to decimal (base-):Now, we evaluate each option by converting it to decimal:- Option (A): in radix- is . This matches.
- Option (B): in radix- is . This matches.
- Option (C): in radix- is . This does not match.
- Option (D): in radix- is . This matches.
50
Q50MSQ2 marksMediumConsider 4-variable functions expressed in sum-of-minterms form as given below. …Think it through. Then check your answer.Question
Consider 4-variable functions expressed in sum-of-minterms form as given below.With respect to the circuit given above, which of the following options is/are CORRECT?
Correct answer
(C) Y = Σ(0,1,2,3,4,5,6,7); (D) Y = (8,9,10,11,12,13,14,15)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The circuit consists of an AND gate, an OR gate, and an XOR gate.1.Top Branch (AND gate):Let the output of the AND gate be .
The intersection of minterms is:
2.Bottom Branch (OR gate):Let the output of the OR gate be .
The union of minterms is:
3.Final Output (XOR gate):
The XOR operation includes minterms present in or but not both (Symmetric Difference).
Minterms in :
Minterms in :
Common minterms ():
Union ():
Removing common minterms from the union:
So, in sum-of-minterms form:
This matches Option (C).4.Product-of-Maxterms Form:The maxterms correspond to the minterms not present in the function.
The missing minterms from the set are .
Therefore, .
This matches Option (D).Thus, both (C) and (D) are correct representations of the function .51
Q51MSQ2 marksHardLet be an undirected connected graph in which every edge has a positive integer weight. Suppose that every spanning tree in has even weight. Which of the following…Think it through. Then check your answer.Question
Let be an undirected connected graph in which every edge has a positive integer weight. Suppose that every spanning tree in has even weight. Which of the following statements is/are TRUE for every such graph ?Correct answer
(D) In each cycle C in G, either all edges in C have even weight OR all edges in C have odd weight
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let denote the weight of edge . The weight of a spanning tree is . We are given thatW(T)is even for every spanning tree of .Consider any cycle in . Let be an edge in . Since is connected, there exists a spanning tree such that contains all edges of except (i.e., is the fundamental cycle edge with respect to ).
Let be any other edge in . Since and is on the unique cycle formed by adding to , the set of edges forms another spanning tree of .The weights of and are:
We are given that bothW(T)and are even. Therefore, their difference must be even:
This implies that any two edges and in the cycle must have the same parity (both even or both odd). Since this holds for any pair of edges in , all edges in the cycle must have the same parity.Thus, for every cycle , either all edges in are even, or all edges in are odd. This corresponds to statement (D).Counter-examples for other options:- (A) & (C): Consider a graph consisting of a single cycle of length 3 (triangle) with edge weights 1, 1, 1. The spanning trees have weights (even). This satisfies the condition. However, the edges are odd, so (A) and (C) are false.
- (B): Consider two disjoint triangles, one with weights (1, 1, 1) and another with weights (2, 2, 2), connected by a path of two edges with weights 1, 1. The total weight of any spanning tree will be sum of (2 edges from triangle 1) + (2 edges from triangle 2) + (path edges). Sum = (odd+odd) + (even+even) + (odd+odd) = even + even + even = even. This graph satisfies the condition. However, it contains both odd and even edges, so (B) is false.
52
Q52MSQ2 marksMediumConsider a context-free grammar with the following 3 rules. Let . Let , ,…Think it through. Then check your answer.Question
Consider a context-free grammar with the following 3 rules.Let . Let , , denote the number of times occur in , respectively. Which of the following statements is/are TRUE?Correct answer
(B) nₐ(w) n_c(w) - 2; (C) n_c(w) = n_b(w) + 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the number of times the rules , , and are applied in the derivation of a string , respectively.We track the number of non-terminals and the terminals generated:1.Start: We begin with 1 .2.Rule 1 (): Replaces 1 with 1 . Net change in is . Adds 1 .3.Rule 2 (): Replaces 1 with 2 's. Net change in is . Adds 1 and 1 .4.Rule 3 (): Replaces 1 with 0 's. Net change in is . Adds 1 .For a derivation to terminate and produce a string , the final number of 's must be 0. Starting from 1 , the total change must be .The number of terminals in are:- (since rules 1 and 2 produce 'a')
- (only rule 2 produces 'b')
- (only rule 3 produces 'c')
Substituting the counts: . This matches our derived constraint exactly. Thus, this statement is TRUE.(B)
Substitute :Since and , this becomes:Since is a count of rule applications, . Therefore, is always true. Thus, this statement is TRUE.(A) This is not always true. For example, the derivation has . Thus, this statement is FALSE.(D) This is not always true. For example, has , so . Thus, this statement is FALSE.Correct options are (B) and (C).53
Q53NAT2 marksHardConsider a disk with the following specifications: rotation speed of 6000 RPM, average seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors. A file has content stored…Think it through. Then check your answer.Question
Consider a disk with the following specifications: rotation speed of 6000 RPM, average seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors.
A file has content stored in 3000 sectors located randomly on the disk. Assuming average rotational latency, the total time (in seconds, rounded off to 2 decimal places) to read the entire file from the disk is _________Correct answer
29.5 to 30.5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Rotation speed = 6000 RPM
- Average seek time () = 5 ms
- Sectors per track = 500
- Total sectors to read = 3000
- Sectors are located randomly.
Since there are 500 sectors per track, the time to read one sector is the time for one rotation divided by the number of sectors:Step 3: Calculate Total Time
Since the sectors are located randomly, each sector access requires independent Seek, Rotational Latency, and Transfer.Total time for 3000 sectors:The value 30.06 lies within the accepted range of 29.50 to 30.50.54
Q54NAT2 marksMediumConsider a TCP connection operating at a point of time with the congestion window of size 12 MSS (Maximum Segment Size), when a timeout occurs due to packet loss. Assuming that…Think it through. Then check your answer.Question
Consider a TCP connection operating at a point of time with the congestion window of size 12 MSS (Maximum Segment Size), when a timeout occurs due to packet loss. Assuming that all the segments transmitted in the next two RTTs (Round Trip Time) are acknowledged correctly, the congestion window size (in MSS) during the third RTT will be _________Correct answer
4 to 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
When a timeout occurs in TCP (standard implementations like Tahoe, Reno, or NewReno), the congestion control mechanism performs the following steps:1.Update ssthresh: The slow start threshold () is set to half of the current congestion window ().2.Reset CWND: The congestion window is reset to 1 MSS.3.Enter Slow Start: The algorithm restarts in the Slow Start phase.Now, we trace the value of over the subsequent Round Trip Times (RTTs):- During 1st RTT:
- starts at MSS.
- 1 segment is transmitted.
- Since it is acknowledged correctly, increases by 1 (exponential growth in Slow Start).
- End of 1st RTT: MSS.
- During 2nd RTT:
- starts at MSS.
- 2 segments are transmitted.
- Both are acknowledged correctly. increases by 1 for each ACK (total +2).
- End of 2nd RTT: MSS.
- During 3rd RTT:
- starts at MSS.
- Since (), we are still in the Slow Start phase.
55
Q55NAT2 marksMediumConsider an Ethernet segment with a transmission speed of bits/sec and a maximum segment length of 500 meters. If the speed of propagation of the signal in the medium is…Think it through. Then check your answer.Question
Consider an Ethernet segment with a transmission speed of bits/sec and a maximum segment length of 500 meters. If the speed of propagation of the signal in the medium is meters/sec, then the minimum frame size (in bits) required for collision detection is _________Correct answer
500 to 500
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In an Ethernet network using CSMA/CD, to ensure that a collision is detected by the transmitting station before it finishes transmitting the frame, the transmission time () must be at least twice the propagation delay () between the two farthest points in the segment.Given:- Transmission speed (Bandwidth, ) = bits/sec
- Maximum segment length () = 500 meters
- Speed of propagation () = meters/sec
56
Q56NAT2 marksMediumA functional dependency is termed as a useful functional dependency if and only if it satisfies all the following three conditions: - is not the empty set. -…Think it through. Then check your answer.Question
A functional dependency is termed as a useful functional dependency if and only if it satisfies all the following three conditions:- is not the empty set.
- is not the empty set.
- Intersection of and is the empty set.
Correct answer
50 to 50
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the total number of useful functional dependencies for a relation with attributes, we follow the given conditions:1.2.3.Let the set of attributes be , so . For each attribute , there are three possible assignments in a functional dependencyX → Ythat satisfies :- and
- Case 1:
- Case 2:
- Case 3: and
57
Q57NAT2 marksMediumA processor with 16 general purpose registers uses a 32-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two register operand…Think it through. Then check your answer.Question
A processor with 16 general purpose registers uses a 32-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two register operand fields, and a 16-bit scalar field. If 8 addressing modes are to be supported, the maximum number of unique opcodes possible for every addressing mode is _________Correct answer
32 to 32
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Instruction size = 32 bits
- Number of registers = 16. Bits required per register = bits.
- Two register operand fields. Total bits = bits.
- Scalar field size = 16 bits.
- Number of addressing modes = 8. Bits required = bits.
The sum of the lengths of all fields must equal the total instruction size:The maximum number of unique opcodes possible is .58
Q58NAT2 marksMediumA non-pipelined instruction execution unit operating at 2 GHz takes an average of 6 cycles to execute an instruction of a program P. The unit is then redesigned to operate on a…Think it through. Then check your answer.Question
A non-pipelined instruction execution unit operating at 2 GHz takes an average of 6 cycles to execute an instruction of a program P. The unit is then redesigned to operate on a 5-stage pipeline at 2 GHz. Assume that the ideal throughput of the pipelined unit is 1 instruction per cycle. In the execution of program P, 20% instructions incur an average of 2 cycles stall due to data hazards and 20% instructions incur an average of 3 cycles stall due to control hazards. The speedup (rounded off to one decimal place) obtained by the pipelined design over the non-pipelined design is _________Correct answer
2.9 to 3.1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Non-pipelined processor frequency .
- Non-pipelined CPI () = 6 cycles.
- Pipelined processor frequency .
- Ideal pipelined CPI = 1.
- Stalls:
- 20% of instructions cause 2 stall cycles.
- 20% of instructions cause 3 stall cycles.
59
Q59NAT2 marksHardThe number of distinct minimum-weight spanning trees of the following graph is _________ [figure]Think it through. Then check your answer.Question
The number of distinct minimum-weight spanning trees of the following graph is _________
Correct answer
9 to 9
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the number of distinct Minimum Spanning Trees (MSTs), we can use Kruskal's algorithm logic, considering edges in increasing order of weights.Step 1: Edges with weight 1
Edges: , , , .
There are 4 such edges. None of them form a cycle among themselves.- and connect nodes .
- and connect nodes .
Current components: , , .Step 2: Edges with weight 2
Edges connecting to : connect to . connect to .
We need to connect the three components together. The MST requires edges. We currently have 4 edges. We need 2 more edges.To connect to , we can choose any one edge from the set . All have weight 2. Since they all connect the same two components ( and ), any one of them is valid and will not form a cycle with the others if only one is picked.
Number of choices = 3.To connect to , we can choose any one edge from the set . All have weight 2.
Number of choices = 3.By picking one edge from the first set and one from the second set, we connect , forming a single connected component containing all vertices. No cycles are formed.Step 3: Edges with weight 3
Edges and have weight 3. Since the graph is already connected using weights 1 and 2, adding any weight 3 edge would create a cycle. Thus, no weight 3 edges are included.Total Distinct MSTs
Total combinations = (Choices for connecting to ) (Choices for connecting to )
Total = .60
Q60NAT2 marksMediumThe chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. The chromatic number of the following graph is _________ [figure]Think it through. Then check your answer.Question
The chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. The chromatic number of the following graph is _________
Correct answer
2 to 2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Label the 8 vertices around the octagon in order: (top-left), (top-right), (right-upper), (right-lower), (bottom-right), (bottom-left), (left-lower), (left-upper).Reading the figure, the edges are:- the 8 octagon sides ;
- two horizontal chords and ;
- two vertical chords and ;
- four diagonal chords , , and .
- Each octagon side joins consecutive indices, hence one odd and one even vertex.
- Each chord also joins an odd and an even index: .
61
Q61NAT2 marksMediumA processor uses a 32-bit instruction format and supports byte-addressable memory access. The ISA of the processor has 150 distinct instructions. The instructions are equally…Think it through. Then check your answer.Question
A processor uses a 32-bit instruction format and supports byte-addressable memory access. The ISA of the processor has 150 distinct instructions. The instructions are equally divided into two types, namely R-type and I-type, whose formats are shown below.R-type Instruction Format:I-type Instruction Format:OPCODE UNUSED DST Register SRC Register1 SRC Register 2 In the OPCODE, 1 bit is used to distinguish between I-type and R-type instructions and the remaining bits indicate the operation. The processor has 50 architectural registers, and all register fields in the instructions are of equal size.Let be the number of bits used to encode the UNUSED field, be the number of bits used to encode the OPCODE field, and be the number of bits used to encode the immediate value/address field. The value of is ________OPCODE DST Register SRC Register # Immediate value/address Correct answer
34 to 34
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Determine the number of bits for the OPCODE field ():- Total instructions = 150.
- Instructions are equally divided: 75 R-type and 75 I-type.
- 1 bit is used to distinguish between types (R-type vs I-type).
- To represent 75 distinct operations within each type, we need bits.
- Therefore, total bits for the OPCODE field, bits.
- The processor has 50 architectural registers.
- Bits required to uniquely identify each register = bits.
- All register fields (DST, SRC1, SRC2, SRC) are of equal size, so each is 6 bits.
- Total instruction length = 32 bits.
- R-type format:
- bits.
- I-type format:
- bits.
- .
62
Q62NAT2 marksMediumLet be the language represented by the regular expression and , where denotes the length of string…Think it through. Then check your answer.Question
Let be the language represented by the regular expression and , where denotes the length of string . The number of strings in which are also in is ___________Correct answer
15 to 15
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Analyze : The regular expression represents the set of all strings over that contain an odd number of 'a's.- generates strings with exactly one 'a'.
- generates strings with an even number of 'a's (including zero).
- Concatenating them results in strings with 'a's, which is always odd.
3.Find : We need to count the number of strings of length that have an odd number of 'a's.- For any length , the number of strings with an odd number of 'a's is exactly half of the total strings, i.e., .
- Length 0: Total strings = (the empty string ). Number of 'a's = 0 (even). Count = 0.
- Length 1: Count = (string is 'a').
- Length 2: Count = (strings are 'ab', 'ba').
- Length 3: Count = (strings are 'aaa', 'abb', 'bab', 'bba').
- Length 4: Count = (strings are 'aaab', 'aaba', 'abaa', 'baaa', 'abbb', 'babb', 'bbab', 'bbba').
63
Q63NAT2 marksMediumLet be the group of integers with addition modulo as the group operation. The number of elements in the group …Think it through. Then check your answer.Question
Let be the group of integers with addition modulo as the group operation. The number of elements in the group that are their own inverses 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
An element in the group is its own inverse if , where is the identity element of the group. This condition is equivalent to solving the following congruences independently for each component:1.In : . This is satisfied by and . Thus, there are 2 such elements in .2.In : . Since , the only solution is . Thus, there is 1 such element in .3.In : . This is satisfied by and . Thus, there are 2 such elements in .According to the fundamental principle of counting, the total number of elements in the product group that are their own inverses is the product of the number of solutions in each component:The specific elements are .64
Q64NAT2 marksHardConsider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each. Assume 1 KB = bytes. The OS uses a 2-level page table for memory management,…Think it through. Then check your answer.Question
Consider a 32-bit system with 4 KB page size and page table entries of size 4 bytes each. Assume 1 KB = bytes. The OS uses a 2-level page table for memory management, with the page table containing an outer page directory and an inner page table. The OS allocates a page for the outer page directory upon process creation. The OS uses demand paging when allocating memory for the inner page table, i.e., a page of the inner page table is allocated only if it contains at least one valid page table entry.An active process in this system accesses 2000 unique pages during its execution, and none of the pages are swapped out to disk. After it completes the page accesses, let denote the minimum and denote the maximum number of pages across the two levels of the page table of the process.The value of is ________Correct answer
1028 to 1028
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.System Parameters:- Logical Address (LA) space = 32 bits.
- Page Size (PS) = 4 KB = bytes.
- Page Table Entry (PTE) size = 4 bytes.
- Number of entries per page = entries.
- Total pages in LA space = pages.
- The Inner Page Table (IPT) needs to map pages. Since each IPT page holds 1024 entries, the total number of IPT pages is pages.
- The Outer Page Directory (OPD) must have one entry for each of the 1024 IPT pages. Thus, the OPD has 1024 entries.
- Size of OPD = bytes = 4 KB, which fits exactly in 1 page.
- 1 page is always allocated for the OPD upon process creation.
- To minimize the number of IPT pages for 2000 unique pages, we assume they are contiguous in the logical address space.
- Number of IPT pages = pages.
- .
- 1 page is always allocated for the OPD.
- To maximize the number of IPT pages, we spread the 2000 unique pages across as many IPT pages as possible.
- Since there are only 1024 IPT pages in total, and the process accesses unique pages (where ), it is possible to have at least one entry in every single IPT page.
- .
- .
65
Q65NAT2 marksHardConsider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is …Think it through. Then check your answer.Question
Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is Let . The number of items in the set is ___________Correct answer
9 to 9
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the number of items in , we first determine the set and then compute the transition for the symbol .1.Compute :- Start with the initial item: .
- Since the dot is before , add all productions of with the dot at the beginning:
- Now, check for non-terminals after the dot in the newly added items:
- In , the dot is before . Add productions: .
- In , the dot is before . Add productions: .
- Thus, .
- .
- The items in with immediately after the dot are and .
- Moving the dot over gives the kernel of the new state: .
- Now, compute the closure of this kernel:
- is already complete.
- For , the dot is before , so we add all productions with the dot at the beginning:
- In , the dot is before , so add .
- In , the dot is before , so add .
The complete set of items is:
1.
2.
3.
4.
5.
6.
7.
8.
9. There are 9 items in total.