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 3 subjective questions GCD and Primality testing

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

    Explain the Basic Euclidean algorithm for computing the GCD of two numbers. Illustrate with an example of finding .

  2. Question 2 of 20

    Describe the Extended Euclidean algorithm. How does it help in finding integers and such that ? Solve for , .

  3. Question 3 of 20

    Explain how to find the total number of divisors of a number using its prime factorization. Compute the number of divisors of .

  4. Question 4 of 20

    Describe an efficient algorithm to find all prime factors of a number . Trace it for .

  5. Question 5 of 20

    Explain why prime factorization can be done by iterating only up to the square root of the number. Justify mathematically.

  6. Question 6 of 20

    Define K-jagged numbers. Explain their significance and give examples.

  7. Question 7 of 20

    Define Stormer numbers. Explain the mathematical condition that characterizes them.

  8. Question 8 of 20

    Define a Frugal number and explain the condition using digit counts. Verify whether is a frugal number.

  9. Question 9 of 20

    Define P-smooth numbers. Describe how to find all P-smooth numbers in a given range .

  10. Question 10 of 20

    State Lemoine's Conjecture and explain it with examples. How does it relate to Goldbach's conjecture?

  11. Question 11 of 20

    Distinguish between the Basic Euclidean algorithm and the Extended Euclidean algorithm in terms of purpose, output, and applications.

  12. Question 12 of 20

    Explain how the Extended Euclidean algorithm is used to compute the modular multiplicative inverse. Find the inverse of modulo .

  13. Question 13 of 20

    Derive the recursive relation used in the Extended Euclidean algorithm and explain how the coefficients are updated at each step.

  14. Question 14 of 20

    Explain the Sieve of Eratosthenes for primality testing and how it can be adapted to find the smallest prime factor of every number up to .

  15. Question 15 of 20

    Given the number , find its prime factorization, the total number of divisors, and the sum of divisors.

  16. Question 16 of 20

    Compare K-jagged (k-rough) numbers and P-smooth numbers. Highlight their differences with examples.

  17. Question 17 of 20

    Write an algorithm to determine whether a given number is prime using the method. Explain the optimizations used.

  18. Question 18 of 20

    Verify whether is a Störmer number and check the first few Störmer numbers. Explain the verification process.

  19. Question 19 of 20

    Solve the following GCD-based problem: Find the GCD of an array and explain the property that allows extending GCD to multiple numbers.

  20. Question 20 of 20

    Explain the relationship and use it to compute the LCM of and . Discuss its use in solving problems.

That's unit 3

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.