$30
Assignment No. 1
EECS 210
Discrete Structures
Submit deliverables in a single zip file to Canvas
Name of the zip file: FirstnameLastname_Assignment1 (with your first and last name)
Name of the Assignment folder within the zip file: FirstnameLastname_Assignment1
Deliverables:
1. Copy of Rubric1.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.
• Create a program that prints out a truth table showing the logical equivalence of
the following propositions:
1. De Morgan’s First Law
2. De Morgan’s Second Law
3. First Associative Law
4. Second Associative Law
5. [(p ∨ q) ∧ (p → r) ∧ (q → r)] → r ≡ T
6. p ↔ q ≡ (p → q) ∧ (q → p)
• For example, to show p → q ≡ ¬q → ¬p:
•
• Do not hardcode the tables, instead use the logical/Boolean variables and
operators of the language to calculate the values in the table.
• Use logical equivalences of ¬, ∨, and ∧ to perform the → and ↔ operations (see
Table 7 and Table 8 in the Propositional Logic lecture).
• Use the following plain letter substitutions for the logical operators:
o ¬ = !
o ∨ = +
o ∧ = *
o → = ->
p q p → q ¬q → ¬p
T T T T
T F F F
F T T T
F F T T
o ↔ = <->
• Print out a line between tables indicating which proposition number the truth table
is for.
• 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.
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.