The PYQ practice room
GATE CS 2026 Set 2
All 65 solved GATE CS 2026 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 · NAT · MSQ
Revision mode
Self-paced
No timer. Focus on understanding.
Explore the questions
General Aptitude (GA)
101
Q1MCQ1 markEasyExpedite, Hasten, Hurry, __________ Fill the blank by choosing a word with a meaning similar to that of the words given above.Think it through. Then check your answer.Question
Expedite, Hasten, Hurry, __________Fill the blank by choosing a word with a meaning similar to that of the words given above.Correct answer
(A) Accelerate
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The words "Expedite", "Hasten", and "Hurry" are synonyms that all mean to speed up a process or move quickly. (A) Accelerate means to increase in speed or cause to happen sooner, which is a synonym.
(B) Retard means to delay or hold back, which is an antonym.
(C) Provide means to make available for use, which is unrelated.
(D) Disable means to limit or impair, which is unrelated.Thus, "Accelerate" is the correct choice.2
Q2MCQ1 markEasyA black square PQRS has been cut into two parts. One part of it is shown in Panel I. Which one of the shapes in Panel II is the other part? [figure]Think it through. Then check your answer.Question
A black square PQRS has been cut into two parts. One part of it is shown in Panel I. Which one of the shapes in Panel II is the other part?
Correct answer
(C) (iii)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem asks to identify the missing piece (the white region) of the square PQRS shown in Panel I.1. Analyze the Black Shape in Panel I:
The black part shown occupies the left vertical strip of the square and has a horizontal extension in the middle connecting to the left strip. This forms a shape resembling a 'T' rotated 90 degrees clockwise (or a block with a central protrusion).2. Analyze the Missing (White) Part:
The missing part is the complement of the black shape within the square. Based on the black shape:- The top-right corner and bottom-right corner are white.
- The vertical strip along the right edge is white.
- The horizontal strips along the top and bottom edges (above and below the central black protrusion) are white.
- These white areas are connected, forming a 'C' shape (or a 'U' shape rotated 90 degrees) facing left. Specifically, it has a vertical spine on the right and two horizontal arms extending left at the top and bottom.
- (i) Has a vertical spine on the left with top and middle arms extending right (resembles an 'F'). This does not match the 'C' shape.
- (ii) Has a vertical spine on the right with top and middle arms extending left (resembles a mirrored 'F'). This does not match the 'C' shape.
- (iii) Has a vertical spine on the left with top and bottom arms extending right. This is a 'C' shape. Although it is rotated 180 degrees relative to the hole in Panel I, it is the only option with the correct topological shape (a spine with top and bottom arms).
- (iv) Has a vertical spine on the right with top and middle arms extending left (resembles a mirrored 'F'). This does not match the 'C' shape.
3
Q3MCQ1 markEasyA day can only be cloudy or sunny. The probability of a day being cloudy is , independent of the condition on other days. What is the probability that in any given four days,…Think it through. Then check your answer.Question
A day can only be cloudy or sunny. The probability of a day being cloudy is , independent of the condition on other days. What is the probability that in any given four days, there will be three cloudy days and one sunny day?Correct answer
(A) 1/4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
This problem can be modeled using the Binomial Distribution formula:Where:- (total number of days)
- (number of cloudy days required)
- (probability of a day being cloudy)
- (probability of a day being sunny)
4
Q4MCQ1 markEasyThe values of Stock and Stock on a particular day are Rs. and Rs. , respectively. An investor invests Rs. in Stock and Rs. in Stock . He sells…Think it through. Then check your answer.Question
The values of Stock and Stock on a particular day are Rs. and Rs. , respectively. An investor invests Rs. in Stock and Rs. in Stock . He sells all the stocks the next day when the value of Stock is Rs. and Stock is Rs. . The profit made by the investor is Rs. ________Correct answer
(A) 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Determine the number of shares purchased:- For Stock : Investment = Rs. , Price = Rs. . Number of shares = shares.
- For Stock : Investment = Rs. , Price = Rs. . Number of shares = share.
- Total Investment = Rs. .
- Value of Stock = .
- Value of Stock = .
- Total Final Value = Rs. .
- Profit = Total Final Value - Total Initial Investment = Rs. .
5
Q5MCQ1 markEasy‘When it is raining, peacocks dance.’ Based only on this sentence, which one of the following options is necessarily true?Think it through. Then check your answer.Question
‘When it is raining, peacocks dance.’Based only on this sentence, which one of the following options is necessarily true?Correct answer
(C) When peacocks are not dancing, it is not raining.
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The given statement is a conditional statement of the form "If , then " (), where:
: It is raining
: Peacocks danceThe statement is: .Let's analyze the options:
(A) "Peacocks dance only when it is raining" implies that if peacocks are dancing, it must be raining (). This is the converse, which is not necessarily true.
(B) "When peacocks dance, it is raining" is also . This is the converse, not necessarily true.
(C) "When peacocks are not dancing, it is not raining" translates to "If not , then not " (). This is the contrapositive of the original statement. In logic, a conditional statement is always logically equivalent to its contrapositive. Therefore, this must be true.
(D) "When it is not raining, peacocks do not dance" translates to "If not , then not " (). This is the inverse, which is not necessarily true.Thus, option (C) is the correct answer.6
Q6MCQ2 marksEasyWater : :: Food : Choose the and combination from the options below to form a meaningful analogy.Think it through. Then check your answer.Question
Water : :: Food : Choose the and combination from the options below to form a meaningful analogy.Correct answer
(A) P = Thirst; Q = Hunger
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 'Substance : Need it satisfies'. Water is consumed to quench Thirst, and Food is consumed to satisfy Hunger. Therefore, = Thirst and = Hunger.7
Q7MCQ2 marksEasyTwo tiles are missing in Panel I. Which one of the options in Panel II is the appropriate choice for the missing tiles? [figure]Think it through. Then check your answer.Question
Two tiles are missing in Panel I. Which one of the options in Panel II is the appropriate choice for the missing tiles?
Correct answer
(A) (i)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem asks to identify the missing tiles in a grid based on a pattern.Analysis of the number of dots in each tile:- Row 1:
- Tile (1,1): 2 dots
- Tile (1,2): 3 dots
- Tile (1,3): 4 dots
- Pattern: The number of dots increases by 1 from left to right ().
- Row 2:
- Tile (2,1): 3 dots
- Tile (2,2): 4 dots
- Tile (2,3): Missing
- Following the pattern (increase by 1), the missing tile should have dots.
- Row 3:
- Tile (3,1): 4 dots
- Tile (3,2): 5 dots
- Tile (3,3): Missing
- Following the pattern (increase by 1), the missing tile should have dots.
The missing vertical block consists of two tiles:- Top tile: 5 dots
- Bottom tile: 6 dots
- (i): Top has 5 dots, Bottom has 6 dots. (Matches)
- (ii): Top has 5 dots, Bottom has 5 dots. (Incorrect)
- (iii): Top has 6 dots, Bottom has 6 dots. (Incorrect)
- (iv): Top has 6 dots, Bottom has 5 dots. (Incorrect)
8
Q8MCQ2 marksMediumFigures (i) and (ii) represent intercity highway systems. The black dots represent cities and the line segments between them represent intercity highways. A salesperson needs to…Think it through. Then check your answer.Question
Figures (i) and (ii) represent intercity highway systems. The black dots represent cities and the line segments between them represent intercity highways.
A salesperson needs to make a trip. She needs to start from a city, visit each of the remaining cities exactly once, and finally return to the same city from which she started.
Which one of the following options is then true?
Correct answer
(A) Such a trip is possible for (i), but not for (ii).
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem asks for the existence of a Hamiltonian cycle in the given graphs. A Hamiltonian cycle is a closed path that visits every vertex of the graph exactly once and returns to the starting vertex.1.Graph (i): This is a grid graph. A grid graph contains a Hamiltonian cycle if and only if the total number of vertices is even and . Since is even, a Hamiltonian cycle exists for graph (i).2.Graph (ii): In this graph, the top-left vertex has a degree of 1 (it is connected only to the top-right vertex). For a Hamiltonian cycle to exist, every vertex must have a degree of at least 2, as the cycle must enter and leave each vertex through different edges. Because there is a vertex with degree 1, a Hamiltonian cycle cannot exist for graph (ii).Thus, the trip is possible for graph (i) but not for graph (ii). The correct option is (A).9
Q9MCQ2 marksEasyThe figure in Panel I below is a grid of cells with four rows and four columns. The numbers on the top and on the left represent the number of cells that are to be shaded in that…Think it through. Then check your answer.Question
The figure in Panel I below is a grid of cells with four rows and four columns. The numbers on the top and on the left represent the number of cells that are to be shaded in that column and row, respectively. Which one of the options shown in Panel II below represents the grid shaded correctly?
Correct answer
(B) (ii)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The problem asks to identify the grid that satisfies the given row and column shading counts.Constraints:- Row counts (from top to bottom): 3, 1, 2, 2
- Column counts (from left to right): 2, 2, 2, 2
- Grid (i):
- Rows: 3, 1, 2, 2 (Correct)
- Columns: 3, 2, 2, 1 (Incorrect; Col 1 has 3, Col 4 has 1)
- Grid (ii):
- Rows: 3, 1, 2, 2 (Correct)
- Columns: 3, 2, 2, 1 (Incorrect; Col 1 has 3, Col 4 has 1)
- Grid (iii):
- Rows: 3, 1, 2, 2 (Correct)
- Columns: 2, 2, 2, 2 (Correct)
- Grid (iv):
- Rows: 3, 1, 1, 2 (Incorrect; Row 3 has 1)
10
Q10MCQ2 marksEasyAn unbiased six-faced dice whose faces are marked with numbers 1, 2, 3, 4, 5, and 6 is rolled twice in succession and the number on the top face is recorded each time. The…Think it through. Then check your answer.Question
An unbiased six-faced dice whose faces are marked with numbers 1, 2, 3, 4, 5, and 6 is rolled twice in succession and the number on the top face is recorded each time. The probability that the sum of the two recorded numbers is a prime number is ________Correct answer
(C) (15)/(36)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Total number of outcomes when rolling two dice = .The possible sums range from to . The prime numbers in this range are 2, 3, 5, 7, 11.Let's list the favorable outcomes for each prime sum:- Sum = 2: (1, 1) 1 outcome
- Sum = 3: (1, 2), (2, 1) 2 outcomes
- Sum = 5: (1, 4), (2, 3), (3, 2), (4, 1) 4 outcomes
- Sum = 7: (1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1) 6 outcomes
- Sum = 11: (5, 6), (6, 5) 2 outcomes
Computer Science & Information Technology (CS2)
5511
Q11MCQ1 markMediumFor two different persons and , the predicate denotes that knows . Consider the following statement. *There is a person who does not know anyone else, but…Think it through. Then check your answer.Question
For two different persons and , the predicate denotes that knows .
Consider the following statement.There is a person who does not know anyone else, but that person is known by everyone else.Which one of the following expressions represents the above statement?Correct answer
(A) (∃ y)(∀ x) ((x ≠ y) arrow (M(x, y) ∧ ¬ M(y, x)))
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let the person described be .1."There is a person": This implies existence, so we use the existential quantifier .2."who does not know anyone else": This means for all other persons (where ), does not know . This is represented as .3."but that person is known by everyone else": This means for all other persons (where ), knows . This is represented as .Combining these conditions:
This matches option (A).12
Q12MCQ1 markEasyThe set T represents various traversals over binary tree. The set S represents the order of visiting nodes during a traversal. | | T | | S | |---|---|---|---| | I:…Think it through. Then check your answer.Question
The set T represents various traversals over binary tree. The set S represents the order of visiting nodes during a traversal.Which one of the following is the correct match from T to S ?T S I: Inorder L: left subtree, node, right subtree II: Preorder M: node, left subtree, right subtree III: Postorder N: left subtree, right subtree, node Correct answer
(A) I – L, II – M, III – N
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The standard definitions for binary tree traversals are:1.Inorder (I): Visit Left subtree, then Node (Root), then Right subtree. This matches L.2.Preorder (II): Visit Node (Root), then Left subtree, then Right subtree. This matches M.3.Postorder (III): Visit Left subtree, then Right subtree, then Node (Root). This matches N.Therefore, the correct matching is:
I L
II M
III N13
Q13MCQ1 markEasyWhich one of the following statements is equivalent to the following assertion? Turing machine decides the languageThink it through. Then check your answer.Question
Which one of the following statements is equivalent to the following assertion?
Turing machine decides the languageCorrect answer
(D) Turing machine M accepts all input strings in L and rejects all input strings in \0,1\^ - L
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A Turing machine is said to decide a language if and only if:1.For every string , halts in the accept state.2.For every string (i.e., ), halts in the reject state.This means must halt on all inputs, accepting those in and rejecting those not in .- Option (A) only states that halts, but does not specify that it accepts exactly .
- Option (B) only states that accepts strings in , which is the definition of recognizing , but allows looping on strings not in .
- Option (C) only specifies behavior for strings not in .
- Option (D) correctly combines both conditions: accepting strings in and rejecting strings not in .
14
Q14MCQ1 markEasyThe probability density function of a random variable which takes real values is…Think it through. Then check your answer.Question
The probability density function of a random variable which takes real values isWhich one of the following statements is correct about the random variable ?Correct answer
(B) X is a normal random variable
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The probability density function (PDF) of a normal distribution is given by:Comparing this with the given PDF:We can identify the parameters by inspection:1. (from the coefficient )2. (since the numerator in the exponent is , which is )3. (which is consistent with the coefficient)Since the given function matches the standard form of a normal distribution PDF, is a normal random variable.15
Q15MCQ1 markEasyIn the context of DBMS, consider the two sets T and S given below. | T | S | |---|---| | I: Logical schema | L: Views | | II: Physical schema | M: File organization and…Think it through. Then check your answer.Question
In the context of DBMS, consider the two sets T and S given below.Which one of the following is the correct match from T to S ?T S I: Logical schema L: Views II: Physical schema M: File organization and indexes III: External schema N: Relations Correct answer
(C) I – N, II – M, III – L
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In the three-schema architecture of a DBMS:1.Logical Schema (Conceptual Level): Describes the logical structure of the entire database, including entities, attributes, and relationships. In a relational DBMS, this is represented by Relations (tables). Thus, I matches N.2.Physical Schema (Internal Level): Describes the physical storage structures and access paths. This includes details like File organization and indexes. Thus, II matches M.3.External Schema (View Level): Describes the part of the database that is visible to specific user groups. This level consists of various Views. Thus, III matches L.Therefore, the correct matching is I – N, II – M, III – L.16
Q16MCQ1 markEasyWhich one of the following options is not a property of Boolean Algebra? Note: is OR operation, is AND operation, and is NOT operationThink it through. Then check your answer.Question
Which one of the following options is not a property of Boolean Algebra?Note: is OR operation, is AND operation, and is NOT operationCorrect answer
(B) a. a' = 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In Boolean Algebra:1.Commutative Law: and . Thus, options (A) and (D) are valid properties.2.Complement Law:- (ORing a variable with its complement yields 1). Thus, option (C) is a valid property.
- (ANDing a variable with its complement yields 0).
17
Q17MCQ1 markEasyIn C runtime environment, which one of the following is stored in heap?Think it through. Then check your answer.Question
In C runtime environment, which one of the following is stored in heap?Correct answer
(C) A dynamically allocated array of integers created using malloc() function call
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In the C memory layout, memory is typically divided into several segments:1.Stack Segment: Stores local variables (automatic variables), function parameters, and the return address of a function. When a function is called, a new stack frame is created; when it returns, the frame is destroyed.2.Heap Segment: Used for dynamic memory allocation. Memory is allocated at runtime using functions likemalloc(),calloc(), orrealloc()and must be manually managed (freed) by the programmer.3.Data Segment: Stores global and static variables. It is further divided into initialized data and uninitialized data (BSS).4.Code (Text) Segment: Stores the executable instructions of the program.Analysis of Options:- (A) A static variable is stored in the Data segment.
- (B) An array declared inside a function (local variable) is stored on the Stack.
- (C) A dynamically allocated array created using
malloc()is stored on the Heap. This is the correct answer. - (D) The return address of a function is stored on the Stack as part of the activation record.
18
Q18MCQ1 markMediumConsider the following two statements about interrupt handling mechanisms in a CPU. S1: In non-vectored interrupt mechanism, it usually takes more time to start the Interrupt…Think it through. Then check your answer.Question
Consider the following two statements about interrupt handling mechanisms in a CPU.S1: In non-vectored interrupt mechanism, it usually takes more time to start the Interrupt Service Routine (ISR) when compared to that in a vectored interrupt mechanism.S2: In daisy-chain interrupt mechanism, the CPU polls all the input devices individually to determine the source of the interrupt.Which one of the following options is correct with respect to S1 and S2 ?Correct answer
(C) S1 is true and S2 is false
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Statement S1 is TRUE. In a non-vectored interrupt mechanism, the CPU jumps to a fixed memory location (the general ISR) upon receiving an interrupt. This ISR must then poll the devices to determine which one caused the interrupt, which consumes time. In contrast, a vectored interrupt mechanism provides the address of the specific ISR directly, allowing the CPU to jump immediately to the correct handler, which is faster.Statement S2 is FALSE. Daisy-chaining is a hardware mechanism for priority resolution and device identification. The interrupt acknowledge signal propagates through the devices in series. The requesting device closest to the CPU intercepts the signal and places its vector on the bus. The CPU does not poll the devices individually; the hardware propagation handles the selection.19
Q19MCQ1 markEasyConsider the following three ANSI-C programs, P1, P2, and P3. P1 [code] P2 [code] P3 [code] Which one of the following statements is true?Think it through. Then check your answer.Question
Consider the following three ANSI-C programs, P1, P2, and P3.P1P2#include <stdio.h> int a=5; int main(){ int a=7; return(0); }P3#include <stdio.h> int main(){ int a=5; int a=7; return(0); }Which one of the following statements is true?#include <stdio.h> int main(){ int a=5; float a=7; return(0); }Correct answer
(A) Only P1 will compile without any error
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
P1: This program declares a global variableint a = 5;and a local variableint a = 7;insidemain. In C, a local variable can shadow a global variable with the same name. This is valid and will compile.P2: This program declaresint a = 5;and then attempts to redeclareint a = 7;within the same scope (themainfunction). Redeclaration of a variable in the same scope is not allowed in C. This will cause a compile-time error.P3: This program declaresint a = 5;and then attempts to declarefloat a = 7;in the same scope. Even though the types are different, the identifierais already defined in this scope. This results in a conflicting types/redefinition error. This will cause a compile-time error.Therefore, only P1 compiles without error.20
Q20MCQ1 markEasyConsider concurrent execution of two transactions and in a DBMS, both of which access a data object . For these two transactions to not conflict on , which one…Think it through. Then check your answer.Question
Consider concurrent execution of two transactions and in a DBMS, both of which access a data object . For these two transactions to not conflict on , which one of the following statements must be true?Correct answer
(A) Both T₁ and T₂ only read A
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In DBMS, two operations are said to be in conflict if they satisfy the following three conditions:1.They belong to different transactions.2.They access the same data item ( in this case).3.At least one of the operations is a write operation.Possible pairs of operations on the same data item:- Read-Read (R-R): No conflict.
- Read-Write (R-W): Conflict.
- Write-Read (W-R): Conflict.
- Write-Write (W-W): Conflict.
21
Q21MCQ1 markMediumConsider a file of size 4 million bytes being transferred between two hosts connected via a path consisting of three consecutive links of bandwidth 2 Mbps, 500 kbps, and 1 Mbps,…Think it through. Then check your answer.Question
Consider a file of size 4 million bytes being transferred between two hosts connected via a path consisting of three consecutive links of bandwidth 2 Mbps, 500 kbps, and 1 Mbps, respectively. All processing delays and propagation delays are negligible. Assume that there is no other background traffic over the path and no other additional overhead to transfer the file.Which one of the following is the total time (in seconds) to transfer the file?Note: ,Correct answer
(B) 64
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- File size = 4 million bytes = bytes
- File size in bits = bits
- Link bandwidths: Mbps, kbps, Mbps
bits per second.Total transfer time
Total time = seconds.Since processing and propagation delays are negligible, the total time is 64 seconds.22
Q22MCQ1 markEasyWhich one of the following protocols may need to broadcast some of its messages?Think it through. Then check your answer.Question
Which one of the following protocols may need to broadcast some of its messages?Correct answer
(C) DHCP
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
DHCP (Dynamic Host Configuration Protocol) uses broadcasting. When a client connects to a network, it broadcasts a DHCPDISCOVER message to find available DHCP servers on the network.- SMTP, FTP, and HTTP use TCP and are unicast protocols.
23
Q23MCQ1 markEasyWhich one of the following CPU scheduling algorithms cannot be preemptive?Think it through. Then check your answer.Question
Which one of the following CPU scheduling algorithms cannot be preemptive?Correct answer
(B) First Come First Serve (FCFS) Scheduling
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
First Come First Serve (FCFS) scheduling is inherently non-preemptive. Once a process is assigned to the CPU, it runs until it completes or performs an I/O operation.- SRTF is the preemptive version of SJF.
- Round Robin is inherently preemptive (based on time quantum).
- Priority Scheduling can be either preemptive or non-preemptive.
24
Q24MCQ1 markEasyConsider the following functions, where is a positive integer. Which one of the following options lists the functions in increasing…Think it through. Then check your answer.Question
Consider the following functions, where is a positive integer.Which one of the following options lists the functions in increasing order of asymptotic growth rate?Note: Assume the base of log to be 2.Correct answer
(A) log(n), n^(1/3), 2^(log(n)), log(n!)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We analyze the asymptotic growth of each function:1.: Logarithmic growth.2.: Polynomial growth (power ). We know that any polylogarithmic function grows slower than any polynomial function with positive power. Thus, .3.: Assuming base 2, . This is linear growth. Since , .4.: Using Stirling's approximation, . This grows faster than linear ().The increasing order is:
This corresponds to Option (A).25
Q25MSQ1 markMediumWhich of the following can be recurrence relation(s) corresponding to an algorithm with time complexity ?Think it through. Then check your answer.Question
Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity ?Correct answer
(A) T(n) = T(n-1) + 1, T(1) = 1; (B) T(n) = 2T((n)/(2)) + 1, T(1) = 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We solve each recurrence relation:(A)
This represents a simple loop or recursion depth of with constant work per step.
.
This is correct.(B)
Using Master Theorem: .
.
Since , Case 1 applies.
.
This is correct.(C)
Using Master Theorem: .
.
Since , Case 2 applies.
.
This is incorrect.(D)
This is the sum of the first integers.
.
This is incorrect.Thus, options (A) and (B) are correct.26
Q26MSQ1 markMediumLet be a binary relation on the set , where if the product of and is square of an integer. Which of the following properties is/are…Think it through. Then check your answer.Question
Let be a binary relation on the set , where if the product of and is square of an integer. Which of the following properties is/are satisfied by ?Correct answer
(A) Reflexive; (B) Symmetric; (C) Transitive
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A binary relation on a set is defined as for some integer .1.Reflexive: For any , , which is a perfect square. Thus, for all . is reflexive.2.Symmetric: If , then . Since multiplication is commutative, , so . is symmetric.3.Transitive: If and , then and . Multiplying gives . Since are positive integers, must be a rational number whose square is an integer, which implies is an integer. Thus is a perfect square. is transitive.4.Antisymmetric: For , so . Also because . However, . Thus is not antisymmetric.27
Q27MSQ1 markEasyFor a real number , let . Which of the following statements is/are true?Think it through. Then check your answer.Question
For a real number , let . Which of the following statements is/are true?Correct answer
(A) The value of I(a) is independent of the value of a; (C) There exists a ∈ (-∞, +∞) such that I(a) is a positive real number
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Evaluate the integral:Since for all :- The value is independent of (Option A is true).
- It is a positive real number for any (Option C is true).
28
Q28MSQ1 markMediumIn a system, numbers are represented using 4-bit two’s complement form. Consider four numbers , , and in the system. Which of the…Think it through. Then check your answer.Question
In a system, numbers are represented using 4-bit two’s complement form. Consider four numbers , , and in the system.
Which of the following operations will result in arithmetic overflow?Correct answer
(B) N2 + N3; (D) N1 + N4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
In 4-bit two's complement representation, the range of representable numbers is from to , i.e., .Let's determine the decimal values of the given numbers:- . The MSB is 1, so it is negative. Magnitude = 2's complement of . Thus, .
- . MSB is 1. Magnitude = 2's complement of . Thus, .
- . MSB is 1. Magnitude = 2's complement of . Thus, .
- . MSB is 1. Magnitude = 2's complement of . Thus, .
(A) . This is within the range . No overflow.
(B) . This is less than , so it cannot be represented. Overflow occurs.
(C) . This is within the range. No overflow.
(D) . This is less than , so it cannot be represented. Overflow occurs.Therefore, operations (B) and (D) result in arithmetic overflow.29
Q29MSQ1 markMediumWhich of the following grammars is/are ambiguous?Think it through. Then check your answer.Question
Which of the following grammars is/are ambiguous?Correct answer
(B) E arrow E + E E E id; (C) S arrow aS Sa ε
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
A grammar is ambiguous if there exists at least one string that can be generated by the grammar with more than one distinct leftmost derivation (or parse tree).(A)
This grammar generates the language . Every string has a unique derivation. For example, is derived as . Unambiguous.(B)
This is a classic ambiguous grammar because it does not define operator precedence or associativity. For the string , we can have two parse trees corresponding to and . Ambiguous.(C)
This grammar generates the language . Consider the string . It can be derived in multiple ways:1.2.Since there are multiple derivations for the same string, it is ambiguous.(D)
This is a right-linear grammar generating . It is deterministic. For any string , there is exactly one derivation: . Unambiguous.Thus, grammars (B) and (C) are ambiguous.30
Q30NAT1 markEasyThe keys 5, 28, 19, 15, 26, 33, 12, 17, 10 are inserted into a hash table using the hash function . The collisions are resolved by chaining. After all the keys…Think it through. Then check your answer.Question
The keys 5, 28, 19, 15, 26, 33, 12, 17, 10 are inserted into a hash table using the hash function . The collisions are resolved by chaining. After all the keys are inserted, the length of the longest chain is __________. (answer in integer)Correct answer
3 to 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We calculate the hash value for each key using :- Index 1: {28, 19, 10} (Length 3)
- Index 3: {12} (Length 1)
- Index 5: {5} (Length 1)
- Index 6: {15, 33} (Length 2)
- Index 8: {26, 17} (Length 2)
31
Q31NAT1 markMediumConsider the system of linear equations given below. Suppose the values of and are chosen such that the system of linear equations produce…Think it through. Then check your answer.Question
Consider the system of linear equations given below.Suppose the values of and are chosen such that the system of linear equations produce multiple solutions. Then the product of and is __________. (answer in integer)Correct answer
24 to 24
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For a system of linear equations to have multiple (infinite) solutions, the lines must be coincident. The condition for the system and to have infinite solutions is:Substituting the given values:From the first part:Case 1: If , then:Product .Case 2: If , then:Product .In both cases, the product of and is 24.32
Q32NAT1 markMediumConsider an array . Suppose the merge sort algorithm is executed on array to sort it in increasing order. The merge sort algorithm will…Think it through. Then check your answer.Question
Consider an array . Suppose the merge sort algorithm is executed on array to sort it in increasing order. The merge sort algorithm will carry out a total of 7 merge operations.A merge operation on sorted left array and sorted right array is said to be void if the output of the merge operation is the elements of array followed by the elements of array .The number of void merge operations among these 7 merge operations 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
We perform Merge Sort on the array .Step 1: Splitting- Level 0:
- Level 1: and
- Level 2: , , ,
- Level 3: , , , , , , ,
A merge is void if all elements of are less than or equal to all elements of (i.e., ), resulting in the concatenation then .1.Merge([10], [7]):- .
- Result: .
- Is it then ? No (). Not void.
- .
- Result: .
- Is it then ? Yes (). Void (1).
- .
- Result: .
- Is it then ? No (). Not void.
- .
- Result: .
- Is it then ? Yes (). Void (2).
- .
- Result: .
- Is it then ? No (). Not void.
- .
- Result: .
- Is it then ? No (). Not void.
- .
- , .
- Since , the result is simply concatenated with : .
- Is it then ? Yes. Void (3).
33
Q33NAT1 markEasyIf an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can be assigned to network interfaces is __________.Think it through. Then check your answer.Question
If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can be assigned to network interfaces is __________.Correct answer
4094 to 4094
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The subnet mask is given as 255.255.240.0.Converting to binary:- 255 = 11111111
- 255 = 11111111
- 240 = 11110000
- 0 = 00000000
The number of host bits (0s) is .The total number of IP addresses in the subnet is .However, two addresses are reserved:1.The Network Address (all host bits 0).2.The Broadcast Address (all host bits 1).Therefore, the maximum number of IP addresses that can be assigned to network interfaces (hosts) is:34
Q34NAT1 markMediumThe 32-bit IEEE 754 single precision representation of a number is . The number in decimal representation is ________. (rounded off to two decimal places)Think it through. Then check your answer.Question
The 32-bit IEEE 754 single precision representation of a number is .
The number in decimal representation is ________. (rounded off to two decimal places)Correct answer
-60.25
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The hexadecimal representation is .
Converting to binary:Binary string: IEEE 754 Single Precision format (32 bits):- Sign bit (S): 1 bit (MSB)
- Exponent (E): 8 bits
- Mantissa (M): 23 bits
- (Negative number)
35
Q35NAT1 markMediumA lexical analyzer uses the following token definitions - - - - -…Think it through. Then check your answer.Question
A lexical analyzer uses the following token definitionsCorrect answer
13 to 13
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The lexical analyzer typically uses the "longest match" rule to identify tokens. Let's analyze the string token by token:Input String:x1 23mm 78 y 7z zz5 14A 8H AaYcD1.x1: Starts with a letter, followed by a digit. Matches . (Token 1)2.: Whitespace (), ignored.3.23mm:23matches . The next charactermis not a digit, so the number token ends here. (Token 2)mmstarts with a letter, matches . (Token 3)
: Whitespace (), ignored.5.78: Matches . (Token 4)6.: Whitespace (), ignored.7.y: Matches . (Token 5)8.: Whitespace (), ignored.9.7z:7matches . The next characterzis not a digit. (Token 6)zmatches . (Token 7)
: Whitespace (), ignored.11.zz5: Starts with a letter, followed by letter and digit. Matches . (Token 8)12.: Whitespace (), ignored.13.14A:14matches . The next characterAis not a digit. (Token 9)Amatches . (Token 10)
: Whitespace (), ignored.15.8H:8matches . The next characterHis not a digit. (Token 11)Hmatches . (Token 12)
: Whitespace (), ignored.17.Total tokens identified: 13.AaYcD: Matches . (Token 13)36
Q36MCQ2 marksMediumConsider a complete graph with vertices (). Note that multiple spanning trees can be constructed over . Each of these spanning trees is represented as a set…Think it through. Then check your answer.Question
Consider a complete graph with vertices (). Note that multiple spanning trees can be constructed over . Each of these spanning trees is represented as a set of edges. The Jaccard coefficient between any two sets is defined as the ratio of the size of the intersection of the two sets to the size of the union of the two sets.Which one of the following options gives the lowest possible value for the Jaccard coefficient between any two spanning trees of ?Correct answer
(C) 0
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The Jaccard coefficientJ(A, B)between two sets and is defined as:Here, the sets are the sets of edges of spanning trees of . Let and be two spanning trees of . The number of edges in any spanning tree of a graph with vertices is . Thus, .The size of the union is given by .Let be the number of common edges. Then:To find the lowest possible value of the Jaccard coefficient, we need to minimize , the number of common edges.A known result in graph theory states that a complete graph contains edge-disjoint spanning trees. Since , . This means there exist at least two spanning trees and such that they share no edges, i.e., , so .Substituting into the formula:Thus, the lowest possible value is 0.37
Q37MCQ2 marksEasyLet be a weighted directed acyclic graph with edges and vertices. Given and a source vertex in , which one of the following options gives the worst case…Think it through. Then check your answer.Question
Let be a weighted directed acyclic graph with edges and vertices. Given and a source vertex in , which one of the following options gives the worst case time complexity of the fastest algorithm to find the lengths of shortest paths from to all vertices that are reachable from in ?Correct answer
(A) Θ(m + n)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For a general weighted graph, Dijkstra's algorithm (for non-negative weights) takes and Bellman-Ford (for general weights) takes .However, the problem specifies that is a Directed Acyclic Graph (DAG). For DAGs, the shortest path problem from a single source can be solved more efficiently using topological sorting, regardless of whether edge weights are positive or negative.The algorithm is as follows:1.Perform a topological sort of the vertices. This takes time.2.Initialize distances to all vertices as infinity and distance to source as 0.3.Process vertices in topological order. For each vertex , relax all outgoing edges . Since each edge is processed exactly once, this step takes time.The total time complexity is .38
Q38MCQ2 marksMediumConsider an array of integers of size . The indices of run from 1 to . An algorithm is to be designed to check whether satisfies the condition given below.…Think it through. Then check your answer.Question
Consider an array of integers of size . The indices of run from 1 to . An algorithm is to be designed to check whether satisfies the condition given below.
such that .Which one of the following gives the worst case time complexity of the fastest algorithm that can be designed for the problem?Correct answer
(A) Θ(n)
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let for . The condition given is:
such that , we have .This condition is equivalent to saying that the sequence of differences is strictly increasing. That is, .To check if a sequence of size is strictly increasing, we can iterate through the sequence once and check if for all . This requires computing the differences (which takes time) and then verifying the sorted order (which takes time).The total time complexity is . Since we must read the input array of size , we cannot do better than . Thus, the worst-case time complexity of the fastest algorithm is .39
Q39MCQ2 marksMediumConsider a table , where the elements , represent the cost of the optimal solutions of different subproblems of a problem that is being solved using…Think it through. Then check your answer.Question
Consider a table , where the elements , represent the cost of the optimal solutions of different subproblems of a problem that is being solved using a dynamic programming algorithm. The recursive formulation to compute the table entries is as follows:Consider the following two algorithms to compute entries of . Assume that for both the algorithms, for all , has been initialized to 1.Algorithm :Algorithm :For i = 1, 2, ..., n For j = 1, 2, ..., n T[i][j] = 2T[i-1][j] + 3T[i][j-1]Algorithm is said to be correct if and only if it calculates the correct values of , for all , (as per the recursive formulation) at the end of the execution of the algorithm .Which one of the following statements is true?For s = 2, 3, ..., 2n For i = 1, 2, ..., n For j = 1, 2, ..., n If (i + j == s) T[i][j] = 2T[i-1][j] + 3T[i][j-1]Correct answer
(A) Both algorithms B₁ and B₂ are correct
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The recurrence relation is . This means to compute , we need the values of the cell directly above it () and the cell directly to its left ().Algorithm (Row-Major Order):- It iterates from 1 to and from 1 to .
- When computing , the row index has already been fully processed (since the outer loop is on ), so is available.
- The column index in the current row has already been processed (since the inner loop is on ), so is available.
- Thus, respects the dependencies and is correct.
- It iterates on the sum of indices from 2 to .
- When computing where , the dependencies are and .
- The sum of indices for is .
- The sum of indices for is .
- Since the outer loop iterates on in increasing order, all cells with index sum have been computed in the previous iteration of the outer loop.
- Thus, also respects the dependencies and is correct.
40
Q40MCQ2 marksEasyConsider the following 4-variable Boolean function Consider as MSB, as LSB. Which one of the following options…Think it through. Then check your answer.Question
Consider the following 4-variable Boolean functionConsider as MSB, as LSB. Which one of the following options represents the minimal sum of products form for the above function?Note: is OR operation, is AND operation, is NOT operationCorrect answer
(B) B'
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The minterms are given as .
Let's map these to a 4-variable K-map ( as rows, as columns).Row (Indices 0, 1, 2, 3): All are 1s. This corresponds to the term .
Row (Indices 4, 5, 6, 7): All are 0s.
Row (Indices 12, 13, 14, 15): All are 0s.
Row (Indices 8, 9, 10, 11): All are 1s. This corresponds to the term .Combining the two groups of 1s:
Alternatively, looking at the binary representations:
0, 1, 2, 3: 0000, 0001, 0010, 0011 (independent of C, D)
8, 9, 10, 11: 1000, 1001, 1010, 1011 (independent of C, D)In both cases, must be 0. can be 0 or 1. and can be anything.
Thus, the function is .41
Q41MCQ2 marksHardConsider the canonical parsing of the grammar below using terminals and non-terminals with as the start symbol.S → ACB…Think it through. Then check your answer.Question
Consider the canonical parsing of the grammar below using terminals and non-terminals with as the start symbol.S → ACB
Which one of the following options gives the number of shift-reduce conflicts that will occur in the ACTION table?Correct answer
(D) 5
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We construct the item sets. The augmented grammar is .State :
(Reduce )- Shift on 'a' to .
- Reduce applies to all terminals in .
- Conflict 1: Shift/Reduce on input 'a'.
(Reduce )- Shift on 'a' to (loop).
- Reduce .
- Conflict 2: Shift/Reduce on input 'a'.
(Reduce )- Shift on 'c' to .
- Reduce .
- Conflict 3: Shift/Reduce on input 'c'.
(Reduce )- Shift on 'c' to (loop).
- Reduce .
- Conflict 4: Shift/Reduce on input 'c'.
- Shift on 'b' to . No reduce items here.
(Reduce )- Shift on 'b' to (loop).
- Reduce .
- Conflict 5: Shift/Reduce on input 'b'.
42
Q42MCQ2 marksMediumIn the context of schema normalization in relational DBMS, consider a set F of functional dependencies. The set of all functional dependencies implied by F is called the closure…Think it through. Then check your answer.Question
In the context of schema normalization in relational DBMS, consider a set F of functional dependencies. The set of all functional dependencies implied by F is called the closure of F. To compute the closure of F, Armstrong's Axioms can be applied. Consider and as sets of attributes over a relational schema. The three rules of Armstrong's Axioms are described as follows.Reflexivity: If , thenX → Y
Augmentation: IfX → Y, thenXZ → YZfor any
Transitivity: IfX → YandY → Z, thenX → ZThe additional rule of Union is defined as follows.
Union: IfX → YandX → Z, thenX → YZIt can be proved that the additional rule of Union is also implied by the three rules of Armstrong's Axioms. Listed below are four combinations of these three rules. Which one of these combinations is both necessary and sufficient for the proof?Correct answer
(D) Augmentation and Transitivity
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The proof for the Union rule () using Armstrong's Axioms is as follows:1.X → Y(Given)2.X → Z(Given)3.Apply Augmentation to (1) with :(Note: Strictly, Augmentation givesXX → XY, which simplifies toX → XY.XZ → YZ. If we augmentX → Ywith , we getXX → YX, i.e.,X → XY.)4.Apply Augmentation to (2) with :XY → ZY, which isXY → YZ.5.Apply Transitivity to (3) and (4): SinceThus, Augmentation and Transitivity are sufficient and necessary to derive the Union rule from the base axioms.X → XYandXY → YZ, thenX → YZ.43
Q43MCQ2 marksMediumConsider the transmission of data bits 110001011 over a link that uses Cyclic Redundancy Check (CRC) code for error detection. If the generator bit pattern is given to be 1001,…Think it through. Then check your answer.Question
Consider the transmission of data bits 110001011 over a link that uses Cyclic Redundancy Check (CRC) code for error detection. If the generator bit pattern is given to be 1001, which one of the following options shows the remainder bit pattern appended to the data bits before transmission?Correct answer
(D) 100
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
To find the CRC remainder, we perform binary division (modulo-2 arithmetic) of the data bits appended with zeros by the generator polynomial, where is the number of bits in the generator.Data bits (M):
Generator (G): The generator has bits. Therefore, we append zeros to the data bits.
Augmented data (M'): Now, we perform modulo-2 binary division of the augmented data by the generator. We align the generator with the leftmost '1' of the current dividend segment and perform XOR. If the current segment starts with '0', we effectively XOR with '0000' (or just bring down the next bit without XORing with the generator).110001011000 (Augmented Data) ^ 1001 (Generator) ----------- 01010 (Result of 1100 XOR 1001, then bring down next bit '0') ^ 1001 (Align with leftmost '1') ----------- 00110 (Result of 1010 XOR 1001, then bring down next bit '0') ^ 0000 (Current segment 0110 starts with '0', so XOR with 0000) ----------- 01101 (Result of 0110 XOR 0000, then bring down next bit '1') ^ 1001 (Align with leftmost '1') ----------- 01001 (Result of 1101 XOR 1001, then bring down next bit '1') ^ 1001 (Align with leftmost '1') ----------- 00000 (Result of 1001 XOR 1001, then bring down next bit '0') ^ 0000 (Current segment 0000 starts with '0', so XOR with 0000) ----------- 00000 (Result of 0000 XOR 0000, then bring down next bit '0') ^ 0000 (Current segment 0000 starts with '0', so XOR with 0000) ----------- 00000 (Result of 0000 XOR 0000, then bring down next bit '0') ^ 0000 (Current segment 0000 starts with '0', so XOR with 0000) ----------- 000 (Remainder - the last 3 bits, as generator is 4 bits)
The remainder bit pattern is .Therefore, the correct option is C.44
Q44MCQ2 marksMediumConsider a processor that has 16 general purpose registers and it uses 2-byte instruction format for all its instructions. Variable-sized opcodes are permitted. There are three…Think it through. Then check your answer.Question
Consider a processor that has 16 general purpose registers and it uses 2-byte instruction format for all its instructions. Variable-sized opcodes are permitted. There are three different types of instructions; M-type, R-type, and C-type. Each M-type instruction has 2 register operands and a 6-bit immediate operand. Each R-type instruction has 3 register operands. Each C-type instruction has a register operand and a 6-bit offset value. If there are 2 unique M-type opcodes and 7 unique R-type opcodes, which one of the following options gives the maximum number of unique opcodes possible for C-type instructions?Correct answer
(B) 4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Total instruction length = 16 bits.
Number of registers = 16 4 bits per register operand.M-type:- Operands: 2 registers (8 bits) + 6-bit immediate = 14 bits.
- Opcode bits: bits.
- Space consumed: .
- Operands: 3 registers (12 bits).
- Opcode bits: bits.
- Space consumed: .
- Operands: 1 register (4 bits) + 6-bit offset = 10 bits.
- Opcode bits: bits.
- Let be the number of C-type opcodes.
- Space consumed: .
45
Q45MCQ2 marksMediumConsider the control flow graph given below. [figure] Which one of the following options is the set of live variables at the exit point of each basic block?Think it through. Then check your answer.Question
Consider the control flow graph given below.Which one of the following options is the set of live variables at the exit point of each basic block?
Correct answer
(A) B1:{a, b, c, e, f}, B2:{d, e}, B3:{b, c, e, f}, B4:∅
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We perform backward liveness analysis. . .Topology from graph:- Uses: , Defs:
- Uses: , Defs:
- Successors: (Note: Graph shows B2 goes to B4. Does B2 go to B3? No line. Does B1 go to B3? Yes.)
- Uses: , Defs:
- Successor:
- Uses: , Defs:
- Successors:
1.Assume initially.2..3..4.Update .5.Update .6.Update .7.Update . (Stable)Final LiveOut Sets:- B1:
- B2:
- B3:
- B4:
46
Q46MCQ2 marksMediumAn index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise it is called a sparse index. Consider the following two…Think it through. Then check your answer.Question
An index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise it is called a sparse index. Consider the following two statements.S1: A hash index must be a dense index
S2: A tree index can be a sparse indexWhich one of the following options is correct?Correct answer
(A) Both S1 and S2 are true
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Statement S1 is true. A hash index organizes search keys into buckets based on a hash function. To locate a record with a specific search key , the system computes to find the bucket. If the index were sparse (i.e., not containing every search key), there would be no way to locate a record whose key is not in the index, because hashing does not preserve order (unlike tree indices where you can search for the nearest key). Therefore, a hash index must be dense.Statement S2 is true. A tree index can be sparse, specifically when it is a clustering index (primary index) on a file that is sorted by the search key. In this case, the index only needs to store an entry for the first record of each block (or a representative key), rather than for every single record.Thus, both statements are true.47
Q47MSQ2 marksMediumConsider the following two finite automata and . [figure] Which of the following statements is/are true?Think it through. Then check your answer.Question
Consider the following two finite automata and .Which of the following statements is/are true?
Correct answer
(C) L(D₁) ∩ L(D₂) = \ε\; (D) (L(D₁) ∪ L(D₂))^ consists of all strings in \0,1\^ whose length is divisible by 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let us analyze the languages accepted by the two automata and .Analysis of :- States: (start, final), , .
- Transitions:
- ,
- ,
- ,
- Let's assign values to states: , , (modulo 3).
- Reading : , , . So input 0 adds 1 mod 3.
- Reading : , , . So input 1 subtracts 1 mod 3.
- The automaton maintains the value .
- It accepts strings where , i.e., .
- Examples of accepted strings: , , , , , etc.
- States: (start, final), , .
- Transitions:
- ,
- ,
- ,
- Let's trace some strings:
- : (Accepted)
- : (Accepted)
- : (Rejected)
- : (Rejected)
- : (Accepted)
- : (Accepted)
- contains (length 2), but does not. Thus and . Options (A) and (B) are false.
- contains (length 2), but does not ().
- Intersection: requires . accepts strings like . Checking intersection for short strings shows no common non-empty strings (e.g., rejected by ; rejected by ; rejected by ). Thus, it is likely that . Option (C) is true.
- Union Closure: Since contains (length 2) and contains (length 2), the union contains strings of length 2. The Kleene star of the union will therefore contain strings of length 2, 4, etc., which are not divisible by 3. Thus, Option (D) is false.
48
Q48MSQ2 marksMediumLet and let . Which of the following constraints ensure(s) that the language is context-free?Think it through. Then check your answer.Question
Let and let .
Which of the following constraints ensure(s) that the language is context-free?Correct answer
(A) i + k = j +; (C) i = and j = k; (D) i + j = k +
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We analyze each constraint:(A) . This language is Context-Free. It can be generated by the union of two CFLs (one for and one for ). Alternatively, a PDA can push for , pop for (switching to a 'negative' stack symbol if empty), then handle and to balance the count to 0.(B) and . This generates . This involves crossing dependencies ( matches , matches ) and is a classic example of a non-Context-Free language.(C) and . This generates . This involves nested dependencies ( matches , matches ). This is a standard Context-Free language (generated by ).(D) . This requires the total number of 's and 's to equal the total number of 's and 's. Since all appear before , a PDA can simply push a token for every and , and then pop a token for every and . If the stack is empty at the end, the string is accepted. Thus, it is Context-Free.Therefore, options (A), (C), and (D) ensure the language is Context-Free.49
Q49MSQ2 marksHardConsider a binary search tree (BST) with leaf nodes (). Given any node , the key present in the node is denoted as . All the keys present in the given BST…Think it through. Then check your answer.Question
Consider a binary search tree (BST) with leaf nodes (). Given any node , the key present in the node is denoted as . All the keys present in the given BST are distinct. The keys belong to the set of real numbers.For a node , let denote the node that is its inorder successor. If a node does not have an inorder successor, then is . As there are no duplicates, if is not , then .Corresponding to every leaf node that has a non-NULL , a new key with the following property is to be inserted into the BST.Let represent the list of all such new keys to be inserted into the BST.Which of the following statements is/are true?Correct answer
(A) K cannot have any duplicates; (C) After inserting all keys from K, the height of the BST can increase at most by one
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Duplicates in : The keys are chosen from the open intervals . In a BST, the inorder traversal yields a sorted sequence of keys. For any leaf , its successor is the immediate next node in the inorder sequence. Therefore, the intervals for different leaves are disjoint (they represent gaps between adjacent values in the sorted sequence). Since the intervals are disjoint, all selected keys must be distinct. Thus, cannot have duplicates. Statement (A) is true.2.Size of : If the BST consists of a single root node, it is a leaf (). The root is the maximum element, so its successor is NULL. In this case, no key is inserted, and is empty. Thus, does not necessarily have at least one element. Statement (B) is false.3.Height Increase: Each key satisfies . Since is a leaf, it has no right child. In a BST, a value greater than a node but less than its successor must be in the right subtree of that node. Since has no right child, will be inserted as the right child of . This adds exactly one level to the depth of each such leaf . The height of the tree (maximum depth) can therefore increase by at most 1. Statement (C) is true.4.Number of Nodes: We insert at most nodes (one for each leaf with a successor). The total number of nodes in the original tree is . The new total is at most . This is not necessarily double the original number of nodes (e.g., in a skewed tree with nodes and 1 leaf, we add at most 1 node). Statement (D) is false.50
Q50MSQ2 marksMediumConsider a stack and a queue . Both of them are initially empty and have the capacity to store ten elements each. The elements 1, 2, 3, 4, and 5 arrive one by one, in that…Think it through. Then check your answer.Question
Consider a stack and a queue . Both of them are initially empty and have the capacity to store ten elements each. The elements 1, 2, 3, 4, and 5 arrive one by one, in that order. When an element arrives, it is assigned either to (pushed on ) or to (enqueued to ). Once all the five elements are stored, the output is generated in two steps. First, stack S is emptied by popping all elements. Then queue is emptied by dequeueing all elements. The output obtained by following this process is 4 3 1 2 5 .
Given the output, the objective is to predict whether an element was assigned to or .
Which of the following options is/are possible valid assignment(s) of the elements?Note: In the options, the notation denotes that element was assigned to and denotes that element was assigned to .Correct answer
(A) 1S, 2Q, 3S, 4S, 5Q; (B) 1Q, 2Q, 3S, 4S, 5Q
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The input sequence is 1, 2, 3, 4, 5. The output sequence is generated by first popping all elements from stack , then dequeueing all elements from queue . The final output is 4, 3, 1, 2, 5.Let the sequence of elements pushed to be and the sequence of elements enqueued to be .
The output from will be the reverse of (LIFO).
The output from will be (FIFO).The total output is Reverse() concatenated with .
We need to find a split point in the output sequence 4, 3, 1, 2, 5 such that the first part is the reverse of a subsequence of the input (1, 2, 3, 4, 5) and the second part is the remaining subsequence in increasing order.Let's test the options:Option (A):
. Output from = Reverse() = .
. Output from = .
Total Output = . This matches the given output. So, (A) is correct.Option (B):
. Output from = Reverse() = .
. Output from = .
Total Output = . This matches the given output. So, (B) is correct.Option (C):
. Output from = .
. Output from = .
Total Output = . Mismatch.Option (D):
. Output from = .
. Output from = .
Total Output = . Mismatch.Thus, both (A) and (B) are valid assignments.51
Q51MSQ2 marksHardConsider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A and B are two binary semaphores initialized to 1 and 0, respectively. X is a…Think it through. Then check your answer.Question
Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A and B are two binary semaphores initialized to 1 and 0, respectively. X is a shared variable initialized to 0. Each line in the pseudocode is executed atomically.Pseudocode of P1, P2, and P3Wait(A); Print(*); X = X+1; If (X == 2) { Print($); Signal(B); } Signal(A); Wait(B); Print(#); Signal(B);
Assume that any of the three processes can start to execute first and context switching can happen between these processes at any arbitrary time and in any arbitrary order.Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?Correct answer
(A) $; (B) $; (C) $
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The code has two sections. The first section is protected by semaphore A (mutex). The second section is controlled by semaphore B.1.First Section (Wait(A) ... Signal(A)):- Processes enter sequentially.
- 1st process: Prints
*, sets X=1. - 2nd process: Prints
*, sets X=2, entersif, prints$, signals B. - 3rd process: Prints
*, sets X=3. - Because of
Wait(A), the 3rd process cannot print*until the 2nd process releases A. The 2nd process prints$before releasing A. Thus, the output must contain*(from 1st) and*$(from 2nd) before the 3rd*can appear? No, the 3rd*appears after 2nd releases A. But$is printed inside the critical section of the 2nd process. So*and$from the 2nd process are atomic relative to other*s. The sequence of*and$must be*(1st),*$(2nd),*(3rd) in terms of when they are enabled. Specifically,$must appear after the second*and before the 2nd process releases A. - This implies the prefix
**$is mandatory. Option (D)***$is impossible because the 3rd*cannot occur before the 2nd process releases A, and the 2nd process prints$before releasing A.
- This is enabled by
Signal(B)in the 2nd process. - Once B becomes 1, processes can print
#sequentially. - The printing of
#can be interleaved with the 3rd process's execution of the first section (printing the 3rd*), as these are independent once A is released by the 2nd process.
- (A)
**$*###: 2nd proc finishes, 3rd proc enters and prints*, then all print#. Possible. - (B)
**$#*##: 2nd proc finishes, one proc prints#, then 3rd proc prints*, then others print#. Possible. - (C)
**$##*#: 2nd proc finishes, two procs print#, then 3rd proc prints*, then last#. Possible. - (D)
***$###: Impossible as explained above.
52
Q52MSQ2 marksHardConsider a system with a processor and a 4 KB direct mapped cache with block size of 16 bytes. The system has a 16 MB physical memory. Four words P, Q, R, and S are accessed by…Think it through. Then check your answer.Question
Consider a system with a processor and a 4 KB direct mapped cache with block size of 16 bytes. The system has a 16 MB physical memory. Four words P, Q, R, and S are accessed by the processor in the same order 10 times. That is, there are a total of 40 memory references in the sequence P, Q, R, S, P, Q, R, S,…Assume that the cache memory is initially empty. The physical addresses of the words are given below (1 word =1 byte).P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32Which of the following statements is/are true?Note: andCorrect answer
(A) Every access to P results in a cache miss; (B) Every access to R results in a cache hit
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Cache Configuration:- Cache Size = 4 KB = bytes
- Block Size = 16 bytes = bytes
- Number of Lines = lines
- Address Mapping: Block Offset = 4 bits, Line Index = 8 bits, Tag = Remaining bits.
We look at the last 3 hex digits (12 bits) to determine the Set Index (middle 8 bits) and Offset (last 4 bits).1.P: 0x845B32- Last 12 bits: 0xB32 = 1011 0011 0010
- Offset: 0010 (2)
- Index: 1011 0011 = 0xB3
- Tag: 0x845
- Last 12 bits: 0xB26 = 1011 0010 0110
- Offset: 0110 (6)
- Index: 1011 0010 = 0xB2
- Tag: 0x845
- Last 12 bits: 0xB36 = 1011 0011 0110
- Offset: 0110 (6)
- Index: 1011 0011 = 0xB3
- Tag: 0x845
- Last 12 bits: 0xB32 = 1011 0011 0010
- Offset: 0010 (2)
- Index: 1011 0011 = 0xB3
- Tag: 0x846
- Line 0xB2: Accessed only by Q. Tag 0x845.
- 1st access: Miss (Cold). Block loaded.
- Subsequent accesses: Hit.
- Line 0xB3: Accessed by P, R, S in sequence P R S.
- Sequence: P (Tag 845) R (Tag 845) S (Tag 846) P (Tag 845) ...
- Step 1 (P): Tag 845. Cache Empty/Different. Miss. Install Tag 845.
- Step 2 (R): Tag 845. Cache has 845. Hit.
- Step 3 (S): Tag 846. Cache has 845. Miss. Replace with Tag 846.
- Step 4 (P): Tag 845. Cache has 846. Miss. Replace with Tag 845.
- Step 5 (R): Tag 845. Cache has 845. Hit.
- This cycle repeats.
- P is always a Miss (evicted by S).
- R is always a Hit (brought in by P).
- Q is a Miss once, then Hits.
- S is always a Miss (evicted by P).
53
Q53NAT2 marksHardTo keep track of free blocks in a file system, one of the two approaches is generally used – using bitmaps (bit vectors) or using linked lists. Consider that the linked list…Think it through. Then check your answer.Question
To keep track of free blocks in a file system, one of the two approaches is generally used – using bitmaps (bit vectors) or using linked lists. Consider that the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is 16 GB, block size is 2 KB, and block numbers used are 32-bit long. A single pointer of size 4 bytes is used in each block of the list to point to the next block of the list. The number of blocks required to hold the free disk block numbers is ____________. (answer in integer)Note: andCorrect answer
16417 to 16417
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- Disk Size = 16 GB = bytes = bytes
- Block Size = 2 KB = bytes = bytes
- Block Number Size = 32 bits = 4 bytes
- Pointer Size = 4 bytes
54
Q54NAT2 marksHardA system has a Translation Lookaside Buffer (TLB) that has a reach of 1 MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB…Think it through. Then check your answer.Question
A system has a Translation Lookaside Buffer (TLB) that has a reach of 1 MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size 4 KB. The virtual address space is 64 GB and physical address space is 1 GB. If each TLB entry stores a 4-bit process id, page number, frame number, and a 2-bit control field, then the size of the TLB (in bytes) is ___________. (answer in integer)Note:Correct answer
1536 to 1536
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Given:- TLB Reach = 1 MB = bytes
- Page Size = 4 KB = bytes
- Virtual Address Space (VAS) = 64 GB = bytes
- Physical Address Space (PAS) = 1 GB = bytes
TLB Reach is the product of the number of entries and the page size.Step 2: Determine the size of fields in a TLB entry.- Page Number (VPN): Derived from Virtual Address bits minus Page Offset bits.
- Virtual Address bits = bits
- Page Offset bits = bits
- VPN bits = bits
- Frame Number (PFN): Derived from Physical Address bits minus Page Offset bits.
- Physical Address bits = bits
- PFN bits = bits
- Other fields given:
- Process ID = 4 bits
- Control Field = 2 bits
55
Q55NAT2 marksMediumConsider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 8 holes in the memory of sizes 20 KB, 4 KB, 25 KB, 18 KB, 7…Think it through. Then check your answer.Question
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 8 holes in the memory of sizes 20 KB, 4 KB, 25 KB, 18 KB, 7 KB, 9 KB, 15 KB, and 12 KB. Assume that no two holes are adjacent. Two processes P1 of size 16 KB and P2 of size 9 KB arrive in that order, and they are allocated memory using the best-fit technique. After allocating space to P1 and P2, the number of holes of size less than 8 KB is ____________. (answer in integer)Note:Correct answer
3 to 3
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Initial holes (in KB): 20, 4, 25, 18, 7, 9, 15, 12.1.Allocation of P1 (16 KB):The best-fit algorithm searches for the smallest hole that is at least 16 KB. The candidates are 20, 25, and 18. The smallest is 18 KB.
After allocation, the remaining hole size is KB.
Updated holes: 20, 4, 25, 2, 7, 9, 15, 12.2.Allocation of P2 (9 KB):The best-fit algorithm searches for the smallest hole that is at least 9 KB. The candidates are 20, 25, 9, 15, and 12. The smallest is 9 KB.
After allocation, the remaining hole size is KB (the hole is completely filled).
Updated holes: 20, 4, 25, 2, 7, 15, 12.3.Counting holes less than 8 KB:The final list of holes is: 20, 4, 25, 2, 7, 15, 12.
Holes with size KB are: 4 KB, 2 KB, and 7 KB.
The number of such holes is 3.56
Q56NAT2 marksHardConsider a system with 1 MB physical memory and a word length of 1 byte. The system uses a direct mapped cache, with block numbers starting from 0. The word with physical address…Think it through. Then check your answer.Question
Consider a system with 1 MB physical memory and a word length of 1 byte. The system uses a direct mapped cache, with block numbers starting from 0. The word with physical address 0xA2C28 is mapped to the cache block number . The maximum possible size of the cache (in KB) for this configuration is ___________. (answer in integer)Note: andCorrect answer
128 to 128
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Physical memory = 1 MB = bytes. Thus, the physical address is 20 bits.
Word length = 1 byte.
Physical address = 0xA2C28 = .In a direct-mapped cache, the cache block number (Index) is calculated as:Let Block Size = bytes and Number of Cache Blocks = .
Given Index = .We need to find the maximum possible cache size, which is .
Let's test values for :- If , then .
- .
- .
- The maximum value for is 11.
- Cache size = bytes = 128 KB.
57
Q57NAT2 marksMediumA non-pipelined instruction execution unit that operates at 1.6 GHz clock takes an average of 5 clock cycles to complete the execution of an instruction. To improve the…Think it through. Then check your answer.Question
A non-pipelined instruction execution unit that operates at 1.6 GHz clock takes an average of 5 clock cycles to complete the execution of an instruction. To improve the performance, the system was pipelined with a goal of achieving an average throughput of one instruction per clock cycle. However, it could operate only at 1.2 GHz due to pipeline overheads. While executing a program in the pipelined design, 30% of instructions encountered a stall of 2 cycles due to pipeline hazards. The speed-up obtained by the pipelined design over the non-pipelined one for this program is ___________. (rounded off to two decimal places)Note:Correct answer
2.3 to 2.4
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Speedup () is defined as the ratio of the execution time of the non-pipelined system to the execution time of the pipelined system for the same program.Non-pipelined system:- Clock frequency, GHz
- Average cycles per instruction,
- Execution time per instruction, seconds.
- Clock frequency, GHz
- Ideal
- 30% of instructions have a 2-cycle stall. Average
- Execution time per instruction, seconds.
58
Q58NAT2 marksMediumConsider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at 48 KB, the maximum segment size (MSS) is 2 KB, and the slow start…Think it through. Then check your answer.Question
Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at 48 KB, the maximum segment size (MSS) is 2 KB, and the slow start threshold for TCP congestion control is 16 KB. Assume that there are no timeouts or duplicate acknowledgements. The number of rounds of transmission required for the congestion control algorithm of the TCP connection to reach the congestion avoidance phase is ___________. (answer in integer)Note: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 TCP Slow Start algorithm initializes the Congestion Window () to 1 MSS and doubles it after every Round Trip Time (RTT) or round of transmission, provided .Given:- KB
- KB
- Receiver Window () = 48 KB
- Current MSS = 2 KB.
- Data transmitted = 2 KB.
- After ACK, doubles: KB.
- Current KB.
- Data transmitted = 4 KB.
- After ACK, doubles: KB.
- Current KB.
- Data transmitted = 8 KB.
- After ACK, doubles: KB.
- Current KB.
- Since , the behavior depends on implementation (RFC 5681 allows either Slow Start or Congestion Avoidance). In the context of this problem and the answer key, the transmission at the threshold (16 KB) is considered part of the process to fully establish or complete the Slow Start phase logic before strictly entering Congestion Avoidance growth for subsequent rounds.
- Data transmitted = 16 KB.
59
Q59NAT2 marksMediumConsider the digital circuit shown below with two input lines and , two select lines and , and an output line . The blocks and represent active high…Think it through. Then check your answer.Question
Consider the digital circuit shown below with two input lines and , two select lines and , and an output line . The blocks and represent active high 2:4 decoder and 4-to-1 multiplexer, respectively. Out of 16 possible input combinations, the number of combinations that produce is ____________. (answer in integer)Note: One input combination is an instance of .
Correct answer
6 to 6
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
1.Analyze the 2:4 Decoder :The decoder has inputs and . Since it is active high, the outputs are:- (High when )
- (High when )
- (High when )
- (High when )
The select lines are (MSB) and (LSB). The data inputs are:- (constant low)
- (constant high)
Substituting the specific inputs from the circuit:
3.Count combinations where :- Case 1:
Combination: (1 combination)- Case 2:
- Case 3:
Combinations: (4 combinations)- Case 4:
Combination: (1 combination)4.Total number of combinations:Total = .60
Q60NAT2 marksEasyConsider the following ANSI-C program. [code] The output of this program is ____________. (answer in integer) Note: Assume that the program compiles and runs successfully.Think it through. Then check your answer.Question
Consider the following ANSI-C program.The output of this program is ____________. (answer in integer)Note: Assume that the program compiles and runs successfully.#include <stdio.h> int main(){ int *ptr, a, b, c; a=5; b=11; c=20; ptr=&a; *ptr=c; ptr=&c; a=*(&b); c=*ptr-a; printf("%d",c); return(0); }Correct answer
9 to 9
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 program step-by-step:1.Initialization:a = 5b = 11c = 20
ptr = &a;:ptrnow points to the memory location of variablea.*ptr = c;: The value at the address stored inptr(which isa) is updated to the value ofc. Thus,abecomes .ptr = &c;:ptris updated to point to the memory location of variablec.
a = *(&b);:&bis the address ofb, and*(&b)dereferences it to get the value ofb. Thus,abecomes .c = *ptr - a;: Sinceptrpoints toc,*ptris the current value ofc(). Therefore,c = 20 - 11 = 9.
printf("%d", c);prints the final value ofc, which is .
61
Q61NAT2 marksMediumConsider the following ANSI-C function. [code] The maximum possible value that can be returned from this function is ____________. (answer in integer) *Note: Ignore syntax…Think it through. Then check your answer.Question
Consider the following ANSI-C function.The maximum possible value that can be returned from this function isint func(int start, int end){ int length=end+1-start; if((length<1)||(start<0)||(end<0)){ return(0); } if(length%3==0){ return(func(start+1, end)); } else if(length%3==1){ return(1+func(start, end-1)); } else { return(func(start+2, end)); } }
____________. (answer in integer)Note: Ignore syntax errors (if any) in the function.Correct answer
1 to 1
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
Let be the length of the range, calculated as . The function's return value depends on modulo 3:1.If : The function callsfunc(start+1, end), reducing length by 1 (). No value is added.2.If : The function returns1 + func(start, end-1), reducing length by 1 (). 1 is added.3.If : The function callsLet's trace the state transitions of :func(start+2, end), reducing length by 2 (). No value is added.- From , we add 1 and go to .
- From , we add 0 and go to (since ).
- From , we add 0 and go to (since ).
62
Q62NAT2 marksEasyThe determinant of a matrix is 3. The value of the determinant of is ____________. (answer in integer)Think it through. Then check your answer.Question
The determinant of a matrix is 3. The value of the determinant of is
____________. (answer in integer)Correct answer
48 to 48
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
For an matrix and a scalar , the property of determinants states that:Given:- (since is a matrix)
63
Q63NAT2 marksHardSuppose an unbiased coin is tossed 6 times. Each coin toss is independent of all previous coin tosses. Let be the event that among the second, fourth, and sixth coin tosses,…Think it through. Then check your answer.Question
Suppose an unbiased coin is tossed 6 times. Each coin toss is independent of all previous coin tosses. Let be the event that among the second, fourth, and sixth coin tosses, there are at least two heads. Let be the event that among the first, second, third, and fifth coin tosses, there are equal number of heads and tails.The conditional probability is equal to ____________. (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
We need to find .Let the outcomes of the 6 tosses be .- involves tosses . Condition: Equal heads and tails (2H, 2T).
- involves tosses . Condition: At least 2 heads.
Number of ways to arrange 2H and 2T in 4 positions is . The other 2 tosses () can be anything ( ways).
.Calculate :
We split cases based on since it is common to both sets.Case 1:- For (tosses 1, 2, 3, 5): We have H at . We need 1H and 2T in . Ways = .
- For (tosses 2, 4, 6): We have H at . We need at least 1 more H in . Outcomes for are HH, HT, TH, TT. Valid are HH, HT, TH. Ways = 3.
- Total for Case 1: .
- For (tosses 1, 2, 3, 5): We have T at . We need 2H and 1T in . Ways = .
- For (tosses 2, 4, 6): We have T at . We need at least 2 more H in . Only HH is valid. Ways = 1.
- Total for Case 2: .
64
Q64NAT2 marksHardConsider a function defined as follows. For a real number , if the second digit after the decimal point in is one of…Think it through. Then check your answer.Question
Consider a function defined as follows.For a real number , if the second digit after the decimal point in is one of the four digits 2, 3, 6 and 7. Otherwise, is equal to 0.The number of points in at which is discontinuous is __________. (answer in integer)Correct answer
40 to 40
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
The function takes the value 1 if the second decimal digit of is in the set , and 0 otherwise.The second digit changes at values for . Within any interval of the form , the second digit cycles through . Let's analyze the transitions of and the corresponding values of :- : changes from . Discontinuous (e.g., at ).
- : changes from . Continuous.
- : changes from . Discontinuous (e.g., at ).
- : changes from . Discontinuous (e.g., at ).
- : changes from . Continuous.
- : changes from . Discontinuous (e.g., at ).
Since there are 10 such intervals in , the total number of discontinuities is .65
Q65NAT2 marksHardIt is necessary to design a link-layer protocol between two hosts that are directly connected over a lossless link of length 3000 kilometers. Assume that the link bandwidth is…Think it through. Then check your answer.Question
It is necessary to design a link-layer protocol between two hosts that are directly connected over a lossless link of length 3000 kilometers. Assume that the link bandwidth is bits per second and that the propagation delay in the link is 5 nanoseconds per meter. Every transmitted data byte is assigned a unique sequence number.Let be the minimum number of bits needed for the sequence number field in the protocol header such thati. the sequence numbers do not wrap around before 60 seconds, and
ii. the maximum utilization of the link is achieved.The value of is ______. (answer in integer)Correct answer
30 to 30
Turn this into a strength.Explore AI-powered practice and doubt support with Success Tracker.Step-by-step solution
We need to determine the minimum satisfying two conditions.Condition i: No wrap around before 60 seconds
Bandwidth bits/sec.
Since sequence numbers are assigned per byte, the byte rate is:Total bytes transmitted in 60 seconds:The sequence number space must be at least this size:Calculating powers of 2:
(too small)
(sufficient)
So, .Condition ii: Maximum utilization is achieved
For maximum utilization, the window size must cover the Bandwidth-Delay Product (BDP).
Propagation delay .
Round Trip Time .
BDP in bytes:The sequence number space must be larger than the window size (typically or ).
. This requires bits.Conclusion
The constraint from condition (i) () dominates the constraint from condition (ii) ().
Thus, the minimum value is .