CSL 100: Introduction to Computers and Computer Science (3-0-2-4)

I Semester 2013-14

Instructor: Subhashis Banerjee and S. Arun-Kumar

Last modified: Sat Aug 10 09:57:13 IST 2013
Week 3: 12-17 Aug 2013

Since Thursday 15 Aug is a holiday, the lab for Thursday groups will be held on Saturday 17 Aug 2013.


  1. Consider an obvious extension of the definition of GCD to all integers. Write a new algorithmic definition of the gcd function to all integers. Program it in SML and test it out.
    Question What is a suitable collection of tests which will convince anybody that your program works correctly?

  2. Find out when two natural numbers are relatively prime. Use the gcd algorithm given in the last week's labs to determine whether a pair of numbers is relatively prime.
    Question Can two negative integers be relatively prime to each other?

  3. Question How will you extend your function for negative integers?

  4. Question Is it not easier to check divisibility by 3 and 9 simply by actually dividing the numbers by 3 and 9 respectively?Can you think of a situation where your divisibility-checking algorithms might actually be useful?

  5. Question Here again design a collection of tests which gives you confidence and may convince your TA that your program works correctly.

  6. Question Here again design a collection of tests which gives you confidence and may convince your TA that your program works correctly .

S. Arun-Kumar
Last modified: Sat Aug 10 11:08:19 IST 2013