Starting from:

$30

Assignment No. 5 EECS 210 Discrete Structures

Assignment No. 5
EECS 210
Discrete Structures

Submit deliverables in a single zip file to Canvas
Name of the zip file: FirstnameLastname_Assignment5 (with your first and last name)
Name of the Assignment folder within the zip file: FirstnameLastname_Assignment5
Deliverables:
1. Copy of Rubric5.docx with your name and ID filled out (do not submit a PDF).
2. Source code.
3. Screen print showing the successful execution of your code or copy and paste the
output from a console screen to a Word document and PDF it.
Assignment:
• You may use any language you want, but if you want help from me or one of the
SIs, you should probably use C++ or Python.
• Recall that a function f from A to B, is a relation f ⊆ A x B such that each element
of A is assigned to exactly one element of B.
• Thus, we can represent a function as a relation of order pairs, (a,b), where a ∊ A, b
∊ B, and b = f(a).
• Write a program that takes inputs of A, B, and a relation f and a) determines if the
relation is a function or not, b) and if it is a function, determines if it is injective,
surjective, or bijective, c) and if it is bijective, determines the inverse function.
• Your program should print out the inputs using the notation you learned in class,
i.e., A = {…}, B = {…}, f = {(a,b), …}, whether the relation is a function or not,
b) and if it is a function, whether it is injective, surjective, or bijective, c) and if it
is bijective, what is the inverse function. Test your program with the following
inputs:
1. A = {a,b,c,d}, B = {v,w,x,y,z}, f = {(a,z),(b,y),(c,x),(d,w)}
2. A = {a,b,c,d}, B = {x,y,z}, f = {(a,z),(b,y),(c,x),(d,z)}
3. A = {a,b,c,d}, B = {w,x,y,z}, f = {(a,z),(b,y),(c,x),(d,w)}
4. A = {a,b,c,d}, B = {1,2,3,4,5}, f = {(a,4),(b,5),(c,1),(d,3)}
5. A = {a,b,c}, B = {1,2,3,4}, f = {(a,3),(b,4),(c,1)}
6. A = {a,b,c,d}, B = {1,2,3}, f = {(a,2),(b,1),(c,3),(d,2)}
7. A = {a,b,c,d}, B = {1,2,3,4}, f = {(a,4),(b,1),(c,3),(d,2)}
8. A = {a,b,c,d}, B = {1,2,3,4}, f = {(a,2),(b,1),(c,2),(d,3)}
9. A = {a,b,c}, B = {1,2,3,4}, f = {(a,2),(b,1),(a,4),(c,3)}
• Provide comments that explain what each line of code is doing. See rubric below.
Rubric for Program Comments
Exceeds Expectations
(90-100%)
Meets Expectations
(80-89%)
Unsatisfactory
(0-79%)
Software is adequately
commented with prologue
comments, comments
summarizing major blocks of
code, and comments on every
line.
Prologue comments are present
but missing some items or some
major blocks of code are not
commented or there are
inadequate comments on each
line.
Prologue comments are missing
all together or there are no
comments on major blocks of
code or there are very few
comments on each line.
Adequate Prologue Comments:
• Name of program contained in the file (e.g., EECS 210 Assignment 3)
• Brief description of the program, e.g.:
o Python code for demonstrating operations on relations and properties of
relations.
• Inputs (e.g., none, for a function, it would be the parameters passed to it)
• Output, e.g.,
o Print out of the name of each exercise, followed by the exercise’s output.
• Author’s full name
• Creation date: The date you first create the file, i.e., the date you write this
comment
Adequate comments summarizing major blocks of code and comments on every line:
• Provide comments that explain what each line of code is doing.
• You may comment each line of code (e.g., using //) and/or provide a multi-line
comment (e.g., using /* and */) that explains what a group of lines does.
• Multi-line comments should be detailed enough that it is clear what each line of
code is doing.
Remember:
• Your Programming Assignments are individual-effort.
• You can brainstorm with other students and help them work through problems in
their programs, but everyone should have their own unique assignment programs.

More products