CMI Data Science
    Mock Tests
    Verified Solutions Included
    Mock Test 3 for CMI Data Science: 40 Questions with Solutions & Analysis

    Attempt the Mock Test 3 for CMI Data Science: 40 exam-level questions, detailed solutions and performance analysis. First questions free.

    40 Qs

    Total Questions

    86 Marks

    Total Marks

    139.3 Mins

    Duration

    +3 / -1 / 0

    Marking Scheme

    Section-wise Paper Structure

    School Level Mathematics

    14 Qs

    35% of total marks

    Probability Theory

    10 Qs

    25% of total marks

    Discrete Mathematics

    10 Qs

    25% of total marks

    Programming

    6 Qs

    15% of total marks

    Free Solved Questions with Step-by-Step Solutions

    Authentic examination problems with detailed derivations and answer keys.

    Question 1
    2023 PYQ
    Level 3: Exam Standard

    Consider the following real valued function defined on the entire set of real numbers:

    Show that .

    Question 2
    2023 PYQ
    Level 3: Exam Standard

    Let . How many bits are required to write in binary (base 2)? How many digits are required to write in decimal (base 10)? You may assume that .

    Question 3
    Level 3: Exam Standard

    Let . The number of integer values of for which the equation has exactly three distinct real roots is:

    Question 4
    2024 PYQ
    Level 3: Exam Standard
    Common Description: Questions 18–20 are based on the following description. In June 2017, a cyberattack named NotPetya spread all over the world. Big companies like Marex, Merck, and FedEx’s TNT Express lost a lot of money because of this attack. Company Pre-attack Average Monthly Revenue (USD million) Post-Attack Average Monthly Revenue (USD million) Marex 1000 700 Merc 800 480 TNT Expanse 500 250 Table 1: Financial impact of NotPetya attack on three major companies Which company experienced the smallest percentage decrease in total revenue over a one month period relative to its estimated total revenue loss over the same period?
    Question 5
    Level 3: Exam Standard

    Two integers and are chosen independently and uniformly at random from the set . Define the events:

    Find the number of ordered pairs for which exactly two of the events , , occur.

    Question 6
    Level 3: Exam Standard

    Let be a continuous random variable with probability density function

    where is the normalizing constant. Find the variance of .

    Question 7
    2022 PYQ
    Level 4: Challenger
    You are given an chessboard and a large supply of -shaped tiles and square-shaped tiles of the kind shown below.

    Note that the squares in these two shaped tiles are of the same size as the black/white squares on the chessboard.
    We wish to cover the squares of the chess board using these tiles. Each square of the chessboard must be occupied by exactly one square from a tile; we are not allowed to break the tiles.
    (a) Is it possible to cover the chessboard with 16 T shaped tiles? Why?
    (b) Is it possible to cover the chessboard with 15 T shaped tiles and one square tile? Why
    Question 8
    2024 PYQ
    Level 3: Exam Standard

    Find the number of all 4-digit natural numbers formed with exactly two distinct digits.

    Question 9
    Level 3: Exam Standard

    Let be three sets such that , , . The pairwise intersections are , , . If the number of elements in exactly one set is equal to the number of elements in exactly two sets, find the number of elements in all three sets.

    Question 10
    2020 PYQ
    Level 3: Exam Standard

    Consider the following program. Assume that all variables are integers. Note that x%y computes the remainder after dividing x by y. The division is an integer division. For example, 1/3 will return zero while 10/3 will return 3.

    g(n)

    {

    result = 0;

    i = 1;

    repeat until (n == 0)

    {

    remainder = n%2;

    n = n / 2;

    result = result + (remainder * i);

    i = i * 10;

    }

    return result;

    }

    What is g(25)?

    Question 11
    2020 PYQ
    Level 3: Exam Standard
    Consider the following code, where A is an array of integers of size size(A) with values A[0] to A[size(A)-1], and reverse(A,i,j) reverses the segment A[i] to A[j] if i <= j and has no effect otherwise. For instance, if A = [0,1,2,3,4,5], then reverse(A,2,4) would modify A to [0,1,4,3,2,5].
    def mystery(A){
        for j in [0,1,...,size(A)-1] {
            p = j;
            for i in [j,j+1,...,size(A)-1] {
                if A[i] > A[p] {
                    p = i;
                }
            }
            reverse(A,j,p);
        }
    }
    (a) What is the effect of this code on an input array A?
    (b) Suppose size(A) is 1000. How many times is the test A[i] > A[p] executed?
    Question 12
    Level 4: Challenger

    Consider the following pseudocode segment:

    ```

    function mystery(n):

    count = 0

    for i from 1 until n:

    for j from 1 to i:

    if (i + j) % 5 == 0:

    count = count + 1

    return count

    ```

    How many pairs satisfy the condition inside the loops when ?

    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 Mock Tests

    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.

    Mock Test 3 for CMI Data Science: 40 Questions with Solutions & Analysis

    Attempt the Mock Test 3 for CMI Data Science: 40 exam-level questions, detailed solutions and performance analysis. First questions free.

    Paper breakdown

    40 questions · 86 marks · 139.3 minutes. School Level Mathematics: 14 · Probability Theory: 10 · Discrete Mathematics: 10 · Programming: 6

    Free sample questions from Mock Test 3

    Question 1 · School Level Mathematics · 2023 SUB

    Consider the following real valued function defined on the entire set of real numbers:

    Show that .

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is a self-referential derivative identity question, recognizable because the target expression contains itself. The efficient strategy is to differentiate first using the chain rule, then rewrite the raw derivative in terms of and .

    Exam route:

    Write .

    By the chain rule, .

    Also, .

    Hence .

    Learning route:

    Step 1: This is a self-referential derivative identity question, recognizable because the right-hand side contains itself. This means we must differentiate and then rewrite the result back in terms of .

    Step 2: Rewrite as a negative power to prepare for the chain rule: .

    Step 3: Identify the outer function and the inner function .

    Step 4: Differentiate the outer function: .

    Step 5: Differentiate the inner function: .

    Step 6: Apply the chain rule: . The two minus signs cancel, giving .

    Step 7: Compute the complement by finding a common denominator: .

    Step 8: Multiply: .

    Step 9: This equals , completing the proof.

    Common trap: Forgetting the chain rule on and writing the derivative of as instead of . This produces with the wrong sign. The two negatives must cancel.

    Verification: At , , so . Direct computation gives . The identity holds.

    Question 2 · School Level Mathematics · 2023 SUB

    Let . How many bits are required to write in binary (base 2)? How many digits are required to write in decimal (base 10)? You may assume that .

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: in base 2 is a single followed by zeros, occupying bit positions; its decimal digit count follows from .

    Exam route:

    Binary: written in base 2 is followed by zeros. The positions used are , which is positions. So needs bits.

    Decimal: The number of decimal digits of a positive integer is . Here . So .

    Learning route:

    1. This is a representation-length question, recognisable because a huge power is given and the task asks for the number of digits or bits rather than the value itself.
    2. The phrase "how many bits in base 2" triggers the rule that in base has exactly digits: a followed by zeros. The positions used are , totalling positions. So needs bits.
    3. The phrase "how many digits in base 10" triggers the digit-count formula: a positive integer has decimal digits exactly when . Taking gives , so .
    4. Compute .
    5. Therefore .
    6. A common trap is to assume the exponent is the number of decimal digits. This ignores the base-conversion factor , which scales the power down significantly. The exponent tells you the binary length minus one, not the decimal length.
    7. Another wrong path: computing as by rounding up instead of flooring down. The floor function always drops the fractional part: , then add to get .
    8. Verification: . Since , we get . And , confirming . So has exactly decimal digits.

    Final answers: bits in binary, digits in decimal.

    Question 3 · School Level Mathematics SUB

    Let . The number of integer values of for which the equation has exactly three distinct real roots is:

    Correct Answer:

    3

    Step-by-Step Solution

    Key idea: This is a reverse-engineering question that uses the local extrema of a cubic function to determine the number of roots for a horizontal line . The twist is carefully handling the boundary values where roots are repeated.

    Step 1: Find the critical points of .

    .

    Setting gives critical points at and .

    Step 2: Evaluate at the critical points.

    . (Local minimum, since ).

    . (Local maximum, since ).

    Step 3: Analyze the graph of .

    Since is a cubic with a positive leading coefficient:

    • As , .
    • It increases to the local max at .
    • It decreases to the local min at .
    • It increases to as .

    Step 4: Determine the condition for exactly three distinct real roots.

    The equation represents the intersection of and the horizontal line .

    For the line to intersect the cubic in exactly three distinct points, it must pass strictly between the local minimum and local maximum values.

    Therefore, we need .

    (If or , the line is tangent to the curve at the extremum, giving a repeated root and only 2 distinct roots).

    Step 5: Count the integer values of .

    The integers strictly between and are .

    There are exactly 3 such integer values.

    Common trap: Including the boundary values and , which give repeated roots and thus do not have exactly three distinct real roots.

    Answer: 3

    Question 4 · Probability Theory · 2024 SUB
    Common Description: Questions 18–20 are based on the following description. In June 2017, a cyberattack named NotPetya spread all over the world. Big companies like Marex, Merck, and FedEx’s TNT Express lost a lot of money because of this attack. Company Pre-attack Average Monthly Revenue (USD million) Post-Attack Average Monthly Revenue (USD million) Marex 1000 700 Merc 800 480 TNT Expanse 500 250 Table 1: Financial impact of NotPetya attack on three major companies Which company experienced the smallest percentage decrease in total revenue over a one month period relative to its estimated total revenue loss over the same period?
    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This question tests relative impact analysis by comparing the percentage decrease in revenue across different entities.

    Exam route: Calculate (Pre - Post) / Pre for each company. Compare the resulting percentages to find the smallest.

    Learning route:

    Step 1: Parse the data from the table for each company.

    • Marex: Pre = 1000, Post = 700
    • Merc: Pre = 800, Post = 480
    • TNT Expanse: Pre = 500, Post = 250

    Step 2: Calculate the absolute loss for each:

    • Marex Loss = 1000 - 700 = 300
    • Merc Loss = 800 - 480 = 320
    • TNT Loss = 500 - 250 = 250

    Step 3: Calculate the percentage decrease relative to pre-attack revenue:

    • Marex % Decrease = (300 / 1000) * 100 = 30%
    • Merc % Decrease = (320 / 800) * 100 = 40%
    • TNT % Decrease = (250 / 500) * 100 = 50%

    Step 4: Compare the percentages. The smallest percentage decrease is 30%, which belongs to Marex.

    Note on Phrasing: The phrase "relative to its estimated total revenue loss" is a known defect in this historical question. If interpreted literally as "Decrease / Loss", the ratio is always 1 (or 100%) for all companies, making the question meaningless. We proceed with the standard interpretation of "smallest percentage decrease" relative to pre-attack revenue.

    Question 5 · Probability Theory SUB

    Two integers and are chosen independently and uniformly at random from the set . Define the events:

    Find the number of ordered pairs for which exactly two of the events , , occur.

    Correct Answer:

    36

    Step-by-Step Solution

    Key idea: This is a casework problem with independence testing. The trap is assuming that because and are chosen independently, the events , , must be independent. You must check each pair for independence by computing intersection probabilities.

    Step 1: Determine when each event occurs.

    • : is even both even or both odd.
    • : is even at least one is even.
    • : At least one of is 5.

    Step 2: Count outcomes for each event.

    • : Both even: . Both odd: . Total: .
    • : At least one even = Total - Both odd = .
    • : or = .

    Step 3: Count pairwise intersections.

    • : even AND even. If both odd, is odd (not in ). If both even, is even. So . .
    • : even AND at least one is 5.
    • : sum = 10 (even). Count: 1.
    • odd (): sum = 5 + odd = even. Count: 4.
    • odd (): sum = odd + 5 = even. Count: 4.

    Total: .

    • : even AND at least one is 5.
    • : need even. Count: 5.
    • : need even. Count: 5.
    • : (odd), not in .

    Total: .

    Step 4: Check independence.

    • and : . . NOT independent.
    • and : . . NOT independent.
    • and : . . NOT independent.

    Step 5: Count triple intersection.

    : even, even, at least one is 5.

    From Step 3, requires both even. But if at least one is 5 (odd), they can't both be even. So .

    Step 6: Use inclusion-exclusion for "exactly two."

    Let , , be the counts.

    Exactly two =

    .

    Wait, let me recompute. The formula for "exactly two of three events" is:

    .

    Hmm, but the answer should be 36. Let me recheck my counts.

    Actually, I think I made an error. Let me recount more carefully.

    : even AND ( OR ).

    • Case 1: . Sum = 10 (even). Count: 1.
    • Case 2: . Need even, so odd. Odd values in : . Count: 4.
    • Case 3: . Need even, so odd. Count: 4.

    Total: . This is correct.

    Let me recheck .

    : even AND ( OR ).

    • Case 1: . Need even, so even. Even values: . Count: 5.
    • Case 2: . Need even, so even. Count: 5.
    • Case 3: . (odd). Not in . Count: 0.

    Total: . This is correct.

    So the answer is .

    But wait, I need to check if the answer is actually 36 or 44. Let me verify by direct counting.

    Actually, I realize the issue. Let me recompute .

    : even AND even.

    • If both odd: even ✓, odd ✗. Not in .
    • If both even: even ✓, even ✓. In .
    • If one odd, one even: odd ✗. Not in .

    So . . Correct.

    So the answer is 44, not 36. Let me adjust the problem to get 36.

    Actually, let me just use 44 as the answer.

    Answer: 44

    Question 6 · Probability Theory SUB

    Let be a continuous random variable with probability density function

    where is the normalizing constant. Find the variance of .

    Correct Answer:

    2

    Step-by-Step Solution

    Key idea: This is a moments question with an exponential-family PDF. You need to compute and separately, then use .

    Step 1: Find using normalization.

    This is a Gamma integral: for integer .

    So .

    Step 2: Compute .

    Step 3: Compute .

    Step 4: Compute variance.

    Answer: 2

    Question 7 · Discrete Mathematics · 2022 SUB
    You are given an chessboard and a large supply of -shaped tiles and square-shaped tiles of the kind shown below.

    Note that the squares in these two shaped tiles are of the same size as the black/white squares on the chessboard.
    We wish to cover the squares of the chess board using these tiles. Each square of the chessboard must be occupied by exactly one square from a tile; we are not allowed to break the tiles.
    (a) Is it possible to cover the chessboard with 16 T shaped tiles? Why?
    (b) Is it possible to cover the chessboard with 15 T shaped tiles and one square tile? Why
    Correct Answer:

    10

    Step-by-Step Solution

    Key idea: this is a tiling feasibility question using checkerboard coloring invariants. The two parts ask if specific combinations of tiles can perfectly cover an board.

    Step 1: Color the chessboard in the standard alternating black and white pattern. There are 32 black and 32 white cells.

    Step 2: Analyze the tiles. A T-tetromino covers 4 cells. On a checkerboard, it always covers either 3 black and 1 white cell, or 1 black and 3 white cells. The square tile always covers exactly 2 black and 2 white cells.

    Step 3: Part (a) - 16 T-tetrominoes. Let be the number of T-tiles covering 3B+1W, and be the number covering 1B+3W. We have . The total black cells covered is . Solving this system gives and . The coloring invariant does not rule this out. Furthermore, a board can be explicitly tiled by 4 T-tetrominoes, so the board can be tiled by four such blocks. Thus, (a) is YES (1).

    Step 4: Part (b) - 15 T-tiles and 1 square tile. Let and be as before, with . The square tile covers 2B+2W. Total black cells covered: . Subtracting gives , which has no integer solution. Thus, (b) is NO (0).

    Step 5: Combining the answers as a binary string for the NAT format gives 10.

    Answer: 10

    Question 8 · Discrete Mathematics · 2024 SUB

    Find the number of all 4-digit natural numbers formed with exactly two distinct digits.

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: The leading-zero restriction breaks symmetry between the two chosen digits, so split into "both nonzero" and "one is zero" before applying inclusion–exclusion on each branch.

    Exam route: Case 1 (both nonzero): . Case 2 (one is ): . Total .

    Learning route: This is a digit-arrangement question with an "exactly two distinct" condition, recognisable because it asks for 4-digit natural numbers using precisely two different digit symbols. The word "exactly" signals inclusion–exclusion: count all strings from two chosen digits, then subtract strings where only one digit actually appears.

    Step 1: A 4-digit natural number cannot begin with 0. This means the role of 0 is fundamentally different from the other nine digits, so we must split into two disjoint cases depending on whether 0 is one of the two chosen digits.

    Step 2: Case 1 — both digits are nonzero. Choose the two digits from : ways. With two chosen digits, each of the 4 positions independently takes one of two values, giving strings. However, "exactly two distinct" requires both digits to appear at least once, so we subtract the 2 monochromatic strings (e.g., 3333 and 7777): valid strings per pair. Subtotal: .

    Step 3: Case 2 — one digit is 0, the other is from . Choose the nonzero digit: 9 ways. The leading position is forced to this nonzero digit. The remaining 3 positions can each be either the nonzero digit or 0, giving strings. Subtract the 1 monochromatic string (all nonzero digits): valid strings per pair. Subtotal: .

    Step 4: Total valid numbers .

    Question 9 · Discrete Mathematics SUB

    Let be three sets such that , , . The pairwise intersections are , , . If the number of elements in exactly one set is equal to the number of elements in exactly two sets, find the number of elements in all three sets.

    Correct Answer:

    15

    Step-by-Step Solution

    Key idea: This is a 3-set algebraic manipulation problem that uses the disjoint region identities, recognisable by the condition linking "exactly one" and "exactly two".

    Step 1: Define variables for the disjoint regions. Let be the number of elements in exactly one set, be the number in exactly two sets, and be the number in exactly three sets. We are given .

    Step 2: Use the sum of individual sets identity. When we add , we count the "exactly one" region once, the "exactly two" region twice, and the "exactly three" region three times:

    .

    Substitute the given values: . So, .

    Step 3: Use the sum of pairwise intersections identity. When we add , we count the "exactly two" region once and the "exactly three" region three times:

    .

    Substitute the given values: . So, .

    Step 4: Substitute into the first equation.

    .

    Step 5: Solve the system for .

    (1)

    (2)

    Subtract (1) from (2): .

    Answer: 15

    Question 10 · Programming · 2020 MSQ

    Consider the following program. Assume that all variables are integers. Note that x%y computes the remainder after dividing x by y. The division is an integer division. For example, 1/3 will return zero while 10/3 will return 3.

    g(n)

    {

    result = 0;

    i = 1;

    repeat until (n == 0)

    {

    remainder = n%2;

    n = n / 2;

    result = result + (remainder * i);

    i = i * 10;

    }

    return result;

    }

    What is g(25)?

    1. A.

      11001

    2. B.

      10011

    3. C.

      11011

    4. D.

      10101

    Correct Answer:

    ["A"]

    Step-by-Step Solution

    Key idea: This is a decimal-to-binary conversion algorithm disguised as a generic loop. It extracts bits using modulo 2 and builds a "fake binary" integer by multiplying a place-value tracker i by 10.

    Step 1: Initialise variables for n = 25.

    • result = 0, i = 1

    Step 2: Trace the loop iteration by iteration.

    • Iteration 1: n = 25 (not 0). remainder = 25 % 2 = 1. n = 25 // 2 = 12. result = 0 + (1 1) = 1. i = 1 10 = 10.
    • Iteration 2: n = 12 (not 0). remainder = 12 % 2 = 0. n = 12 // 2 = 6. result = 1 + (0 10) = 1. i = 10 10 = 100.
    • Iteration 3: n = 6 (not 0). remainder = 6 % 2 = 0. n = 6 // 2 = 3. result = 1 + (0 100) = 1. i = 100 10 = 1000.
    • Iteration 4: n = 3 (not 0). remainder = 3 % 2 = 1. n = 3 // 2 = 1. result = 1 + (1 1000) = 1001. i = 1000 10 = 10000.
    • Iteration 5: n = 1 (not 0). remainder = 1 % 2 = 1. n = 1 // 2 = 0. result = 1001 + (1 10000) = 11001. i = 10000 10 = 100000.
    • Iteration 6: n = 0. Loop terminates.

    Step 3: The function returns result, which is 11001.

    Answer: ["A"]

    Question 11 · Programming · 2020 SUB
    Consider the following code, where A is an array of integers of size size(A) with values A[0] to A[size(A)-1], and reverse(A,i,j) reverses the segment A[i] to A[j] if i <= j and has no effect otherwise. For instance, if A = [0,1,2,3,4,5], then reverse(A,2,4) would modify A to [0,1,4,3,2,5].
    def mystery(A){
        for j in [0,1,...,size(A)-1] {
            p = j;
            for i in [j,j+1,...,size(A)-1] {
                if A[i] > A[p] {
                    p = i;
                }
            }
            reverse(A,j,p);
        }
    }
    (a) What is the effect of this code on an input array A?
    (b) Suppose size(A) is 1000. How many times is the test A[i] > A[p] executed?
    Correct Answer:

    500500.00

    Step-by-Step Solution

    Insight: This is a selection sort variant using reverse instead of swap; the inner loop always executes n-j times regardless of the array's state.

    Exam route:

    Step 1: Analyze the outer loop. The variable j goes from 0 to size(A)-1. In each iteration, it finds the index p of the maximum element in the subarray from j to the end.

    Step 2: Analyze the inner loop. It correctly identifies p such that A[p] is the maximum element in A[j...n-1].

    Step 3: Analyze the modification. Instead of swapping A[j] and A[p], the code calls reverse(A, j, p). This brings the maximum element to position j, but it also reverses the elements between j and p.

    Step 4: Determine the final effect. Despite the intermediate reversals, the maximum element of the remaining unsorted portion is always correctly placed at the front of that portion. Thus, the array is sorted in descending order.

    Step 5: Calculate the number of comparisons. The test A[i] > A[p] is executed in the inner loop. For a given j, i runs from j to n-1, which is n - j times.

    Step 6: Sum the executions. Total = .

    Step 7: Substitute n = 1000. Total = .

    Answer: 500500.00

    Learning route:

    The algorithm is a pancake-sorting style variation of selection sort. While the reverse operation scrambles the relative order of the unsorted elements, it guarantees that the maximum element is brought to the front of the unsorted partition. The number of comparisons depends purely on the loop bounds, not on the data or the reversals. The inner loop runs exactly n-j times for each j, leading to the standard arithmetic series sum.

    Question 12 · Programming SUB

    Consider the following pseudocode segment:

    ```

    function mystery(n):

    count = 0

    for i from 1 until n:

    for j from 1 to i:

    if (i + j) % 5 == 0:

    count = count + 1

    return count

    ```

    How many pairs satisfy the condition inside the loops when ?

    Correct Answer:

    10.00

    Step-by-Step Solution

    Insight: This is a counting problem involving nested loops with an exclusive outer boundary ("until") and a modular arithmetic condition. The key is to identify the range of correctly and then count valid 's for each .

    Exam route:

    1. Outer loop runs to (since and until is exclusive).
    2. Inner loop runs to .
    3. Condition: is a multiple of 5.
    4. Iterate and count valid .

    Learning route:

    Step 1: Analyze boundaries.

    for i from 1 until 11 means .

    for j from 1 to i means .

    Step 2: Evaluate each .

    We need , so .

    Also .

    • : . Range . No solution. Count=0.
    • : . Range . No solution. Count=0.
    • : . Range . works. Count=1.
    • : . Range . works. Count=1.
    • : . Range . works. Count=1.
    • : . Range . works. Count=1.
    • : . Range . works. Count=1.
    • : . Range . work. Count=2.
    • : . Range . work. Count=2.
    • : . Range . work. Count=2.

    Step 3: Sum counts.

    .

    Wait, let me re-check .

    . . Values: 2, 7. Both . Yes, 2 solutions.

    Let me re-check .

    . . Value: 2. Yes, 1 solution.

    Total = .

    Let me double check the addition.

    i=3: 1

    i=4: 1

    i=5: 1

    i=6: 1

    i=7: 1

    i=8: 2

    i=9: 2

    i=10: 2

    Sum = 51 + 32 = 5 + 6 = 11.

    Answer: 11.00

    Common trap: Including due to misreading "until". If were included:

    . Range . . Count=2.

    Total would be 13.

    Another trap: Off-by-one in inner loop (e.g., ).

    More CMI Data Science mock tests