Starting from:

$30

Assignment No. 3 EECS 210 Discrete Structures

Assignment No. 3
EECS 210
Discrete Structures

Submit deliverables in a single zip file to Canvas
Name of the zip file: FirstnameLastname_Assignment3 (with your first and last name)
Name of the Assignment folder within the zip file: FirstnameLastname_Assignment3
Deliverables:
1. Copy of Rubric3.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.
• Label each output with a description, e.g., “1a. Union of R1 and R2”
• Use the methods or functions inherent in the language and/or using methods or
functions you create. Like previous assignments, don’t “hard code” a solution you
did on paper as the output.
• Create a program for the following:
1. For the relations:
R1 = {(1,1), (2,2), (3,3)} and R2 = {(1,1), (1,2), (1,3), (1,4)}
perform the following set operations and display the results:
a) R1 ∪ R2
b) R1 ∩ R2
c) R1 − R2
d) R2 − R1
2. Display S ◦ R, where:
R is the relation from A = {1, 2, 3} to B = {1, 2, 3, 4} with
R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)}
S is the relation from B = {1, 2, 3, 4} to C = {0, 1, 2} with
S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)}
3. For R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)}, show R2
.
4. For the relation R = {(x, y) | x + y = 0} on the set {-10, …, -1, 0, 1, …, 10}:
a) Show R as a set of ordered pairs.
b) Show whether R is reflexive or not.
c) Show whether R is symmetric or not.
d) Show whether R is antisymmetric or not.
e) Show whether R is transitive or not.
• 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