The PYQ practice room
GATE CS 2025 Set 2
All 65 solved GATE CS 2025 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 markEasyDespite his initial hesitation, Rehman’s _________ to contribute to the success of the project never wavered. Select the most appropriate option to complete the above sentence.Think it through. Then check your answer.Question
Despite his initial hesitation, Rehman’s _________ to contribute to the success of the project never wavered.Select the most appropriate option to complete the above sentence.Correct answer
(C) resolve
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The sentence contrasts Rehman's 'initial hesitation' with a quality that 'never wavered' and contributed to the project's success.- Ambivalence means having mixed feelings or contradictory ideas. While related to hesitation, saying his ambivalence never wavered would mean he remained undecided, which doesn't fit the context of contributing to success.
- Satisfaction refers to fulfillment, which doesn't fit the context of determination.
- Resolve means firm determination to do something. 'Rehman's resolve... never wavered' indicates that despite being hesitant at the start, his determination to succeed remained firm.
- Revolve is a verb meaning to move in a circle, which is grammatically incorrect here.
2
Q2MCQ1 markEasyBird : Nest :: Bee : _______ Select the correct option to complete the analogy.Think it through. Then check your answer.Question
Bird : Nest :: Bee : _______Select the correct option to complete the analogy.Correct answer
(C) Hive
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The analogy follows the relationship of Animal : Natural Habitat/Home.- A Bird lives in a Nest.
- Similarly, a Bee lives in a Hive.
- Kennel: A small shelter for a dog.
- Hammock: A type of bed made of canvas or rope mesh suspended from supports.
- Lair: A wild animal's resting place, such as a den.
3
Q3MCQ1 markEasyIf for all real values of , which one of the following statements is true?Think it through. Then check your answer.Question
If for all real values of , which one of the following statements is true?Correct answer
(A) P = Q = 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the equation holds for all real values of .Method 1: Testing specific values of- For : .
- For : .
.
Since (as ), we must have .
Since , it follows that .Method 2: Using properties of functions
Rearrange the equation: .
For this to be true for all , the left side must be a constant function. The function is constant if and only if its derivative is zero everywhere:
.
If , then .Thus, is the only correct statement.4
Q4MCQ1 markMediumThe paper as shown in the figure is folded to make a cube where each square corresponds to a particular face of the cube. Which one of the following options correctly represents…Think it through. Then check your answer.Question
The paper as shown in the figure is folded to make a cube where each square corresponds to a particular face of the cube. Which one of the following options correctly represents the cube?Note: The figures shown are representative.
Correct answer
(A) [figure]
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given figure is a net of a cube. Let's analyze the relative positions of the symbols with respect to the central face containing the Triangle ().From the net:- The Triangle () is in the center.
- The Solid Circle () is directly above the Triangle.
- The Circle () is directly below the Triangle.
- The Empty Square is to the left of the Triangle.
- The Solid Triangle () is to the right of the Triangle.
- The Top face must be the Solid Circle.
- The Bottom face must be the Circle.
- The Left face must be the Empty Square.
- The Right face must be the Solid Triangle.
- (A) Shows the Triangle on the Front. The Top face is the Solid Circle. The Left face is the Empty Square. This matches the net perfectly.
- (B) Shows the Triangle on the Front. The Top face is an Empty Square (incorrect, should be Solid Circle). The Right face is the Solid Triangle (correct position, but Top is wrong).
- (C) Shows the Triangle on the Front. The Top face is an Empty Square (incorrect).
- (D) Shows the Triangle on the Front. The Top face is the Solid Triangle (incorrect). The Right face is the Solid Circle (incorrect).
5
Q5MCQ1 markEasyLet and denote two arbitrary prime numbers. Which one of the following statements is correct for all values of and ?Think it through. Then check your answer.Question
Let and denote two arbitrary prime numbers. Which one of the following statements is correct for all values of and ?Correct answer
(B) p₁ p₂ is not a prime number.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We analyze each option using properties of prime numbers and counterexamples:1.Option (A): " is not a prime number."- Counterexample: Let and . Both are prime. Their sum is , which is a prime number. Thus, the statement is false.
- By definition, a prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Since and are primes, and . The product has divisors and . Since , has at least three divisors (or four if ). Therefore, the product of two primes is always composite (not prime). This statement is always true.
- Counterexample: Let and . Their sum plus one is , which is composite (). Thus, the statement is false.
- Counterexample: Let and . The product plus one is , which is composite (). Thus, the statement is false.
6
Q6MCQ2 marksEasyBased only on the conversation below, identify the logically correct inference: “Even if I had known that you were in the hospital, I would not have gone there to see you”, Ramya…Think it through. Then check your answer.Question
Based only on the conversation below, identify the logically correct inference:“Even if I had known that you were in the hospital, I would not have gone there to see you”, Ramya told Josephine.Correct answer
(B) Ramya did not know that Josephine was in the hospital.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The statement uses a counterfactual conditional structure: "Even if I had known...". In English grammar, this specific construction (even if + past perfect) is used to describe a hypothetical situation in the past that did not actually occur. Therefore, the use of "had known" implies that the speaker, Ramya, did not actually know that Josephine was in the hospital at that time.- (A) is incorrect because the counterfactual implies the opposite.
- (C) might be a reasonable real-world assumption based on the cold tone, but it is not a logically certain inference based only on the provided text.
- (D) is completely unsupported by the text.
7
Q7MCQ2 marksEasyIf IMAGE and FIELD are coded as FHBNJ and EMFJG respectively then, which one among the given options is the most appropriate code for BEACH ?Think it through. Then check your answer.Question
If IMAGE and FIELD are coded as FHBNJ and EMFJG respectively then, which one among the given options is the most appropriate code for BEACH ?Correct answer
(B) IDBFC
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The coding pattern involves reversing the word and then shifting each letter forward by one position in the alphabet ().Step 1: Analyze the pattern for IMAGE FHBNJ1.Reverse the word: IMAGE EGAMI2.Add 1 to each letter:- E F
- G H
- A B
- M N
- I J
1.Reverse the word: FIELD DLEIF2.Add 1 to each letter:- D E
- L M
- E F
- I J
- F G
1.Reverse the word: BEACH HCAEB2.Add 1 to each letter:- H I
- C D
- A B
- E F
- B C
8
Q8MCQ2 marksEasyWhich one of the following options is correct for the given data in the table? | Iteration () | 0 | 1 | 2 | 3 | | :--- | :--- | :--- | :--- | :--- | | Input () | 20 | |…Think it through. Then check your answer.Question
Which one of the following options is correct for the given data in the table?Iteration () 0 1 2 3 Input () 20 10 15 Output () 20 16 26 41 Output () 20 Correct answer
(A) X(i) = X(i - 1) + I(i); Y(i) = Y(i - 1)I(i); i 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the correct recurrence relations, we test the given options with the data from the table for .1. Testing :- For : . Using , we get . (Matches)
- For : . Using , we get . (Matches)
- For : . Using , we get . (Matches)
- For : .
- Option (A): . (Matches)
- Option (D): . (Does not match)
- For : .
- Option (A): . (Matches)
- For : .
- Option (A): . (Matches)
9
Q9MCQ2 marksMediumIn the given figure, PQRS is a square of side 2 cm and PLMN is a rectangle. The corner L of the rectangle is on the side QR. Side MN of the rectangle passes through the corner S…Think it through. Then check your answer.Question
In the given figure, PQRS is a square of side 2 cm and PLMN is a rectangle. The corner L of the rectangle is on the side QR. Side MN of the rectangle passes through the corner S of the square.What is the area (in cm) of the rectangle PLMN?Note: The figure shown is representative.
Correct answer
(D) 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the vertices of the square PQRS be represented in a Cartesian coordinate system. Let be at , at , at , and at . The side length of the square is 2 cm.The point lies on the side , which is on the x-axis. Let the coordinates of be , where .The rectangle is PLMN. The side connects and .
The length of side is the distance between these two points:The side is parallel to the side . The width of the rectangle, , is the perpendicular distance between the line segment and the line segment .
Since the side passes through the corner , the width is equal to the perpendicular distance from point to the line passing through and .The equation of the line passing through and can be found using the intercept form :The perpendicular distance from a point to a line is given by .
Here, point is , and the line is .The area of the rectangle PLMN is the product of its length and width:Thus, the area of the rectangle is 4 cm.10
Q10MCQ2 marksMediumThe diagram below shows a river system consisting of 7 segments, marked P, Q, R, S, T, U, and V. It splits the land into 5 zones, marked Z1, Z2, Z3, Z4, and Z5. We need to connect…Think it through. Then check your answer.Question
The diagram below shows a river system consisting of 7 segments, marked P, Q, R, S, T, U, and V. It splits the land into 5 zones, marked Z1, Z2, Z3, Z4, and Z5. We need to connect these zones using the least number of bridges. Out of the following options, which one is correct?Note: The figure shown is representative.
Correct answer
(C) Bridges on Q, R, T, and V
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
This problem can be modeled as finding a spanning tree in a graph where the zones ( to ) are nodes and the river segments () represent potential edges (bridges) connecting adjacent zones.1. Identify Adjacencies (Edges):
Based on the topology of the diagram:- P connects and .
- S connects and .
- Q connects and (separating the left zone from the top-right zone).
- R connects and .
- T connects and .
- V connects and .
- U connects and .
Connect all 5 nodes () using the least number of bridges. For a graph with nodes, the minimum number of edges required to connect them is (a spanning tree).3. Evaluate Options:- (A) Bridges on P, Q, and T:
- Edges: .
- Connected components: . Node is isolated.
- Incorrect.
- (B) Bridges on P, Q, S, and T:
- Edges: .
- This creates a cycle . Node is still isolated.
- Incorrect.
- (C) Bridges on Q, R, T, and V:
- Edges: .
- All edges connect to node (forming a star-like structure centered at ).
- Connectivity: . All nodes are connected.
- Number of bridges: 4 (minimal).
- Correct.
- (D) Bridges on P, Q, S, U, and V:
- Number of bridges: 5. Since 4 is sufficient, 5 is not the least number.
- Incorrect.
Computer Science and Information Technology (CS2)
5511
Q11MCQ1 markEasyIf , then which ONE of the following is ?Think it through. Then check your answer.Question
If , then which ONE of the following is ?Correct answer
(C) pmatrix 625 & 0 \ 0 & 625 pmatrix
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the matrix .Step 1: Calculate .where is the identity matrix.Step 2: Calculate .Step 3: Calculate .Therefore, the correct option is (C).12
Q12MCQ1 markMediumThe value of such that , satisfying the equation isThink it through. Then check your answer.Question
The value of such that , satisfying the equation isCorrect answer
(A) √(e)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the value of satisfying the equation , we evaluate the integral using integration by parts.Let and . Then and .The indefinite integral is:Now, apply the limits from to :Since , the expression simplifies to:Setting this equal to the given value :Since , . Therefore:Thus, the correct option is (A).13
Q13MCQ1 markEasyConsider a binary tree in which every node has either zero or two children. Let be the number of nodes in . Which ONE of the following is the number of nodes in …Think it through. Then check your answer.Question
Consider a binary tree in which every node has either zero or two children.
Let be the number of nodes in .Which ONE of the following is the number of nodes in that have exactly two children?Correct answer
(B) (n-1)/(2)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the number of internal nodes (nodes with 2 children) and be the number of leaf nodes (nodes with 0 children).
In a binary tree where every node has either 0 or 2 children (a full or strict binary tree), the relationship between the number of leaf nodes and internal nodes is given by:The total number of nodes is the sum of leaf nodes and internal nodes:Substituting into the equation for :We need to find the number of nodes with exactly two children, which is . Rearranging the equation to solve for :Thus, the number of nodes with exactly two children is .14
Q14MCQ1 markEasyLet and be non-singular matrices of order 3 satisfying the equations Which ONE of the following is the value of the…Think it through. Then check your answer.Question
Let and be non-singular matrices of order 3 satisfying the equationsWhich ONE of the following is the value of the determinant of ?Correct answer
(A) 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given the equation . Since is a non-singular matrix, we can multiply both sides by to obtain:where is the identity matrix of order 3.Now, let's evaluate the matrix :We are given that . Therefore, the matrix is:where is the zero matrix.The determinant of a zero matrix is always 0:Hence, the correct option is (A).15
Q15MCQ1 markMediumLet be an arbitrary predicate over the domain of natural numbers. Which ONE of the following statements is TRUE?Think it through. Then check your answer.Question
Let be an arbitrary predicate over the domain of natural numbers.Which ONE of the following statements is TRUE?Correct answer
(A) (P(0) ∧ (∀ x [P(x) ⇒ P(x+1)])) ⇒ (∀ x P(x))
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The statement in option (A) corresponds to the Principle of Mathematical Induction.For a predicate over the natural numbers (typically starting from 0):1.Base Case: is true.2.Inductive Step: For all , if is true, then is true.If both conditions hold, then is true for all natural numbers . This is exactly what option (A) states: .Analysis of other options:- (B) suggests backward induction from 0, which would imply properties for negative integers, not covering the natural numbers .
- (C) suggests backward induction starting from 1000. This would prove for , but not for .
- (D) suggests forward induction starting from 1000. This would prove for all , but not for .
16
Q16MCQ1 markEasyConsider the following statements: (i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address. (ii) A single…Think it through. Then check your answer.Question
Consider the following statements:(i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address.
(ii) A single TCP segment from a sender S to a receiver R cannot carry both data from S to R and acknowledgement for a segment from R to S.Which ONE of the following is CORRECT?Correct answer
(B) (i) is TRUE and (ii) is FALSE
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Statement (i) is TRUE. The Address Resolution Protocol (ARP) is used to map a network layer address (like an IPv4 address) to a link layer address (like a MAC address).Statement (ii) is FALSE. TCP supports piggybacking, where an acknowledgment for a received packet can be included in the header of an outgoing data packet. Therefore, a single TCP segment can carry both data (payload) and an acknowledgment (in the ACK field of the header).17
Q17MCQ1 markEasyConsider the routing protocols given in List I and the names given in List II: | List I | List II | | :--- | :--- | | (i) Distance vector routing | (a) Bellman-Ford | |…Think it through. Then check your answer.Question
Consider the routing protocols given in List I and the names given in List II:For matching of items in List I with those in List II, which ONE of the following options is CORRECT?List I List II (i) Distance vector routing (a) Bellman-Ford (ii) Link state routing (b) Dijkstra Correct answer
(A) (i) – (a) and (ii) – (b)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Distance Vector Routing protocols (e.g., RIP) typically use the Bellman-Ford algorithm (or a variant like split horizon with poison reverse) to determine the shortest path.Link State Routing protocols (e.g., OSPF, IS-IS) typically use Dijkstra's algorithm (Shortest Path First) to compute the routing table.Therefore, the correct matching is:
(i) Distance vector routing (a) Bellman-Ford
(ii) Link state routing (b) Dijkstra18
Q18MCQ1 markMediumA machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X. Which ONE of the following is NOT a possible candidate for X?Think it through. Then check your answer.Question
A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X.Which ONE of the following is NOT a possible candidate for X?Correct answer
(D) Routing Information Protocol (RIP)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The Protocol field in the IPv4 header identifies the protocol used in the data portion of the IP datagram.1.ICMP (Internet Control Message Protocol): Encapsulated directly in IP datagrams. Protocol number is 1.2.IGMP (Internet Group Management Protocol): Encapsulated directly in IP datagrams. Protocol number is 2.3.OSPF (Open Shortest Path First): Encapsulated directly in IP datagrams. Protocol number is 89.4.RIP (Routing Information Protocol): RIP uses the User Datagram Protocol (UDP) as its transport protocol. It uses UDP port 520. Therefore, for a RIP packet, the Protocol field in the IPv4 header will contain the protocol number for UDP (which is 17), not a specific protocol number for RIP itself.Thus, RIP is not a possible candidate for X.19
Q19MCQ1 markMediumConsider the following C program: [code] Which ONE of the following will be the output of the program?Think it through. Then check your answer.Question
Consider the following C program:Which ONE of the following will be the output of the program?#include <stdio.h> void stringcopy(char *, char *); int main() { char a[30] = "@#Hello World!"; stringcopy(a, a + 2); printf("%s\n", a); return 0; } void stringcopy(char *s, char *t) { while(*t) *s++ = *t++; }Correct answer
(D) Hello World!d!
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The program defines a functionstringcopythat copies characters from the source pointertto the destination pointersas long as*tis not the null terminator (\0).Insidemain:1.char a[30]is initialized to"@#Hello World!".- The array contents (indices 0-14) are:
@,#,H,e,l,l,o,,W,o,r,l,d,!,\0.
stringcopy(a, a + 2)is called.spoints toa[0]('@').tpoints toa[2]('H').
while(*t)loop executes:- It copies characters from
ttosand increments both pointers. - It copies the substring
"Hello World!"(length 12) from indices 2-13 to indices 0-11. a[0]becomes 'H',a[1]becomes 'e', ...,a[11]becomes '!'.
while(*t)checks the value before copying. Whentreaches index 14 (the null terminator\0), the condition fails, and the loop terminates. The assignment*s++ = *t++is NOT executed for the null terminator.5.Therefore, the null terminator is NOT copied to the new position (index 12). The character at index 12 remains what it was originally.- Original
a[12]was 'd'. - Original
a[13]was '!'. - Original
a[14]was\0.
ais:- Indices 0-11:
Hello World! - Index 12:
d(unchanged) - Index 13:
!(unchanged) - Index 14:
\0(unchanged) - Result:
"Hello World!d!"
printf("%s\n", a)prints the string up to the first null terminator.- Output:
Hello World!d!
- The array contents (indices 0-14) are:
20
Q20MCQ1 markEasyConsider an unordered list of distinct integers. What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?Think it through. Then check your answer.Question
Consider an unordered list of distinct integers.What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?Correct answer
(A) 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find an element that is NOT the largest in a list of distinct integers, we simply need to find an element that is smaller than at least one other element in the list.Algorithm:1.Pick any two elements from the list, say and .2.Compare them.3.Since all integers are distinct, either or .- If , then is definitely not the largest (since is larger).
- If , then is definitely not the largest (since is larger).
21
Q21MCQ1 markEasyConsider the following statements about the use of backpatching in a compiler for intermediate code generation: (I) Backpatching can be used to generate code for Boolean…Think it through. Then check your answer.Question
Consider the following statements about the use of backpatching in a compiler for intermediate code generation:(I) Backpatching can be used to generate code for Boolean expression in one pass.
(II) Backpatching can be used to generate code for flow-of-control statements in one pass.Which ONE of the following options is CORRECT?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
Backpatching is a technique used in the intermediate code generation phase of a compiler. It is primarily used to generate code for boolean expressions and flow-of-control statements in a single pass.When generating code for boolean expressions (likea < borA || B) and control flow statements (likeif,while), the compiler often needs to generate jump instructions. In a single-pass compiler, the target address (label) of a forward jump is not known at the moment the jump instruction is generated.Backpatching solves this by generating the jump instruction with an empty or placeholder target and adding the location of this instruction to a list. Later, when the target label is determined, the compiler goes back and fills in (backpatches) the correct address in all the instructions on the list.Therefore:
(I) is TRUE: Backpatching allows single-pass generation for Boolean expressions (short-circuit evaluation involves jumps).
(II) is TRUE: Backpatching allows single-pass generation for flow-of-control statements.Hence, both statements are correct.22
Q22MCQ1 markMediumGiven the following syntax directed translation rules: Rule 1: Rule 2:…Think it through. Then check your answer.Question
Given the following syntax directed translation rules:Rule 1:
Rule 2:
Rule 3: Which ONE is the CORRECT option among the following?Correct answer
(C) Rule 1 is neither S-attributed nor L-attributed; Rule 2 is not S-attributed and is L-attributed; Rule 3 is S-attributed and L-attributed
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine if the rules are S-attributed or L-attributed, we analyze the dependencies of the attributes:Definitions:- S-attributed: Only uses synthesized attributes (attributes of the LHS depend on attributes of the RHS symbols).
- L-attributed: Attributes can be synthesized or inherited. Inherited attributes of a symbol on the RHS can only depend on attributes of the LHS (parent) or attributes of symbols to its left.
- : inherits from parent . Allowed in L-attributed.
- : inherits from . In the production
R → AB, is to the right of . An inherited attribute depending on a right sibling is NOT allowed in L-attributed definitions. - Since it uses inherited attributes, it is NOT S-attributed.
- Conclusion: Rule 1 is neither S-attributed nor L-attributed.
- : Synthesized attribute. Allowed in both.
- : inherits from . In
P → CD, is to the left of . This dependency is allowed in L-attributed definitions. - Since is an inherited attribute (computed before the node is fully processed), it is NOT S-attributed.
- Conclusion: Rule 2 is L-attributed but not S-attributed.
- : Synthesized attribute. No inherited attributes are present.
- Conclusion: Rule 3 is S-attributed (and by definition, all S-attributed definitions are also L-attributed).
- Rule 1: Neither S nor L.
- Rule 2: Not S, is L.
- Rule 3: S and L.
23
Q23MCQ1 markMediumConsider a network that uses Ethernet and IPv4. Assume that IPv4 headers do not use any options field. Each Ethernet frame can carry a maximum of 1500 bytes in its data field. A…Think it through. Then check your answer.Question
Consider a network that uses Ethernet and IPv4. Assume that IPv4 headers do not use any options field. Each Ethernet frame can carry a maximum of 1500 bytes in its data field. A UDP segment is transmitted. The payload (data) in the UDP segment is 7488 bytes.Which ONE of the following choices has the CORRECT total number of fragments transmitted and the size of the last fragment including IPv4 header?Correct answer
(D) 6 fragments, 116 bytes
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Identify Protocol Overheads and Sizes:- Ethernet MTU: The maximum data field in an Ethernet frame is 1500 bytes. This is the Maximum Transmission Unit (MTU) for the IP packet.
- IPv4 Header: The problem states no options are used, so the standard header size is bytes.
- Max IP Payload: The maximum amount of data an IP packet can carry per fragment is bytes.
- UDP Header: A standard UDP header is bytes.
- UDP Payload (Data): Given as bytes.
- The IP layer encapsulates the entire UDP segment (Header + Data).
- Total IP Payload = UDP Header + UDP Data = bytes.
- Total data to be fragmented = bytes.
- Max data per fragment = bytes.
- Number of fragments = fragments.
- Data carried in the first 5 fragments = bytes.
- Remaining data for the 6th fragment = bytes.
- Total size of the last fragment = IP Header + Remaining Data = bytes.
24
Q24MCQ1 markEasyWhich ONE of the following languages is accepted by a deterministic pushdown automaton?Think it through. Then check your answer.Question
Which ONE of the following languages is accepted by a deterministic pushdown automaton?Correct answer
(A) Any regular language.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A Deterministic Pushdown Automaton (DPDA) accepts the class of Deterministic Context-Free Languages (DCFLs).1.Regular Languages: Every regular language is accepted by a Deterministic Finite Automaton (DFA). A DFA can be viewed as a DPDA that simply ignores its stack (or never pushes anything onto it). Since the set of Regular Languages is a subset of DCFLs (), every regular language is accepted by a DPDA. Hence, option (A) is correct.2.Context-Free Languages (CFLs): CFLs are accepted by Non-deterministic Pushdown Automata (NPDAs). The set of DCFLs is a proper subset of CFLs (). There are context-free languages (specifically, inherently ambiguous languages and non-deterministic CFLs) that cannot be accepted by a DPDA. Hence, option (B) is incorrect.3.Languages accepted by NPDA: This is equivalent to the set of Context-Free Languages. As stated above, not all such languages are accepted by a DPDA. Hence, option (C) is incorrect.4.Decidable Languages: The set of decidable languages (Recursive languages) is a superset of CFLs (). There are many decidable languages (e.g., ) that are not even context-free, let alone accepted by a DPDA. Hence, option (D) is incorrect.25
Q25MCQ1 markEasyLet be Context Free Grammars (CFGs) and be a regular expression. For a grammar , letL(G)denote the language generated by . Which ONE among the following…Think it through. Then check your answer.Question
Let be Context Free Grammars (CFGs) and be a regular expression. For a grammar , letL(G)denote the language generated by .Which ONE among the following questions is decidable?Correct answer
(D) Is L(G₁) = ∅ ?
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We analyze the decidability of each problem for Context Free Languages (CFLs):1.Equivalence of CFGs (): This is undecidable. There is no algorithm to determine if two arbitrary CFGs generate the same language.2.Intersection Emptiness (): This is undecidable. The intersection of two CFLs is not necessarily a CFL, and determining if their intersection is empty is undecidable (related to the Post Correspondence Problem).3.Equality to a Regular Language (): This is undecidable. Specifically, the problem of determining if (Universality) is undecidable. Since is a regular language, checking is undecidable in the general case.4.Emptiness (): This is decidable. We can determine if the start symbol of the grammar can generate any string of terminals by checking reachability in the grammar (e.g., marking productive symbols).Therefore, only option (D) is decidable.26
Q26MCQ1 markMediumProcesses arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively.…Think it through. Then check your answer.Question
Processes arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times.Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?Correct answer
(D) 19
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We are given the following processes with their Arrival Times (AT) and Burst Times (BT). The scheduling algorithm is Shortest Remaining Time First (SRTF), which is the preemptive version of SJF.Gantt Chart Execution:Process AT BT 0 10 1 13 2 6 8 9 1.Time 0: arrives. Remaining time: . starts.2.Time 1: arrives. Remaining times: . Since , continues.3.Time 2: arrives. Remaining times: . Since has the shortest remaining time (), is preempted and starts.4.Time 8: finishes execution (). arrives. Remaining times: . is done. Comparing remaining times, is the shortest (). resumes.5.Time 16: finishes execution (). Remaining times: . is the shortest. starts.6.Time 25: finishes execution (). Remaining time: . starts.7.Time 38: finishes execution ().Completion Times (CT):- : 8
- : 16
- : 25
- : 38
- :
- :
- :
- :
27
Q27MSQ1 markMediumAn audit of a banking transactions system has found that on an earlier occasion, two joint holders of account attempted simultaneous transfers of Rs. 10000 each from account…Think it through. Then check your answer.Question
An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account attempted simultaneous transfers of Rs. 10000 each from account to account . Both transactions read the same value, Rs. 11000, as the initial balance in and were allowed to go through. was credited Rs. 10000 twice. was debited only once and ended up with a balance of Rs. 1000.Which of the following properties is/are certain to have been violated by the system?Correct answer
(B) Consistency; (C) Isolation
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The scenario described is the classic Lost Update problem, which occurs when two transactions read the same initial value of a data item and then update it based on that value, overwriting each other's updates.1.Transaction 1 (): Reads . Calculates . Writes .2.Transaction 2 (): Reads (before writes). Calculates . Writes .The update from is overwritten (lost) by . The net effect is that is decremented by 10000 only once, but is credited twice (total 20000). This interleaving of operations is a failure to ensure Isolation. The Isolation property requires that concurrent execution of transactions leaves the database in a state that would have been obtained if the transactions were executed serially. In a serial execution, the second transaction would have read the updated balance () and likely failed due to insufficient funds (or resulted in a negative balance if allowed, but definitely not ).While the database state becomes inconsistent (violating Consistency), the root cause in the context of ACID properties and concurrency control is the violation of Isolation.28
Q28MSQ1 markEasyWhich of the following is/are part of an Instruction Set Architecture of a processor?Think it through. Then check your answer.Question
Which of the following is/are part of an Instruction Set Architecture of a processor?Correct answer
(D) The total number of registers
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The Instruction Set Architecture (ISA) serves as the interface between the software and the hardware. It defines the attributes of the processor that are visible to the programmer (or compiler), such as:- Instruction Set: The set of operations the processor can perform.
- Data Types: The formats of data (integer, floating-point, etc.).
- Registers: The number and type of architectural registers available to instructions.
- Addressing Modes: How instructions access memory.
- Memory Architecture: Address space, alignment, etc.
- Cache Memory: Size, associativity, and number of levels.
- Clock Frequency: The speed at which the processor runs.
- Pipeline: Number of stages, branch prediction, etc.
- (A) The size of the cache memory: Microarchitecture.
- (B) The clock frequency of the processor: Microarchitecture.
- (C) The number of cache memory levels: Microarchitecture.
- (D) The total number of registers: This refers to the architectural registers (e.g., 32 general-purpose registers in MIPS), which are a fundamental part of the ISA because instructions must encode register operands.
29
Q29MSQ1 markMediumWhich of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph is/are TRUE?Think it through. Then check your answer.Question
Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph is/are TRUE?Correct answer
(B) Every non-tree edge of G with respect to a DFS tree is a forward/back edge.; (C) If (u, v) is a non-tree edge of G with respect to a BFS tree, then the distances from the source vertex s to u and v in the BFS tree are within ± 1 of each other.; (D) Both BFS and DFS can be used to find the connected components of G.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Statement (A) is FALSE. DFS does not necessarily produce a shortest path tree; BFS does (for unweighted graphs). For example, in a triangle graph with vertices , a DFS might go , giving path length 2 to , while the direct edge has length 1.Statement (B) is TRUE. In the DFS of an undirected graph, every edge is either a tree edge or a back edge. There are no forward edges (as distinct from back edges in undirected context) or cross edges. Thus, every non-tree edge is a back edge, which satisfies the condition of being a "forward/back edge".Statement (C) is TRUE. In a BFS tree, for any edge in , the levels of and differ by at most 1. Since the distance in the BFS tree corresponds to the level, .Statement (D) is TRUE. Both BFS and DFS can be used to traverse a graph and identify connected components by starting a traversal from an unvisited node until all nodes are visited.30
Q30MSQ1 markMediumConsider the two lists List I and List II given below: | List I | List II | |---|---| | (i) Context free languages | (a) Closed under union | | (ii) Recursive languages |…Think it through. Then check your answer.Question
Consider the two lists List I and List II given below:For matching of items in List I with those in List II, which of the following option(s) is/are CORRECT?List I List II (i) Context free languages (a) Closed under union (ii) Recursive languages (b) Not closed under complementation (iii) Regular languages (c) Closed under intersection Correct answer
(B) (i) – (b), (ii) – (a), and (iii) – (c); (C) (i) – (b), (ii) – (c), and (iii) – (a)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We analyze the closure properties of the language classes given in List I:1.(i) Context free languages (CFLs):- Closed under Union: Yes.
- Closed under Intersection: No.
- Closed under Complementation: No.
- Therefore, (i) matches with (b) Not closed under complementation.
- Closed under Union: Yes.
- Closed under Intersection: Yes.
- Closed under Complementation: Yes.
- Can match (a) or (c).
- Closed under Union: Yes.
- Closed under Intersection: Yes.
- Closed under Complementation: Yes.
- Can match (a) or (c).
Comparing (B) and (C):- Option (B) maps (iii) Regular languages to (c) Closed under intersection. This is a key distinguishing property of Regular languages compared to CFLs (which are not closed under intersection).
- Option (B) maps (ii) Recursive languages to (a) Closed under union.
31
Q31MSQ1 markMediumConsider the following logic circuit diagram. Which is/are the CORRECT option(s) for the output function ? [figure]Think it through. Then check your answer.Question
Consider the following logic circuit diagram.Which is/are the CORRECT option(s) for the output function ?
Correct answer
(A) XY; (B) X + Y + XY; (C) XY + X + XY
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the circuit to determine the output function .1. Identify Inputs and Gates:- The circuit has two inputs, and .
- Top Gate: A NAND gate with inputs and . Output = .
- Middle Gate: A NOT gate connected to input . Output = .
- Bottom Structure:
- A NOT gate connected to input . Output = .
- An AND gate with inputs and . Output = .
- Final Gate: An OR gate that sums the outputs of the previous stages.
The inputs to the final OR gate are:1. (from the NAND gate)2. (from the middle NOT gate)3. (from the bottom AND gate)Thus, the raw expression for the output is:This matches Option (C).3. Simplify the Expression:
We know that (De Morgan's Law).
Substitute this into the expression:This matches Option (B).Further simplification:Since :Using De Morgan's Law again:This matches Option (A).4. Check Option (D):
Option (D) is , which is not equivalent to .Conclusion:
Options (A), (B), and (C) are all correct representations of the output function .32
Q32NAT1 markMediumThe following two signed 2’s complement numbers (multiplicand M and multiplier Q) are being multiplied using Booth’s algorithm: : 1100 1101 1110 1101 and : 1010 0100 1010…Think it through. Then check your answer.Question
The following two signed 2’s complement numbers (multiplicand M and multiplier Q) are being multiplied using Booth’s algorithm:
: 1100 1101 1110 1101 and : 1010 0100 1010 1010The total number of addition and subtraction operations to be performed is ___________. (Answer in integer)Correct answer
13 to 13
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In Booth's multiplication algorithm, the number of addition and subtraction operations is determined by the number of transitions (0 to 1 or 1 to 0) in the multiplier bits , considering an implicit at the least significant end.The multiplier is given as .
Let's list the bits and append :Bits:
Implicit : We examine pairs for to :- : Subtraction
- : Addition
- or : No arithmetic operation (only shift)
1.: No Op2.: Subtraction (1)3.: Addition (2)4.: Subtraction (3)5.: Addition (4)6.: Subtraction (5)7.: Addition (6)8.: Subtraction (7)9.: Addition (8)10.: No Op11.: Subtraction (9)12.: Addition (10)13.: No Op14.: Subtraction (11)15.: Addition (12)16.: Subtraction (13)Total operations = 13.33
Q33NAT1 markEasy[code] The output of the given C code segment is ________. (Answer in integer)Think it through. Then check your answer.Question
int x=126, y=105; do { if(x>y) x=x-y; else y=y-x; } while(x!=y); printf("%d",x);
The output of the given C code segment is ________. (Answer in integer)Correct answer
21 to 21
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given C code implements the Euclidean algorithm for finding the Greatest Common Divisor (GCD) of two numbers using subtraction.Initial values: , .Iteration 1:
() is true.
.
Values: , .
Condition () is true.Iteration 2:
() is false.
.
Values: , .
Condition () is true.Iteration 3:
() is false.
.
Values: , .
Condition () is true.Iteration 4:
() is false.
.
Values: , .
Condition () is true.Iteration 5:
() is false.
.
Values: , .
Condition () is false. The loop terminates.Theprintfstatement prints the value of , which is 21.34
Q34NAT1 markMediumIn a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is ________. (Answer in integer)Think it through. Then check your answer.Question
In a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is ________. (Answer in integer)Correct answer
250 to 250
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In an -bit ripple counter, the output frequency at the -th flip-flop () is related to the input clock frequency () by the formula:Given:- Number of bits,
- Period at the last flip-flop,
35
Q35NAT1 markEasySuppose the values are inserted in that order into an initially empty binary search tree. Let be the resulting binary search tree. The number…Think it through. Then check your answer.Question
Suppose the values are inserted in that order into an initially empty binary search tree. Let be the resulting binary search tree.
The number of edges in the path from the node containing to the root node of 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
We insert the keys into the Binary Search Tree (BST) in the given order: .1.Insert 10: Root node is .2.Insert -4: , so becomes the left child of .3.Insert 15: , so becomes the right child of .4.Insert 30: (Right) (Right). becomes the right child of .5.Insert 20: (Right) (Right) (Left). becomes the left child of .6.Insert 5: (Left) (Right). becomes the right child of .7.Insert 60: (Right) (Right) (Right). becomes the right child of .8.Insert 19:- Compare with : (Go Right)
- Compare with : (Go Right)
- Compare with : (Go Left)
- Compare with : (Go Left)
- becomes the left child of .
The edges in this path are:1.2.3.4.Total number of edges = .36
Q36MCQ2 marksMediumSuppose we are transmitting frames between two nodes using Stop-and-Wait protocol. The frame size is 3000 bits. The transmission rate of the channel is 2000 bps (bits/second) and…Think it through. Then check your answer.Question
Suppose we are transmitting frames between two nodes using Stop-and-Wait protocol. The frame size is 3000 bits. The transmission rate of the channel is 2000 bps (bits/second) and the propagation delay between the two nodes is 100 milliseconds. Assume that the processing times at the source and destination are negligible. Also, assume that the size of the acknowledgement packet is negligible.Which ONE of the following most accurately gives the channel utilization for the above scenario in percentage?Correct answer
(A) 88.23
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:
Frame size () = 3000 bits
Transmission rate () = 2000 bps
Propagation delay () = 100 ms = secondsTransmission delay () is calculated as:For Stop-and-Wait protocol, the channel utilization (efficiency) is given by:Substituting the values:Converting to percentage:The closest option is 88.23.37
Q37MCQ2 marksMediumLet be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant is added to the weight of every edge. Which ONE of the following…Think it through. Then check your answer.Question
Let be an edge-weighted undirected graph with positive edge weights. Suppose a positive constant is added to the weight of every edge.Which ONE of the following statements is TRUE about the minimum spanning trees (MSTs) and shortest paths (SPs) in before and after the edge weight update?Correct answer
(C) Every MST remains an MST, and SPs need not remain SPs.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Minimum Spanning Tree (MST): Algorithms like Kruskal's and Prim's determine the MST based on the relative order of edge weights. If a constant is added to every edge weight, the inequality becomes . The relative order of edges remains unchanged. Therefore, the set of edges forming the MST remains the same.2.Shortest Path (SP): The shortest path depends on the sum of edge weights. Let be a path with edges and total weight , and be a path with edges and total weight . Suppose is the shortest path initially, so . After adding to each edge, the new weights are and . If (the shortest path has more edges), it is possible that for a large enough , , making the new shortest path. Thus, shortest paths can change.Conclusion: Every MST remains an MST, but SPs need not remain SPs.38
Q38MCQ2 marksMediumA meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures: P: Unsorted doubly…Think it through. Then check your answer.Question
A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures:P: Unsorted doubly linked list with pointers to the head node and tail node of the list.Q: Min-heap implemented using an array.R: Binary Search Tree.Which ONE of the following options gives the worst-case time complexities for meld operation on instances of size of these data structures?Correct answer
(A) P: Θ(1), Q: Θ(n), R: Θ(n)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.P (Unsorted doubly linked list): Since the list maintains pointers to both the head and the tail, melding two lists involves simply updating thenextpointer of the first list's tail to point to the second list's head and updating theprevpointer of the second list's head. This is a constant time operation, .2.Q (Min-heap implemented using an array): To meld two binary heaps stored as arrays, the standard efficient approach is to concatenate the elements of both arrays (size ) and then perform thebuildHeapoperation (heapify). Concatenation takes andbuildHeaptakes linear time . Thus, the total complexity is .3.R (Binary Search Tree): To meld two BSTs efficiently, one can perform an inorder traversal on both trees to produce two sorted lists (), merge the two sorted lists into one (), and then build a new balanced BST from the sorted list (). The total worst-case complexity is .Therefore, the complexities are P: , Q: , R: .39
Q39MCQ2 marksMediumFor a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no…Think it through. Then check your answer.Question
For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block.Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?Correct answer
(A) 64 KB and 4 KB
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Tag bits () = 4
- Index bits () = 12
- Block size = 1 byte
The physical address size is the sum of Tag, Index, and Offset bits:The size of the main memory is determined by the physical address space:2. Cache Memory Size:
The number of cache lines (blocks) is determined by the index bits:The size of the cache memory (data capacity) is:Thus, the main memory size is 64 KB and the cache memory size is 4 KB.Option (A) matches these values.40
Q40MCQ2 marksHardGiven a Context-Free Grammar as follows: Which ONE of the following statements is TRUE?Think it through. Then check your answer.Question
Given a Context-Free Grammar as follows:Which ONE of the following statements is TRUE?Correct answer
(C) G is LALR(1), not SLR(1)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine the class of the grammar, we analyze the conflicts in the SLR(1) and LALR(1) parsing tables.1. SLR(1) Analysis:
First, we compute the Follow set of the non-terminal .- From , we have .
- From , we have .
State contains:- There is a Shift action on input (to continue ).
- There is a Reduce action () on input because .
We construct the LR(1) items to see if the lookaheads resolve the conflict.- Start State ():
- Transition on (State ):
Here, we Shift on and Reduce on . Since , there is NO conflict.Since the LR(1) states have no conflicts and no merging of states introduces new conflicts (the cores are distinct), the grammar is LALR(1).Conclusion:
The grammar is LALR(1) but not SLR(1).41
Q41MCQ2 marksMediumAn array of length with distinct elements is said to be bitonic if there is an index such that is sorted in the non-decreasing order and…Think it through. Then check your answer.Question
An array of length with distinct elements is said to be bitonic if there is an index such that is sorted in the non-decreasing order and is sorted in the non-increasing order.Which ONE of the following represents the best possible asymptotic bound for the worst-case number of comparisons by an algorithm that searches for an element in a bitonic array ?Correct answer
(D) Θ(log n)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A bitonic array is an array that first increases (non-decreasing) and then decreases (non-increasing). To search for an element in a bitonic array of length :1.Find the Peak: The peak element (the point where the array transitions from increasing to decreasing) can be found using a modified binary search. By comparing with , we can determine if the peak is to the left or right. This takes comparisons.2.Binary Search on Segments: Once the peak index is identified, the array is split into two sorted subarrays: (sorted in non-decreasing order) and (sorted in non-increasing order).3.Search: Perform a standard binary search on the first segment () and a reverse binary search on the second segment ().The total number of comparisons in the worst case is . Since binary search is the optimal comparison-based search for sorted data, the best possible asymptotic bound for the worst-case is .42
Q42MSQ2 marksMediumLet be the set of all functions from to . Define the binary relation on as follows:…Think it through. Then check your answer.Question
Let be the set of all functions from to . Define the binary relation on as follows: if and only if , where .Which of the following statement(s) is/are TRUE?Correct answer
(B) (F,) is a partial order; (C) (F,) is a lattice
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The set represents the set of all functions mapping elements from to . This structure is isomorphic to the power set of a set with elements, denoted as , where the relation corresponds to the subset relation (bitwise less than or equal).Let's analyze the properties of the relation :1.Reflexive: For any function , for all . Thus, . The relation is reflexive.2.Antisymmetric: If and , then for all , and , which implies . Thus . The relation is antisymmetric.3.Transitive: If and , then for all , so . Thus . The relation is transitive.Since the relation is reflexive, antisymmetric, and transitive, is a partial order. Therefore, option (B) is TRUE.Since the relation is antisymmetric, it is not symmetric (unless the set has only one element, but generally speaking for arbitrary , it is not). Therefore, option (A) is FALSE.Since it is not symmetric, it cannot be an equivalence relation. Therefore, option (D) is FALSE.A partial order is a lattice if every pair of elements has a least upper bound (join) and a greatest lower bound (meet). In this case:- Join (): Define . This is the smallest function greater than or equal to both and .
- Meet (): Define . This is the largest function smaller than or equal to both and .
43
Q43MSQ2 marksMediumGiven the following Karnaugh Map for a Boolean function : [figure] Which one or more of the following Boolean expression(s) represent(s) ?Think it through. Then check your answer.Question
Given the following Karnaugh Map for a Boolean function :Which one or more of the following Boolean expression(s) represent(s) ?
Correct answer
(A) wxyz + wxyz + wxyz + wxyz + xz; (D) xz + xz
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
From the given Karnaugh Map, we identify the minterms where the function is 1:Row 00 ():- Column 00 (): 1
- Column 10 (): 1
- Column 01 (): 1
- Column 11 (): 1
- Column 01 (): 1
- Column 11 (): 1
- Column 00 (): 1
- Column 10 (): 1
1.Corners (0, 2, 8, 10): In these cells, and . This group simplifies to .2.Center Block (5, 7, 13, 15): In these cells, and . This group simplifies to .Thus, the simplified Boolean expression is:This matches Option (D).Checking Option (A):
Option (A) expands the term into its canonical minterms with respect to and :Adding the term, we get exactly the expression in Option (A). Thus, Option (A) is also correct.Checking Option (B):
Contains (minterm 11, 1011), which is 0 in the K-map. Incorrect.Checking Option (C):
Contains minterms 0, 8, 10 but misses minterm 2 (). Incorrect.Therefore, options (A) and (D) are correct.44
Q44MSQ2 marksMediumConsider a system of linear equations where and . Suppose has an LU decomposition, , where…Think it through. Then check your answer.Question
Consider a system of linear equations where and .
Suppose has an LU decomposition, , whereWhich of the following statement(s) is/are TRUE?Correct answer
(A) The system PX = Q can be solved by first solving LY = Q and then UX = Y.; (B) If P is invertible, then both L and U are invertible.; (C) If P is singular, then at least one of the diagonal elements of U is zero.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We analyze each statement:(A) Given and , we have . Let . Then the equation becomes . Since is lower triangular, we can solve for using forward substitution. Once is known, we solve for using backward substitution (since is upper triangular). This is the standard procedure for solving linear systems using LU decomposition. Thus, statement (A) is TRUE.(B) The determinant of a product is the product of determinants: . Since is a lower triangular matrix with all diagonal entries equal to 1, its determinant is the product of its diagonal entries: . Therefore, .
If is invertible, then , which implies . Thus, is invertible. Since , is always invertible. Hence, both and are invertible. Statement (B) is TRUE.(C) If is singular, then . From the relation , it follows that . Since is an upper triangular matrix, its determinant is the product of its diagonal elements: . For the product to be zero, at least one of the diagonal elements must be zero. Statement (C) is TRUE.(D) If is symmetric, . However, is lower triangular and is upper triangular. A triangular matrix is symmetric if and only if it is a diagonal matrix. In general LU decomposition, and are not diagonal matrices, so they are not symmetric. For example, let . Then and . Neither nor is symmetric. Statement (D) is FALSE.45
Q45MSQ2 marksMediumConsider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and that all keys are distinct. We…Think it through. Then check your answer.Question
Consider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and that all keys are distinct.We wish to augment the stack data structure with an time MIN operation that returns a pointer to the record with smallest key present in the stack
1) without deleting the corresponding record, and
2) without increasing the complexities of the standard stack operations.Which one or more of the following approach(es) can achieve it?Correct answer
(A) Keep with every record in the stack, a pointer to the record with the smallest key below it.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem requires adding a MIN operation to a stack with time complexity, without increasing the time complexity of PUSH and POP operations.Analysis of Options:- (A) Keep with every record in the stack, a pointer to the record with the smallest key below it: This is the correct approach. By storing a pointer to the minimum element of the sub-stack below the current element, we can determine the minimum of the entire stack at any point in time. Specifically, if the current top element is , the minimum of the stack is . When pushing a new element, we can compute its "min below" pointer in using the current top's information. This maintains for PUSH, POP, and MIN.
- (B) Keep a pointer to the record with the smallest key in the stack: While this allows access to the minimum, if the minimum element is POPped, finding the next minimum would require scanning the remaining stack, taking time. This violates condition 2.
- (C) Keep an auxiliary sorted array: Inserting a new element into a sorted array takes time, which increases the complexity of the PUSH operation. This violates condition 2.
- (D) Keep a Min-Heap: Heap operations (insert, delete) take time. This increases the complexity of PUSH and POP operations. This violates condition 2.
46
Q46MSQ2 marksMediumConsider the following relational schema along with all the functional dependencies that hold on them. …Think it through. Then check your answer.Question
Consider the following relational schema along with all the functional dependencies that hold on them.
.Which of the following statement(s) is/are TRUE?Correct answer
(C) R1 is NOT in 3NF; (D) R2 is NOT in 3NF
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To determine if the relations are in 3NF, we first find the candidate keys for each.ForR1(A, B, C, D, E)with FDs:1.Find Candidate Keys: Attributes and do not appear on the right-hand side of any functional dependency. Therefore, they must be part of every candidate key.(sinceD → E, thenEA → B, thenEB → C).
Thus, is the only candidate key.2.Identify Prime and Non-prime Attributes:- Prime attributes:
- Non-prime attributes:
X → Y, either is a superkey or is a prime attribute.- For
D → E: is not a superkey (it's a proper subset of the key ), and is not a prime attribute. This violates 3NF (and also 2NF).
R2(A, B, C, D)with FDs:1.Find Candidate Keys: Attribute does not appear on the right-hand side of any functional dependency. Therefore, it must be part of every candidate key.(sinceC → A, thenA → DandA → B).
Thus, is the only candidate key.2.Identify Prime and Non-prime Attributes:- Prime attributes:
- Non-prime attributes:
- For
A → D: is not a superkey, and is not a prime attribute. This violates 3NF. - For
A → B: is not a superkey, and is not a prime attribute. This violates 3NF.
47
Q47MSQ2 marksMediumConsider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6 4 5 1 3 2. The contents of the frames are as follows initially and…Think it through. Then check your answer.Question
Consider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6 4 5 1 3 2. The contents of the frames are as follows initially and after each reference (from left to right):The *-marked references cause page replacements.Which one or more of the following could be the page replacement policy/policies in use?initially 1* 2* 3* 4* 5* 4 1 6* 4 5 1* 3* 2* - 1 1 1 1 1 1 1 6 6 6 6 6 2 - - 2 2 4 4 4 4 4 4 4 1 1 1 - - - 3 3 5 5 5 5 5 5 5 3 3 Correct answer
(D) Optimal page replacement policy
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We analyze the page replacements to determine the policy:Reference String: 1, 2, 3, 4, 5, 4, 1, 6, 4, 5, 1, 3, 2
Frames: 31.Ref 4 (Fault): Current frames . Replaces 2. New frames .- LRU: History is 3, 2, 1. LRU is 1. Replaced 2. Not LRU.
- Optimal: Future refs: 5, 4, 1, 6, 4, 5, 1, 3, 2. Next uses: 1 (soon), 3 (far), 2 (farthest). Optimal replaces 2. Matches.
- Optimal: Future refs: 4, 1, 6... Next uses: 4 (soon), 1 (soon), 3 (far). Optimal replaces 3. Matches.
- LFU: Counts in memory: 1 (2 refs), 4 (2 refs), 5 (1 ref). LFU is 5. Replaced 1. Not LFU.
- Optimal: Future refs: 4, 5, 1... Next uses: 4 (soon), 5 (soon), 1 (far). Optimal replaces 1. Matches.
- Optimal: Future refs: 3, 2. Pages 6, 4, 5 are never used again. Tie-breaking (e.g., FIFO on 'never used') replaces 4. Matches.
- MFU: Counts (accumulated): 1 (3 refs), 5 (2 refs), 6 (1 ref). MFU is 1. Replaced 5. Not MFU.
- Optimal: Future ref: 2. Pages 6, 1, 5 never used. Tie-breaking replaces 5. Matches.
48
Q48MSQ2 marksMediumconsists of all active processes in an operating system. consists of single instances of distinct types of resources in…Think it through. Then check your answer.Question
consists of all active processes in an operating system.
consists of single instances of distinct types of resources in the system.The resource allocation graph has the following assignment and claim edges.Assignment edges: (the assignment edge means resource is assigned to process , and so on for others)Claim edges: (the claim edge means process is waiting for resource , and so on for others)Which of the following statement(s) is/are CORRECT?Correct answer
(C) Aborting P₂ makes the system deadlock free.; (D) Aborting P₁ and P₄ makes the system deadlock free.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To analyze the deadlock, we construct the Wait-for Graph (WFG) where nodes are processes and a directed edge exists if is waiting for a resource held by .Given Edges:- Assignment (Held): holds , holds , holds , holds .
- Claim (Waiting):
- waits for (held by )
- waits for (held by )
- waits for (held by )
- waits for (held by )
- waits for (held by )
Since resources are single instances, a cycle in the WFG is necessary and sufficient for deadlock.1.Cycle 1: (involves )2.Cycle 2: (involves )To make the system deadlock-free, we must break all cycles.Analysis of Options:- (A) Aborting : Removes . Breaks Cycle 1. Cycle 2 () remains. Deadlock persists.
- (B) Aborting : Removes . Breaks Cycle 1. Cycle 2 () remains. Deadlock persists.
- (C) Aborting : Removes . Since is part of both Cycle 1 and Cycle 2, removing it breaks both cycles. The system becomes deadlock-free.
- (D) Aborting and :
- Aborting breaks Cycle 1.
- Aborting breaks Cycle 2.
- Both cycles are broken. The system becomes deadlock-free.
49
Q49MSQ2 marksHardThree floating point numbers , and are stored in three registers RX, RY, and RZ, respectively in IEEE 754 single precision format as given below in hexadecimal:…Think it through. Then check your answer.Question
Three floating point numbers , and are stored in three registers RX, RY, and RZ, respectively in IEEE 754 single precision format as given below in hexadecimal:Which of the following option(s) is/are CORRECT?Correct answer
(A) 4(X + Y) + Z = 0; (B) 2Y - Z = 0; (C) 4X + 3Z = 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to convert the IEEE 754 single precision hexadecimal representations to decimal values.The format is: 1 sign bit (), 8 exponent bits (), and 23 mantissa bits ().
The value is given by .1. Convert
Binary:1100 0001 0001 0000 ... 0000- Sign (): 1 (Negative)
- Exponent ():
10000010= - Mantissa ():
0010000... - Value
Binary:0100 0000 1100 0000 ... 0000- Sign (): 0 (Positive)
- Exponent ():
10000001= - Mantissa ():
1000000... - Value
Binary:0100 0001 0100 0000 ... 0000- Sign (): 0 (Positive)
- Exponent ():
10000010= - Mantissa ():
1000000... - Value
(A) . Correct.
(B) . Correct.
(C) . Correct.
(D) . Incorrect.Thus, options (A), (B), and (C) are correct.50
Q50MSQ2 marksMediumWhich of the following Boolean algebraic equation(s) is/are CORRECT?Think it through. Then check your answer.Question
Which of the following Boolean algebraic equation(s) is/are CORRECT?Correct answer
(B) A B + A C + B C = A B + A C; (C) (A + C) (A + B) = A B + A C; (D) (A + B + D) (C + D) (A + C + D) (A + B + D) = A D + C D
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's evaluate each option individually:Option (A):
LHS:
Grouping terms:
Using the absorption-like identity :
RHS:
Since , Option (A) is INCORRECT.Option (B):
This is the standard Consensus Theorem. It can be proven by expanding the term as :
Thus, Option (B) is CORRECT.Option (C):
LHS:
By applying the Consensus Theorem (as shown in Option B), .
Thus, Option (C) is CORRECT.Option (D):
LHS:
Applying De Morgan's Law ():
Grouping terms:
This matches the RHS. Thus, Option (D) is CORRECT.Final correct options are (B), (C), and (D).51
Q51MSQ2 marksHardConsider two grammars and with the production rules given below: …Think it through. Then check your answer.Question
Consider two grammars and with the production rules given below:where are the terminals.Which of the following option(s) is/are CORRECT?Correct answer
(C) G₁ and G₂ are not LL(1).; (D) G₁ and G₂ are ambiguous.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For a grammar to be , it must be free of left recursion and for any non-terminal , if , then . Also, if , then .Analyzing :
is the standard "dangling else" grammar. It is well-known to be ambiguous because the string "" has two parse trees (the can be associated with the inner or outer ).
Since is ambiguous, it cannot be .Analyzing :
Productions:
Let's check the condition for :
The intersection is .
Since the First sets of the alternatives for overlap, is not .Thus, option (C) is correct.Regarding ambiguity, is definitely ambiguous. While is often used as a structure to resolve the dangling else ambiguity (by forcing the "matched" statement to appear before an ), in this specific formulation, it is considered ambiguous in the context of this question (as per the official key).Therefore, options (C) and (D) are correct.52
Q52MSQ2 marksMediumLet . For , and , let denote the number of occurrences of in . Which one or more of the…Think it through. Then check your answer.Question
Let . For , and , let denote the number of occurrences of in .Which one or more of the following option(s) define(s) regular language(s)?Correct answer
(A) \a^m bⁿ m, n ≥ 0\; (C) \w w ∈ \a, b\^, \ ₐ(w) ≡ 2 ±od 7, and \ _b(w) ≡ 3 ±od 9\
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Option (A): The language corresponds to the regular expression . Since it can be represented by a regular expression, it is a regular language.Option (B): Let and . The intersection consists of strings in that contain only symbols from . For a string to be in , the number of 's must be zero. Thus, , which implies . The resulting language is . This is a well-known context-free language that is not regular (can be proved using the Pumping Lemma).Option (C): The condition can be checked by a DFA with 7 states. The condition can be checked by a DFA with 9 states. The language is the intersection of these two regular languages. Since regular languages are closed under intersection, this language is regular.Option (D): The condition requires comparing the counts of 's and 's, which requires unbounded memory (like a stack). A finite automaton cannot check equality of counts for an arbitrary length string. Thus, this language is not regular.53
Q53MSQ2 marksMediumConsider the database transactions and , and data items and . Which of the schedule(s) is/are conflict serializable? | Transaction | Transaction | |…Think it through. Then check your answer.Question
Consider the database transactions and , and data items and . Which of the schedule(s) is/are conflict serializable?Transaction Transaction Correct answer
(B) W₂(X), R₁(X), W₂(Y), W₁(Y), R₁(X), COMMIT(T₂), W₁(X), COMMIT(T₁)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A schedule is conflict serializable if its precedence graph is acyclic. Let's analyze the conflicts for each schedule.Transactions:
Conflicts:- On : , , ,
- On : ,
54
Q54MSQ2 marksMediumConsider the following relational schema: Students (rollno: integer, name: string, age: integer, cgpa: real) Courses (courseno: integer, cname: string, credits:…Think it through. Then check your answer.Question
Consider the following relational schema:Students (rollno: integer, name: string, age: integer, cgpa: real)Courses (courseno: integer, cname: string, credits: integer)Enrolled (rollno: integer, courseno: integer, grade: string)Which of the following options is/are correct SQL query/queries to retrieve the names of the students enrolled in course number (i.e., courseno) 1470?Correct answer
(A) [code]; (C) [code]; (D) [code]
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The goal is to find the names of students enrolled in course 1470.1.Option (A) uses a correlated subquery withEXISTS. It selects a student if there exists a record in theEnrolledtable with the samerollnoandcourseno = 1470. This is a standard and correct SQL approach.2.Option (B) usesSIZEOF, which is not a standard SQL operator/function. The correct function to count rows isCOUNT. Therefore, this option is syntactically incorrect.3.Option (C) uses a subquery that counts the number of matching enrollment records. IfCOUNT(*)is greater than 0, it means the student is enrolled. This is logically equivalent toEXISTSand is a correct SQL query.4.Option (D) usesTherefore, options (A), (C), and (D) are correct.NATURAL JOIN. A natural join automatically joins tables based on columns with the same name and data type. In the given schema,StudentsandEnrolledshare only therollnoattribute. Thus,NATURAL JOINperforms an inner join onrollno, correctly linking students to their enrollments. TheWHEREclause filters for course 1470. This is a correct query.55
Q55NAT2 marksMediumGiven a computing system with two levels of cache (L1 and L2) and a main memory. The first level (L1) cache access time is 1 nanosecond (ns) and the “hit rate” for L1 cache is 90%…Think it through. Then check your answer.Question
Given a computing system with two levels of cache (L1 and L2) and a main memory. The first level (L1) cache access time is 1 nanosecond (ns) and the “hit rate” for L1 cache is 90% while the processor is accessing the data from L1 cache. Whereas, for the second level (L2) cache, the “hit rate” is 80% and the “miss penalty” for transferring data from L2 cache to L1 cache is 10 ns. The “miss penalty” for the data to be transferred from main memory to L2 cache is 100 ns.Then the average memory access time in this system in nanoseconds is ___________. (rounded off to one decimal place)Correct answer
4 to 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The average memory access time () for a multi-level cache system with hierarchical access is calculated as follows:Where the is the time taken to resolve a request when it is not found in L1. This involves checking L2 and, if it misses there, fetching from main memory:Given the values from the question:- ns
- (given as miss penalty from L2 to L1) ns
- (given as miss penalty from main memory to L2) ns
56
Q56NAT2 marksMediumA 5-stage instruction pipeline has stage delays of 180, 250, 150, 170, and 250, respectively, in nanoseconds. The delay of an inter-stage latch is 10 nanoseconds. Assume that…Think it through. Then check your answer.Question
A 5-stage instruction pipeline has stage delays of 180, 250, 150, 170, and 250, respectively, in nanoseconds. The delay of an inter-stage latch is 10 nanoseconds. Assume that there are no pipeline stalls due to branches and other hazards. The time taken to process 1000 instructions in microseconds is __________ . (rounded off to two decimal places)Correct answer
260.2 to 261.2
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the total time taken to process the instructions in a pipeline, we first determine the clock cycle time ().1.Calculate Clock Cycle Time ():The clock cycle time is determined by the maximum stage delay plus the inter-stage latch delay.2.Calculate Total Execution Time ():For a -stage pipeline executing instructions, the total number of clock cycles required is .
Given:- Number of stages () = 5
- Number of instructions () = 1000
3.Convert to Microseconds ():Since :Rounding to two decimal places, the time taken is .57
Q57NAT2 marksMediumIn a B-tree where each node can hold at most four key values, a root to leaf path consists of the following nodes:…Think it through. Then check your answer.Question
In a B-tree where each node can hold at most four key values, a root to leaf path consists of the following nodes:The *-marked keys signify that these are data entries in a leaf.Assume that a pointer between keys and points to a subtree containing keys in , and that when a leaf is created, the smallest key in it is copied up into its parent.A record with key value 23 is inserted into the B-tree.The smallest key value in the parent of the leaf that contains 25* is ___________. (Answer in integer)Correct answer
33 to 33
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Analyze the B-tree properties:- Max keys per node = 4. This implies the order of the tree (max children) is 5. The minimum number of keys in a node is .
- Path: Root Internal Leaf .
- Node : Keys .
- Node : Keys . Since is on the path to (keys 20-26), must be the child pointed to by the pointer between 19 and 33 in node .
- Node : Keys .
- 23 falls into the range of leaf .
- Insert 23 into : Sorted keys become .
- Number of keys is 5, which exceeds the maximum of 4. Leaf must split.
- We split the 5 keys into two nodes. Valid splits respecting the minimum key count (2) are:
- Option 1: Left , Right . Smallest in Right is 23.
- Option 2: Left , Right . Smallest in Right is 25.
- In both cases, the key 25* ends up in the Right Leaf ().
- The smallest key of the new right leaf (either 23 or 25) is copied up to the parent .
- Original keys in : .
- Insert the copied-up key (let's call it , where or ).
- New key set for : (sorted).
- Number of keys is 5, which exceeds the maximum of 4. Node must split.
- Keys: .
- Median key is (since 7, 19 are smaller and 33, 44 are larger).
- Split:
- Left Internal Node (): .
- Right Internal Node (): .
- Key is pushed up to parent .
- The pointers are redistributed. The new Right Leaf (containing 25*) contains keys . The first pointer of covers the range . Thus, becomes the first child of .
- The leaf containing 25* is .
- The parent of is the new right internal node .
- The keys in are .
- The smallest key value in this parent node is 33.
58
Q58NAT2 marksMediumA computer system supports a logical address space of bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical address is divided into a…Think it through. Then check your answer.Question
A computer system supports a logical address space of bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical address is divided into a -bit index to the outer page table, an offset within the page of the inner page table, and an offset within the desired page. Each entry of the inner page table uses eight bytes. All the pages in the system have the same size.The value of is ___________. (Answer in integer)Correct answer
11 to 11
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Logical Address Space: The logical address space is bytes, which means the logical address is 32 bits long.2.Page Size: The page size is 4096 bytes, which is bytes. This implies that the page offset (offset within the desired page) is 12 bits.3.Total bits for Page Table Indexing: The remaining bits for indexing the two levels of page tables are bits.4.Inner Page Table Constraints: The problem states that all pages in the system have the same size (4096 bytes). In a standard hierarchical paging system, an inner page table is designed to fit exactly within one page.- Size of one page = bytes.
- Size of each inner page table entry = 8 bytes = bytes.
- Number of entries in the inner page table = .
- Therefore, the number of bits required to index the inner page table (referred to in the question as the 'offset within the page of the inner page table') is bits.
59
Q59NAT2 marksMediumConsider the following algorithmsomeAlgothat takes an undirected graph as input.someAlgo(G)1. Let be any vertex in . Run BFS on starting at . Let be…Think it through. Then check your answer.Question
Consider the following algorithmsomeAlgothat takes an undirected graph as input.someAlgo(G)1.Let be any vertex in . Run BFS on starting at . Let be a vertex in at maximum distance from as given by the BFS.2.Run BFS on again with as the starting vertex. Let be the vertex at maximum distance from as given by the BFS.3.Output the distance between and in .The output ofsomeAlgo(T)for the tree shown in the given figure is ___________. (Answer in integer)
Correct answer
6 to 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The algorithmsomeAlgo(G)is a standard two-pass Breadth-First Search (BFS) algorithm used to find the diameter of a tree.1.Step 1: Starting from an arbitrary node , the first BFS finds a node that is at the maximum distance from . In a tree, this node is guaranteed to be one of the endpoints of a longest path (diameter).2.Step 2: The second BFS starts from node and finds the node that is farthest from it. The distance between and is the diameter of the tree.3.Analysis of the given tree :- Let's identify the central node (the node with degree 4). Let's call it .
- Top branch: Path from to the top-most leaf is . This path has 3 edges.
- Bottom branch: Path from to the bottom-most leaf is . This path has 3 edges.
- Left branch: Path from to any of its 3 leaves is . This path has 2 edges.
- Right branch: Path from to any of its 2 leaves is . This path has 2 edges.
5.Diameter = Distance() + Distance() = .60
Q60NAT2 marksHardLet . For , let be the product of symbols in modulo 7. We take , where is the null string. For…Think it through. Then check your answer.Question
Let . For , let be the product of symbols in modulo 7. We take , where is the null string.For example, .Define .The number of states in a minimum state DFA for is ___________. (Answer in integer)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 states in the minimum state DFA for the language , we use the Myhill-Nerode theorem, which states that the number of states in the minimal DFA is equal to the number of equivalence classes of the relation .1.Define the Language: , where .2.Identify Reachable Residues: The state of the DFA must track the current product modulo 7. The possible non-zero residues modulo 7 are .3.Check Reachability: Starting from the initial product (for ), we can reach any residue if the set generates the multiplicative group .- The powers of modulo 7 are: , , , , , .
- Since is a primitive root modulo 7 and , all 6 non-zero residues are reachable.
5.Equivalence Classes: Two strings and are equivalent () if for all , .- .
- Because is a group, this condition is equivalent to .
- Thus, .
61
Q61NAT2 marksMediumAn application executes number of instructions in seconds. There are four types of instructions, the details of which are given in the table. The duration…Think it through. Then check your answer.Question
An application executes number of instructions in seconds. There are four types of instructions, the details of which are given in the table. The duration of a clock cycle in nanoseconds is _________. (rounded off to one decimal place)Instruction type Clock cycles required per instruction (CPI) Number of instructions executed Branch 2 Load 5 Store 4 Arithmetic 3 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 find the duration of a clock cycle, we first calculate the total number of clock cycles required to execute all the instructions.Step 1: Calculate the total clock cycles ().
cycles.Step 2: Relate total cycles and execution time to clock cycle duration ().
Step 3: Convert the duration to nanoseconds.
Since ,
.The question asks for the answer rounded off to one decimal place, which is .62
Q62NAT2 marksMediumConsider the following C program: [code] The output of the above program is ___________.Think it through. Then check your answer.Question
Consider the following C program:The output of the above program is ___________.#include <stdio.h> int main() { int a; int arr[5] = {30, 50, 10}; int *ptr; ptr = &arr[0] + 1; a = *ptr; (*ptr)++; ptr++; printf("%d", a + (*ptr) + arr[1]); return 0; }Correct answer
111 to 111
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's trace the execution of the C program step by step:1.Initialization:int arr[5] = {30, 50, 10};
The arrayarris initialized. The first three elements are specified, and the remaining are zero-initialized (standard C behavior).
arr[0] = 30
arr[1] = 50
arr[2] = 10
arr[3] = 0
arr[4] = 02.Pointer Assignment:ptr = &arr[0] + 1;
&arr[0]is the address of the first element. Adding 1 moves the pointer to the next integer in the array.
So,ptrnow points toarr[1].3.Value Assignment toa:a = *ptr;
Dereferencingptrgives the value ofarr[1], which is 50.
So,a = 50.4.Incrementing the Value Pointed to byptr:(*ptr)++;
This increments the value at the memory locationptris pointing to (arr[1]).
arr[1]changes from 50 to 51.
Current state of array:{30, 51, 10, 0, 0}.5.Incrementing the Pointer:ptr++;
The pointerptris incremented to point to the next element.
ptrnow points toarr[2].6.Print Statement:printf("%d", a + (*ptr) + arr[1]);
Let's evaluate the expressiona + (*ptr) + arr[1]:-
a: The value stored inais 50 (from step 3). -
*ptr:ptrpoints toarr[2], so*ptris 10. -
arr[1]: The value ofarr[1]is currently 51 (modified in step 4).
The output is 111.-
63
Q63NAT2 marksEasyConsider the following C program: [code] The output of the given C program is ________. (Answer in integer)Think it through. Then check your answer.Question
Consider the following C program:The output of the given C program is ________. (Answer in integer)#include <stdio.h> int g(int n) { return (n+10); } int f(int n) { return g(n*2); } int main() { int sum, n; sum=0; for (n=1; n<3; n++) sum += g(f(n)); printf ("%d", sum); return 0; }Correct answer
46 to 46
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let's analyze the functions:1.g(n)returns .2.Now analyze thef(n)callsg(n*2), so it returns .mainfunction:sumis initialized to 0.- The loop runs for
n = 1andn = 2(sincen < 3). - Inside the loop,
sum += g(f(n))is executed.
g(f(n)):f(n)returns .g(x)returns .- Therefore,
g(f(n))returns .
- Value added = .
sum= .
- Value added = .
sum= .
nbecomes 3.
The program prints the value ofsum, which is 46.64
Q64NAT2 marksHardA quadratic polynomial over complex numbers is said to be square invariant if . Suppose from the…Think it through. Then check your answer.Question
A quadratic polynomial over complex numbers is said to be square invariant if . Suppose from the set of all square invariant quadratic polynomials we choose one at random.The probability that the roots of the chosen polynomial are equal is __________. (rounded off to one decimal place)Correct answer
0.5 to 0.5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A quadratic polynomial is square invariant if the set of its roots is identical to the set of the squares of its roots . This implies that the squaring operation must be a permutation of the set of roots.There are two possible cases for this permutation:1.Case 1: Identity Permutation (Each root is its own square)
The possible distinct sets of roots are , , and .2.Case 2: Transposition Permutation (Roots are swapped by squaring)and
Substituting into the first equation: .
The solutions for are , where is a cube root of unity.- If , then (already counted in Case 1).
- If , then (already counted in Case 1).
- If , then . The set of roots is .
- If , then (same set as above).
- (roots: )
- (roots: )
- (roots: )
- (roots: )
The polynomials with equal roots are and .
Number of favorable outcomes .Probability .65
Q65NAT2 marksHardThe unit interval is divided at a point chosen uniformly distributed over in into two disjoint subintervals. The expected length of the subinterval…Think it through. Then check your answer.Question
The unit interval is divided at a point chosen uniformly distributed over in into two disjoint subintervals.The expected length of the subinterval that contains is ___________. (rounded off to two decimal places)Correct answer
0.7 to 0.8
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the point where the interval is divided. Since is uniformly distributed over , its probability density function is for .The two subintervals formed are and .The subinterval containing is:- if , with length .
- if , with length .