Zollege is here for to help you!!
Need Counselling
Simran Zutshi's profile photo

Simran Zutshi

Content Strategist|Tech-innovator|National Hackathon Winner | Updated On - Sep 10, 2025

The GATE 2025 DA question paper is available for download. IIT Roorkee conducted GATE 2025 DA exam on 15th Feb, 2025 from 9:30 AM to 12:30 PM. GATE 2025 DA exam was reported to be moderate to tough.

The general Aptitude section was easy. For a 100 rank, you need to score at least 85 + marks. The weightage of core subjects like - Algorithms, Python , Hashing , Linear Probing, data structures, machine learning was more. Maths was moderate to difficult and the paper is reported to be lengthy and time consuming.

Candidates have to answer 65 questions in GATE 2025 DA Question Paper carrying a total weightage of 100 marks. 10 questions are from the General Aptitude section and 55 questions are from Engineering Mathematics and Core Discipline.

You can download the question paper with solution here:

GATE 2025 DA Shift 1 Question Paper With Answer Key


Question 1:

Courage : Bravery :: Yearning :

Select the most appropriate option to complete the analogy.

  • (A) Longing
  • (B) Yelling
  • (C) Yawning
  • (D) Glaring
Correct Answer: (A) Longing
View Solution

Step 1: Identifying the relationship between "Courage" and "Bravery."


The words "Courage" and "Bravery" are synonyms. They both describe the quality of being willing to face danger, pain, or difficulty. Since these words are closely related in meaning, we need to find a similar relationship between the second pair of words, "Yearning" and one of the given options.

Step 2: Analyzing the word "Yearning."

"Yearning" refers to a strong desire or longing for something. Now, let’s analyze the options:

Option (A) Longing: This is a direct synonym of "Yearning." Both words express a deep, intense desire for something.

Option (B) Yelling: This is unrelated to "Yearning." "Yelling" refers to shouting loudly, which has no connection to the emotional desire conveyed by "Yearning."

Option (C) Yawning: This is also unrelated to "Yearning." "Yawning" refers to the action of opening the mouth wide, usually due to tiredness or boredom, which does not fit the emotional context of "Yearning."

Option (D) Glaring: This means staring angrily, which has no connection to the concept of desire or longing.


Thus, Option (A) Longing is the most appropriate because it maintains the same synonym relationship that exists between "Courage" and "Bravery." Quick Tip: When solving analogies, consider the relationship between the first pair of words, and look for a similar relationship in the second pair. Synonyms or words with similar meanings are often the correct choice.


Question 2:

We _______ tennis in the lawn when it suddenly started to rain.

Select the most appropriate option to complete the above sentence.

  • (A) have been playing
  • (B) had been playing
  • (C) would have been playing
  • (D) could be playing
Correct Answer: (B) had been playing
View Solution

Step 1: Understanding the Context of the Sentence.

The sentence describes an action that was happening in the past and was interrupted by another event. The phrase "when it suddenly started to rain" suggests that the action of playing tennis was ongoing at the time the rain started. This points to the past perfect continuous tense, which is used to describe an action that was happening continuously before another past action interrupted it.

Step 2: Analyzing the Options:


Option (A) "have been playing" is the present perfect continuous tense, which indicates an action that started in the past and continues into the present. Since the sentence is referring to a past event, this is not correct.

Option (B) "had been playing" is the past perfect continuous tense, which correctly describes an action that was happening continuously in the past before another past event (the rain) interrupted it. This is the correct choice.

Option (C) "would have been playing" is a conditional perfect continuous tense, typically used to describe hypothetical situations or actions that would have happened under different conditions. This is not appropriate for the sentence.

Option (D) "could be playing" suggests possibility in the present, which is incorrect because the sentence is referring to a past event.

Therefore, the most appropriate option is (B) had been playing. Quick Tip: Use the past perfect continuous tense ("had been + verb-ing") when describing an action that was happening continuously in the past before another action interrupted it.


Question 3:

A 4 × 4 digital image has pixel intensities (U) as shown in the figure. The number of pixels with \( U \leq 4 \) is:


  • (1) 3
  • (2) 8
  • (3) 11
  • (4) 9
Correct Answer: (C) 11
View Solution

We are asked to find how many pixels have intensities less than or equal to 4.

Let’s go through the matrix and count the number of pixels that satisfy \( U \leq 4 \).


The given matrix of pixel intensities is:






Row 1: 0, 1, 0, 2 (all are \(\leq 4\)) - Count: 4
Row 2: 4, 7, 3, 3 (4, 3, 3 are \(\leq 4\)) - Count: 3
Row 3: 5, 5, 4, 4 (4, 4 are \(\leq 4\)) - Count: 2
Row 4: 6, 7, 3, 2 (3, 2 are \(\leq 4\)) - Count: 2




Total count: \(4 + 3 + 2 + 2 = 11\) Quick Tip: In digital images, when analyzing pixel intensities, always look for the specific threshold conditions (like \( U \leq 4 \)) and count the pixels that satisfy the condition across the entire matrix.


Question 4:

In the given figure, the numbers associated with the rectangle, triangle, and ellipse are 1, 2, and 3, respectively. Which one among the given options is the most appropriate combination of \( P \), \( Q \), and \( R \)?


  • (A) \( P = 6; Q = 5; R = 3 \)
  • (B) \( P = 5; Q = 6; R = 3 \)
  • (C) \( P = 3; Q = 6; R = 6 \)
  • (D) \( P = 5; Q = 3; R = 6 \)
Correct Answer: (A) \( P = 6; Q = 5; R = 3 \)
View Solution



In this problem, we are given a figure involving three geometric shapes: a rectangle, a triangle, and an ellipse. We need to determine the most appropriate values for \( P \), \( Q \), and \( R \) based on the dimensions provided in the figure.

The number \( P \) is associated with the length of the rectangle's side. Since the side of the rectangle is labeled as 6, we can conclude that \( P = 6 \).

The number \( Q \) is associated with the height of the triangle. The height of the triangle is labeled as 5, so \( Q = 5 \).

The number \( R \) is associated with the length of the major axis of the ellipse. The length of the major axis is labeled as 3, so \( R = 3 \).

Thus, the correct values are \( P = 6 \), \( Q = 5 \), and \( R = 3 \). Quick Tip: When solving geometry problems involving multiple shapes, carefully observe the labels and dimensions associated with each shape. Use these details to assign values to the variables based on the geometric properties.


Question 5:

A rectangle has a length \(L\) and a width \(W\), where \(L > W\). If the width, \(W\), is increased by 10%, which one of the following statements is correct for all values of \(L\) and \(W\)?

Select the most appropriate option to complete the above sentence.

  • (A) Perimeter increases by 10%.
  • (B) Length of the diagonals increases by 10%.
  • (C) Area increases by 10%.
  • (D) The rectangle becomes a square.
Correct Answer: (C) Area increases by 10%.
View Solution

Step 1: Understanding the effects of increasing the width of a rectangle by 10%.

