CSE115/ENGR160 Discrete Mathematics 01/17/12

Download CSE115/ENGR160 Discrete Mathematics 01/17/12

Post on 13-Jan-2016




0 download


CSE115/ENGR160 Discrete Mathematics 01/17/12. Ming-Hsuan Yang UC Merced. CSE 115/ENGR 160. Instructor: Ming-Hsuan Yang ( mhyang@ucmerced.edu ) Teaching assistant: Jime Yang ( jyang44@ucmerced.edu ) and Chih-Yuan Yang (cyang35@ucmerced.edu) Lectures: - PowerPoint PPT Presentation


  • CSE115/ENGR160 Discrete Mathematics01/17/12Ming-Hsuan YangUC Merced*

  • CSE 115/ENGR 160Instructor: Ming-Hsuan Yang (mhyang@ucmerced.edu) Teaching assistant: Jime Yang (jyang44@ucmerced.edu) and Chih-Yuan Yang (cyang35@ucmerced.edu)Lectures:KL 217, Tuesday/Thursday 4:30 pm to 5:45 pmLabs:SE 138, Monday 8:00 am to 10:50 am (CSE115-02L), Wednesday 1:00 pm to 3:50 pm (CSE115-03L)Web site: http://faculty.ucmerced.edu/mhyang/course/cse115*

  • Office hoursOffice hours: Wednesday 3:00 pm 4:00 pmSE 258TA hoursMonday 8:00 am to 10:50 am, Wednesday 1:00 pm to 3:50 pmSE 138


  • Course goalsMathematical reasoningLogic, inference, proofCombinatorial analysisCount and enumerate objectsDiscrete structuresSets, sequences, functions, graphs, trees, relationsAlgorithmic reasoningSpecifications and verificationsApplications and modelingInternet, business, artificial intelligence, etc.*

  • TopicsLogicProofSetsFunctionsNumber theoryCountingRelationsGraphBoolean algebra*

  • TextbookDiscrete Mathematics and Its Applications by Kenneth H. Rosen, 7th edition, McGraw Hill


  • PrerequisiteUpper division standingBasic knowledge of calculus (MATH 21 and MATH 22)Basic knowledge in computer science*

  • Grading5% Class participation25% Homework 20% Four quizzes20% Two midterms 30% Final


  • Class policyDo not use computers or smart phones in classAll the lecture notes will be posted on the class webWeekly homework assigned on Thursday and due in the following Thursday in classMust be your own workHomework returned in class


  • 1.1 Propositional logicUnderstand and construct correct mathematical argumentsGive precise meaning to mathematical statementsRules are used to distinguish between valid (true) and invalid argumentsUsed in numerous applications: circuit design, programs, verification of correctness of programs, artificial intelligence, etc.*

  • PropositionA declarative sentence that is either true or false, but not bothWashington, D.C., is the capital of USACalifornia is adjacent to New York1+1=22+2=5What time is it?Read this carefully*

  • Logical operatorsNegation operatorConjunction (and, ^)Disjunction (or v )Conditional statement Biconditional statement Exclusive Or


  • Negation*

  • ExampleToday is FridayIt is not the case that today is FridayToday is not FridayAt least 10 inches of rain fell today in MiamiIt is not the case that at least 10 inches of rain fell today in MiamiLess than 10 inches of rain fell today in Miami*

  • Conjunction*Conjunction: p ^ q is true when both p and q are true. False otherwise

  • Examplep: Today is Friday, q: It is raining todaypq Today is Friday and it is raining todaytrue: on rainy Fridaysfalse otherwise:Any day that is not a Friday Fridays when it does not rain


  • Disjunction*Disjunction: p v q is false when both p and q are false. True otherwise

  • Examplep q: Today is Friday or it is raining todayTrue: Today is FridayIt is raining todayIt is a rainy FridayFalseToday is not Friday and it does not rain


  • Exclusive or*Exclusive Or is true when exactly one of p, q is true. False otherwise

  • Conditional statement*Conditional Statement: p is called the premise (or antecedent) and q is called the conclusion (or consequent)p q is false when p is true and q is false. True otherwise

  • Conditional statement pq Also called an implication

    *Conditional Statement: pq is false when p is true and q is false. True otherwiseExamplep: you go, q: I go. pq means If you go, then I go is equivalent to p only if q You go only if I go (not the same as I go only if you go which is q only if p)

    if p, then qp implies qif p, qp only if qp is sufficient for qa sufficient condition for q is pq if pq whenever pq when pq is necessary for pa necessary condition for p is qq unless pq follows from p

  • pqp only if q: p cannot be true when q is not trueThe statement is false if p is true but q is falseWhen p is false, q may be either true or falseNot to use q only if p to express pqq unless pIf p is false, then q must be trueThe statement is false when p is true but q is false, but the statement is true otherwise


  • ExampleIf Maria learns discrete mathematics, then she will find a good jobMaria will find a good job when she learns discrete mathematics (q when p)For Maria to get a good job, it is sufficient for her to learn discrete mathematics (sufficient condition for q is p)Maria will find a good job unless she does not learn discrete mathematics (q unless not p)


  • Common mistake for pqCorrect: p only if qMistake to think q only if p*

  • ExampleIf today is Friday, then 2+3=6The statement is true every day except Friday even though 2+3=6 is false*

  • Converse, contrapositive and inverseFor conditional statement p qConverse: q p Contrapositive: q pInverse: p qContrapositive and conditional statements are equivalent*

  • Biconditional statement* Biconditional Statement: p if and only if q p q is true when p, q have the same truth value. False otherwise Also known as bi-implications

  • ExampleP: you can take the flight, q: you buy a ticketP q: You can take the flight if and only if you buy a ticketThis statement is true If you buy a ticket and take the flightIf you do not buy a ticket and you cannot take the flight *

  • Truth table of compound propositions*

  • Precedence of logic operators*

  • Bit operations*

  • 1.2 Translating English to logical expressionsWhy? English is often ambiguous and translating sentences into compound propositions removes the ambiguityUsing logical expressions, we can analyze them and determine their truth valuesWe can use rules of inferences to reason about them*

  • Example You can access the internet from campus only if you are a computer science major or you are not a freshman. p : You can access the internet from campus q : You are a computer science major r : You are freshmenp ( q v r )


  • System specificationTranslating sentences in natural language into logical expressions is an essential part of specifying both hardware and software systems.Consistency of system specification.Example: Express the specification The automated reply cannot be sent when the file system is full


  • ExampleLet p denote The automated reply can be sentLet q denote The file system is fullThe logical expression for the sentence The automated reply cannot be sent when the file system is full is*

  • ExampleDetermine whether these system specifications are consistent:1. The diagnostic message is stored in the buffer or it is retransmitted.2. The diagnostic message is not stored in the buffer.3. If the diagnostic message is stored in the buffer, then it is retransmitted.


  • ExampleLet p denote The diagnostic message is stored in the bufferLet q denote The diagnostic message is retransmitted The three specifications are


  • ExampleIf we add one more requirement The diagnostic message is not retransmitted The new specifications now are

    *This is inconsistent! No truth values of p and q will make all the above statements true

  • Logic gates *