CSCI 246 Homework 5
- Due Date: Thursday, March 24th no later than 11:59 p.m.
- Partner Information: You may complete this assignment individually or
with exactly one classmate.
- Submission Instructions (working alone): Upload your solution,
entitled YourFirstName-YourLastName.py
to the BrightSpace Homework 5 Dropbox.
- Submission Instructions (working with exactly one classmate): Upload your solution, entitled
YourFirstName-YourLastName-PartnerFirstName-PartnerLastName.py
to the BrightSpace Homework 5 Dropbox. Note: If you work with a
partner, only one person needs to submit a solution. If you both
submit a solution, the submission that will be graded is the one from
the partner whose last name comes alphabetically first.
- Deadline Reminder: Once the submission deadline passes, BrightSpace
will no longer accept your submission and you will no longer be able
to earn credit. Thus, if you are not able to fully complete the
assignment, submit whatever you have before the deadline so that
partial credit can be earned.
Learning Outcomes
- Gain experience writing Python functions that are
relevant to Discrete Mathematics concepts.
- Write a function that generates a power set.
- Write a function that determines Hamming distance.
- Write functions that determine whether a relation is
reflexive, symmetric and/or transitive.
Assignment
- Download 246.py and rename
it according to the instructions above.
- Modify the program by adding the missing function.
If the missing functions
are implemented correctly, this output
might appear.
Grading - 50 points
Note: Your program will be tested with different inputs than
what appear in the starting python program above. Make sure
your solution is a general one.
- 10 points - The power_set function is implemented correctly
and works on all test inputs.
- 10 points - The hamming function is implemented correctly
and works on all test inputs. You may assume that the function
will be tested on two non-negative integers that can be arbitrarily
large.
- 10 points - The reflexive function is implemented correctly
and works on all test inputs.
- 10 points - The symmetric function is implemented correctly
and works on all test inputs.
- 10 points - The transitive function is implemented correctly
and works on all test inputs.
Test Cases with Sample Solution