1 / 14

CSE 20 – Discrete Mathematics

hova
Download Presentation

CSE 20 – Discrete Mathematics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.Based on a work at http://peerinstruction4cs.org.Permissions beyond the scope of this license may be available at http://peerinstruction4cs.org. CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett

  2. Today’s Topics: Propositional logic • Truth tables for basic logical connectives • not, and, or, xor, implies • Truth table for new/made-up connectives • “Step-by-step” truth tables for complex propositional formulas

  3. 1. Truth table for basic logical connectives not, and, or, xor, implies

  4. Logical connectives mathJava/C++ • and p  q p && q • or p  q p || q • xor p  q p ^ q • not p !p • If/then, implies p  q • If and only if, iff p  q • We will use the math notation

  5. Logical connectives: Operator precedence • As with programming, it is good practice to use parenthesis for clarity

  6. OR is tricky in English OR XOR Birthday party host: “Do you want some cake OR ice-cream?” YOU CAN HAVE BOTH (imagine it is rude to have nothing) Diner breakfast special: “Pancake, two eggs and bacon XOR sausage.” YOU MUST PICK EXACTLY ONE

  7. What does it mean: IMPLIES • Prof Lee says: “If you win the CA state lottery between now and the end of quarter, you will get an A+ in this class.” 4 months later… under which of the following scenarios is Prof. Lee a liar? • You won the lottery and got an A+ • You won the lottery and got a B+ • You did not win the lottery and got an A+ • You did not win the lottery and got a B+ • None/More/Other

  8. What does it mean: IMPLIES • Your roommate: “If you come to my party Friday, you will have fun” Under which of the following scenarios is your roommate a liar? • You stayed home studying Friday and you did not have fun. • You stayed home studying Friday and you had fun. • You went to the party Friday and did not have fun. • You went to the party Friday and you had fun. • None/More/Other

  9. Truth tables: IMPLIES I’m interested in seeing if this makes intuitive sense to you – can you explain why each output makes sense, using example sentences? T, F, F, T F, T, T, T F, F, F, T F, T, T, F None/more/other

  10. 2. Truth table for new/made-up connectives

  11. Making our own connective: AtLeastOneOfTheseThreeALOOTT(p,q,r) • Let’s make a truth table for ALOOTT. How many rows and columns should be in our truth table (ignoring header row)? • 5 rows, 4 columns • 6 rows, 4 columns • 7 rows, 4 columns • 8 rows, 4 columns • 9 rows, 4 columns

  12. Making our own connective: AtLeastOneOfTheseThreeALOOTT(p,q,r) Homework

  13. 3. “Step-by-step” truth tables for complex propositional formulas

  14. Truth table for (pq)p

More Related