You are on page 1of 2

Asgn # 3

Discrete Mathematics
Dated:_______Sep 23__________
Discussion on submissions only, during office hours:
Bilal Hayat: Monday 1400-1600 and Tuesday 1100 - 1300
Sadaf Iqbal: Monday - Full day
You are required to show that the following two sets are countably infinite.
1. set of Positive Rational Numbers (R+)
2. set of All Integers (Z)
An infinite set is countable if and only if it is possible to list the elements of the set in a sequence
(indexed by the Natural Numbers). The reason for this is that a one-to-one correspondence f from
the set of Natural Numbers to a set S can be expressed in terms of a sequence a1, a2, . . . , ai, . . . ,
where a1=f(1), a2=f(2) . . . , ai=f(i), . .
This sequence is called an enumeration. You are, therefore, required to code the enumeration
procedure.
Part 1 - Submission due: 27 Sept 2015 (Ungraded, no extensions)
Write a pseudocode or make a flowchart for the enumeration procedure for R+ and Z.
Submit a pdf file, named K1x-xxxx.pdf (use your student id as filename) or handwritten
submissions are allowed only for Part 1 for those who are out of station for Eid Holidays or
those who has some internet issues. They can submit the assignments in only Monday class.
Part 2 - Submission due: 4 Oct 2015 (Graded, no extensions)
Define the function for enumeration procedure for R+ and Z. Use any programming language
of your choice. Use this enumeration procedure to prove that R+ and Z are countable.
Evaluation will be on the technique used for enumeration. Code should be executable,
attach the output of your program.
Submit a pdf file, named K1x-xxxx.pdf (use your student id as filename) containing:
1. Description of the enumeration technique used in simple english. [25 Marks]
2. Code with proper comments [Write function named EnumR() and EnumZ()] [50 Marks]
3. Code output with at least 10 different inputs each for Z and R+. [25 Marks]

Example flow of your code:


1. Your program should first ask whether user want to enumerate Z or R+.
2. Then your program should ask whether user wants to enter Domain or Co-domain value as
input.
3a. If domain value is input (any value of Natural Number, say ai) then your code should output
the desired (R+ or Z) sequence till element ai.
3b. If Co-domain value is input (any value of R+ or Z, say n) then your code should output the
unique element of Natural Number. Every time n is output your enumeration should return the
same unique element of Natural Number.

You might also like