Updated: Mar 2026
Mock 1 - 100% FREE
CMI Data Science Mock Tests
Practice CMI Data Science mock tests with 10 full-length tests and 400+ questions. Real exam interface, All India ranking, and detailed analytics. First mock FREE!
10
Mock Tests
400+
Questions
FREE
First Mock
AIR
Ranking
Available Mock Tests
Free Mock Preview
1 Single Choice
Consider the following pseudocode for a function that processes a non-negative integer:
```
function calculateSpecialSum(n) {
if n < 0 {
return -1;
}
current_sum = 0;
place_value_multiplier = 1;
while n > 0 {
digit = n % 10;
if digit % 2 == 0 { // If digit is even
current_sum = current_sum + (digit * place_value_multiplier);
} else { // If digit is odd
current_sum = current_sum - (digit * place_value_multiplier);
}
place_value_multiplier = place_value_multiplier * 10;
n = n // 10;
}
return current_sum;
}
```
Here,
* `a % b` represents the remainder when `a` is divided by `b`. For example, .
* `a // b` represents integer division. For example, .
What will `calculateSpecialSum(1524)` return?
View Solution
**Step 1: Initialize variables.**
When `calculateSpecialSum(1524)` is called, the function first checks if . Since , it proceeds to initialize the variables:
**Step 2: Execute the while loop for each digit.**
The `while` loop continues as long as . The digits are processed from right to left (least significant to most significant).
* **Iteration 1:**
* Current
*
* Since (even),
*
*
* **Iteration 2:**
* Current
*
* Since (even),
*
*
* **Iteration 3:**
* Current
*
* Since (odd),
*
*
* **Iteration 4:**
* Current
*
* Since (odd),
*
*
**Step 3: Return the final sum.**
The loop terminates because is now . The function returns the final value of .
**Answer:**
2 Multiple Select
Let and be arbitrary matrices with real entries. A square matrix is called symmetric if and skew-symmetric if , where is the transpose of . Which of the following statements are always true?
A
For any square matrix , the matrix is symmetric.
B
If is a skew-symmetric matrix, then is a symmetric matrix.
C
If and are symmetric matrices, then their product is also a symmetric matrix.
D
For any two matrices and , the identity holds.
View Solution
We analyze each statement based on the properties of matrix transpose and multiplication.
**Step 1: For any square matrix , the matrix is symmetric.**
To check if a matrix is symmetric, we must verify if . Let . We compute its transpose:
Using the property that the transpose of a sum is the sum of the transposes, , we get:
Using the property , we have:
Since , the matrix is always symmetric. Thus, this statement is **true**.
**Step 2: If is a skew-symmetric matrix, then is a symmetric matrix.**
Given that is skew-symmetric, we have . We need to check if . Let's compute the transpose of :
Using the property of the transpose of a product, , we get:
Now, substitute the skew-symmetric property :
Since , the matrix is symmetric. Thus, this statement is **true**.
**Step 3: If and are symmetric matrices, then their product is also a symmetric matrix.**
Given that and are symmetric, we have and . We check if the product is symmetric by computing its transpose:
Using the symmetric property of and , we substitute and :
For to be symmetric, we would need , which implies . However, matrix multiplication is not commutative in general. We can provide a counterexample.
Let and . Both are symmetric.
Since , the product is not symmetric. Thus, this statement is **false**.
**Step 4: For any two matrices and , the identity holds.**
Let's expand the left-hand side using the distributive property of matrix multiplication:
For this to be equal to , we must have , where is the zero matrix. This means , i.e., the matrices and must commute. Since this is not true for all pairs of matrices, the identity does not hold in general. Thus, this statement is **false**.
Answer: \boxed{Statements 1 and 2 are true, while Statements 3 and 4 are false.}
3 Single Choice
Seven distinct individuals, including two siblings (Alice and Bob) and a married couple (Carol and David), are to be seated around a circular table. Find the number of distinct seating arrangements such that Alice and Bob are never seated next to each other, but Carol and David are always seated next to each other.
View Solution
**Step 1: Identify the total number of individuals and the primary constraint.**
We have 7 distinct individuals to be seated around a circular table. The primary constraint is that Carol and David (the married couple) must always sit together. The secondary constraint is that Alice and Bob (the siblings) must never sit next to each other.
**Step 2: Treat Carol and David as a single unit.**
Since Carol and David must always sit together, we can treat them as a single block. Let's denote this block as (CD). The remaining 5 individuals are Alice, Bob, and 3 other distinct individuals (let's call them X, Y, Z). So, we are effectively arranging 6 units around the circular table: (CD), A, B, X, Y, Z.
The number of ways to arrange distinct units around a circular table is .
Here, units. So, the number of circular arrangements for these 6 units is:
Within the (CD) block, Carol and David can be arranged in ways (CD or DC). Therefore, the total number of arrangements where Carol and David are together is:
**Step 3: Calculate arrangements where Carol and David are together AND Alice and Bob are together.**
Now, we need to consider the arrangements from Step 2 where Alice and Bob are also seated together. If Alice and Bob are together, we treat them as another single block, (AB). So, we have 5 units to arrange: (CD), (AB), X, Y, Z.
The number of ways to arrange these 5 units around a circular table is:
Within the (CD) block, Carol and David can be arranged in ways. Within the (AB) block, Alice and Bob can be arranged in ways. Therefore, the total number of arrangements where Carol and David are together AND Alice and Bob are together is:
**Step 4: Subtract the unwanted arrangements to find the final count.**
We want the number of arrangements where Carol and David are together, but Alice and Bob are *not* together. This can be found by subtracting the cases where both pairs are together from the cases where only Carol and David are together:
Answer: \boxed{144}
4 Multiple Select
Let , , and be three events in a sample space. Suppose that , , and . The events are pairwise independent, i.e., , , and . Furthermore, it is given that . Which of the following statement(s) is/are true?
A
B
The probability that exactly one of the three events occurs is .
C
The probability that at least two of the three events occur is .
D
Events and are independent.
View Solution
The solution involves applying the principles of probability for unions and intersections of events, and checking for independence.
**Step 1: Calculate pairwise intersection probabilities.**
Given that the events are pairwise independent, we calculate the probabilities of their pairwise intersections:
We are also given .
**Step 2: Evaluate the probability of the union .**
Using the Principle of Inclusion-Exclusion for three events:
Substituting the known values:
Thus, the first option is **correct**.
**Step 3: Evaluate the probability that exactly one event occurs.**
The event that exactly one of occurs is given by the sum of probabilities of the mutually exclusive events , , and . The probability can be calculated using the formula:
Thus, the second option is **correct**.
**Step 4: Evaluate the probability that at least two events occur.**
The event that at least two of occur is the union of , , and . The probability is:
The option states the probability is . Thus, the third option is **incorrect**.
**Step 5: Check for independence of and .**
For and to be independent, we must have .
First, calculate :
Then,
Next, calculate :
Since , the events are not independent. Thus, the fourth option is **incorrect**.
Answer: \boxed{\text{Statements 1 and 2 are correct; Statements 3 and 4 are incorrect.}}
5 Single Choice
An e-commerce company's annual revenue distribution by product category is shown in Figure (a). Figure (b) details the units sold (in thousands) of the 'Electronics' category across its top 5 cities.