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

    91 Marks

    Total Marks

    118.825 Mins

    Duration

    +3 / -1 / 0

    Marking Scheme

    Section-wise Paper Structure

    School Level Mathematics

    21 Qs

    53% of total marks

    Probability Theory

    8 Qs

    20% of total marks

    Programming

    7 Qs

    18% of total marks

    Discrete Mathematics

    4 Qs

    10% of total marks

    Free Solved Questions with Step-by-Step Solutions

    Authentic examination problems with detailed derivations and answer keys.

    Question 1
    2026 PYQ
    Level 3: Exam Standard

    Common Description:

    Questions (13) and (14) are based on the following information.

    Let be a prime and be a natural number such that

    Suppose . Show that the numbers leave distinct remainders upon division by .

    Question 2
    2026 PYQ
    Level 3: Exam Standard

    Find all two-digit positive integers that are equal to three times the sum of their digits.

    Question 3
    Level 3: Exam Standard

    Let be a two-digit positive integer. When its digits are reversed

    the resulting number exceeds the original by .

    How many such two-digit integers exist?

    Question 4
    2021 PYQ
    Level 3: Exam Standard
    We draw two rows of points with labels , as shown in the figure below.
    1 2 3 1 2 3
    We connect each point on the top with a point on the bottom at random, making sure that no two points on the top are connected to the same point on the bottom. We say point on the top is special if it gets connected to point below.
    Let be the number of special points. What is , the expected value of ?
    Question 5
    2020 PYQ
    Level 3: Exam Standard

    Let and be events such that , and . Which of the following are true? (For sets , .)

    Question 6
    2021 PYQ
    Level 3: Exam Standard
    In the finale of the Indian Idol programme, Ladies Special, there are four women contestants — Arunima, Priyamani, Razi and Shriya. The organisers send all participants a list of 7 songs, asking each one to pick one song for the finale. All the four girls pick the same song, Pyar Hua Chupkese from the film 1942 A Love Story. To resolve the tie, two days before the finale, the organisers prepare 7 sheets of paper and fold them. Exactly one of the 7 songs from the list is written on each folded sheet and the folded sheets are identical in all other aspects. First Arunima is asked to pick one sheet out of 7, then Priyamani is asked to pick one sheet out of the remaining 6, then Razi is asked to pick one out of the remaining 5 and finally Shriya is asked to pick one out of the remaining 4.
    (a) What is the probability that the sheet chosen by Razi has the song Pyar Hua Chupkese?
    (b) When Shriya is asked to choose a sheet, she argues that the three sheets chosen by the others should be opened, and if Pyar Hua Chupkese is not chosen by anyone, she should be allowed to pick that song. This is agreed to. What is the probability that Shriya gets to sing the song Pyar Hua Chupkese?
    Question 7
    2026 PYQ
    Level 3: Exam Standard

    Common Description:

    Questions (8) and (9) are based on the following description.

    In the pseudocode below, the function Steps(n) takes a positive integer as input. For positive integers and , the expression evaluates to the remainder obtained when is divided by .

    function Steps(n) {

    count = 0;

    while (n > 1) {

    if (n % 2 == 0) {

    n = n / 2;

    } else {

    n = n - 1;

    }

    count = count + 1;

    }

    return(count);

    }

    Compute the value of Steps(13).

    Question 8
    2026 PYQ
    Level 4: Challenger

    Common Description:

    Questions (8) and (9) are based on the following description.

    In the pseudocode below, the function Steps(n) takes a positive integer as input. For positive integers and , the expression evaluates to the remainder obtained when is divided by .

    function Steps(n) {

    count = 0;

    while (n > 1) {

    if (n % 2 == 0) {

    n = n / 2;

    } else {

    n = n - 1;

    }

    count = count + 1;

    }

    return(count);

    }

    Let be a positive integer with exactly digits in its binary representation. What is the maximum possible value of Steps(n)? For which value(s) of (expressed in terms of ) is this maximum attained?

    Question 9
    2023 PYQ
    Level 3: Exam Standard
    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 10
    2021 PYQ
    Level 3: Exam Standard
    The CMI MSc DS 2021 batch of 60 students is holding an online event to celebrate their joining CMI. Student Aruni is in charge of organizing the musical section, and she sends out an online form where each student has to mark whether they agree or decline to performing two activities during the event: singing, and playing a musical instrument. Each student can mark one of four sets of choices: (i) agree to both singing and playing an instrument, (ii) agree to sing and decline to play an instrument, (iii) agree to play an instrument and decline to sing, or (iv) decline to do either activity.
    All the students respond within the deadline, and Aruni sits down to tabulate the results so that she can plan the musical events. She finds that thirty five students agreed to sing or play an instrument, of whom twenty students agreed to do both.
    How many students agreed to do exactly one activity, and how many declined to participate?
    Question 11
    2025 PYQ
    Level 3: Exam Standard

    How many positive integers less than 1000 are neither divisible by 3 nor divisible by 5? Explain how you arrived at your answer.

    Question 12
    Level 3: Exam Standard

    Let and be subsets of a finite universal set with . It is given that and . Which of the following CANNOT be 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.

    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 · 91 marks · 118.825 minutes. School Level Mathematics: 21 · Probability Theory: 8 · Programming: 7 · Discrete Mathematics: 4

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

    Question 1 · School Level Mathematics · 2026 SUB

    Common Description:

    Questions (13) and (14) are based on the following information.

    Let be a prime and be a natural number such that

    Suppose . Show that the numbers leave distinct remainders upon division by .

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: "Distinct remainders mod " means pairwise non-congruent. Assume each of the three possible collisions and derive contradictions from with .

    Exam route: Three pairs to check: (i) , contradicts . (ii) or ; gives (impossible), already ruled out. (iii) ; ruled out, gives (impossible). All collisions ruled out, so leave distinct remainders.

    Learning route: This is a modular distinctness proof by contradiction, recognisable from "show that ... leave distinct remainders" combined with a polynomial divisibility condition.

    Step 1: "Distinct remainders mod " means no two of are congruent mod . There are pairs to check: , , and .

    Step 2: Assume . Substitute into : get , so , meaning . But , contradiction.

    Step 3: Assume . Factor: . Since is prime, or . If , then , so , impossible. If , already ruled out in Step 2.

    Step 4: Assume . Then , so or . The case is ruled out. If , substitute into : get , impossible.

    Step 5: Since all three possible collisions lead to contradictions, must leave distinct remainders modulo .

    Question 2 · School Level Mathematics · 2026 SUB

    Find all two-digit positive integers that are equal to three times the sum of their digits.

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: Translate the verbal condition into the place-value equation , simplify to , then use digit bounds to find the unique solution .

    Exam route:

    Let the number be with and .

    Condition: .

    Since , must be even. Also .

    The only positive even integer is , giving .

    The number is .

    Learning route:

    1. This is a digit-equation question, recognisable because a two-digit number is described in terms of the sum of its digits.
    2. The phrase "two-digit positive integers" forces two things: use place value , and impose digit bounds , . The leading-zero trap () is essential.
    3. Write the number as , write the digit sum as , and set up the equation .
    4. Expand and rearrange: .
    5. This is now a divisibility-and-bounding problem. Since , the factor of must divide , so .
    6. Test each candidate in :
    • , valid (single digit ).
    • , invalid (not a digit).
    • , invalid.
    • , invalid.
    1. The only solution is , so the number is .
    2. A common wrong path is to forget the digit bound and accept as a solution, producing a nonsensical "number" with a two-digit "digit". Always check that every variable representing a digit actually falls in .
    3. Verification: The digit sum of is . Three times the digit sum is , which equals the original number. Confirmed.
    Question 3 · School Level Mathematics MSQ

    Let be a two-digit positive integer. When its digits are reversed

    the resulting number exceeds the original by .

    How many such two-digit integers exist?

    1. A.

      4

    2. B.

      5

    3. C.

      6

    4. D.

      7

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: set up the reversal equation and reduce it to a simple difference of digits, then count valid pairs.

    Step 1: Original number is ; reversed is , with and .

    Step 2: The condition gives , which simplifies to .

    Step 3: So .

    Step 4: Enumerate valid pairs with , , and :

    .

    Step 5: There are exactly such numbers: .

    Answer: 6

    Question 4 · Probability Theory · 2021 SUB
    We draw two rows of points with labels , as shown in the figure below.
    1 2 3 1 2 3
    We connect each point on the top with a point on the bottom at random, making sure that no two points on the top are connected to the same point on the bottom. We say point on the top is special if it gets connected to point below.
    Let be the number of special points. What is , the expected value of ?
    Correct Answer:

    1.00

    Step-by-Step Solution

    Key idea: this is a linearity of expectation problem involving random matchings (permutations).

    Step 1: Let be the total number of special points. We can write , where is an indicator random variable such that if point on the top is connected to point on the bottom (a "special" point), and otherwise.

    Step 2: The total number of ways to connect the top points to the bottom points is (all permutations are equally likely).

    Step 3: For a specific point , the number of permutations where point is connected to point is (since the remaining points can be connected in any way).

    Step 4: Therefore, the probability that point is special is .

    Step 5: By linearity of expectation, the expected value of is the sum of the expected values of the indicators:

    .

    Answer: 1.00.

    Question 5 · Probability Theory · 2020 MSQ

    Let and be events such that , and . Which of the following are true? (For sets , .)

    1. A.

      and are mutually exclusive

    2. B.

      and are independent

    3. C.

    4. D.

    Correct Answer:

    ["B","D"]

    Step-by-Step Solution

    Key idea: This question tests the Addition Rule, independence criteria, symmetric difference, and De Morgan's Laws.

    Step 1: Find using the Addition Rule.

    .

    Step 2: Check Option A (Mutually Exclusive). Mutually exclusive means . Here it is 0.2, so A is false.

    Step 3: Check Option B (Independent). Independent means . Here , which matches exactly. B is true.

    Step 4: Check Option C (Symmetric Difference). . The option claims 0.1, so C is false.

    Step 5: Check Option D (De Morgan's Laws). . This matches the option, so D is true.

    Answer: B and D are true.

    Question 6 · Probability Theory · 2021 SUB
    In the finale of the Indian Idol programme, Ladies Special, there are four women contestants — Arunima, Priyamani, Razi and Shriya. The organisers send all participants a list of 7 songs, asking each one to pick one song for the finale. All the four girls pick the same song, Pyar Hua Chupkese from the film 1942 A Love Story. To resolve the tie, two days before the finale, the organisers prepare 7 sheets of paper and fold them. Exactly one of the 7 songs from the list is written on each folded sheet and the folded sheets are identical in all other aspects. First Arunima is asked to pick one sheet out of 7, then Priyamani is asked to pick one sheet out of the remaining 6, then Razi is asked to pick one out of the remaining 5 and finally Shriya is asked to pick one out of the remaining 4.
    (a) What is the probability that the sheet chosen by Razi has the song Pyar Hua Chupkese?
    (b) When Shriya is asked to choose a sheet, she argues that the three sheets chosen by the others should be opened, and if Pyar Hua Chupkese is not chosen by anyone, she should be allowed to pick that song. This is agreed to. What is the probability that Shriya gets to sing the song Pyar Hua Chupkese?
    Correct Answer:

    0.57

    Step-by-Step Solution

    Key idea: this is a sampling without replacement problem where symmetry and conditional probability simplify the analysis.

    Step 1 (Part a): Razi is the 3rd person to pick. By symmetry, every song is equally likely to be in any position of the 7 sheets. Thus, the probability that the specific song is in the 3rd position (Razi's pick) is exactly .

    Step 2 (Part b): Shriya is the 4th person. She argues that if the song has not been chosen by the first three, she should be allowed to pick it. This means she gets the song if and only if it was not chosen by Arunima, Priyamani, or Razi.

    Step 3: The probability that the specific song is not chosen by the first three people is the probability that it remains among the last 4 sheets.

    This is calculated as: .

    Since she is guaranteed to pick it if it's available, her probability of getting the song is exactly .

    Numerically, , which rounds to .

    Answer: 0.57.

    Question 7 · Programming · 2026 SUB

    Common Description:

    Questions (8) and (9) are based on the following description.

    In the pseudocode below, the function Steps(n) takes a positive integer as input. For positive integers and , the expression evaluates to the remainder obtained when is divided by .

    function Steps(n) {

    count = 0;

    while (n > 1) {

    if (n % 2 == 0) {

    n = n / 2;

    } else {

    n = n - 1;

    }

    count = count + 1;

    }

    return(count);

    }

    Compute the value of Steps(13).

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is a standard even-halve, odd-subtract while-loop tracing question.

    Exam route: Build a trace table for n=13 until n=1.

    Learning route:

    Step 1: Initialize n=13, count=0.

    Step 2: 13 is odd -> n=12, count=1.

    Step 3: 12 is even -> n=6, count=2.

    Step 4: 6 is even -> n=3, count=3.

    Step 5: 3 is odd -> n=2, count=4.

    Step 6: 2 is even -> n=1, count=5.

    Step 7: n=1, loop condition n > 1 is false. Loop terminates.

    Step 8: Return count = 5.

    Wrong path: Counting the failed check at n=1 gives 6.

    Generalization: Always count only completed loop-body executions.

    Question 8 · Programming · 2026 SUB

    Common Description:

    Questions (8) and (9) are based on the following description.

    In the pseudocode below, the function Steps(n) takes a positive integer as input. For positive integers and , the expression evaluates to the remainder obtained when is divided by .

    function Steps(n) {

    count = 0;

    while (n > 1) {

    if (n % 2 == 0) {

    n = n / 2;

    } else {

    n = n - 1;

    }

    count = count + 1;

    }

    return(count);

    }

    Let be a positive integer with exactly digits in its binary representation. What is the maximum possible value of Steps(n)? For which value(s) of (expressed in terms of ) is this maximum attained?

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is a binary-analysis optimization question on the even-halve/odd-subtract loop.

    Exam route: Translate each branch into its binary effect and build the steps formula.

    Learning route:

    Step 1: A k-bit number has 1 leading 1, c-1 non-leading 1s, and k-c zeros.

    Step 2: Each 0 requires 1 step (halve). Each non-leading 1 requires 2 steps (subtract 1, then halve). The leading 1 is never removed because the loop stops at n=1.

    Step 3: Total steps S = 1(k-c) + 2(c-1) = k + c - 2.

    Step 4: To maximize S for a fixed k, maximize c. The maximum number of 1s is c = k.

    Step 5: S_max = k + k - 2 = 2k - 2. This is attained when n = 2^k - 1.

    Wrong path: Counting the leading 1 as needing a removal step gives 2k - 1.

    Generalization: The loop stops exactly when n=1, so the leading 1 is never processed.

    Question 9 · Programming · 2023 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 10 · Discrete Mathematics · 2021 SUB
    The CMI MSc DS 2021 batch of 60 students is holding an online event to celebrate their joining CMI. Student Aruni is in charge of organizing the musical section, and she sends out an online form where each student has to mark whether they agree or decline to performing two activities during the event: singing, and playing a musical instrument. Each student can mark one of four sets of choices: (i) agree to both singing and playing an instrument, (ii) agree to sing and decline to play an instrument, (iii) agree to play an instrument and decline to sing, or (iv) decline to do either activity.
    All the students respond within the deadline, and Aruni sits down to tabulate the results so that she can plan the musical events. She finds that thirty five students agreed to sing or play an instrument, of whom twenty students agreed to do both.
    How many students agreed to do exactly one activity, and how many declined to participate?
    Correct Answer:

    15

    Step-by-Step Solution

    Key idea: This is a 2-set survey cardinality problem asking for "exactly one" and "neither", recognisable by the four-choice structure (both, A only, B only, neither) and the inclusive "or" phrasing.

    Step 1: Extract the given data. Total students = 60. "Agreed to sing or play" = inclusive union, so . "Agreed to do both" = intersection, so .

    Step 2: Find students who agreed to exactly one activity. "Exactly one" means the union minus the intersection: .

    Step 3: Find students who declined both. "Neither" = Total Union = .

    Note: The original question asks for two values (15 and 25). The primary answer recorded here is 15 (exactly one activity).

    Answer: 15

    Question 11 · Discrete Mathematics · 2025 SUB

    How many positive integers less than 1000 are neither divisible by 3 nor divisible by 5? Explain how you arrived at your answer.

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is a "neither-nor over an integer range" question, recognisable because it asks for a count of integers in a bounded range that avoid two divisibility conditions simultaneously.

    Exam route:

    1. The positive integers less than 1000 are , so .
    2. Let be multiples of 3. Then .
    3. Let be multiples of 5. Then .
    4. The overlap is multiples of , so .
    5. Unwanted union: .
    6. Required complement: .

    Learning route:

    The phrase "neither divisible by 3 nor divisible by 5" triggers complement counting. Instead of listing every qualifying integer, we count the unwanted ones (multiples of 3 or 5) and subtract from the total. The sizes of divisibility sets inside are found by floor division. The critical step is Inclusion-Exclusion: multiples of both 3 and 5 (i.e., multiples of 15) are counted in both and , so we must subtract once to avoid double-counting.

    Wrong path:

    A tempting shortcut is . This breaks at step 5: the multiples of 15 have been subtracted twice (once inside and once inside ), so we must add them back. The correct complement form is .

    Another error is using instead of 999. "Less than 1000" means the maximum integer is 999. Using 1000 would incorrectly yield .

    Generalization: For any range to , the count of integers divisible by neither nor is .

    Verification: The number of integers divisible by 3 or 5 is 466. Adding the 533 integers not divisible by either gives , which exactly matches the total number of positive integers less than 1000.

    Question 12 · Discrete Mathematics MSQ

    Let and be subsets of a finite universal set with . It is given that and . Which of the following CANNOT be the value of ?

    1. A.

      3

    2. B.

      8

    3. C.

      15

    4. D.

      28

    5. E.

      35

    Correct Answer:

    E

    Step-by-Step Solution

    Key idea: This is a bounding problem on the intersection of two sets, recognisable because it asks which value is impossible given set sizes and the universal set size.

    Step 1: Establish the upper bound on . Since and :

    Step 2: Establish the lower bound. By inclusion-exclusion, . Since :

    Step 3: So the valid range is .

    Step 4: Check each option:

    • 3: valid (minimum, when union = 60)
    • 8: valid
    • 15: valid
    • 28: valid (maximum, when )
    • 35: INVALID, exceeds

    Answer: E (35)

    More CMI Data Science tests