CMI Data Science
    Test Series
    Verified Solutions Included
    Functions & Calculus, Combinatorics & Induction, Probability & Random… Test for CMI Data Science: 40 Questions with Solutions & Analysis

    Attempt the Functions & Calculus, Combinatorics & Induction, Probability & Random… test for CMI Data Science: 40 exam-level questions, detailed solutions and

    40 Qs

    Total Questions

    88 Marks

    Total Marks

    135.24 Mins

    Duration

    +3 / -1 / 0

    Marking Scheme

    Section-wise Paper Structure

    Probability Theory

    20 Qs

    50% of total marks

    School Level Mathematics

    14 Qs

    35% of total marks

    Programming

    4 Qs

    10% of total marks

    Discrete Mathematics

    2 Qs

    5% of total marks

    Free Solved Questions with Step-by-Step Solutions

    Authentic examination problems with detailed derivations and answer keys.

    Question 1
    2025 PYQ
    Level 3: Exam Standard
    Common Description: Instructions for Questions 18,19, and 20:
    Read the following description carefully and answer the questions that follow. Use all the information provided. Clearly show all your calculations.
    Description:
    NorthCool Beverages Pvt. Ltd. is a leading beverage company that operates across six northern states of India. During the past summer the company launched an aggressive marketing campaign to promote its range of flavoured drinks. The charts below summarise the sales data collected during this campaign.
    Revenue Share by Flavour Other (5%) Orange (18%) Mango (15%) Lemon (28%) Ginger Ale (10%) Cola (24%) Lemon Flavour Sales By State (Rs. Lakhs) Uttar Pradesh Haryana Punjab Himachal Pradesh Delhi Uttarakhand 0 5 10 15 20 25 30 Sales States Figure 1: Revenue share by flavour, and sales of lemon-flavoured drink by state What is the revenue, in Lakhs, from the sales of the mango flavoured drink?
    Question 2
    2025 PYQ
    Level 3: Exam Standard
    Common Description: Instructions for Questions 18,19, and 20:
    Read the following description carefully and answer the questions that follow. Use all the information provided. Clearly show all your calculations.
    Description:
    NorthCool Beverages Pvt. Ltd. is a leading beverage company that operates across six northern states of India. During the past summer the company launched an aggressive marketing campaign to promote its range of flavoured drinks. The charts below summarise the sales data collected during this campaign.
    Revenue Share by Flavour Other (5%) Orange (18%) Mango (15%) Lemon (28%) Ginger Ale (10%) Cola (24%) Lemon Flavour Sales By State (Rs. Lakhs) Uttar Pradesh Haryana Punjab Himachal Pradesh Delhi Uttarakhand 0 5 10 15 20 25 30 Sales States Figure 1: Revenue share by flavour, and sales of lemon-flavoured drink by state NorthCool Beverages plans to launch a new variant, “Lemon Max”, in the two states with the highest sales of the lemon flavour. The company expects Lemon Max to generate additional revenue equal to 20% of the current lemon flavour sales in those two states. What would be the percentage revenue share of lemon flavour drinks if their expectations are met?
    Question 3
    2025 PYQ
    Level 3: Exam Standard
    Common Description: Instructions for Questions 18,19, and 20:
    Read the following description carefully and answer the questions that follow. Use all the information provided. Clearly show all your calculations.
    Description:
    NorthCool Beverages Pvt. Ltd. is a leading beverage company that operates across six northern states of India. During the past summer the company launched an aggressive marketing campaign to promote its range of flavoured drinks. The charts below summarise the sales data collected during this campaign.
    Revenue Share by Flavour Other (5%) Orange (18%) Mango (15%) Lemon (28%) Ginger Ale (10%) Cola (24%) Lemon Flavour Sales By State (Rs. Lakhs) Uttar Pradesh Haryana Punjab Himachal Pradesh Delhi Uttarakhand 0 5 10 15 20 25 30 Sales States Figure 1: Revenue share by flavour, and sales of lemon-flavoured drink by state On average, for every ₹1 lakh in total revenue from the lemon-flavoured drink, 10,000 litres of lemon-flavoured drink are sold across the six states. Estimate the total volume (in litres) of lemon-flavoured drink sold by NorthCool Beverages across all six states.
    Question 4
    2024 PYQ
    Level 3: Exam Standard

    Let be a fixed real number and let be a function from to defined as

    Write down an expression for , where denotes the function obtained by composing with itself 10 times.

    Question 5
    2025 PYQ
    Level 3: Exam Standard

    Evaluate the following limit:

    Question 6
    Level 3: Exam Standard

    Evaluate

    Question 7
    2021 PYQ
    Level 3: Exam Standard
    Consider the following code where is an array indexed from 0.
    function foo(A, year, n) {
        l = 0, r = n - 1, c = 0;
        while (l <= r) {
            c = c + 1;
            m = l + (r - l) // 2;
            if (A[m] == year) {
                return(c * m);
            }
            if (A[m] < year) {
                l = m + 1;
            } else {
                r = m - 1;
            }
        }
        return(-1);
    }

    function bar() {
        A = [2016, 2017, 2018, 2019, 2020, 2021, 2022];
        result = foo(A, 2021, 7);
        print(result);
    }

    Here, represents integer division. For example, . What will be printed when bar() is executed?
    Question 8
    Level 3: Exam Standard

    Consider the standard bubble sort algorithm applied to an array of 5 distinct integers. How many possible initial permutations of this array will result in exactly 3 swaps being performed during the entire sorting process?

    Question 9
    Level 3: Exam Standard

    Consider the optimized bubble sort algorithm (which includes a boolean flag to terminate early if a pass completes with zero swaps). How many permutations of the array will require exactly 2 passes of the outer loop to fully sort the array?

    Question 10
    2023 PYQ
    Level 3: Exam Standard
    Consider a city with East-West Streets (EWS) and North-South Avenues (NSA). The EWS are the line segments for all and the NSA are the line segments for all . A junction is a pair where avenue intersects street . How many junctions are there in the city?
    For increased safety, the city council decides to place cameras at various junctions in the city. The cameras being super-powerful, can observe the entire street and avenue corresponding to the junction that they are placed at. For instance, a camera placed at the junction can observe both avenue and street . Write down an expression for the minimum number of cameras needed to observe every street and avenue in the city.
    Justify your answers.
    Question 11
    Level 3: Exam Standard

    A bug travels from the bottom-left junction to the top-right junction of a grid of cells, moving only one unit right or one unit up at each step. How many such shortest paths do not pass through the junction or the junction ?

    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.

    Functions & Calculus, Combinatorics & Induction, Probability & Random… Test for CMI Data Science: 40 Questions with Solutions & Analysis

    Attempt the Functions & Calculus, Combinatorics & Induction, Probability & Random… test for CMI Data Science: 40 exam-level questions, detailed solutions and performance analysis. First questions free.

    Paper breakdown

    40 questions · 88 marks · 135.24 minutes. Probability Theory: 20 · School Level Mathematics: 14 · Programming: 4 · Discrete Mathematics: 2

    Free sample questions from Functions & Calculus, Combinatorics & Induction, Probability & Random…

    Question 1 · Probability Theory · 2025 SUB
    Common Description: Instructions for Questions 18,19, and 20:
    Read the following description carefully and answer the questions that follow. Use all the information provided. Clearly show all your calculations.
    Description:
    NorthCool Beverages Pvt. Ltd. is a leading beverage company that operates across six northern states of India. During the past summer the company launched an aggressive marketing campaign to promote its range of flavoured drinks. The charts below summarise the sales data collected during this campaign.
    Revenue Share by Flavour Other (5%) Orange (18%) Mango (15%) Lemon (28%) Ginger Ale (10%) Cola (24%) Lemon Flavour Sales By State (Rs. Lakhs) Uttar Pradesh Haryana Punjab Himachal Pradesh Delhi Uttarakhand 0 5 10 15 20 25 30 Sales States Figure 1: Revenue share by flavour, and sales of lemon-flavoured drink by state What is the revenue, in Lakhs, from the sales of the mango flavoured drink?
    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is a cross-chart proportional reasoning question linking an absolute value (Lemon sales) to a percentage share to derive another absolute value (Mango sales).

    Exam route: Sum Lemon bars to get absolute Lemon revenue (120 Lakhs). Divide by Lemon % (28%) to get Total Revenue. Multiply Total by Mango % (15%).

    Learning route:

    Step 1: Calculate total absolute revenue for Lemon flavour from the bar chart: 30 + 25 + 20 + 20 + 15 + 10 = 120 Lakhs.

    Step 2: Relate Lemon revenue to Total Revenue using the pie chart. Lemon represents 28% of Total Revenue.

    Step 3: Calculate Total Revenue = 120 / 0.28 = 3000 / 7 Lakhs.

    Step 4: Calculate Mango revenue, which is 15% of Total Revenue: (3000 / 7) * 0.15 = 450 / 7 ≈ 64.29 Lakhs.

    Question 2 · Probability Theory · 2025 SUB
    Common Description: Instructions for Questions 18,19, and 20:
    Read the following description carefully and answer the questions that follow. Use all the information provided. Clearly show all your calculations.
    Description:
    NorthCool Beverages Pvt. Ltd. is a leading beverage company that operates across six northern states of India. During the past summer the company launched an aggressive marketing campaign to promote its range of flavoured drinks. The charts below summarise the sales data collected during this campaign.
    Revenue Share by Flavour Other (5%) Orange (18%) Mango (15%) Lemon (28%) Ginger Ale (10%) Cola (24%) Lemon Flavour Sales By State (Rs. Lakhs) Uttar Pradesh Haryana Punjab Himachal Pradesh Delhi Uttarakhand 0 5 10 15 20 25 30 Sales States Figure 1: Revenue share by flavour, and sales of lemon-flavoured drink by state NorthCool Beverages plans to launch a new variant, “Lemon Max”, in the two states with the highest sales of the lemon flavour. The company expects Lemon Max to generate additional revenue equal to 20% of the current lemon flavour sales in those two states. What would be the percentage revenue share of lemon flavour drinks if their expectations are met?
    Correct Answer:

    none

    Step-by-Step Solution

    Insight: Adding revenue to a specific sub-category changes both the numerator (Lemon sales) and the denominator (Total sales), requiring a recalculation of the percentage share.

    Exam route: Calculate total Lemon sales (120 Lakhs). Find total revenue (120 / 0.28). Identify top 2 states (UP 30, Haryana 25). Calculate additional revenue (20% of 55 = 11). New Lemon = 131, New Total = (120/0.28) + 11. Compute new share.

    Learning route:

    Step 1: Calculate total Lemon sales from the bar chart: 30 + 25 + 20 + 20 + 15 + 10 = 120 Lakhs.

    Step 2: Calculate the initial Total Revenue. Since Lemon is 28% of Total Revenue, Total Revenue = 120 / 0.28 = 3000 / 7 ≈ 428.57 Lakhs.

    Step 3: Identify the two states with the highest Lemon sales: Uttar Pradesh (30 Lakhs) and Haryana (25 Lakhs). Their sum is 55 Lakhs.

    Step 4: Calculate the additional revenue from "Lemon Max": 20% of 55 = 11 Lakhs.

    Step 5: Calculate the new Lemon revenue: 120 + 11 = 131 Lakhs.

    Step 6: Calculate the new Total Revenue: (3000 / 7) + 11 = (3000 + 77) / 7 = 3077 / 7 Lakhs.

    Step 7: Calculate the new percentage revenue share of lemon flavour drinks: (131 / (3077 / 7)) 100 = (917 / 3077) 100 ≈ 29.80%.

    Question 3 · Probability Theory · 2025 SUB
    Common Description: Instructions for Questions 18,19, and 20:
    Read the following description carefully and answer the questions that follow. Use all the information provided. Clearly show all your calculations.
    Description:
    NorthCool Beverages Pvt. Ltd. is a leading beverage company that operates across six northern states of India. During the past summer the company launched an aggressive marketing campaign to promote its range of flavoured drinks. The charts below summarise the sales data collected during this campaign.
    Revenue Share by Flavour Other (5%) Orange (18%) Mango (15%) Lemon (28%) Ginger Ale (10%) Cola (24%) Lemon Flavour Sales By State (Rs. Lakhs) Uttar Pradesh Haryana Punjab Himachal Pradesh Delhi Uttarakhand 0 5 10 15 20 25 30 Sales States Figure 1: Revenue share by flavour, and sales of lemon-flavoured drink by state On average, for every ₹1 lakh in total revenue from the lemon-flavoured drink, 10,000 litres of lemon-flavoured drink are sold across the six states. Estimate the total volume (in litres) of lemon-flavoured drink sold by NorthCool Beverages across all six states.
    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is a direct scaling question where the total volume depends entirely on the total revenue of the specific flavour, which is already aggregated.

    Exam route: Identify total Lemon revenue (120 Lakhs). Multiply by the given volume rate (10,000 litres per Lakh).

    Learning route:

    Step 1: Identify the total revenue for the lemon-flavoured drink from the bar chart: 30 + 25 + 20 + 20 + 15 + 10 = 120 Lakhs.

    Step 2: Note the scaling factor provided: 10,000 litres per ₹1 lakh of revenue.

    Step 3: Multiply the total revenue by the scaling factor: 120 * 10,000 = 1,200,000 litres.

    Question 4 · School Level Mathematics · 2024 SUB

    Let be a fixed real number and let be a function from to defined as

    Write down an expression for , where denotes the function obtained by composing with itself 10 times.

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: The map is a geometric rotation by angle ; composing it 10 times yields a rotation by .

    Exam route: Recognise . Apply with . Substitute into the rotation formula.

    Learning route:

    This is a function-iteration question, recognisable because the formula is the standard rotation matrix and "composing with itself 10 times" signals .

    Step 1: Identify the transformation. The map rotates every point anticlockwise by about the origin. We write .

    Step 2: Iterate geometrically. One application rotates by . A second rotates the result by another , totalling . By induction, applications give rotation by : .

    Step 3: Set . Then .

    Step 4: Substitute for in the original formula:

    .

    Wrong path: Raising each coordinate to the 10th power, e.g. . This confuses iteration with exponentiation . The notation means ten-fold composition, not the tenth power of the output.

    Verification: For , , so and . Formula gives . Matches.

    Question 5 · School Level Mathematics · 2025 SUB

    Evaluate the following limit:

    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is a transcendental limit with mixed exponential, polynomial, and trigonometric terms; the denominator's leading order dictates expanding every numerator term through using Taylor series.

    Exam route:

    1. Denominator: .
    2. Numerator to :

    ,

    ,

    .

    1. Assemble: .
    2. Divide: .

    Learning route:

    This is a transcendental limit, recognisable because direct substitution gives and the numerator mixes exponential, polynomial, and trigonometric terms. The trigger for Taylor expansion is this mixture — algebraic factoring cannot untangle and simultaneously.

    Step 1: Determine the denominator's leading order. Expand , so:

    The leading term is . This tells us we must expand every numerator term through — no less, no more.

    Step 2: Expand each numerator term to :

    Step 3: Combine all numerator terms:

    Step 4: Divide by the denominator and take the limit:

    Wrong path: Using L'Hôpital's rule twice is possible but extremely messy and prone to calculation errors. Another common mistake is expanding the numerator only to , which yields in the numerator and leads to the incorrect conclusion that the limit is .

    Question 6 · School Level Mathematics SUB

    Evaluate

    Correct Answer:

    0.5

    Step-by-Step Solution

    Key idea: This is a mixed transcendental limit combining exponential and trigonometric functions. The denominator is , so we need Taylor expansions up to order for every term in the numerator.

    Step 1: Verify the indeterminate form. At : . Denominator is . Confirmed .

    Step 2: Write Taylor expansions to order .

    (we only need up to )

    Step 3: Substitute into the numerator.

    Step 4: Divide by the denominator.

    Step 5: Take the limit as .

    The terms vanish, leaving .

    Answer: 0.5

    Question 7 · Programming · 2021 SUB
    Consider the following code where is an array indexed from 0.
    function foo(A, year, n) {
        l = 0, r = n - 1, c = 0;
        while (l <= r) {
            c = c + 1;
            m = l + (r - l) // 2;
            if (A[m] == year) {
                return(c * m);
            }
            if (A[m] < year) {
                l = m + 1;
            } else {
                r = m - 1;
            }
        }
        return(-1);
    }

    function bar() {
        A = [2016, 2017, 2018, 2019, 2020, 2021, 2022];
        result = foo(A, 2021, 7);
        print(result);
    }

    Here, represents integer division. For example, . What will be printed when bar() is executed?
    Correct Answer:

    15

    Step-by-Step Solution

    Key idea: Trace the binary search algorithm to count the number of iterations () and find the index () where the target is found. Then compute .

    Step 1: Initialize variables.

    Step 2: Iteration 1.

    Condition () is True.

    .

    .

    Check ? . .

    Check ? is True.

    Update .

    ( remains 6).

    Step 3: Iteration 2.

    Condition () is True.

    .

    .

    Check ? . Yes!

    Return .

    Wait, let me re-read the code carefully.

    m = l + (r - l) // 2

    Re-trace Iteration 1:

    .

    .

    .

    . True.

    .

    .

    Re-trace Iteration 2:

    .

    .

    .

    . True.

    Return .

    Current is incremented at start of loop.

    Start of Iter 2: becomes 2.

    So return .

    Let me double check the array indices.

    Index: 0: 2016

    1: 2017

    2: 2018

    3: 2019

    4: 2020

    5: 2021

    6: 2022

    Target 2021 is at index 5.

    Trace again.

    Init: l=0, r=6, c=0.

    Loop 1:

    l<=r (0<=6) True.

    c=1.

    m = 0 + (6-0)//2 = 3.

    A[3] = 2019.

    A[3] == 2021? No.

    A[3] < 2021? Yes.

    l = 3+1 = 4.

    Loop 2:

    l<=r (4<=6) True.

    c=2.

    m = 4 + (6-4)//2 = 4 + 1 = 5.

    A[5] = 2021.

    A[5] == 2021? Yes.

    Return c m = 2 5 = 10.

    Answer: 10.

    Question 8 · Programming MSQ

    Consider the standard bubble sort algorithm applied to an array of 5 distinct integers. How many possible initial permutations of this array will result in exactly 3 swaps being performed during the entire sorting process?

    1. A.

      6

    2. B.

      10

    3. C.

      15

    4. D.

      20

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: Recognize that the total number of swaps in bubble sort is exactly equal to the number of inversions in the initial array, then count the permutations with exactly 3 inversions.

    Step 1: Establish the invariant. Each swap in bubble sort exchanges two adjacent elements that are out of order. This operation reduces the total number of inversions in the array by exactly 1. The algorithm terminates when the array is sorted (0 inversions). Therefore, Total Swaps = Initial Inversions.

    Step 2: Reframe the problem. We need to find the number of permutations of 5 distinct elements that have exactly 3 inversions.

    Step 3: Use the inversion sequence representation. Any permutation of elements can be uniquely represented by an inversion sequence , where is the number of elements to the left of the -th element that are greater than it. The constraints are .

    Step 4: We need the number of sequences such that , with , , , , .

    Step 5: Enumerate the valid sequences for :

    • : (0, 0, 0, 3) 1 way
    • : (0, 0, 1, 2), (0, 1, 0, 2), (1, 0, 0, 2) 3 ways
    • : (0, 0, 2, 1), (0, 1, 1, 1), (0, 2, 0, 1), (1, 0, 1, 1), (1, 1, 0, 1) 5 ways
    • : (0, 0, 3, 0), (0, 1, 2, 0), (0, 2, 1, 0), (1, 0, 2, 0), (1, 1, 1, 0), (1, 2, 0, 0) 6 ways

    Step 6: Sum the possibilities: .

    Answer: 15

    Question 9 · Programming MSQ

    Consider the optimized bubble sort algorithm (which includes a boolean flag to terminate early if a pass completes with zero swaps). How many permutations of the array will require exactly 2 passes of the outer loop to fully sort the array?

    1. A.

      6

    2. B.

      7

    3. C.

      8

    4. D.

      9

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: Relate the number of passes in optimized bubble sort to the maximum inversion count of any single element, then bound and count the valid permutations.

    Step 1: Establish the invariant. In optimized bubble sort, the algorithm terminates after passes if and only if the maximum number of inversions for any single element in the initial array is .

    Step 2: Reframe the problem. We need to find the number of permutations of where the maximum inversion count for any element is exactly . (If it were 0, it would take 1 pass; if , it would take passes).

    Step 3: Use the inversion sequence representation. A permutation can be uniquely represented by , where is the number of elements to the left of the -th smallest element that are greater than it. The constraints are .

    Step 4: We require .

    Since always, we need , , and .

    Step 5: Count the valid sequences. There are such sequences. Each uniquely maps to a valid permutation.

    Step 6: Exclude the case requiring only 1 pass. The sequence corresponds to the already sorted array , which requires exactly 1 pass (0 swaps in the first pass).

    Step 7: Calculate the final count. The number of permutations requiring exactly 2 passes is .

    Answer: 7

    Question 10 · Discrete Mathematics · 2023 SUB
    Consider a city with East-West Streets (EWS) and North-South Avenues (NSA). The EWS are the line segments for all and the NSA are the line segments for all . A junction is a pair where avenue intersects street . How many junctions are there in the city?
    For increased safety, the city council decides to place cameras at various junctions in the city. The cameras being super-powerful, can observe the entire street and avenue corresponding to the junction that they are placed at. For instance, a camera placed at the junction can observe both avenue and street . Write down an expression for the minimum number of cameras needed to observe every street and avenue in the city.
    Justify your answers.
    Correct Answer:

    none

    Step-by-Step Solution

    Insight: The streets and avenues are explicitly lines each (not cell boundaries of an board), so junctions ; the camera problem is a minimum edge-cover on , which equals by the diagonal construction.

    Exam route:

    Part 1 — The EWS are : exactly horizontal line segments. The NSA are : exactly vertical line segments. A junction is the intersection of one avenue with one street, so by the product rule the number of junctions is .

    Part 2 — A camera at covers avenue and street , i.e. exactly one avenue and one street. To cover all avenues we need at least cameras (each camera covers at most one avenue). The diagonal placement uses exactly cameras and covers every avenue (via camera ) and every street (via camera ). Therefore the minimum number of cameras is .

    Learning route:

    This is a grid-enumeration plus covering-argument question, recognisable because the problem defines lines by explicit equations and then asks for a minimum set of junctions that "dominate" all lines.

    Step 1 — Count the lines carefully. The set for contains exactly distinct horizontal line segments. Similarly the avenues for give exactly vertical segments. Crucially, the problem gives us lines in each direction, NOT cells. This is the opposite of the usual chessboard setup where an board has lines.

    Step 2 — Count junctions. Each junction is uniquely determined by choosing one avenue and one street. Since there are choices for the avenue and choices for the street, the total number of junctions is .

    Step 3 — Model the camera problem. A camera at junction observes avenue and street . We need every avenue and every street to be observed by at least one camera. This is equivalent to finding a minimum edge cover in the complete bipartite graph where left vertices = avenues, right vertices = streets, and edges = junctions.

    Step 4 — Lower bound. Each camera covers exactly one avenue. Since there are avenues to cover, we need at least cameras.

    Step 5 — Construction. Place cameras at . Camera covers avenue and street . As ranges from to , all avenues and all streets are covered. This uses exactly cameras, matching the lower bound.

    Verification: For , we have 3 streets and 3 avenues, giving junctions. Cameras at cover all 3 avenues and all 3 streets. No set of 2 cameras can cover 3 avenues (each covers at most 1). So the answer is correct.

    Question 11 · Discrete Mathematics MSQ

    A bug travels from the bottom-left junction to the top-right junction of a grid of cells, moving only one unit right or one unit up at each step. How many such shortest paths do not pass through the junction or the junction ?

    1. A.

      84

    2. B.

      132

    3. C.

      72

    4. D.

      252

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is a shortest path counting problem with multiple forbidden points, best solved using the Principle of Inclusion-Exclusion (PIE).

    Step 1: Calculate the total number of unrestricted shortest paths from to . This requires 5 right and 5 up moves, totaling 10 moves. The number of ways is .

    Step 2: Calculate paths passing through . This is paths from to multiplied by paths from to .

    .

    Step 3: Calculate paths passing through . This is paths from to multiplied by paths from to .

    .

    Step 4: Calculate paths passing through both and . This requires going .

    .

    Step 5: Apply PIE. Valid paths = Total - (Through 2,2) - (Through 3,3) + (Through both).

    Valid paths = .

    Answer: 84.

    More CMI Data Science tests