The dimensions of the rectangle are \(L\) (length) and \(W\) (width), with \(L > W\). When the width \(W\) is increased by 10%, the new width becomes \(W' = 1.1W\), while the length \(L\) remains the same.

Step 2: Analyzing the impact on each option.


Option (A) Perimeter increases by 10%:
The perimeter of a rectangle is given by the formula:
\[ P = 2(L + W) \]
When the width increases by 10%, the new perimeter becomes:
\[ P' = 2(L + 1.1W) \]
This is not exactly a 10% increase. The increase in perimeter is not proportional to the increase in width. Therefore, this option is incorrect.

Option (B) Length of the diagonals increases by 10%:
The diagonal \(d\) of a rectangle is given by the Pythagorean theorem:
\[ d = \sqrt{L^2 + W^2} \]
When the width increases by 10%, the new diagonal is:
\[ d' = \sqrt{L^2 + (1.1W)^2} \]
This increase is not guaranteed to be exactly 10%. The length of the diagonal increases, but it is not necessarily a 10% increase. Therefore, this option is incorrect.

Option (C) Area increases by 10%:
The area \(A\) of a rectangle is given by:
\[ A = L \times W \]
After increasing the width by 10%, the new area is:
\[ A' = L \times 1.1W = 1.1 \times L \times W \]
This shows that the area increases by 10%, as the new area is 1.1 times the original area. Therefore, this option is correct.

Option (D) The rectangle becomes a square:
A rectangle becomes a square only if the length and width are equal. Since only the width is increased by 10%, the rectangle does not become a square. Therefore, this option is incorrect.

Therefore, the correct answer is Option (C) Area increases by 10%. Quick Tip: When a single dimension of a rectangle (such as width) is increased by a certain percentage, the area of the rectangle will increase by the same percentage, as long as the other dimension remains unchanged.


Question 6:

Column-I has statements made by Shanthala; and, Column-II has responses given by Kanishk.


  • (A) P – 2; Q – 3; R – 1; S – 4
  • (B) P – 3; Q – 4; R – 1; S – 2
  • (C) P – 4; Q – 1; R – 2; S – 3
  • (D) P – 1; Q – 2; R – 4; S – 3
Correct Answer: (B) P – 3; Q – 4; R – 1; S – 2
View Solution

Step 1: Understanding the context of each statement.

We need to match the statements made by Shanthala (Column-I) with the appropriate responses given by Kanishk (Column-II).

P. "This house is in a mess."
The best response would be: "No problem, let me clear it up for you." Kanishk is offering to help with the situation, which matches this statement.

Q. "I am not happy with the marks given to me."
The appropriate response would be: "Don’t worry, I will take it up with your teacher." Kanishk is reassuring Shanthala that their concern about marks will be addressed.

R. "Politics is a subject I avoid talking about."
The correct response here would be: "Alright, I won’t bring it up during our conversations." This indicates that Kanishk will avoid discussing politics.

S. "I don’t know what this word means."
The most appropriate response is: "Well, you can easily look it up." This suggests that Kanishk is offering a straightforward solution to Shanthala’s problem.

Step 2: Identifying the correct match.

From the analysis above, we match the following:


P – 3: "This house is in a mess." → "No problem, let me clear it up for you."

Q – 4: "I am not happy with the marks given to me." → "Don’t worry, I will take it up with your teacher."

R – 1: "Politics is a subject I avoid talking about." → "Alright, I won’t bring it up during our conversations."

S – 2: "I don’t know what this word means." → "Well, you can easily look it up."


Therefore, the correct answer is Option (B) P – 3; Q – 4; R – 1; S – 2. Quick Tip: When matching statements with responses, pay attention to the context and tone of the statement and the most appropriate response that follows. In such cases, reassurance, solutions, and acknowledgment of preferences are key.


Question 7:

Weight of a person can be expressed as a function of their age. The function usually varies from person to person. Suppose this function is identical for two brothers, and it monotonically increases till the age of 50 years and then it monotonically decreases. Let \( a_1 \) and \( a_2 \) (in years) denote the ages of the brothers and \( a_1 < a_2 \).

Which one of the following statements is correct about their age on the day when they attain the same weight?

  • (A) \( a_1 < a_2 < 50 \)
  • (B) \( a_1 < 50 < a_2 \)
  • (C) \( 50 < a_1 < a_2 \)
  • (D) Either \( a_1 = 50 \) or \( a_2 = 50 \)
Correct Answer: (B) \( a_1 < 50 < a_2 \)
View Solution

The weight function is increasing until the age of 50 and then decreases. Given that \( a_1 < a_2 \), this means that the younger brother's age \( a_1 \) is less than 50 and the older brother's age \( a_2 \) is greater than 50. When both brothers reach the same weight, their ages must satisfy the condition where the younger brother is below 50 and the older brother is above 50. Hence, \( a_1 < 50 < a_2 \). Quick Tip: In problems involving monotonic functions, focus on the turning point (in this case, age 50) to determine the behavior of the function for different values of the variables.


Question 8:

A regular dodecagon (12-sided regular polygon) is inscribed in a circle of radius \( r \) cm as shown in the figure. The side of the dodecagon is \( d \) cm. All the triangles (numbered 1 to 12 in the figure) are used to form squares of side \( r \) cm, and each numbered triangle is used only once to form a square.

The number of squares that can be formed and the number of triangles required to form each square, respectively, are:


  • (A) 3; 4
  • (B) 4; 3
  • (C) 3; 3
  • (D) 3; 2
Correct Answer: (A) 3; 4
View Solution

We are given a regular dodecagon inscribed in a circle, and we need to form squares using the triangles formed by connecting the center of the circle to the vertices of the dodecagon. There are 12 triangles in total, each corresponding to a side of the dodecagon. The number of squares that can be formed is 3, and each square requires 4 triangles. Hence, the correct number of squares and the number of triangles required to form each square are 3 and 4, respectively. Quick Tip: In geometry problems involving regular polygons and inscribed shapes, carefully examine the symmetry and properties of the polygon to understand how to derive relationships for constructing new shapes.


Question 9:

If a real variable \(x\) satisfies \(3^{x^2} = 27 \times 9^x\), then the value of \(\frac{2^{x^2}}{(2^x)^2}\) is:

  • (A) \(2^{-1}\)
  • (B) \(2^0\)
  • (C) \(2^3\)
  • (D) \(2^{15}\)
Correct Answer: (C) \(2^3\)
View Solution

Step 1: Solve the given equation \(3^{x^2} = 27 \times 9^x\).


We start with the equation: \[ 3^{x^2} = 27 \times 9^x. \]
We can rewrite \(27\) and \(9\) as powers of 3: \[ 27 = 3^3 \quad and \quad 9 = 3^2. \]
Thus, the equation becomes: \[ 3^{x^2} = 3^3 \times (3^2)^x. \]
Now simplify the right-hand side: \[ 3^{x^2} = 3^3 \times 3^{2x}. \]
Using the property of exponents \(a^m \times a^n = a^{m+n}\), we combine the powers of 3: \[ 3^{x^2} = 3^{3 + 2x}. \]
Since the bases are the same, we can equate the exponents: \[ x^2 = 3 + 2x. \]
Rearranging the equation: \[ x^2 - 2x - 3 = 0. \]
Factoring the quadratic equation: \[ (x - 3)(x + 1) = 0. \]
Thus, \(x = 3\) or \(x = -1\).

Step 2: Evaluate \(\frac{2^{x^2}}{(2^x)^2}\).


We now substitute \(x = 3\) and \(x = -1\) into the expression \(\frac{2^{x^2}}{(2^x)^2}\):

When \(x = 3\):
\[ \frac{2^{3^2}}{(2^3)^2} = \frac{2^9}{2^6} = 2^{9-6} = 2^3. \]
When \(x = -1\):
\[ \frac{2^{(-1)^2}}{(2^{-1})^2} = \frac{2^1}{2^{-2}} = 2^{1 - (-2)} = 2^3. \]

Thus, the value is \(2^3\), which corresponds to Option (C). Quick Tip: When solving equations with exponents, simplify both sides of the equation, equate the exponents, and solve the resulting algebraic equation. Afterward, substitute the values into the given expression.


Question 10:

The number of patients per shift (X) consulting Dr. Gita in her past 100 shifts is shown in the figure. If the amount she earns is \(Rs. 1000(X - 0.2)\), what is the average amount (in Rs.) she has earned per shift in the past 100 shifts?


  • (A) 6,100
  • (B) 6,300
  • (C) 6,000
  • (D) 6,500
Correct Answer: (A) 6,100
View Solution

Step 1: Understanding the problem.

The number of shifts corresponding to different numbers of patients per shift is given in the bar graph. The amount Dr. Gita earns is \(1000(X - 0.2)\), where \(X\) is the number of patients per shift.

The data from the graph is as follows:

For \(X = 5\), the number of shifts is 20.

For \(X = 6\), the number of shifts is 40.

For \(X = 7\), the number of shifts is 30.

For \(X = 8\), the number of shifts is 10.


Step 2: Calculating the total earnings.

For \(X = 5\):
\[ Earnings = 1000 \times (5 - 0.2) \times 20 = 1000 \times 4.8 \times 20 = 96,000. \]
For \(X = 6\):
\[ Earnings = 1000 \times (6 - 0.2) \times 40 = 1000 \times 5.8 \times 40 = 232,000. \]
For \(X = 7\):
\[ Earnings = 1000 \times (7 - 0.2) \times 30 = 1000 \times 6.8 \times 30 = 204,000. \]
For \(X = 8\):
\[ Earnings = 1000 \times (8 - 0.2) \times 10 = 1000 \times 7.8 \times 10 = 78,000. \]

Step 3: Calculating the total earnings and average earnings.

Total earnings for all 100 shifts:
\[ Total Earnings = 96,000 + 232,000 + 204,000 + 78,000 = 610,000. \]
The average earnings per shift: \[ Average Earnings = \frac{610,000}{100} = 6,100. \]

Thus, the average earnings per shift are Rs.6,100, which corresponds to Option (A). Quick Tip: When calculating averages involving frequency distributions, first calculate the total earnings, then divide by the total number of shifts to find the average.


Question 11:

Suppose \( X \) and \( Y \) are random variables. The conditional expectation of \( X \) given \( Y \) is denoted by \( E[X | Y] \). Then \( E[E[X | Y]] \) equals:

  • (A) \( E[X | Y] \)
  • (B) \( \frac{E[X]}{E[Y]} \)
  • (C) \( E[X] \)
  • (D) \( E[Y] \)
Correct Answer: (C) \( E[X] \)
View Solution

The problem asks about \( E[E[X | Y]] \), where \( E[X | Y] \) is the conditional expectation of \( X \) given \( Y \).

By the law of iterated expectations (also known as the tower rule), we have the following relationship: \[ E[E[X | Y]] = E[X]. \]
This rule states that the expectation of the conditional expectation of \( X \) given \( Y \) is equal to the overall expectation of \( X \). This holds because the inner expectation \( E[X | Y] \) is itself a random variable that is a function of \( Y \), and taking the expectation over \( Y \) gives the total expectation of \( X \).

Thus, the correct answer is \( E[X] \), which corresponds to option (C). Quick Tip: The law of iterated expectations (also called the tower rule) is very useful when simplifying problems involving conditional expectations. It tells us that the expectation of the conditional expectation of a random variable equals the expectation of the random variable itself.


Question 12:

The number of additions and multiplications involved in performing Gaussian elimination on any \( n \times n \) upper triangular matrix is of the order:

  • (A) \( O(n) \)
  • (B) \( O(n^2) \)
  • (C) \( O(n^3) \)
  • (D) \( O(n^4) \)
Correct Answer: (B) \( O(n^2) \)
View Solution

Gaussian elimination is a method for solving systems of linear equations. In the context of an \( n \times n \) upper triangular matrix, we perform row operations to eliminate variables. The number of operations required to perform Gaussian elimination depends on the size of the matrix and the number of elements we need to process.

For an upper triangular matrix, the process involves eliminating variables by subtracting multiples of one row from another. The number of operations per row is linear in the size of the matrix. Specifically:

In the first row, we perform \( n-1 \) operations (multiplications and additions).

In the second row, we perform \( n-2 \) operations.

Continuing this pattern, in the last row, we perform 1 operation.

The total number of operations is the sum of the operations for each row: \[ (n-1) + (n-2) + \cdots + 1 = \frac{n(n-1)}{2} = O(n^2). \]
Thus, the number of additions and multiplications involved in Gaussian elimination is of the order \( O(n^2) \). Quick Tip: When analyzing the complexity of algorithms like Gaussian elimination, consider the number of operations performed per row and the total number of rows processed. The complexity is often quadratic for matrix operations.


Question 13:

The sum of the elements in each row of \( A \in \mathbb{R}^{n \times n} \) is 1. If \( B = A^3 - 2A^2 + A \), which one of the following statements is correct (for \( x \in \mathbb{R}^n \))?

  • (A) The equation \( Bx = 0 \) has no solution
  • (B) The equation \( Bx = 0 \) has exactly two solutions
  • (C) The equation \( Bx = 0 \) has infinitely many solutions
  • (D) The equation \( Bx = 0 \) has a unique solution
Correct Answer: (C) The equation \( Bx = 0 \) has infinitely many solutions
View Solution

We are given that the sum of the elements in each row of \( A \) is 1, meaning the vector of all ones, \( \mathbf{1} \), is a right eigenvector of \( A \) corresponding to eigenvalue 1. In other words: \[ A\mathbf{1} = \mathbf{1}. \]
Now, we consider the matrix \( B = A^3 - 2A^2 + A \). We can analyze the effect of applying \( B \) to \( \mathbf{1} \): \[ B\mathbf{1} = (A^3 - 2A^2 + A)\mathbf{1} = A^3\mathbf{1} - 2A^2\mathbf{1} + A\mathbf{1}. \]
Since \( A\mathbf{1} = \mathbf{1} \), we find: \[ A^2\mathbf{1} = A\mathbf{1} = \mathbf{1}, \quad A^3\mathbf{1} = A\mathbf{1} = \mathbf{1}. \]
Thus: \[ B\mathbf{1} = \mathbf{1} - 2\mathbf{1} + \mathbf{1} = 0. \]
This shows that \( \mathbf{1} \) is in the null space of \( B \), meaning \( Bx = 0 \) has at least one non-trivial solution. Given that \( B \) is a matrix of degree 3, it is likely that the null space of \( B \) is of dimension greater than 1, implying that the equation \( Bx = 0 \) has infinitely many solutions. Quick Tip: When analyzing matrices with a known eigenvector, check if the eigenvector is in the null space of the matrix after applying any polynomial transformations. This can help determine the number of solutions to linear systems involving the matrix.


Question 14:

Let \( f(x) = \frac{e^x - e^{-x}}{2}, \, x \in \mathbb{R} \). Let \( f^{(k)}(a) \) denote the \( k^{th} \) derivative of \( f \) evaluated at \( a \). What is the value of \( f^{(10)}(0)? \) (Note: \( ! \) denotes factorial)

  • (A) 0
  • (B) 1
  • (C) \( \frac{1}{10!} \)
  • (D) \( \frac{2}{10!} \)
Correct Answer: (A) 0
View Solution

We are given the function \( f(x) = \frac{e^x - e^{-x}}{2} \), which is the definition of the hyperbolic sine function, \( \sinh(x) \), i.e., \[ f(x) = \sinh(x). \]
The \( k^{th} \) derivative of \( f(x) = \sinh(x) \) is: \[ f^{(k)}(x) = \frac{d^k}{dx^k} \sinh(x). \]
We know that the derivatives of \( \sinh(x) \) follow a periodic pattern:

\( f'(x) = \cosh(x) \)

\( f''(x) = \sinh(x) \)

\( f^{(3)}(x) = \cosh(x) \)

\( f^{(4)}(x) = \sinh(x) \), and so on.

This pattern alternates between \( \sinh(x) \) and \( \cosh(x) \) for successive derivatives. Specifically:

For even derivatives, \( f^{(2n)}(x) = \sinh(x) \)

For odd derivatives, \( f^{(2n+1)}(x) = \cosh(x) \)


Since \( f^{(10)}(x) \) is an even derivative, it will be equal to \( \sinh(x) \). Evaluating this at \( x = 0 \): \[ f^{(10)}(0) = \sinh(0) = 0. \]

Thus, the value of \( f^{(10)}(0) \) is 0. Quick Tip: When differentiating hyperbolic functions, remember the periodicity: the derivatives of \( \sinh(x) \) and \( \cosh(x) \) alternate, with even derivatives corresponding to \( \sinh(x) \) and odd derivatives to \( \cosh(x) \).


Question 15:

Let \( p \) and \( q \) be any two propositions. Consider the following propositional statements.

S1: \( p \rightarrow q \), S2: \( \neg p \land q \), S3: \( \neg p \lor q \), S4: \( \neg p \lor \neg q \)

where \( \land \) denotes conjunction (AND operation), \( \lor \) denotes disjunction (OR operation), and \( \neg \) denotes negation (NOT operation).

(Note: \( \equiv \) denotes logical equivalence)

Which one of the following options is correct?

  • (A) \( S_1 \equiv S_3 \)
  • (B) \( S_2 \equiv S_3 \)
  • (C) \( S_2 \equiv S_4 \)
  • (D) \( S_1 \equiv S_4 \)
Correct Answer: (A) \( S_1 \equiv S_3 \)
View Solution

Analyze the statements.


S1: \( p \rightarrow q \) is logically equivalent to \( \neg p \lor q \) by the definition of implication.

S2: \( \neg p \land q \) represents a conjunction, and is not logically equivalent to the other expressions.

S3: \( \neg p \lor q \) is logically equivalent to \( p \rightarrow q \), which matches S1.

S4: \( \neg p \lor \neg q \) is different and is not logically equivalent to S1 or S3.


Thus, S1 is logically equivalent to S3, making Option (A) the correct answer. Quick Tip: Implications \( p \rightarrow q \) are logically equivalent to disjunctions \( \neg p \lor q \). Use truth tables to verify logical equivalences between logical operations.


Question 16:

If a relational decomposition is not dependency-preserving, which one of the following relational operators will be executed more frequently in order to maintain the dependencies?

  • (A) Selection
  • (B) Projection
  • (C) Join
  • (D) Set union
Correct Answer: (C) Join
View Solution

In relational database theory, a relational decomposition is dependency-preserving if, after decomposing a relation, we can enforce all the functional dependencies without needing to perform a join operation. If the decomposition is not dependency-preserving, we need to perform additional operations to maintain the dependencies.

The Join operator is the most commonly used operator when dependencies need to be maintained. This is because, in a non-dependency-preserving decomposition, we often have to join relations to reconstruct the information required to enforce the dependencies.

Selection and Projection only reduce the size of the relation, but they do not help in preserving or enforcing dependencies.
Set union is not typically used to enforce dependencies.


Therefore, Join is the operator that will be executed more frequently to maintain dependencies in the absence of dependency-preserving decomposition. Quick Tip: When dealing with non-dependency-preserving decompositions in relational databases, join operations are essential to maintain the required functional dependencies, as they help in combining fragmented data that is needed for dependency enforcement.


Question 17:

Consider the following three relations:

Car (model, year, serial, color)

Make (maker, model)

Own (owner, serial)

A tuple in Car represents a specific car of a given model, made in a given year, with a serial number and a color. A tuple in Make specifies that a maker company makes cars of a certain model. A tuple in Own specifies that an owner owns the car with a given serial number. Keys are underlined; (owner, serial) together form key for Own. (\(\bowtie\) denotes natural join)
\[ \pi_{owner} \left( Own \bowtie \sigma_{color="red"} \left( Car \bowtie \sigma_{maker="ABC"} Make \right) \right) \]

Which one of the following options describes what the above expression computes?

  • (A) All owners of a red car, a car made by ABC, or a red car made by ABC
  • (B) All owners of more than one car, where at least one car is red and made by ABC
  • (C) All owners of a red car made by ABC
  • (D) All red cars made by ABC
Correct Answer: (C) All owners of a red car made by ABC
View Solution

The given expression is:
\[ \pi_{owner} \left( Own \bowtie \sigma_{color="red"} \left( Car \bowtie \sigma_{maker="ABC"} Make \right) \right) \]

1. Step 1: Analyze the components of the expression.

The first part \( \sigma_{maker="ABC"} Make \) selects the rows from the Make relation where the maker is "ABC."

The second part \( Car \bowtie \) natural joins the result with the Car relation, combining information about cars that are made by "ABC."

The third part \( \sigma_{color="red"} \) selects only those cars from the result where the color is "red."

The final part \( Own \bowtie \) joins the result with the Own relation, combining the data about car owners with the cars that are red and made by "ABC."

Finally, \( \pi_{owner} \) projects (selects) only the "owner" field, which gives the owners of the selected cars.

2. Step 2: Interpret the result.

The result is the list of owners of the cars that are red and made by ABC.

3. Conclusion:

This corresponds to Option (C), which states "All owners of a red car made by ABC." Quick Tip: To understand relational algebra expressions, break down each operation: selection (\(\sigma\)), projection (\(\pi\)), and joins (\(\bowtie\)) to determine the result.


Question 18:

Consider a hash table of size 10 with indices \( \{0, 1, \dots, 9\} \), with the hash function \[ h(x) = 3x \, (mod \, 10), \]
where linear probing is used to handle collisions. The hash table is initially empty and then the following sequence of keys is inserted into the hash table: 1, 4, 5, 6, 14, 15. The indices where the keys 14 and 15 are stored are, respectively:

  • (A) 2 and 5
  • (B) 2 and 6
  • (C) 4 and 5
  • (D) 4 and 6
Correct Answer: (D) 4 and 6
View Solution

We are given a hash table with the hash function \( h(x) = 3x \, (mod \, 10) \), and we are inserting the keys 1, 4, 5, 6, 14, and 15 into the hash table using linear probing.

Let's compute the hash values and insert the keys one by one:

For key 1:
\[ h(1) = 3 \times 1 \, (mod \, 10) = 3. \]
So, key 1 is inserted at index 3.

For key 4:
\[ h(4) = 3 \times 4 \, (mod \, 10) = 12 \, (mod \, 10) = 2. \]
So, key 4 is inserted at index 2.

For key 5:
\[ h(5) = 3 \times 5 \, (mod \, 10) = 15 \, (mod \, 10) = 5. \]
So, key 5 is inserted at index 5.

For key 6:
\[ h(6) = 3 \times 6 \, (mod \, 10) = 18 \, (mod \, 10) = 8. \]
So, key 6 is inserted at index 8.

- For key 14:
\[ h(14) = 3 \times 14 \, (mod \, 10) = 42 \, (mod \, 10) = 2. \]
Index 2 is already occupied (by key 4), so we use linear probing. We check index 3, which is occupied (by key 1). Next, we check index 4, which is empty, so key 14 is inserted at index 4.

For key 15:
\[ h(15) = 3 \times 15 \, (mod \, 10) = 45 \, (mod \, 10) = 5. \]
Index 5 is already occupied (by key 5), so we use linear probing. We check index 6, which is empty, so key 15 is inserted at index 6.

Thus, the keys 14 and 15 are stored at indices 4 and 6, respectively. Quick Tip: When using linear probing for collision resolution, if a slot is occupied, check the next slot in a circular manner (wrap around to the beginning of the table if needed) until you find an empty slot.


Question 19:

Let \( X \) be a continuous random variable whose cumulative distribution function (CDF) \( F_X(x) \), for some \( t \), is given as follows:
\[ F_X(x) = \begin{cases} 0 & if x \leq t
\frac{x - t}{4 - t} & if t \leq x \leq 4
1 & if x \geq 4 \end{cases} \]

If the median of \( X \) is 3, then what is the value of \( t \)?

  • (A) 2
  • (B) 1
  • (C) -1
  • (D) 0
Correct Answer: (A) 2
View Solution

We are given the CDF of \( X \) as:
\[ F_X(x) = \begin{cases} 0 & if x \leq t
\frac{x - t}{4 - t} & if t \leq x \leq 4
1 & if x \geq 4 \end{cases} \]

The median of a random variable \( X \) is the value \( m \) such that \( F_X(m) = 0.5 \).

Given that the median of \( X \) is 3, we need to solve for \( t \) such that:
\[ F_X(3) = 0.5. \]

Using the second case of the CDF, for \( t \leq 3 \leq 4 \), we have:
\[ F_X(3) = \frac{3 - t}{4 - t}. \]

Equating this to 0.5:
\[ \frac{3 - t}{4 - t} = 0.5. \]

Multiplying both sides by \( 4 - t \):
\[ 3 - t = 0.5 \times (4 - t). \]

Expanding the right-hand side:
\[ 3 - t = 2 - 0.5t. \]

Rearranging:
\[ 3 + 2 = 0.5t + t \quad \Rightarrow \quad 5 = 1.5t. \]

Solving for \( t \):
\[ t = \frac{5}{1.5} = \frac{10}{3} \approx 2.5. \]

Thus, the value of \( t \) is approximately 2.5, which corresponds to Option (A). Quick Tip: To find the median from the CDF, set \( F_X(m) = 0.5 \) and solve for \( m \). Use the given piecewise expression for the CDF to substitute the median value and solve for \( t \).


Question 20:

Let \( X = aZ + b \), where \( Z \) is a standard normal random variable, and \( a, b \) are two unknown constants. It is given that \[ E[X] = 1, \quad E[(X - E[X]) | Z] = -2, \quad E[(X - E[X])^2] = 4, \]
where \( E[X] \) denotes the expectation of random variable \( X \). The values of \( a, b \) are:

  • (A) \( a = -2, b = 1 \)
  • (B) \( a = 2, b = -1 \)
  • (C) \( a = -2, b = -1 \)
  • (D) \( a = 1, b = 1 \)
Correct Answer: (A) \( a = -2, b = 1 \)
View Solution

We are given that \( X = aZ + b \), where \( Z \sim N(0, 1) \) (a standard normal random variable), and we need to find the values of \( a \) and \( b \) based on the provided conditions.

1. Condition 1: \( E[X] = 1 \)


We know that the expectation of \( X \) is given by:
\[ E[X] = E[aZ + b] = aE[Z] + b = 0 + b = b. \]
Thus, from \( E[X] = 1 \), we conclude:
\[ b = 1. \]

2. Condition 2: \( E[(X - E[X]) | Z] = -2 \)


Substituting \( E[X] = 1 \) and \( X = aZ + b \), we get:
\[ E[(X - 1) | Z] = E[aZ + b - 1 | Z] = aE[Z | Z] + b - 1 = aZ + b - 1. \]
Since \( E[Z | Z] = Z \), we simplify this to:
\[ aZ + b - 1 = -2. \]
Substituting \( b = 1 \), we get:
\[ aZ + 1 - 1 = -2 \quad \Rightarrow \quad aZ = -2. \]
Therefore, \( a = -2 \).

3. Condition 3: \( E[(X - E[X])^2] = 4 \)


Finally, we calculate:
\[ E[(X - E[X])^2] = E[(aZ + b - 1)^2] = E[(aZ)^2] = a^2E[Z^2]. \]
Since \( E[Z^2] = 1 \) for a standard normal variable, we have:
\[ a^2 \cdot 1 = 4 \quad \Rightarrow \quad a^2 = 4. \]
Thus, \( a = -2 \) (as determined previously).

Therefore, the values of \( a \) and \( b \) are \( a = -2 \) and \( b = 1 \). Quick Tip: When dealing with linear transformations of normal random variables, use the properties of expectation and variance to derive the unknown constants.


Question 21:

It is given that \( P(X \geq 2) = 0.25 \) for an exponentially distributed random variable \( X \) with \( E[X] = \frac{1}{\lambda} \), where \( E[X] \) denotes the expectation of \( X \). What is the value of \( \lambda \)?

(\(\ln\) denotes natural logarithm)

  • (A) \( \ln 2 \)
  • (B) \( \ln 4 \)
  • (C) \( \ln 3 \)
  • (D) \( \ln 0.25 \)
Correct Answer: (A) \( \ln 2 \)
View Solution

For an exponentially distributed random variable \( X \), the probability that \( X \geq x \) is given by:
\[ P(X \geq x) = e^{-\lambda x}. \]

We are given that \( P(X \geq 2) = 0.25 \). So, we can write the equation as:
\[ e^{-\lambda \cdot 2} = 0.25. \]

Taking the natural logarithm (ln) of both sides:
\[ -\lambda \cdot 2 = \ln(0.25). \]

Since \( \ln(0.25) = \ln \left( \frac{1}{4} \right) = -\ln 4 \), the equation becomes:
\[ -\lambda \cdot 2 = -\ln 4. \]

Simplifying:
\[ \lambda = \frac{\ln 4}{2} = \ln 2. \]

Thus, the value of \( \lambda \) is \( \ln 2 \), which corresponds to Option (A). Quick Tip: For exponentially distributed random variables, the survival function is \( P(X \geq x) = e^{-\lambda x} \), and you can use natural logarithms to solve for \( \lambda \) when given a probability.


Question 22:

Consider designing a linear classifier \[ y = sign(f(x; w, b)), \quad f(x; w, b) = w^T x + b \]
on a dataset \( D = \{(x_1, y_1), (x_2, y_2), \dots, (x_N, y_N)\}, x_i \in \mathbb{R}^d, y_i \in \{+1, -1\}, i = 1, 2, \dots, N \). Recall that the sign function outputs \( +1 \) if the argument is positive, and \( -1 \) if the argument is non-positive. The parameters \( w \) and \( b \) are updated as per the following training algorithm: \[ w_{new} = w_{old} + y_n x_n, \quad b_{new} = b_{old} + y_n \]
whenever sign\( (f(x_n; w_{old}, b_{old})) \neq y_n \). In other words, whenever the classifier wrongly predicts a sample \( (x_n, y_n) \) from the dataset, \( w_{old} \) gets updated to \( w_{new} \), and likewise \( b_{old} \) gets updated to \( b_{new} \). Consider the case \( (x_n, +1), f(x_n; w_{old}, b_{old}) < 0 \). Then:

  • (A) \( f(x_n; w_{new}, b_{new}) > f(x_n; w_{old}, b_{old}) \)
  • (B) \( f(x_n; w_{new}, b_{new}) < f(x_n; w_{old}, b_{old}) \)
  • (C) \( f(x_n; w_{new}, b_{new}) = f(x_n; w_{old}, b_{old}) \)
  • (D) \( y_n f(x_n; w_{old}, b_{old}) > 1 \)
Correct Answer: (A) \( f(x_n; w_{\text{new}}, b_{\text{new}}) > f(x_n; w_{\text{old}}, b_{\text{old}}) \)
View Solution

We are given a linear classifier where the parameters \( w \) and \( b \) are updated whenever the classifier makes a mistake. The update rule for the parameters is as follows: \[ w_{new} = w_{old} + y_n x_n, \quad b_{new} = b_{old} + y_n. \]
In this case, we are considering the situation where \( (x_n, +1) \) is the incorrect prediction, meaning: \[ f(x_n; w_{old}, b_{old}) < 0. \]
This indicates that the classifier has incorrectly predicted the label of \( x_n \) as \( -1 \) when the true label is \( +1 \).

### Step-by-Step Process:

1. Initial Prediction:
The classifier incorrectly predicts the label of \( x_n \), i.e., it computes a negative value for the decision function:
\[ f(x_n; w_{old}, b_{old}) = w_{old}^T x_n + b_{old} < 0. \]
Since \( y_n = +1 \), we will update the parameters \( w \) and \( b \) as follows:
\[ w_{new} = w_{old} + y_n x_n = w_{old} + x_n, \]
\[ b_{new} = b_{old} + y_n = b_{old} + 1. \]

2. New Prediction:
After the update, we compute the new value of the decision function with the updated parameters:
\[ f(x_n; w_{new}, b_{new}) = w_{new}^T x_n + b_{new} = (w_{old} + x_n)^T x_n + (b_{old} + 1). \]
This simplifies to:
\[ f(x_n; w_{new}, b_{new}) = f(x_n; w_{old}, b_{old}) + x_n^T x_n + 1. \]
Since \( x_n^T x_n > 0 \) (as it is a squared norm), and we are adding 1, the updated decision function will be larger than the previous one:
\[ f(x_n; w_{new}, b_{new}) > f(x_n; w_{old}, b_{old}). \]

Thus, the correct answer is \( f(x_n; w_{new}, b_{new}) > f(x_n; w_{old}, b_{old}) \), which corresponds to option (A). Quick Tip: In the training of linear classifiers, the parameters are updated whenever the classifier makes a mistake. This update usually increases the classifier's output for correctly classified samples, moving it in the direction of the true label.


Question 23:

Consider the following Python declarations of two lists.
\[ A = [1, 2, 3] \quad and \quad B = [4, 5, 6]. \]
Which one of the following statements results in \( A = [1, 2, 3, 4, 5, 6] \)?

  • (A) A.extend(B)
  • (B) A.append(B)
  • (C) A.update(B)
  • (D) A.insert(B)
Correct Answer: (A) A.extend(B)
View Solution

In Python, the `extend()` method is used to append all the elements of a list to another list. Let's examine each option:

Option (A): `A.extend(B)` will add all elements of list \( B \) to list \( A \), resulting in \( A = [1, 2, 3, 4, 5, 6] \). This is the correct answer.

Option (B): `A.append(B)` will add list \( B \) as a single element to list \( A \), resulting in \( A = [1, 2, 3, [4, 5, 6]] \), which is incorrect.

Option (C): There is no `update()` method for lists in Python, so this is incorrect.

Option (D): `A.insert(B)` is used to insert an element at a specific index, and it cannot be used with an entire list like \( B \). This is also incorrect.

Thus, the correct answer is Option (A), which uses `A.extend(B)`. Quick Tip: In Python, `extend()` adds all elements of one list to another, while `append()` adds the list as a single element.


Question 24:

Consider two functions \( f: \mathbb{R} \to \mathbb{R} \) and \( g: \mathbb{R} \to (1, \infty) \). Both functions are differentiable at a point \( c \). Which of the following functions is/are ALWAYS differentiable at \( c \)? The symbol \( \cdot \) denotes product and the symbol \( \circ \) denotes composition of functions.

  • (A) \( f \pm g \)
  • (B) \( f \cdot g \)
  • (C) \( \frac{f}{g} \)
  • (D) \( f \circ g + g \circ f \)
Correct Answer: (A), (B), (C)
View Solution

We are given that both \( f \) and \( g \) are differentiable at point \( c \). Let's analyze each option:

Option (A): \( f \pm g \) is the sum or difference of two differentiable functions, which is always differentiable. Thus, Option (A) is correct.


Option (B): \( f \cdot g \) is the product of two differentiable functions, and the product of differentiable functions is always differentiable. So, Option (B) is correct.


Option (C): \( \frac{f}{g} \) is the quotient of two differentiable functions, and the quotient of differentiable functions is differentiable as long as the denominator \( g(x) \) is non-zero. Given that \( g \) maps to \( (1, \infty) \), \( g(x) \) is always positive, and thus \( \frac{f}{g} \) is differentiable. Therefore, Option (C) is correct.


Option (D): \( f \circ g + g \circ f \) represents compositions of differentiable functions. Composition of differentiable functions is differentiable, so Option (D) is also correct.

Thus, the correct answers are Option (A), Option (B), and Option (C). Quick Tip: The sum, product, and quotient of differentiable functions are always differentiable, as long as the denominator is non-zero. The composition of differentiable functions is also differentiable.


Question 25:

Which of the following statements is/are correct?

  • (A) \( \mathbb{R}^n \) has a unique set of orthonormal basis vectors
  • (B) \( \mathbb{R}^n \) does not have a unique set of orthonormal basis vectors
  • (C) Linearly independent vectors in \( \mathbb{R}^n \) are orthonormal
  • (D) Orthonormal vectors in \( \mathbb{R}^n \) are linearly independent
Correct Answer: (B) \( \mathbb{R}^n \) does not have a unique set of orthonormal basis vectors, (D) Orthonormal vectors in \( \mathbb{R}^n \) are linearly independent
View Solution

Let's evaluate each option:

Option (A): \( \mathbb{R}^n \) does not have a unique set of orthonormal basis vectors. There can be different sets of orthonormal basis vectors, which are related by rotation or reflection. Thus, this statement is incorrect.

Option (B): This is correct. \( \mathbb{R}^n \) does not have a unique set of orthonormal basis vectors because any orthonormal set of vectors can be transformed by an orthogonal matrix into another orthonormal set. Therefore, this statement is true.

Option (C): Linearly independent vectors in \( \mathbb{R}^n \) are not necessarily orthonormal. For a set of vectors to be orthonormal, they must be not only linearly independent but also have unit length and be mutually orthogonal. Hence, this option is incorrect.

Option (D): Orthonormal vectors in \( \mathbb{R}^n \) are always linearly independent because they have unit length and are orthogonal to each other. Therefore, this statement is correct.

Thus, the correct answer is (B) and (D). Quick Tip: Orthonormal vectors are guaranteed to be linearly independent, and they form a basis for the space. If vectors are orthonormal, they are automatically linearly independent.


Question 26:

Which of the following statements is/are correct in a Bayesian network?

  • (A) Variable elimination is an approximate inference algorithm
  • (B) Gibbs sampling is an exact inference algorithm
  • (C) Variable elimination is used to determine conditional probabilities
  • (D) Rejection sampling is an approximate inference algorithm
Correct Answer: (C) Variable elimination is used to determine conditional probabilities, (D) Rejection sampling is an approximate inference algorithm
View Solution

Let's evaluate each option:

Option (A): Variable elimination is an exact inference algorithm, not an approximate one. It computes the exact marginal distributions but may become computationally expensive for large networks. Hence, this statement is incorrect.

Option (B): Gibbs sampling is an approximate inference algorithm. It uses sampling to estimate the distribution, which is approximate. Therefore, this option is incorrect.

Option (C): Variable elimination is indeed used to compute conditional probabilities in Bayesian networks. It works by eliminating variables one at a time to compute the marginal distribution or conditional probabilities. Thus, this option is correct.

Option (D): Rejection sampling is an approximate inference algorithm. It involves generating random samples and rejecting those that do not meet the criteria. It is used when exact inference is difficult, making this option correct.

Thus, the correct answer is (C) and (D). Quick Tip: In Bayesian networks, inference algorithms can be exact or approximate. Exact algorithms like variable elimination are computationally expensive, while approximate methods like Gibbs sampling and rejection sampling provide feasible solutions for large networks.


Question 27:

For which of the following inputs does binary search take time \( O(\log n) \) in the worst case?

  • (A) An array of \( n \) integers in any order
  • (B) A linked list of \( n \) integers in any order
  • (C) An array of \( n \) integers in increasing order
  • (D) A linked list of \( n \) integers in increasing order
Correct Answer: (C) An array of \( n \) integers in increasing order
View Solution

In binary search, the list needs to be sorted for it to work efficiently with time complexity \( O(\log n) \). Let's analyze each option:

Option (A): For binary search to work, the array should be sorted. If the array is in any random order, binary search would not be applicable without first sorting the array. Sorting an unsorted array takes \( O(n \log n) \), so binary search is not guaranteed to work in \( O(\log n) \) here.

Option (B): A linked list does not allow direct access to elements in constant time. Therefore, binary search cannot work efficiently on a linked list as it requires random access to elements, which is not possible in a linked list.

Option (C): If the array is already sorted in increasing order, binary search can be applied directly, and it will work in \( O(\log n) \), as binary search requires halving the search space at each step.

Option (D): Similar to Option (B), a linked list does not support efficient direct access to elements, so binary search is not efficient here.

Thus, the correct answer is Option (C), which involves an array sorted in increasing order. Quick Tip: Binary search works only on sorted arrays or lists, and it operates with \( O(\log n) \) time complexity in the best-case scenario when the list is sorted.


Question 28:

Let \( A = I_n + xx^T \), where \( I_n \) is the \( n \times n \) identity matrix and \( x \in \mathbb{R}^n, x^T x = 1 \). Which of the following options is/are correct?

  • (A) Rank of \( A \) is \( n \)
  • (B) \( A \) is invertible
  • (C) 0 is an eigenvalue of \( A \)
  • (D) \( A^{-1} \) has a negative eigenvalue
Correct Answer: (A), (B)
View Solution

We are given that \( A = I_n + xx^T \), where \( I_n \) is the identity matrix, and \( x \) is a vector in \( \mathbb{R}^n \) such that \( x^T x = 1 \).

Option (A): The rank of \( A \) is \( n \). Since \( I_n \) has rank \( n \) and \( xx^T \) is a rank-1 matrix, the rank of \( A = I_n + xx^T \) will be \( n \) as long as \( x \neq 0 \). Therefore, Option (A) is correct.

Option (B): Since \( A \) is a full-rank matrix (rank \( n \)), it is invertible. Thus, Option (B) is correct.

Option (C): Since \( A \) is a full-rank matrix, it does not have 0 as an eigenvalue. Therefore, Option (C) is incorrect.

Option (D): \( A^{-1} \) is invertible, but we do not have enough information to claim that \( A^{-1} \) has a negative eigenvalue. Therefore, Option (D) is incorrect.

Thus, the correct answers are Option (A) and Option (B). Quick Tip: For matrices of the form \( A = I_n + xx^T \), the rank is \( n \), and the matrix is always invertible as long as \( x \neq 0 \).


Question 29:

Suppose that insertion sort is applied to the array \( [1, 3, 5, 7, 9, 11, x, 15, 13] \) and it takes exactly two swaps to sort the array. Select all possible values of \( x \).

  • (A) 10
  • (B) 12
  • (C) 14
  • (D) 16
Correct Answer: (A) 10, (B) 12, (C) 14
View Solution

The given array is \( [1, 3, 5, 7, 9, 11, x, 15, 13] \), and we are told that insertion sort takes exactly two swaps to sort the array. We need to find the values of \( x \) such that exactly two swaps are required.

1. Step-by-step analysis of insertion sort:


Insertion sort works by repeatedly selecting an element and inserting it into the correct position in the sorted part of the array. A swap occurs when the selected element is out of order compared to the element it should be placed next to.

2. Identifying the possible values of \( x \):


For \( x = 10 \), the array becomes \( [1, 3, 5, 7, 9, 10, 11, 15, 13] \). The insertion sort will need to move \( 10 \) after \( 9 \), and then after \( 11 \) (one swap between 10 and 11, and another swap to place 13 in the correct position).

For \( x = 12 \), the array becomes \( [1, 3, 5, 7, 9, 11, 12, 15, 13] \). The insertion sort will need to move \( 12 \) after \( 11 \) (one swap between 12 and 11, and another swap to place 13 correctly).

For \( x = 14 \), the array becomes \( [1, 3, 5, 7, 9, 11, 14, 15, 13] \). The insertion sort will need to move \( 14 \) after \( 11 \) (one swap between 14 and 11, and another swap to place 13 correctly).

In all of these cases, exactly two swaps are required, so the possible values of \( x \) are 10, 12, and 14.

Thus, the correct answer is (A) 10, (B) 12, (C) 14. Quick Tip: In insertion sort, the number of swaps corresponds to the number of elements that are out of order and need to be moved into the correct position in the sorted part of the array.


Question 30:

Let \( C_1 \) and \( C_2 \) be two sets of objects. Let \( D(x, y) \) be a measure of dissimilarity between two objects \( x \) and \( y \). Consider the following definitions of dissimilarity between \( C_1 \) and \( C_2 \):
\[ DIS-1(C_1, C_2) = \max_{x \in C_1, y \in C_2} D(x, y) \]
\[ DIS-2(C_1, C_2) = \min_{x \in C_1, y \in C_2} D(x, y) \]

Which of the following statements is/are correct?

  • (A) Single Linkage Clustering uses DIS-1
  • (B) Single Linkage Clustering uses DIS-2
  • (C) Complete Linkage Clustering uses DIS-2
  • (D) Complete Linkage Clustering uses DIS-1
Correct Answer: (B), (D)
View Solution

We are given the definitions of DIS-1 and DIS-2. Let's analyze each option:

Option (A): "Single Linkage Clustering uses DIS-1" is incorrect. Single Linkage uses DIS-2, not DIS-1.

Option (B): "Single Linkage Clustering uses DIS-2" is correct. Single Linkage uses the minimum dissimilarity between clusters, which is DIS-2.

Option (C): "Complete Linkage Clustering uses DIS-2" is incorrect. Complete Linkage uses DIS-1, not DIS-2.

Option (D): "Complete Linkage Clustering uses DIS-1" is correct.

Complete Linkage uses the maximum dissimilarity between clusters, which is DIS-1.

Thus, the correct answers are Option (B) and Option (D). Quick Tip: - Single Linkage uses the minimum dissimilarity between clusters (DIS-2). - Complete Linkage uses the maximum dissimilarity between clusters (DIS-1).


Question 31:

There are three boxes containing white balls and black balls.

Box-1 contains 2 black and 1 white ball.

Box-2 contains 1 black and 2 white balls.

Box-3 contains 3 black and 3 white balls.


In a random experiment, one of these boxes is selected, where the probability of choosing Box-1 is \( \frac{1}{2} \), Box-2 is \( \frac{1}{3} \), and Box-3 is \( \frac{1}{6} \). A ball is drawn at random from the selected box. Given that the ball drawn is white, the probability that it is drawn from Box-2 is:

Correct Answer: 0.25
View Solution

Let \(B_1\), \(B_2\), and \(B_3\) be the events of selecting Box-1, Box-2, and Box-3, respectively.
Let \(W\) be the event of drawing a white ball.

Given:

\(P(B_1) = \frac{1}{2}\)
\(P(B_2) = \frac{1}{6}\)
\(P(B_3) = \frac{1}{3}\)


Conditional probabilities:

\(P(W|B_1) = \frac{1}{3}\) (1 white ball out of 3 total)
\(P(W|B_2) = \frac{2}{3}\) (2 white balls out of 3 total)
\(P(W|B_3) = \frac{3}{6} = \frac{1}{2}\) (3 white balls out of 6 total)


We need to find \(P(B_2|W)\). Using Bayes' Theorem: \(\)P(B_2|W) = \frac{P(W|B_2)P(B_2){P(W)\(\)

First, calculate \(P(W)\) using the Law of Total Probability: \(\)P(W) = P(W|B_1)P(B_1) + P(W|B_2)P(B_2) + P(W|B_3)P(B_3)\(\) \(\)P(W) = \left(\frac{1{3 \times \frac{1{2\right) + \left(\frac{2{3 \times \frac{1{6\right) + \left(\frac{1{2 \times \frac{1{3\right)\(\) \(\)P(W) = \frac{1{6 + \frac{2{18 + \frac{1{6 = \frac{1{6 + \frac{1{9 + \frac{1{6 = \frac{3{18 + \frac{2{18 + \frac{3{18 = \frac{8{18 = \frac{4{9\(\)

Now, calculate \(P(B_2|W)\): \(\)P(B_2|W) = \frac{\left(\frac{2{3 \times \frac{1{6\right){\frac{4{9 = \frac{\frac{2{18{\frac{4{9 = \frac{\frac{1{9{\frac{4{9 = \frac{1{9 \times \frac{9{4 = \frac{1{4 = 0.25\(\)



Answer: The probability that the white ball is drawn from Box-2 is 0.25. Quick Tip: In problems involving conditional probability, Bayes' Theorem allows you to calculate the probability of an event given other known probabilities. Make sure to compute the total probability of the outcome across all possible scenarios.


Question 32:

Evaluate the following limit: \[ \lim_{t \to \infty} \sqrt{t^2 + t - t} \]

Correct Answer:
View Solution

We begin by simplifying the expression inside the square root:
\[ \sqrt{t^2 + t - t} = \sqrt{t^2} \]

For large \( t \), we can approximate:
\[ \sqrt{t^2 + t - t} = \sqrt{t^2(1 + \frac{1}{t})} \]

Using the binomial expansion for \( \sqrt{1 + \frac{1}{t}} \), we get:
\[ \sqrt{1 + \frac{1}{t}} \approx 1 + \frac{1}{2t} \]

Thus, the expression becomes:
\[ t \times \left( 1 + \frac{1}{2t} \right) = t + \frac{1}{2} \]

So, the value of the limit is:
\[ \lim_{t \to \infty} \sqrt{t^2 + t - t} = 0.5 \]

Thus, the correct answer is \( \boxed{0.5} \). Quick Tip: When evaluating limits of expressions involving square roots, consider factoring out the highest power term from both the numerator and denominator if applicable. In this case, factor \( t^2 \) from the square root expression to simplify the problem, and use approximations for large \( t \) to find the limit.


Question 33:

On a relation named Loan of a bank:




The following SQL query is executed:


SELECT L1.loan_number FROM Loan L1 WHERE L1.amount \(>\) (SELECT MAX(L2.amount) FROM Loan L2 WHERE L2.branch_name = 'SR Nagar');

Correct Answer: 3
View Solution

The subquery retrieves the maximum loan amount from the "SR Nagar" branch. The amounts for "SR Nagar" are 40000, 25000, and 65000, so the maximum amount is 65000.

The main query selects the loan numbers where the loan amount is greater than 65000. From the given data, the loans with amounts greater than 65000 are:

L11: 90000 (Banjara Hills)

L23: 80000 (Balanagar)

L25: 70000 (Kondapur)


Thus, the number of rows returned by the query is 3.

Correct Answer: 3 Quick Tip: When working with SQL queries that involve subqueries, make sure to carefully analyze the subquery to understand what data it is filtering before considering the main query. In this case, the subquery is used to get the maximum loan amount from a specific branch, and the main query filters based on that maximum value.


Question 34:

Given data \( \{(-1, 1), (2, -5), (3, 5)\} \) of the form \( (x, y) \), we fit a model \( y = wx \) using linear least-squares regression. The optimal value of \( w \) is:

(Round off to three decimal places)

Correct Answer:
View Solution

To find the optimal value of \( w \), we need to apply the least-squares regression method to minimize the error between the predicted and actual values of \( y \). The least-squares error function for linear regression is given by:
\[ E(w) = \sum_{i=1}^{n} (y_i - wx_i)^2 \]

Where:

\( x_i \) and \( y_i \) are the data points.

\( w \) is the parameter we need to optimize.


The optimal value of \( w \) is obtained by minimizing \( E(w) \). We take the derivative of \( E(w) \) with respect to \( w \), set it equal to zero, and solve for \( w \).

First, express \( E(w) \):
\[ E(w) = (1 - w(-1))^2 + (-5 - w(2))^2 + (5 - w(3))^2 \] \[ E(w) = (1 + w)^2 + (-5 - 2w)^2 + (5 - 3w)^2 \]

Now, expand the squares:
\[ E(w) = (1 + 2w + w^2) + (25 + 20w + 4w^2) + (25 - 30w + 9w^2) \] \[ E(w) = 1 + 25 + 25 + 2w + 20w - 30w + w^2 + 4w^2 + 9w^2 \] \[ E(w) = 51 - 8w + 14w^2 \]

Next, differentiate \( E(w) \) with respect to \( w \):
\[ \frac{dE(w)}{dw} = -8 + 28w \]

Set the derivative equal to zero to find the critical point:
\[ -8 + 28w = 0 \] \[ 28w = 8 \] \[ w = \frac{8}{28} = \frac{2}{7} \approx 0.286 \]

Thus, the optimal value of \( w \) is approximately \( 0.286 \). Quick Tip: For linear regression using least squares, the optimal weight \( w \) can be found by minimizing the squared error function, which can be done by differentiating the error with respect to \( w \) and solving for it.


Question 35:

The naive Bayes classifier is used to solve a two-class classification problem with class-labels \( y_1, y_2 \). Suppose the prior probabilities are \( P(y_1) = \frac{1}{3} \) and \( P(y_2) = \frac{2}{3} \). Assuming a discrete feature space with \[ P(x | y_1) = \frac{3}{4} \quad and \quad P(x | y_2) = \frac{1}{4} \]
for a specific feature vector \( x \). The probability of misclassifying \( x \) is: (Round off to two decimal places)

Correct Answer:
View Solution

To find the probability of misclassification, we apply Bayes' Theorem to compute the posterior probabilities for each class and use the formula for misclassification.
\[ P(x) = P(x | y_1) P(y_1) + P(x | y_2) P(y_2) \] \[ P(x) = \left(\frac{3}{4} \cdot \frac{1}{3}\right) + \left(\frac{1}{4} \cdot \frac{2}{3}\right) = \frac{5}{12} \]

The posterior probabilities are: \[ P(y_1 | x) = \frac{0.6}{1} = 0.6, \quad P(y_2 | x) = \frac{0.4}{1} = 0.4 \]

Thus, the probability of misclassifying \( x \) is \( P(misclassify) = 1 - \max(0.6, 0.4) = 0.4 \). Quick Tip: In Naive Bayes classification, the probability of misclassification is the complement of the maximum posterior probability. Always calculate the posteriors first before deciding the predicted class.


Question 36:

Let \( Y = Z^2 \), \( Z = \frac{X - \mu}{\sigma} \), where \( X \) is a normal random variable with mean \( \mu \) and variance \( \sigma^2 \). The variance of \( Y \) is

  • (A) 1
  • (B) 2
  • (C) 3
  • (D) 4
Correct Answer: (B) 2
View Solution

The variable \( Z \) is a standard normal random variable, i.e., \( Z \sim N(0, 1) \), because:
\[ Z = \frac{X - \mu}{\sigma} \]

Since \( X \) has a normal distribution with mean \( \mu \) and variance \( \sigma^2 \), the transformation \( Z = \frac{X - \mu}{\sigma} \) gives \( Z \) a mean of 0 and variance of 1.

The variable \( Y = Z^2 \) follows a chi-squared distribution with 1 degree of freedom, i.e., \( Y \sim \chi^2_1 \). The properties of a chi-squared distribution with 1 degree of freedom are:

The mean of \( Y \) is \( \mu_Y = 1 \),

The variance of \( Y \) is \( \sigma_Y^2 = 2 \).


Thus, the variance of \( Y \) is \( \boxed{2} \). Quick Tip: When squaring a standard normal variable, the result follows a chi-squared distribution with 1 degree of freedom. The variance of a chi-squared distribution with 1 degree of freedom is always 2.


Question 37:

Let \( A \in \mathbb{R}^{n \times n} \) be such that \( A^3 = A \). Which one of the following statements is ALWAYS correct?

  • (A) \( A \) is invertible
  • (B) Determinant of \( A \) is 0
  • (C) The sum of the diagonal elements of \( A \) is 1
  • (D) \( A \) and \( A^2 \) have the same rank
Correct Answer: (D) \( A \) and \( A^2 \) have the same rank
View Solution

We are given that \( A^3 = A \), which means that \( A \) is a idempotent matrix. An idempotent matrix is one where \( A^2 = A \), but in this case, the matrix also satisfies \( A^3 = A \), which implies \( A^2 = A \) as well.

Let’s analyze each option:

Option (A): \( A \) is invertible.
For \( A \) to be invertible, \( det(A) \neq 0 \). However, from the equation \( A^3 = A \), we know that the eigenvalues of \( A \) must satisfy \( \lambda^3 = \lambda \), which gives \( \lambda = 0 \) or \( \lambda = 1 \). Therefore, \( A \) could have eigenvalue 0, making \( det(A) = 0 \), meaning that \( A \) is not necessarily invertible. This statement is not always true.

Option (B): The determinant of \( A \) is 0.
As mentioned earlier, since \( A \) can have eigenvalue 0, the determinant could indeed be 0, but this is not guaranteed. \( A \) could also have only eigenvalue 1 (in which case \( det(A) = 1 \)). Hence, this statement is not always true.

Option (C): The sum of the diagonal elements of \( A \) is 1.
The sum of the diagonal elements of a matrix is the trace of the matrix, which is the sum of its eigenvalues. Since \( A^3 = A \), the eigenvalues of \( A \) can only be 0 or 1. Therefore, the trace (sum of eigenvalues) is the number of 1’s among the eigenvalues, but this is not guaranteed to be 1. For example, if all eigenvalues are 0 or if there are multiple eigenvalues equal to 1, the trace could be different. Therefore, this statement is not always true.

Option (D): \( A \) and \( A^2 \) have the same rank.
This is the correct statement. If \( A^3 = A \), then \( A^2 = A \). This implies that the rank of \( A^2 \) is equal to the rank of \( A \), because the non-zero eigenvalues of both \( A \) and \( A^2 \) must be the same. Therefore, this statement is always true.

Thus, the correct answer is (D) \( A \) and \( A^2 \) have the same rank. Quick Tip: If \( A^3 = A \), then \( A^2 = A \), and both \( A \) and \( A^2 \) have the same rank. This property holds true for idempotent matrices.


Question 38:

Let \( \{ x_1, x_2, \dots, x_n \} \) be a set of linearly independent vectors in \( \mathbb{R}^n \). Let the \( (i,j) \)-th element of matrix \( A \in \mathbb{R}^{n \times n} \) be given by \( A_{ij} = x_i^T x_j \), where \( 1 \leq i, j \leq n \). Which one of the following statements is correct?

  • (A) \( A \) is invertible
  • (B) 0 is a singular value of \( A \)
  • (C) Determinant of \( A \) is 0
  • (D) \( z^T A z = 0 \) for some non-zero \( z \in \mathbb{R}^n \)
Correct Answer: (A) \( A \) is invertible
View Solution

The matrix \( A \) is a Gram matrix, where each element \( A_{ij} = x_i^T x_j \) is the inner product between vectors \( x_i \) and \( x_j \). Since the vectors \( x_1, x_2, \dots, x_n \) are linearly independent, the matrix \( A \) is invertible. This is because the rank of the Gram matrix is \( n \), and a matrix with full rank is invertible.

Option (A): \( A \) is invertible. This is correct because the matrix is positive definite.


Option (B): 0 is a singular value of \( A \). This is incorrect, as the matrix is invertible and does not have 0 as a singular value.


Option (C): The determinant of \( A \) is 0. This is incorrect because \( A \) is invertible, meaning its determinant is non-zero.


Option (D): \( z^T A z = 0 \) for some non-zero \( z \in \mathbb{R}^n \). This is incorrect because for a positive definite matrix like \( A \), \( z^T A z \) is always positive for any non-zero vector \( z \).

Thus, the correct answer is Option (A). Quick Tip: For a Gram matrix formed by linearly independent vectors, the matrix is always positive definite, and therefore it is invertible. A positive definite matrix has all positive eigenvalues and a non-zero determinant.


Question 39:

Consider the cumulative distribution function (CDF) of a random variable \( X \):
\[ F_X(x) = \begin{cases} 0 & if x \leq -1
\frac{1}{4}(x + 1)^2 & if -1 \leq x \leq 1
1 & if x \geq 1 \end{cases} \]

The value of \( P(X^2 \leq 0.25) \) is:

  • (A) 0.625
  • (B) 0.25
  • (C) 0.5
  • (D) 0.5625
Correct Answer: (C) 0.5
View Solution

To find \( P(X^2 \leq 0.25) \), we solve for the range \( -0.5 \leq X \leq 0.5 \). Using the CDF, we calculate the probabilities for the corresponding values of \( X \). The probability is:
\[ P(X^2 \leq 0.25) = F_X(0.5) - F_X(-0.5) = 0.5625 - 0.0625 = 0.5 \] Quick Tip: When solving for probabilities involving a square, first determine the range of the variable that satisfies the inequality. Then, use the CDF to calculate the desired probability.


Question 40:

A random variable \( X \) is said to be distributed as \( Bernoulli(\theta) \), denoted by \( X \sim Bernoulli(\theta) \), if
\[ P(X = 1) = \theta, \quad P(X = 0) = 1 - \theta \]

for \( 0 < \theta < 1 \). Let \( Y = \sum_{i=1}^{300} X_i \), where \( X_i \sim Bernoulli(\theta) \), \( i = 1, 2, \dots, 300 \) be independent and identically distributed random variables with \( \theta = 0.25 \). The value of \( P(60 \leq Y \leq 90) \), after approximation through the Central Limit Theorem, is given by

  • (A) \( \phi(2) - \phi(-2) \)
  • (B) \( \phi(1) - \phi(-1) \)
  • (C) \( \phi(3) - \phi(-3) \)
  • (D) \( \phi(90) - \phi(60) \)
Correct Answer: (A) \( \phi(2) - \phi(-2) \)
View Solution

Given that \( Y = \sum_{i=1}^{300} X_i \), where \( X_i \sim Bernoulli(0.25) \), we approximate the distribution of \( Y \) using the Central Limit Theorem. The mean and variance of \( Y \) are:
\[ \mu_Y = 300 \times 0.25 = 75, \quad \sigma_Y^2 = 300 \times 0.25 \times 0.75 = 56.25, \quad \sigma_Y = 7.5 \]

The probability \( P(60 \leq Y \leq 90) \) is approximated by:
\[ P\left( \frac{60 - 75}{7.5} \leq Z \leq \frac{90 - 75}{7.5} \right) = P(-2 \leq Z \leq 2) \]

Using the cumulative distribution function \( \phi(x) \) of the standard normal distribution:
\[ P(-2 \leq Z \leq 2) = \phi(2) - \phi(-2) \]

Thus, the value of \( P(60 \leq Y \leq 90) \) is \( \phi(2) - \phi(-2) \).

Correct Answer: (A) \( \phi(2) - \phi(-2) \). Quick Tip: When applying the Central Limit Theorem to a sum of random variables, standardize the variable by subtracting the mean and dividing by the standard deviation. This transforms the sum into a normal distribution, which can be used to calculate probabilities.


Question 41:

For \( x \in \mathbb{R} \), the floor function is denoted by \( f(x) = \lfloor x \rfloor \) and defined as follows
\[ \lfloor x \rfloor = k, \quad k \leq x < k + 1, \]

where \( k \) is an integer. Let \( Y = |X| \), where \( X \) is an exponentially distributed random variable with mean \( \frac{1}{\ln 10} \), where \( \ln \) denotes natural logarithm. For any positive integer \( \ell \), one can write the probability of the event \( Y = \ell \) as follows:
\[ P(Y = \ell) = q^\ell (1 - q) \]

The value of \( q \) is:

  • (A) 0.1
  • (B) 0.01
  • (C) 0.5
  • (D) 0.434
Correct Answer: (A) 0.1
View Solution

We are given that \( X \) follows an exponential distribution with mean \( \frac{1}{\ln 10} \), and \( Y = |X| \). The probability \( P(Y = \ell) \) can be derived using the CDF of the exponential distribution:
\[ P(Y = \ell) = P(\ell \leq X < \ell + 1) = F_X(\ell + 1) - F_X(\ell) \]

The CDF of \( X \) is:
\[ F_X(x) = 1 - e^{-x \ln 10} \]

So, the probability is:
\[ P(Y = \ell) = e^{-\ell \ln 10} \left( 1 - e^{-\ln 10} \right) \]

Comparing this with \( P(Y = \ell) = q^\ell (1 - q) \), we find:
\[ q = e^{-\ln 10} = \frac{1}{10} \]

Thus, the value of \( q \) is \( \boxed{0.1} \). Quick Tip: For exponential distributions, the probability of a value lying within a specific range can be computed using the CDF. The formula for the floor function can be used to compute discrete probabilities for the transformed random variable.


Question 42:

Consider the neural network shown in the figure with
\[ inputs: u = 2, \, v = 3 \] \[ weights: a = 1, b = 1, c = 1, d = -1, e = 4, f = -1 \] \[ output: y \]

R denotes the ReLU function, \( R(x) = \max(0, x) \).




Given \( u = 2, v = 3, a = 1, b = 1, c = 1, d = -1, e = 4, f = -1 \), which one of the following is correct?

  • (A) \( \frac{\partial y}{\partial a} = 8, \frac{\partial y}{\partial f} = 0 \)
  • (B) \( \frac{\partial y}{\partial a} = 1, \frac{\partial y}{\partial f} = 0 \)
  • (C) \( \frac{\partial y}{\partial a} = 1, \frac{\partial y}{\partial f} = -1 \)
  • (D) \( \frac{\partial y}{\partial a} = 2, \frac{\partial y}{\partial f} = -1 \)
Correct Answer: (A) \( \frac{\partial y}{\partial a} = 8, \frac{\partial y}{\partial f} = 0 \)
View Solution

Given the inputs and weights, we can compute the output \( y \) as follows:

1. The first ReLU unit gives an output of \( R(5) = 5 \),

2. The second ReLU unit gives an output of \( R(-1) = 0 \),

3. The final output \( y \) is \( R(19) = 20 \).


Now, we compute the derivatives:
\( \frac{\partial y}{\partial a} = 8 \),
\( \frac{\partial y}{\partial f} = 0 \).


Thus, the correct answer is Option (A). Quick Tip: When calculating derivatives in neural networks, remember that the derivative of a ReLU function is:
\( 1 \) if the input is positive,
\( 0 \) if the input is non-positive.


Question 43:

Consider game trees Tree-1 and Tree-2 as shown. The first level is a MAX agent and the second level is a MIN agent. The value in the square node is the output of the utility function.





For what ranges of \( x \) and \( y \), the right child of node B and the right child of node E will be pruned by the alpha-beta pruning algorithm?

  • (A) \( x \in [1, \infty) \) and \( y \in (-\infty, 2] \)
  • (B) \( x \in (-\infty, 2] \) and \( y \in (-\infty, 5] \)
  • (C) \( x \in (-\infty, 2] \) and \( y \in [2, \infty) \)
  • (D) \( x \in [1, \infty) \) and \( y \in (-\infty, 5] \)
Correct Answer: (C) \( x \in (-\infty, 2] \) and \( y \in [2, \infty) \)
View Solution

To apply the alpha-beta pruning algorithm, we first analyze Tree-1 and Tree-2:

In Tree-1, the right child of node \( B \) (MIN) will be pruned if \( x \in (-\infty, 2] \), since the MIN node will prefer the smaller values.


In Tree-2, the right child of node \( E \) (MIN) will be pruned if \( y \in [2, \infty) \), since the MIN node will prune when \( y \) exceeds the value of \( 5 \).

Thus, the ranges of \( x \) and \( y \) that will cause pruning are \( x \in (-\infty, 2] \) and \( y \in [2, \infty) \), which corresponds to Option C. Quick Tip: When using alpha-beta pruning, prune branches that cannot affect the decision-making process based on the already explored values of the parent nodes. MIN nodes prune values greater than or equal to their beta values, and MAX nodes prune values less than or equal to their alpha values.


Question 44:

The state graph shows the action cost along the edges and the heuristic function \( h \) associated with each state. Suppose the A algorithm is applied on this state graph using a priority queue to store the frontier. In what sequence are the nodes expanded?

  • (A) S, A, E, C, B, D, G
  • (B) S, E, A, C, B, D, G
  • (C) S, A, E, B, C, D, G
  • (D) S, A, B, E, C, D, G
Correct Answer: (C) S, A, E, B, C, D, G
View Solution

We are given the state graph and the heuristic values \( h \). The A algorithm expands nodes based on the f-cost, where:
\[ f(n) = g(n) + h(n) \]

where \( g(n) \) is the cost to reach node \( n \) and \( h(n) \) is the heuristic value.

The f-cost calculations are:

\( f(S) = 2 \), \( f(A) = 4 \), \( f(E) = 10 \), \( f(B) = 6 \), \( f(C) = 10 \), \( f(D) = 9 \), \( f(G) = 10 \).

The order of expansion of nodes is based on their f-cost values. Thus, the nodes are expanded in the following order:
\[ S, A, E, B, C, D, G \]

Thus, the correct answer is Option (C). Quick Tip: When using the A algorithm, always prioritize nodes with the lowest f-cost. The f-cost is calculated as the sum of the action cost to reach a node and its heuristic value. Use a priority queue to efficiently select the node with the lowest f-cost.


Question 45:

A random experiment consists of throwing 100 fair dice, each die having six faces numbered 1 to 6. An event \( A \) represents the set of all outcomes where at least one of the dice shows a 1. Then, \( P(A) = \)

  • (A) 0
  • (B) 1
  • (C) \( 1 - \left(\frac{5}{6}\right)^{100} \)
  • (D) \( \left(\frac{5}{6}\right)^{100} \)
Correct Answer: (C) \( 1 - \left(\frac{5}{6}\right)^{100} \)
View Solution

We are asked to find the probability that at least one of the 100 dice shows a 1 when thrown.

The probability of getting a 1 on a single die is \( \frac{1}{6} \), and the probability of not getting a 1 (i.e., getting one of the other five faces) on a single die is \( \frac{5}{6} \).

Step 1: Probability of no die showing a 1


We first calculate the probability that none of the 100 dice shows a 1. Since the dice rolls are independent, the probability that a single die does not show a 1 is \( \frac{5}{6} \). Therefore, the probability that none of the 100 dice shows a 1 is:
\[ P(no 1 on any die) = \left( \frac{5}{6} \right)^{100} \]

Step 2: Probability of at least one die showing a 1


The event \( A \) represents the set of all outcomes where at least one die shows a 1. This is the complement of the event where none of the dice shows a 1. Therefore, the probability of \( A \) (at least one die shows a 1) is:
\[ P(A) = 1 - P(no 1 on any die) = 1 - \left( \frac{5}{6} \right)^{100} \]

Thus, the probability that at least one die shows a 1 is:
\[ P(A) = 1 - \left( \frac{5}{6} \right)^{100} \]

Conclusion:

The correct answer is \( \boxed{1 - \left(\frac{5}{6}\right)^{100}} \), which corresponds to Option C. Quick Tip: When calculating the probability of "at least one" in independent events, it is often easier to first calculate the probability of the complement event (i.e., "none of the events occur") and then subtract it from 1.


Question 46:

Consider a fact table in an OLAP application: Facts(D1, D2, val), where D1 and D2 are its dimension attributes and val is a dependent attribute. Suppose attribute D1 takes 3 values and D2 takes 2 values, and all combinations of these values are present in the table Facts. How many tuples are there in the result of the following query?
\[ SELECT D1, D2, sum(val) \] \[ FROM Facts \] \[ GROUP BY CUBE (D1, D2); \]

  • (A) 1
  • (B) 6
  • (C) 9
  • (D) 12
Correct Answer: (D) 12
View Solution

The CUBE operation calculates the sum for all combinations of the values of \( D1 \) and \( D2 \), along with their respective totals:


For \( D1 \) with 3 values and \( D2 \) with 2 values, the total number of combinations is \( 3 \times 2 = 6 \).


In addition to these combinations, there are:

2 aggregates over \( D1 \),

3 aggregates over \( D2 \),

1 overall aggregate.


Thus, the total number of tuples is \( 6 + 2 + 3 + 1 = 12 \). Quick Tip: The CUBE operation in OLAP computes aggregates for all combinations of dimension values, including individual dimensions and the overall total.


Question 47:

Consider the following Python code snippet. \[ A = \{"this", "that"\}, \quad B = \{"that", "other"\}, \quad C = \{"other", "this"\} \] \[ while "other" in C: \] \[ \quad if "this" in A: \] \[ \quad \quad A, B, C = A - B, B - C, C - A \] \[ \quad if "that" in B: \] \[ \quad \quad A, B, C = C | A, A | B, B | C \]
When the above program is executed, at the end, which of the following sets contains "this"?

  • (A) Only A
  • (B) Only B
  • (C) Only C
  • (D) A, C
Correct Answer: (B) Only B
View Solution

The initial sets are \( A = \{ "this", "that" \} \), \( B = \{ "that", "other" \} \), and \( C = \{ "other", "this" \} \). After executing the program and performing the set operations within the while loop, the sets are updated as follows:

\( A = \{ "other", "this" \} \)

\( B = \{ "that", "other", "this" \} \)

\( C = \{ "that", "other", "this" \} \)


Thus, "this" is found in set \( B \) at the end of the program execution.

The correct answer is Option (B). Quick Tip: In Python, set operations such as union (\(|\)) and difference (\(-\)) can modify sets in place. The "in" operator checks whether an element exists in a set, and set operations like union and difference are commonly used for solving problems involving sets.


Question 48:

Which of the following statements is/are correct about the rectified linear unit (ReLU) activation function defined as ReLU(x) = max(x, 0), where \( x \in \mathbb{R} \)?

  • (A) ReLU is continuous everywhere
  • (B) ReLU is differentiable everywhere
  • (C) ReLU is not differentiable at \( x = 0 \)
  • (D) ReLU(x) = ReLU(ax), for all \( a \in \mathbb{R} \)
Correct Answer: (A) ReLU is continuous everywhere, and (C) ReLU is not differentiable at \( x = 0 \)
View Solution

The Rectified Linear Unit (ReLU) function is defined as:
\[ ReLU(x) = \max(x, 0) \]

This function returns \( x \) for positive values and 0 for non-positive values of \( x \).

Step 1: Continuity of ReLU

The ReLU function is continuous everywhere. This is because:


For \( x > 0 \), ReLU behaves like the identity function, \( ReLU(x) = x \), which is continuous.


For \( x \leq 0 \), ReLU is constant at 0, which is also continuous.


At \( x = 0 \), the left-hand and right-hand limits both approach 0, and the function value is 0, ensuring continuity.

Thus, ReLU is continuous everywhere, so Option (A) is correct.

Step 2: Differentiability of ReLU

For \( x > 0 \), the derivative of ReLU is \( 1 \) (since ReLU behaves like \( x \) for positive values).


For \( x < 0 \), the derivative of ReLU is \( 0 \) (since ReLU is constant at 0 for non-positive values).

However, at \( x = 0 \), there is a sharp corner in the function, where the left-hand derivative is 0 and the right-hand derivative is 1. Since the derivative does not exist at \( x = 0 \), ReLU is not differentiable at \( x = 0 \).

Thus, Option (C) is correct.

Step 3: Symmetry Property of ReLU
The function \( ReLU(x) = ReLU(ax) \) holds for all \( a \in \mathbb{R} \). This is because multiplying \( x \) by a constant factor does not change whether \( x \) is positive or negative, as long as the function definition is \( \max(x, 0) \). Therefore, Option (D) is also correct.

Conclusion:

The correct answer is that ReLU is continuous everywhere (Option A), and ReLU is not differentiable at \( x = 0 \) (Option C).

Thus, the correct answer is (A) and (C). Quick Tip: The ReLU function is continuous everywhere, but not differentiable at \( x = 0 \) due to the sharp corner. When using ReLU in neural networks, this is handled by techniques like subgradient descent.


Question 49:

Consider the function \( f(x) = \frac{x^3}{3} + \frac{7}{2}x^2 + 10x + \frac{133}{2} \), \( x \in [-8, 0] \). Which of the following statements is/are correct?

  • (A) The maximum value of \( f \) is attained at \( x = -5 \)
  • (B) The minimum value of \( f \) is attained at \( x = -2 \)
  • (C) The maximum value of \( f \) is \( \frac{133}{2} \)
  • (D) The minimum value of the derivative of \( f \) is attained at \( x = -\frac{7}{2} \)
Correct Answer: (C), (D)
View Solution

We calculate the first derivative of the function \( f(x) = \frac{x^3}{3} + \frac{7}{2}x^2 + 10x + \frac{133}{2} \), which gives:
\[ f'(x) = x^2 + 7x + 10 \]

Solving \( f'(x) = 0 \), we find the critical points \( x = -2 \) and \( x = -5 \).

Evaluating the function at the critical points and endpoints:

\( f(-2) = \frac{347}{6} \)

\( f(-5) = \frac{187}{3} \)

\( f(-8) = \frac{239}{6} \)

\( f(0) = \frac{133}{2} \)


The maximum value is \( \frac{133}{2} \) at \( x = 0 \), and the minimum value occurs at \( x = -8 \).

Additionally, the minimum of the derivative occurs at \( x = -\frac{7}{2} \).

Thus, the correct answers are Option (C) and Option (D). Quick Tip: For finding maxima and minima, use the first derivative to identify critical points. To determine whether these points represent maxima or minima, you can use the second derivative or analyze the function's behavior at the endpoints of the interval.


Question 50:

Let \( x_1, x_2, x_3, x_4, x_5 \) be a system of orthonormal vectors in \( \mathbb{R}^{10} \). Consider the matrix \[ A = x_1 x_1^T + x_2 x_2^T + x_3 x_3^T + x_4 x_4^T + x_5 x_5^T. \]
Which of the following statements is/are correct?

  • (A) Singular values of A are also its eigenvalues
  • (B) Singular values of A are either 0 or 1
  • (C) Determinant of A is 1
  • (D) A is invertible
Correct Answer: (A) Singular values of A are also its eigenvalues, (B) Singular values of A are either 0 or 1
View Solution

We are given that \( A = x_1 x_1^T + x_2 x_2^T + x_3 x_3^T + x_4 x_4^T + x_5 x_5^T \), where \( x_1, x_2, x_3, x_4, x_5 \) are orthonormal vectors in \( \mathbb{R}^{10} \). The matrix \( A \) is a projection matrix onto the 5-dimensional subspace spanned by these vectors, which implies:

The eigenvalues of \( A \) are 1 (with multiplicity 5) and 0 (with multiplicity 5).


The singular values of \( A \) are the square roots of the eigenvalues of \( A \), so the singular values are either 0 or 1.

Thus, Option (A) is correct, and Option (B) is also correct.

The determinant of \( A \) is 0 because it has eigenvalues 0, and \( A \) is not invertible, so Options (C) and (D) are incorrect. Quick Tip: In an orthonormal basis, the sum of rank-1 matrices formed by outer products of orthonormal vectors results in a projection matrix. The singular values of a symmetric matrix are equal to its eigenvalues.


Question 51:

Let \( f : \mathbb{R} \to \mathbb{R} \) be a twice-differentiable function, and suppose its second derivative satisfies \( f''(x) > 0 \) for all \( x \in \mathbb{R} \). Which of the following statements is/are ALWAYS correct?

  • (A) \( f \) has a local minima
  • (B) There does not exist \( x \) and \( y \), \( x \neq y \), such that \( f'(x) = f'(y) = 0 \)
  • (C) \( f \) has at most one global minimum
  • (D) \( f \) has at most one local minimum
Correct Answer: (C) \( f \) has at most one global minimum , (B) There does not exist \( x \) and \( y \), \( x \neq y \), such that \( f'(x) = f'(y) = 0 \) , (D) \( f \) has at most one local minimum
View Solution



Since \( f''(x) > 0 \) for all \( x \in \mathbb{R} \), the function is concave up everywhere.

For option (C), because the function is concave up globally, it can only have one global minimum.

For option (B), the second derivative being positive ensures that the first derivative does not change sign more than once, which means the first derivative cannot be zero at two distinct points.

For option (D), because the function is concave up and only has one critical point, it can only have one local minimum. Quick Tip: For twice-differentiable functions with \( f''(x) > 0 \), they are concave up everywhere, and thus, they can have only one global and one local minimum, and the two coincide.


Question 52:

An \( n \times n \) matrix \( A \) with real entries satisfies the property: \[ \|Ax\|^2 = \|x\|^2, \quad for all x \in \mathbb{R}^n, \]
where \( \| \cdot \| \) denotes the Euclidean norm. Which of the following statements is/are ALWAYS correct?

  • (A) \( A \) must be orthogonal
  • (B) \( A = I \), where \( I \) denotes the identity matrix, is the only solution
  • (C) The eigenvalues of \( A \) are either +1 or -1
  • (D) \( A \) has full rank
Correct Answer: (A) \( A \) must be orthogonal, (D) \( A \) has full rank
View Solution

Given that for all \( x \in \mathbb{R}^n \), \[ \|Ax\|^2 = \|x\|^2, \]
we derive: \[ (Ax)^T (Ax) = x^T x \quad \Rightarrow \quad x^T A^T A x = x^T x. \]
This implies \( A^T A = I \), so \( A \) is an orthogonal matrix.

Since \( A \) is orthogonal, it must have full rank.

The eigenvalues of orthogonal matrices lie on the unit circle, so they are not necessarily just +1 or -1.


Therefore, Option (A) is correct: \( A \) must be orthogonal, and Option (D) is correct: \( A \) has full rank.

Option (B) is incorrect because \( A \) can be any orthogonal matrix, not just the identity matrix, and Option (C) is incorrect because the eigenvalues of \( A \) are not restricted to +1 or -1. Quick Tip: For a matrix to be orthogonal, it must satisfy \( A^T A = I \), meaning its rows and columns are orthonormal vectors. Orthogonal matrices always have full rank.


Question 53:

Consider designing a linear binary classifier \( f(x) = sign(w^T x + b), x \in \mathbb{R}^2 \) on the following training data:

Class-1: \( \left\{ \left( \begin{array}{c} 2
0 \end{array} \right), \left( \begin{array}{c} 0
2 \end{array} \right), \left( \begin{array}{c} 2
2 \end{array} \right) \right\} \quad Class-2: \left\{ \left( \begin{array}{c} 0
0 \end{array} \right) \right\} \)

Hard-margin support vector machine (SVM) formulation is solved to obtain \( w \) and \( b \). Which of the following options is/are correct?

  • (A) \( w = \left( \begin{array}{c} 4
    4 \end{array} \right) \) and \( b = 1 \)
  • (B) The number of support vectors is 3
  • (C) The margin is \( \sqrt{2} \)
  • (D) Training accuracy is 98%
Correct Answer: (B) The number of support vectors is 3 , (C) The margin is \( \sqrt{2} \)
View Solution




We are given a set of training points with two classes: \[ Class-1: \left\{ \left( \begin{array}{c} 2
0 \end{array} \right), \left( \begin{array}{c} 0
2 \end{array} \right), \left( \begin{array}{c} 2
2 \end{array} \right) \right\} \quad Class-2: \left\{ \left( \begin{array}{c} 0
0 \end{array} \right) \right\} \]
For the hard-margin SVM, the objective is to find the weight vector \( w \) and bias \( b \) such that the classifier maximizes the margin between the two classes.

The hard-margin SVM problem can be formulated as: \[ \min_{w,b} \frac{1}{2} \|w\|^2 \quad subject to: \quad y_i(w^T x_i + b) \geq 1, \, \forall i \]
Where:

\( w \) is the weight vector

\( b \) is the bias

\( x_i \) are the training data points

\( y_i \) are the corresponding class labels (1 for Class-1, -1 for Class-2)


Step 1: Determine the Support Vectors


In the SVM model, the support vectors are the data points that lie closest to the decision boundary. These are the points that are essential in defining the hyperplane, and they lie on the margin boundaries.

In our case, the support vectors are:

\( \left( 2, 0 \right) \) from Class-1

\( \left( 0, 2 \right) \) from Class-1

\( \left( 2, 2 \right) \) from Class-1


Thus, the total number of support vectors is 3.

Step 2: Find the Weight Vector \( w \)


For the SVM classifier, we need to compute the weight vector \( w \) and bias \( b \). The SVM formulation ensures that the separating hyperplane maximizes the margin while ensuring that the support vectors are correctly classified.

After solving the optimization problem, the weight vector \( w \) obtained is: \[ w = \left( \begin{array}{c} 4
4 \end{array} \right) \]
The bias \( b \) is calculated using the condition that the decision boundary passes through the support vectors. In this case, the bias \( b \) turns out to be 1.

Step 3: Calculate the Margin


The margin in an SVM is given by the formula: \[ Margin = \frac{1}{\|w\|} \]
Where \( \|w\| \) is the norm of the weight vector. For our case: \[ \|w\| = \sqrt{4^2 + 4^2} = \sqrt{32} = 4\sqrt{2} \]
Therefore, the margin is: \[ Margin = \frac{1}{4\sqrt{2}} = \frac{\sqrt{2}}{2} \]

Step 4: Training Accuracy


While the problem asks about training accuracy, we do not have enough information (such as the testing set) to calculate the training accuracy precisely. Therefore, we cannot confirm option (D) with certainty. Quick Tip: In a hard-margin SVM, the margin is directly related to the norm of the weight vector. Also, the support vectors play a key role in determining the optimal hyperplane.


Question 54:

Consider a coin-toss experiment where the probability of head showing up is \( p \). In the \( i \)-th coin toss, let \( X_i = 1 \) if head appears, and \( X_i = 0 \) if tail appears. Consider \[ \hat{p} = \frac{1}{n} \sum_{i=1}^n X_i, \]
where \( n \) is the total number of independent coin tosses. Which of the following statements is/are correct?

  • (A) \( E[\hat{p}] = p \)
  • (B) \( E[\hat{p}] = \frac{p}{n} \)
  • (C) As \( n \) increases, variance of \( \hat{p} \) decreases
  • (D) Variance of \( \hat{p} \) does not depend on \( n \)
Correct Answer: (A) \( E[\hat{p}] = p \), (C) As \( n \) increases, variance of \( \hat{p} \) decreases
View Solution

Let \( X_i \) represent the outcome of the \( i \)-th coin toss, where \( X_i = 1 \) if the toss results in heads, and \( X_i = 0 \) if it results in tails. The variable \( \hat{p} \) represents the proportion of heads in \( n \) independent tosses.

Step 1: Expected Value of \( \hat{p} \)

The expected value of \( \hat{p} \) is the average of the expected values of the individual \( X_i \)'s: \[ E[\hat{p}] = E\left[\frac{1}{n} \sum_{i=1}^n X_i \right] = \frac{1}{n} \sum_{i=1}^n E[X_i] = \frac{1}{n} \times n \times p = p. \]
Thus, Option (A) is correct: \( E[\hat{p}] = p \).

Step 2: Variance of \( \hat{p} \)

The variance of \( \hat{p} \) is: \[ Var(\hat{p}) = \frac{1}{n^2} \sum_{i=1}^n Var(X_i) = \frac{1}{n^2} \times n \times p(1 - p) = \frac{p(1 - p)}{n}. \]
This shows that as \( n \) increases, the variance of \( \hat{p} \) decreases. Therefore, Option (C) is correct: As \( n \) increases, variance of \( \hat{p} \) decreases.

Step 3: Conclusion

Thus, the correct statements are Option (A) and Option (C). Quick Tip: In a binomial distribution (like coin tossing), the expected proportion of heads (or successes) is the true probability \( p \), and the variance decreases as the number of trials \( n \) increases.


Question 55:

Consider a two-class problem in \( \mathbb{R}^d \) with class labels red and green. Let \( \mu_{red} \) and \( \mu_{green} \) be the means of the two classes. Given test sample \( x \in \mathbb{R}^d \), a classifier calculates the squared Euclidean distance (denoted by \( \| \cdot \|^2 \)) between \( x \) and the means of the two classes and assigns the class label that the sample \( x \) is closest to. That is, the classifier computes \[ f(x) = \| \mu_{red} - x \|^2 - \| \mu_{green} - x \|^2 \]
and assigns the label red to \( x \) if \( f(x) < 0 \), and green otherwise. Which of the following statements is/are correct?

  • (A) The sample \( x = 0 \) is assigned the label green if \( \| \mu_{red} \| \| \mu_{green} \| \)
  • (B) \( f \) is a linear function of \( x \)
  • (C) \( f(x) = w^T x + b \), where \( w \) and \( b \) are functions of \( \mu_{red} \) and \( \mu_{green} \)
  • (D) \( f \) is quadratic polynomial in \( x \)
Correct Answer: (B) \( f \) is a linear function of \( x \), (C) \( f(x) = w^T x + b \), where \( w \) and \( b \) are functions of \( \mu_{\text{red}} \) and \( \mu_{\text{green}} \)
View Solution

We are given that the classifier computes the squared Euclidean distance between \( x \) and the means of two classes, and we can expand the function \( f(x) \) as: \[ f(x) = \|\mu_{red} - x\|^2 - \|\mu_{green} - x\|^2 \]
Expanding both terms: \[ f(x) = (\mu_{red}^T \mu_{red} - 2 \mu_{red}^T x + x^T x) - (\mu_{green}^T \mu_{green} - 2 \mu_{green}^T x + x^T x) \]
Simplifying: \[ f(x) = (\mu_{red}^T \mu_{red} - \mu_{green}^T \mu_{green}) + 2 (\mu_{green}^T - \mu_{red}^T) x \]
This shows that \( f(x) \) is a linear function of \( x \), so Option (B) is correct.

Also, \( f(x) \) can be written as \( f(x) = w^T x + b \), where \( w = 2(\mu_{green} - \mu_{red}) \) and \( b = \mu_{red}^T \mu_{red} - \mu_{green}^T \mu_{green} \), so Option (C) is also correct. Quick Tip: The function \( f(x) = \|\mu_{red} - x\|^2 - \|\mu_{green} - x\|^2 \) is linear in \( x \) because it involves the difference of linear terms with respect to \( x \).


Question 56:

Consider the following two relations, named Customer and Person, in a database:


\[ Person \left( \begin{array}{l} aadhaar CHAR(12) PRIMARY KEY,
name VARCHAR (32); \end{array} \right) \] \[ Customer \left( \begin{array}{l} name VARCHAR (32),
email VARCHAR(32) PRIMARY KEY,
phone CHAR(10),
aadhaar CHAR(12),
FOREIGN KEY (aadhaar) REFERENCES Person (aadhaar); \end{array} \right) \]
Which of the following statements is/are correct?

  • (A) aadhaar is a candidate key in the Customer relation
  • (B) phone can be NULL in the Customer relation
  • (C) aadhaar is a candidate key in the Person relation
  • (D) aadhaar can be NULL in the Person relation
Correct Answer: (B) phone can be NULL in the Customer relation, (C) aadhaar is a candidate key in the Person relation
View Solution

Let's go through each of the statements:

Statement (A): Is aadhaar a candidate key in the Customer relation?

The aadhaar field in the Customer relation is a foreign key referencing the Person relation's aadhaar field, and it is not guaranteed to be unique in the Customer relation. Therefore, aadhaar cannot be a candidate key in Customer because a candidate key must be unique for each record in that table.

Thus, Option (A) is incorrect.

Statement (B): Can phone be NULL in the Customer relation?

In the Customer relation, the phone field is not specified as NOT NULL. Therefore, phone can be NULL in the Customer relation, which is allowed as per the given schema.

Thus, Option (B) is correct: phone can be NULL in the Customer relation.

Statement (C): Is aadhaar a candidate key in the Person relation?

In the Person relation, aadhaar is defined as the PRIMARY KEY, which by definition must be unique for each record. Therefore, aadhaar is a candidate key in the Person relation.

Thus, Option (C) is correct: aadhaar is a candidate key in the Person relation.

Statement (D): Can aadhaar be NULL in the Person relation?

The aadhaar field in the Person relation is defined as the PRIMARY KEY, and primary keys cannot be NULL. Therefore, aadhaar cannot be NULL in the Person relation.

Thus, Option (D) is incorrect: aadhaar cannot be NULL in the Person relation.

Conclusion:

The correct answers are Option (B) and Option (C). Quick Tip: In a relational database, a primary key must always be unique and cannot be NULL. A foreign key is used to establish a link between two tables but may not be unique in the table that contains it.


Question 57:

Consider a database relation \( R \) with attributes \( A, B, C, D, E, F, G \), and having the following functional dependencies:
\[ A \rightarrow BCEF \quad E \rightarrow DG \quad BC \rightarrow A \]

Which of the following statements is/are correct?

 

  • (A) \( A \) is the only candidate key of \( R \)
  • (B) \( A, BC \) are the candidate keys of \( R \)
  • (C) \( A, BC, E \) are the candidate keys of \( R \)
  • (D) Relation \( R \) is not in Boyce-Codd Normal Form (BCNF)
Correct Answer: (B) \( A, BC \) are the candidate keys of \( R \), (C) \( A, BC, E \) are the candidate keys of \( R \)
View Solution



Step 1: Analyzing the given functional dependencies.

From \( A \rightarrow BCEF \), we know that if we know \( A \), we can determine \( B, C, E, F \).

From \( E \rightarrow DG \), knowing \( E \) gives us \( D \) and \( G \).

From \( BC \rightarrow A \), knowing \( B \) and \( C \) gives us \( A \).

Thus, the combination of \( A \) and \( BC \) will allow us to determine all the attributes in the relation, making \( A \) and \( BC \) valid candidate keys.

Step 2: Checking other options.

Option (A): \( A \) alone is not the only candidate key because \( BC \) also forms a candidate key.

Option (C): \( E \) can be considered a candidate key along with \( A \) and \( BC \), because knowing \( E \) gives us \( D \) and \( G \), and with \( BC \), we can determine \( A \). This leads to all the attributes in the relation.

Option (D): The relation is in BCNF because the determinant in all functional dependencies is either a superkey or part of a superkey. Quick Tip: When solving database normalization problems, always check if the given functional dependencies can uniquely determine all attributes and analyze candidate keys carefully. For BCNF, ensure the determinant is always a superkey.


Question 58:

Let \( G \) be a simple, unweighted, and undirected graph. A subset of the vertices and edges of \( G \) are shown below.





It is given that \( a - b - c - d \) is a shortest path between \( a \) and \( d \); \( e - f - g - h \) is a shortest path between \( e \) and \( h \); \( a - f - c - h \) is a shortest path between \( a \) and \( h \). Which of the following is/are NOT the edges of \( G \)?

  • (A) \( (b,d) \)
  • (B) \( (b,g) \)
  • (C) \( (b,h) \)
  • (D) \( (e,g) \)
Correct Answer: (A) (b,d), (B) (b,g), (C) (b,h), (D) (e,g)
View Solution

Analyze the shortest paths provided in the problem.
The shortest path from \( a \) to \( d \) is \( a - b - c - d \). This means there is no direct edge between \( b \) and \( d \).
The shortest path from \( e \) to \( h \) is \( e - f - g - h \). This implies that \( e \) and \( g \) are not directly connected.
The shortest path from \( a \) to \( h \) is \( a - f - c - h \), suggesting that \( b \) and \( h \) are not directly connected. Quick Tip: For shortest path problems in graphs, analyze given shortest paths carefully to determine missing edges.


Question 59:

Let \( f : \mathbb{R} \to \mathbb{R} \) be such that \( |f(x) - f(y)| \leq (x - y)^2 \) for all \( x, y \in \mathbb{R} \). Then \[ f(1) - f(0) = \ \hspace{2cm} \quad (Answer in integer) \]

Correct Answer:
View Solution

Step 1: Analyze the given condition.

We are given that \( |f(x) - f(y)| \leq (x - y)^2 \) for all \( x, y \in \mathbb{R} \). Let’s use this condition with \( x = 1 \) and \( y = 0 \): \[ |f(1) - f(0)| \leq (1 - 0)^2 = 1 \]
Thus, we have: \[ |f(1) - f(0)| \leq 1 \]
This implies: \[ -1 \leq f(1) - f(0) \leq 1 \]

Step 2: Consider the behavior of \( f \).

Notice that the condition \( |f(x) - f(y)| \leq (x - y)^2 \) suggests that \( f(x) \) must be a very smooth function, and in fact, it implies that \( f \) is a constant function because the difference \( |f(x) - f(y)| \) is very tightly bound by \( (x - y)^2 \), which tends to 0 as \( x \) approaches \( y \). This implies that: \[ f(x) = f(0) \quad for all \ x \in \mathbb{R}. \]

Step 3: Conclusion.
Since \( f(x) = f(0) \) for all \( x \), we have: \[ f(1) - f(0) = 0 \] Quick Tip: When solving functional equations involving bounds like \( |f(x) - f(y)| \), examine the behavior as \( x \) and \( y \) get closer. Such conditions often suggest continuity or constancy of the function.


Question 60:

Let \( D = \{ x^{(1)}, x^{(2)}, \dots, x^{(n)} \} \) be a dataset of \( n \) observations where each \( x^{(i)} \in \mathbb{R}^{100} \). It is given that \[ \sum_{i=1}^{n} x^{(i)} = 0. \]
The covariance matrix computed from \( D \) has eigenvalues \( \lambda_i = 100^2 - i \), for \( 1 \leq i \leq 100 \). Let \( u \in \mathbb{R}^{100} \) be the direction of maximum variance with \( u^T u = 1 \). The value of \[ \frac{1}{n} \sum_{i=1}^{n} \left( u^T x^{(i)} \right)^2 = \hspace{2cm} \quad (Answer in integer) \]

Correct Answer:
View Solution

Step 1: Understanding the given condition.

We are given that the covariance matrix has eigenvalues \( \lambda_i = 100^2 - i \) for \( 1 \leq i \leq 100 \). The direction of maximum variance, \( u \), corresponds to the first principal component, and it is the eigenvector associated with the largest eigenvalue \( \lambda_1 = 100^2 \).

Step 2: Principal Component Analysis.

The expression \( u^T x^{(i)} \) represents the projection of the \( i \)-th data point onto the principal component \( u \). The term \( \left( u^T x^{(i)} \right)^2 \) is the squared value of this projection.

The sum \( \frac{1}{n} \sum_{i=1}^{n} \left( u^T x^{(i)} \right)^2 \) corresponds to the average of the squared projections of the data points onto the first principal component.

Step 3: Eigenvalue decomposition of the covariance matrix.

The variance along each direction is equal to the corresponding eigenvalue. Since \( u \) is the direction of maximum variance, the variance in the direction of \( u \) is equal to \( \lambda_1 = 100^2 \). Therefore, the average squared projection is:
\[ \frac{1}{n} \sum_{i=1}^{n} \left( u^T x^{(i)} \right)^2 = \lambda_1 = 100. \]

Thus, the value of \( \frac{1}{n} \sum_{i=1}^{n} \left( u^T x^{(i)} \right)^2 \) is \( 100 \).

% Quick tip
\begin{quicktipbox
In PCA, the first principal component is the direction corresponding to the largest eigenvalue of the covariance matrix. The average squared projection onto this component gives the variance along the direction of maximum variance.
\end{quicktipbox Quick Tip: In PCA, the first principal component is the direction corresponding to the largest eigenvalue of the covariance matrix. The average squared projection onto this component gives the variance along the direction of maximum variance.


Question 61:

A bag contains 5 white balls and 10 black balls. In a random experiment, \( n \) balls are drawn from the bag one at a time with replacement. Let \( S_n \) denote the total number of black balls drawn in the experiment. The expectation of \( S_{100} \) denoted by \( E[S_{100}] \) is \( \_\ \_\ \_\ \_\ \_\ \) (Round off to one decimal place).

Correct Answer: 66.7
View Solution

Step 1: Define the probability of drawing a black ball.

The bag contains a total of \( 5 + 10 = 15 \) balls. The probability of drawing a black ball in one draw is: \[ P(B) = \frac{10}{15} = \frac{2}{3}. \]

Step 2: Compute the expectation.

Since \( S_{100} \) denotes the number of black balls drawn in 100 trials, it follows a binomial distribution: \[ S_{100} \sim Binomial(100, \frac{2}{3}). \]
The expectation of a binomially distributed random variable \( X \sim Binomial(n, p) \) is given by: \[ E[X] = n p. \]
Substituting the values: \[ E[S_{100}] = 100 \times \frac{2}{3} = 66.7. \] Quick Tip: For binomial distributions, the expectation is given by \( E[X] = np \), and variance is \( Var(X) = np(1-p) \).


Question 62:

Consider the following tables, \textbf{Loan} and \textbf{Borrower}, of a bank.







Query: \[ \pi_{branch\_name, customer\_name} (Loan \bowtie Borrower) \div \pi_{branch\_name}(Loan) \]
where \( \bowtie \) denotes natural join.

The number of tuples returned by the above relational algebra query is \underline{1 (Answer in integer).

Correct Answer: 1
View Solution

Step 1: Understanding the division operation.

The relational division operation finds the set of customers who have taken loans from all branches appearing in the Loan table.

Step 2: Extracting relevant data.

The distinct branch names from the Loan table are:
\{ Banjara Hills, Kondapur, SR Nagar, Balanagar \.
A customer must have taken loans from all these branches to be included in the result.

Step 3: Identifying customers who satisfy this condition.

By analyzing the Borrower table, we find that the customer Karteek has loans in Banjara Hills (L11), Kondapur (L14), SR Nagar (L22), and Balanagar (L23), satisfying the condition.

Thus, the number of tuples returned by the query is: \[ \textbf{1}. \] Quick Tip: Relational division \( R \div S \) returns all tuples from \( R \) that are associated with all tuples in \( S \). This is useful for queries involving "for all" conditions.


Question 63:

Consider the following Python code snippet.

\begin{verbatim
def f(a, b):
if (a == 0):
return b
if (a % 2 == 1):
return 2 * f((a - 1) / 2, b)
return b + f(a - 1, b)

print(f(15, 10))
\end{verbatim

The value printed by the code snippet is \underline{160 (Answer in integer).

Correct Answer: 160
View Solution

Step 1: Understanding the function behavior.

The function \texttt{f(a, b) follows a recursive pattern.

If \( a = 0 \), it returns \( b \).

If \( a \) is odd, it halves \( a - 1 \) and multiplies the result by 2.

Otherwise, it reduces \( a \) by 1 and adds \( b \).


Step 2: Evaluating \texttt{f(15, 10)}.

1. \( f(15,10) = 2 \times f(7,10) \)

2. \( f(7,10) = 2 \times f(3,10) \)

3. \( f(3,10) = 2 \times f(1,10) \)

4. \( f(1,10) = 2 \times f(0,10) \)

5. \( f(0,10) = 10 \)

6. \( f(1,10) = 2 \times 10 = 20 \)

7. \( f(3,10) = 2 \times 20 = 40 \)

8. \( f(7,10) = 2 \times 40 = 80 \)

9. \( f(15,10) = 2 \times 80 = 160 \)


Thus, the output of the program is: \[ \textbf{160}. \] Quick Tip: Recursive functions often follow a divide-and-conquer approach. Breaking down the recursion tree step-by-step helps in understanding its behavior.


Question 64:

Consider the following pseudocode.

\begin{verbatim
Create empty stack S
Set x = 0, flag = 0, sum = 0
Push x onto S
while (S is not empty){
if (flag equals 0){
Set x = x + 1
Push x onto S

if (x equals 8):
Set flag = 1
if (flag equals 1){
x = Pop(S)
if (x is odd):
Pop(S)
Set sum = sum + x


Output sum
\end{verbatim

The value of \( sum \) output by a program executing the above pseudocode is:

Correct Answer:
View Solution

Analyzing the Pseudocode.


Initially, \( x = 0 \), \( flag = 0 \), and \( sum = 0 \).

First, \( x = 0 \) is pushed onto the stack.

The loop starts with \( flag = 0 \), and the value of \( x \) is incremented by 1 on each iteration until \( x = 8 \). So the stack contains: \( [0, 1, 2, 3, 4, 5, 6, 7, 8] \).

When \( x = 8 \), \( flag \) is set to 1.

Now, \( flag = 1 \), and we start popping values from the stack.

First, \( x = 8 \) is popped from the stack.

Since \( x = 8 \) is even, we don't pop again and add \( x \) to the sum. So, \( sum = 0 + 8 = 8 \).

Next, \( x = 7 \) is popped from the stack.

Since \( x = 7 \) is odd, we pop the next value, \( x = 6 \), and add \( x \) to the sum. So, \( sum = 8 + 6 = 14 \).

Next, \( x = 5 \) is popped from the stack.

Since \( x = 5 \) is odd, we pop the next value, \( x = 4 \), and add \( x \) to the sum. So, \( sum = 14 + 4 = 18 \).

Next, \( x = 3 \) is popped from the stack.
Since \( x = 3 \) is odd, we pop the next value, \( x = 2 \), and add \( x \) to the sum. So, \( sum = 18 + 2 = 20 \).

Finally, \( x = 1 \) is popped from the stack.

Since \( x = 1 \) is odd, we pop the next value, \( x = 0 \), and add \( x \) to the sum. So, \( sum = 20 + 4 = 24 \).


Step 2: Conclusion.

The final value of \( sum \) after the program executes is \( \boxed{24} \).

% Quick tip
\begin{quicktipbox
When analyzing pseudocode with stack operations, always keep track of the stack contents and the conditions that trigger operations like pop. In this case, the alternation between odd and even values affects how the stack is manipulated.
\end{quicktipbox Quick Tip: When analyzing pseudocode with stack operations, always keep track of the stack contents and the conditions that trigger operations like pop. In this case, the alternation between odd and even values affects how the stack is manipulated.


Question 65:

Consider a directed graph \( G = (V,E) \), where \( V = \{0,1,2,\dots,100\} \) and \[ E = \{(i,j) : 0 < j - i \leq 2, for all i,j \in V \}. \]
Suppose the adjacency list of each vertex is in decreasing order of vertex number, and depth-first search (DFS) is performed at vertex 0. The number of vertices that will be discovered after vertex 50 is:

Correct Answer: 75
View Solution

Step 1: Understanding the graph structure.

Each vertex \( i \) has directed edges to \( i+1 \) and \( i+2 \), if they exist.

The adjacency list is sorted in decreasing order, meaning DFS explores the highest-numbered neighbor first.

Step 2: DFS traversal starting from vertex 0.

DFS starts at 0 and always visits the highest-numbered connected vertex first.

This results in the traversal order: 0, 2, 4, ..., reaching 100 first.

After backtracking, vertices in the range \( 1, 3, 5, \dots \) get visited.


Step 3: Counting vertices discovered after vertex 50.

Since DFS reaches 100 before backtracking, all vertices from 51 to 100 are discovered after 50.

The number of such vertices is \( 100 - 25 = 75 \).


Thus, the number of vertices discovered after vertex 50 is: \[ \textbf{75}. \] Quick Tip: When DFS is performed with an adjacency list sorted in decreasing order, higher-numbered vertices are visited first, affecting the traversal order significantly.

*The article might have information for the previous academic years, please refer the official website of the exam.

Ask your question

Subscribe To Our News Letter

Get Latest Notification Of Colleges, Exams and News

© 2026 Patronum Web Private Limited