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 MCQs Basic math operations (addition, subtraction, multiplication, division and exponentiation)

CSE329 — Prelude To Competitive Coding 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Modular Exponentiation Easy

    What does modular exponentiation compute?

  2. Question 2 of 60 Exponential squaring Easy

    What is the time complexity of computing using exponentiation by squaring?

  3. Question 3 of 60 Exponential squaring Easy

    In exponentiation by squaring, when the exponent is even, equals:

  4. Question 4 of 60 Fast modulo multiplication Easy

    Fast modulo multiplication is mainly used to:

  5. Question 5 of 60 Fast modulo multiplication Easy

    Which technique does fast modulo multiplication resemble in its approach?

  6. Question 6 of 60 N-th non-square number Easy

    Which of the following is a non-square number?

  7. Question 7 of 60 N-th non-square number Easy

    What is the 1st non-square number (starting counting from 1)?

  8. Question 8 of 60 Modular multiplicative inverse Easy

    The modular multiplicative inverse of modulo is a number such that:

  9. Question 9 of 60 Modular multiplicative inverse Easy

    A modular multiplicative inverse of modulo exists if and only if:

  10. Question 10 of 60 Modular multiplicative inverse Easy

    What is the modular multiplicative inverse of modulo ?

  11. Question 11 of 60 Modular Exponentiation Easy

    Which property is used in modular exponentiation to keep intermediate values small?

  12. Question 12 of 60 Modular Exponentiation Easy

    Compute .

  13. Question 13 of 60 Sum of middle row and element in matrix Easy

    For an matrix where is odd, the middle row index (0-based) is:

  14. Question 14 of 60 Sum of middle row and element in matrix Easy

    In a matrix, the middle element is located at position:

  15. Question 15 of 60 Checking if all rows of a matrix are circular rotations of each other Easy

    A row is a circular rotation of another if it can be obtained by:

  16. Question 16 of 60 Checking if all rows of a matrix are circular rotations of each other Easy

    A common technique to check if one string is a rotation of another is to check if it is a substring of:

  17. Question 17 of 60 Inclusion - Exclusion Principle Easy

    For two sets and , equals:

  18. Question 18 of 60 Inclusion - Exclusion Principle Easy

    If , , and , then is:

  19. Question 19 of 60 Pigeonhole principle Easy

    The pigeonhole principle states that if items are placed into containers with , then:

  20. Question 20 of 60 Pigeonhole principle Easy

    If 13 people are in a room, by the pigeonhole principle at least two share the same:

  21. Question 21 of 60 Fast modulo multiplication Medium

    Fast modulo multiplication (also called Russian peasant multiplication under a modulus) computes without overflow by repeatedly doubling and adding. What is the primary advantage of this technique over directly computing first?

  22. Question 22 of 60 Fast modulo multiplication Medium

    Using the doubling method to compute , the loop processes the bits of . What is the final result?

  23. Question 23 of 60 Exponential squaring Medium

    Exponentiation by squaring computes in multiplications. Which recurrence correctly describes it for even ?

  24. Question 24 of 60 Exponential squaring Medium

    How many multiplications does exponentiation by squaring perform (approximately) to compute ?

  25. Question 25 of 60 N-th non-square number Medium

    The -th non-square (non-perfect-square) number is given by the formula . What is the th non-square number?

  26. Question 26 of 60 N-th non-square number Medium

    Using the formula , what is the th non-square number?

  27. Question 27 of 60 Modular Exponentiation Medium

    What is using modular exponentiation?

  28. Question 28 of 60 Modular Exponentiation Medium

    In modular exponentiation computing , why is the result reduced modulo after every multiplication rather than only at the end?

  29. Question 29 of 60 Modular Exponentiation Medium

    What is the time complexity of computing using fast modular exponentiation?

  30. Question 30 of 60 Modular multiplicative inverse Medium

    The modular multiplicative inverse of modulo exists if and only if which condition holds?

  31. Question 31 of 60 Modular multiplicative inverse Medium

    What is the modular multiplicative inverse of modulo ?

  32. Question 32 of 60 Modular multiplicative inverse Medium

    When is prime, Fermat's Little Theorem gives the modular inverse of as which expression?

  33. Question 33 of 60 Sum of middle row and element in matrix Medium

    For an odd-sized matrix, the middle element lies at which index (0-based)?

  34. Question 34 of 60 Sum of middle row and element in matrix Medium

    Given the matrix , what is the sum of the middle row?

  35. Question 35 of 60 Checking if all rows of a matrix are circular rotations of each other Medium

    A common technique to check whether every row of a matrix is a circular rotation of the first row uses string concatenation. If the first row (as a string) is , a row is a circular rotation of it when:

  36. Question 36 of 60 Checking if all rows of a matrix are circular rotations of each other Medium

    Consider a matrix with rows , , and . Are all rows circular rotations of the first row?

  37. Question 37 of 60 Inclusion - Exclusion Principle Medium

    How many integers from to are divisible by or ?

  38. Question 38 of 60 Inclusion - Exclusion Principle Medium

    For three finite sets, the inclusion-exclusion principle gives as:

  39. Question 39 of 60 Pigeonhole principle Medium

    If people are in a room, the pigeonhole principle guarantees that at least how many share the same birth month?

  40. Question 40 of 60 Pigeonhole principle Medium

    What is the minimum number of items needed so that, when placed into boxes, at least one box contains at least items?

  41. Question 41 of 60 Fast modulo multiplication Hard

    You need to compute where can each be up to . Direct multiplication overflows 64-bit integers. Which technique correctly computes this without overflow using only integer arithmetic?

  42. Question 42 of 60 Exponential squaring Hard

    How many modular multiplications (including squarings) does exponentiation by squaring perform in the worst case to compute , where has bits?

  43. Question 43 of 60 N-th non-square number Hard

    The -th non-square (non-perfect-square) positive integer is given by the closed form . What is the -th non-square number?

  44. Question 44 of 60 Modular Exponentiation Hard

    Using Fermat's little theorem, what is ?

  45. Question 45 of 60 Modular multiplicative inverse Hard

    The modular inverse of modulo exists if and only if which condition holds?

  46. Question 46 of 60 Modular multiplicative inverse Hard

    Compute the modular multiplicative inverse of modulo .

  47. Question 47 of 60 Modular multiplicative inverse Hard

    To compute inverses of modulo a prime in time, the recurrence is used. This works because implies which congruence?

  48. Question 48 of 60 Modular Exponentiation Hard

    To compute for prime using modular exponentiation, which exponent should be used?

  49. Question 49 of 60 Inclusion - Exclusion Principle Hard

    How many integers in are divisible by at least one of , , or ?

  50. Question 50 of 60 Inclusion - Exclusion Principle Hard

    How many integers in are divisible by none of , , or ?

  51. Question 51 of 60 Pigeonhole principle Hard

    From any set of integers chosen from , the pigeonhole principle guarantees that at least one pair satisfies which relationship?

  52. Question 52 of 60 Pigeonhole principle Hard

    In any sequence of distinct real numbers, the Erdős–Szekeres theorem (a pigeonhole application) guarantees a monotonic subsequence of length at least:

  53. Question 53 of 60 Sum of middle row and element in matrix Hard

    For an matrix with odd , the sum of the middle row and middle column shares which element that must be counted only once to avoid double counting?

  54. Question 54 of 60 Sum of middle row and element in matrix Hard

    Given a matrix where element (0-indexed), what is the sum of the middle row?

  55. Question 55 of 60 Checking if all rows of a matrix are circular rotations of each other Hard

    To check whether all rows of an matrix are circular rotations of the first row, the standard efficient approach concatenates the first row with itself and then does what?

  56. Question 56 of 60 Checking if all rows of a matrix are circular rotations of each other Hard

    Consider rows and . Why is a valid circular rotation of ?

  57. Question 57 of 60 Modular Exponentiation Hard

    When computing with a very large exponent given as a decimal string, and prime with , the exponent can first be reduced modulo which value?

  58. Question 58 of 60 Exponential squaring Hard

    Exponentiation by squaring can be generalized to compute the -th power of an matrix. What is its time complexity for computing ?

  59. Question 59 of 60 Pigeonhole principle Hard

    Given any integers, the pigeonhole principle guarantees a non-empty subset whose sum is divisible by . Which quantities serve as the pigeons and holes in the standard proof?

  60. Question 60 of 60 N-th non-square number Hard

    Why does the formula for the -th non-square number add rather than simply ?

That's unit 2

Answer a few questions and your score shows up here.