$30
Assignment No. 7
EECS 210
Discrete Structures
Submit deliverables in a single zip file to Canvas
Name of the zip file: FirstnameLastname_Assignment7 (with your first and last name)
Name of the Assignment folder within the zip file: FirstnameLastname_Assignment7
Deliverables:
1. Copy of Rubric7.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++, Python, or Haskell.
• Topic: Distributing Objects into Boxes
1. Write a program for counting the number of ways to distribute distinguishable
objects into distinguishable boxes.
a) Debug your program by answering Example 8 in the Permutations &
Combinations lecture slides.
b) Test your program by answering this question: “A professor packs her
collection of 40 issues of a mathematics journal in four boxes with 10
issues per box. How many ways can she distribute the journals if each box
is numbered, so that they are distinguishable?”
2. Write a program for counting the number of ways to distribute indistinguishable
objects into distinguishable boxes.
a) Debug your program by answering Example 9 in the Permutations &
Combinations lecture slides.
b) Test your program by answering this question: “How many ways are there
to distribute 12 indistinguishable balls into six distinguishable bins?”
3. Write a program for counting the number of ways to distribute distinguishable
objects into indistinguishable boxes.
a) Debug your program by answering Example 10 in the Permutations &
Combinations lecture slides.
b) Test your program by answering this question: “How many ways are there
to put five temporary employees into four identical offices?”
4. Write a program for counting the number of ways to distribute indistinguishable
objects into indistinguishable boxes.
a) Debug your program by answering Example 11 in the Permutations &
Combinations lecture slides.
b) Test your program by answering this question: “How many ways are there
to distribute five indistinguishable objects into three indistinguishable
boxes?”
5. 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.