CMI Data Science
    Test Series
    Verified Solutions Included

    Algebra & Number Theory, Sets, Logic & Relations, Probability & Random… Test for CMI Data Science: 40 Questions with Solutions & Analysis

    Attempt the Algebra & Number Theory, Sets, Logic & Relations, Probability & Random… test for CMI Data Science: 40 exam-level questions, detailed solutions and

    40 Qs

    Total Questions

    Not provided

    Total Marks

    Not provided

    Duration

    Free Solved Questions with Step-by-Step Solutions

    Authentic examination problems with detailed derivations and answer keys.

    Question 1

    Let . Which of the following statements is/are correct?

    Question 2

    Starting with , we apply operations or . Which of the following numbers requires exactly 5 operations, and the sequence of operations contains more operations than operations?

    Question 3

    Consider the following function, where // denotes integer division.

    ```python

    def process(n):

    count = 0

    while n > 4:

    if n % 3 == 0:

    n = n // 3

    else:

    n = n - 1

    count += 1

    return count

    ```

    Match the initial values of in List I with the corresponding return value of process(n) in List II.

    List I

    P.

    Q.

    R.

    S.

    List II

    1. $1$
    2. $2$
    3. $3$
    4. $4$
    Question 4
    In the following pseudocode segment, denotes an array and len() denotes the number of elements in that array. The array is indexed from 1 to len(). Write down the array in each iteration of the for loop when the input array is .
    function weirdify(A):
        for i from 1 to len(A):
            if i % 2 == 0:
                A[i] = A[i/2]*A[i]
            else if i*i > len(A):
                A[i] = A[i-2] + 4
            else:
                A[i] = A[i] - 1
    Question 5

    For how many integers does the sum divide the sum ?

    Question 6

    Let and be two events in a sample space. The probability that at least one of them occurs is , and the probability that exactly one of them occurs is . If , find the value of .

    Unlock All 40 Questions in Real Examination Mode

    Practice with the authentic timer, on-screen calculator, instant percentile ranking, and section-wise analytics.

    More CMI Data Science Test Series

    Free preview ends here

    Login to view the complete test and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Algebra & Number Theory, Sets, Logic & Relations, Probability & Random… Test for CMI Data Science: 40 Questions with Solutions & Analysis

    Attempt the Algebra & Number Theory, Sets, Logic & Relations, Probability & Random… test for CMI Data Science: 40 exam-level questions, detailed solutions and performance analysis. First questions free.

    Paper breakdown

    40 questions.

    Free sample questions from Algebra & Number Theory, Sets, Logic & Relations, Probability & Random…

    Question 1 · Discrete Mathematics MSQ

    Let . Which of the following statements is/are correct?

    1. A.

      The number of elements of divisible by at least one of $3,4,5$ is $44$.

    2. B.

      The number of elements of divisible by exactly two of $3,4,5$ is $12$.

    3. C.

      The number of elements of divisible by none of $3,4,5$ is $28$.

    4. D.

      The number of elements of divisible by exactly one of $3,4,5$ is $34$.

    Correct Answer:

    ["A","C"]

    Step-by-Step Solution

    Key idea: this is a Venn-layer counting problem. The statements ask for different layers: union, exactly two, complement, and exactly one. We compute the basic set sizes first, then derive each layer.

    Step 1: Count single divisibility sets.

    Step 2: Count pairwise intersections using LCMs.

    Step 3: Count the triple intersection.

    so

    Step 4: Count the union.

    Therefore statement A is correct.

    Step 5: Count the complement.

    Therefore statement C is correct.

    Step 6: Count exactly two.

    The sum of pairwise intersections is

    The triple intersection is counted in each pairwise intersection, so it has been counted three times. To count exactly two, remove it three times:

    Statement B claims $12$, so B is false.

    Step 7: Count exactly one.

    Use

    Thus

    Statement D claims $34$, so D is false.

    Answer: options A and C.

    Question 2 · School Level Mathematics MSQ

    Starting with , we apply operations or . Which of the following numbers requires exactly 5 operations, and the sequence of operations contains more operations than operations?

    1. A.

      43

    2. B.

      37

    3. C.

      55

    4. D.

      61

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: The number of operations determines the length of the binary representation, and the type of operation determines the bits appended.

    Step 1: Determine the binary length.

    Exactly 5 operations means the final number has bits in binary.

    The range of 6-bit numbers is . All options fall in this range.

    Step 2: Translate the operation constraint to binary digits.

    The operation appends a 0. The operation appends a 1.

    "More operations than operations" means among the 5 appended bits, there are at least three 0s and at most two 1s.

    Step 3: Count the 1s in the binary representation of each option.

    Since the leading bit is always 1, the total number of 1s in the 6-bit number must be .

    So we are looking for a number with at most three 1s in its binary representation.

    Step 4: Check the options.

    A) (four 1s) three , two . (Invalid)

    B) (three 1s) two , three . (Valid)

    C) (five 1s) four , one . (Invalid)

    D) (five 1s) four , one . (Invalid)

    Answer: B.

    Question 3 · Programming MSQ

    Consider the following function, where // denotes integer division.

    ```python

    def process(n):

    count = 0

    while n > 4:

    if n % 3 == 0:

    n = n // 3

    else:

    n = n - 1

    count += 1

    return count

    ```

    Match the initial values of in List I with the corresponding return value of process(n) in List II.

    List I

    P.

    Q.

    R.

    S.

    List II

    1. $1$
    2. $2$
    3. $3$
    4. $4$
    1. A.

      P-1, Q-3, R-1, S-2

    2. B.

      P-2, Q-3, R-2, S-2

    3. C.

      P-1, Q-2, R-1, S-3

    4. D.

      P-1, Q-3, R-1, S-3

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: The loop condition is strictly n > 4, meaning the loop terminates the moment reaches $4$ or less.

    Exam route: Trace each value step-by-step using a table, updating and count until the condition becomes false.

    Learning route:

    • For P (): (True) , count = 1. (False). Loop ends. Return 1. (Matches 1)
    • For Q (): (True) , count = 1. (True) , count = 2. (True) , count = 3. (False). Loop ends. Return 3. (Matches 3)
    • For R (): (True) , count = 1. (False). Loop ends. Return 1. (Matches 1)
    • For S (): (True) , count = 1. (True) , count = 2. (False). Loop ends. Return 2. (Matches 2)

    The correct matching is P-1, Q-3, R-1, S-2.

    Question 4 · Programming SUB
    In the following pseudocode segment, denotes an array and len() denotes the number of elements in that array. The array is indexed from 1 to len(). Write down the array in each iteration of the for loop when the input array is .
    function weirdify(A):
        for i from 1 to len(A):
            if i % 2 == 0:
                A[i] = A[i/2]*A[i]
            else if i*i > len(A):
                A[i] = A[i-2] + 4
            else:
                A[i] = A[i] - 1
    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is a cascading in-place mutation problem with multi-branch conditionals. The loop modifies as it runs, and later iterations read back values that were already overwritten via and . The key is to maintain a live-state trace table and never use stale values.

    Exam route: Build a trace table row by row. For each from 1 to 6, evaluate the three branches strictly top-down ( first, then , then else). Compute the right-hand side using the current live array, then record the full new array state.

    Learning route: This is a cascading-dependency pseudocode trace, recognisable because the loop mutates array in-place and later iterations reference earlier indices (, ) that may have already been overwritten. The method is the tabular tracing method with live-state reads.

    Initial state: , .

    Iteration :

    • skip first branch.
    • ? No skip second branch.
    • else: .
    • Array after :

    Iteration :

    • first branch applies.
    • .
    • Array after :

    Iteration :

    • skip first branch.
    • ? Yes second branch applies.
    • .
    • Array after :

    Iteration :

    • first branch applies.
    • .
    • Array after :

    Iteration :

    • skip first branch.
    • ? Yes second branch applies.
    • .
    • Array after :

    Iteration :

    • first branch applies.
    • .
    • Array after :

    Final answer: The array states after each iteration are:

    • :
    • :
    • :
    • :
    • :
    • :

    Verification: Re-check : was set to 57 at , and was 12. . Correct. Re-check : was set to 23 at , and was 6. . Correct.

    Question 5 · School Level Mathematics MSQ

    For how many integers does the sum divide the sum ?

    1. A.

      31

    2. B.

      33

    3. C.

      34

    4. D.

      35

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a divisibility condition involving summation formulas. We must express both sums in closed form and simplify the divisibility requirement.

    Step 1: Recall the formulas:

    Step 2: We want to divide .

    Since , , so we can cancel it.

    The condition simplifies to: divides , which means must be an integer.

    Step 3: Thus, we need .

    .

    Wait, let's re-evaluate the division.

    .

    So we need .

    .

    Let's check : sum1 = 1, sum2 = 1. 1 divides 1. (1 mod 3 = 1).

    : sum1 = 3, sum2 = 5. 3 does not divide 5. (2 mod 3 = 2).

    : sum1 = 6, sum2 = 14. 6 does not divide 14. (0 mod 3 = 0).

    : sum1 = 10, sum2 = 30. 10 divides 30. (1 mod 3 = 1).

    So is the ONLY condition!

    Wait, what about the parity? The formula is an integer if . There is no parity constraint because the terms cancel completely, including the 2 in the denominator!

    Let me re-read my previous thought. I said . That was wrong.

    The ratio is exactly .

    So we just need .

    Step 4: Count such that .

    The sequence is .

    This is an arithmetic progression with first term 1, common difference 3.

    .

    There are 34 such integers.

    Answer: 34

    Question 6 · Probability Theory SUB

    Let and be two events in a sample space. The probability that at least one of them occurs is , and the probability that exactly one of them occurs is . If , find the value of .

    Correct Answer:

    3

    Step-by-Step Solution

    Key idea: this is a four-region table question. The Venn diagram of two events splits the sample space into four disjoint regions. We can assign variables to these regions and use the given conditions to solve for the intersection.

    Step 1: let , , and .

    The condition "at least one occurs" means .

    The condition "exactly one occurs" means .

    Step 2: subtract the second equation from the first to find :

    .

    So .

    Step 3: we are given .

    and .

    So .

    Step 4: substitute into the equation:

    .

    We also know .

    Substitute : .

    Step 5: find :

    .

    Step 6: the question asks for .

    .

    Answer: 3

    More CMI Data Science tests