Answered step by step
Verified Expert Solution
Question
1 Approved Answer
solve this question by using python the section 1.5 mentions all of the laws of propositional logic, you just need to identify which law you
solve this question by using python
the section 1.5 mentions all of the laws of propositional logic, you just need to identify which law you use using symbol # before the code
Problem 5. (Bonus 10 points) In this problem, you will use the laws of propositional logic to prove equivalences and implications. Proofs via truth tables are not allowed. Your proofs will be expressed in Python notation, one formula per line, with each line equivalent to the previous. For each line except the first, explain what law (from Section 1.5 in the textbook) makes it equivalent to the previous line by putting the symbol # and then the name of the law you are using. You may combine some laws into a single line when it is very clear what you are doing (for example, you can apply associativity and commutativity together to rearrange order and add/remove parentheses). We give you an example how it's done first. Example: Prove that "if you love winter, then you like Boston" is equivalent to "if you don't like Boston, then you don't love winter." Use p to denote "you like Boston" and q to denote "you love winter." Prove that "if you study computer science, you'll be smart and if you study computer science, you'll be happy" is equivalent to "if you study computer science, you'll be smart and happy". Let p denote "you study computer science," q denote "you'll be smart" and "r denote "you'll be happy." Submit your proof in a file ps2.py into assignment ps2-code. The autograder, for 5 points, will give you immediate feedback on the correctness of each line, but not whether you correctly identified the laws (that will be graded manually). Problem 5. (Bonus 10 points) In this problem, you will use the laws of propositional logic to prove equivalences and implications. Proofs via truth tables are not allowed. Your proofs will be expressed in Python notation, one formula per line, with each line equivalent to the previous. For each line except the first, explain what law (from Section 1.5 in the textbook) makes it equivalent to the previous line by putting the symbol # and then the name of the law you are using. You may combine some laws into a single line when it is very clear what you are doing (for example, you can apply associativity and commutativity together to rearrange order and add/remove parentheses). We give you an example how it's done first. Example: Prove that "if you love winter, then you like Boston" is equivalent to "if you don't like Boston, then you don't love winter." Use p to denote "you like Boston" and q to denote "you love winter." Prove that "if you study computer science, you'll be smart and if you study computer science, you'll be happy" is equivalent to "if you study computer science, you'll be smart and happy". Let p denote "you study computer science," q denote "you'll be smart" and "r denote "you'll be happy." Submit your proof in a file ps2.py into assignment ps2-code. The autograder, for 5 points, will give you immediate feedback on the correctness of each line, but not whether you correctly identified the laws (that will be graded manually)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started