Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 2 subjective questions Basic math operations (addition, subtraction, multiplication, division and exponentiation)

CSE329 — Prelude To Competitive Coding 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define Fast Modulo Multiplication and explain why it is needed in competitive programming. Illustrate with an example.

  2. Question 2 of 20

    Explain the technique of Exponentiation by Squaring (Exponential squaring). Derive its time complexity.

  3. Question 3 of 20

    What is the N-th non-square number? Derive a direct formula to find it without generating all numbers.

  4. Question 4 of 20

    Define Modular Exponentiation and write an algorithm to compute efficiently.

  5. Question 5 of 20

    Explain the concept of Modular Multiplicative Inverse. Under what condition does it exist?

  6. Question 6 of 20

    Using Fermat's Little Theorem, derive the formula for the modular multiplicative inverse and demonstrate with an example.

  7. Question 7 of 20

    Describe how to compute the sum of the middle row and middle column elements in a square matrix. Write the conditions and formula.

  8. Question 8 of 20

    Explain the algorithm to check whether all rows of a matrix are circular rotations of each other.

  9. Question 9 of 20

    State and explain the Inclusion-Exclusion Principle for two and three sets with a suitable example.

  10. Question 10 of 20

    State the Pigeonhole Principle and its generalized form. Give two real applications.

  11. Question 11 of 20

    Compare naive exponentiation with exponentiation by squaring in terms of time complexity, and explain when each is preferable.

  12. Question 12 of 20

    Explain how the Extended Euclidean Algorithm is used to compute the modular multiplicative inverse. Trace it for finding the inverse of modulo .

  13. Question 13 of 20

    Distinguish between the Inclusion-Exclusion Principle and the Pigeonhole Principle with respect to their purpose and typical use cases.

  14. Question 14 of 20

    Write pseudocode for fast modulo multiplication (multiplying two large numbers under a modulus) and explain each step.

  15. Question 15 of 20

    Using the Inclusion-Exclusion Principle, find how many integers from to are divisible by , , or . Show all steps.

  16. Question 16 of 20

    Explain why applying modulo at intermediate steps gives correct results in modular arithmetic. State the key distributive properties for addition and multiplication.

  17. Question 17 of 20

    Prove using the Pigeonhole Principle that in any group of integers chosen from , at least one pair is coprime.

  18. Question 18 of 20

    Describe a step-by-step approach to compute where is prime. Illustrate with .

  19. Question 19 of 20

    Explain the significance of modular exponentiation in cryptography, particularly in the RSA algorithm.

  20. Question 20 of 20

    Given a matrix, explain the special case handling and edge cases when computing the sum of the middle row and middle column, and discuss even-order matrices.

That's unit 2

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.