cpsc 121 models of computation
play

CPSC 121: Models of Computation Instructor: Bob Woodham - PowerPoint PPT Presentation

CPSC 121: Models of Computation Instructor: Bob Woodham woodham@cs.ubc.ca Department of Computer Science University of British Columbia Lecture Notes 2008/2009, Section 203 CPSC 121: Models of Computation Menu April 8, 2009 Topics: Example:


  1. CPSC 121: Models of Computation Instructor: Bob Woodham woodham@cs.ubc.ca Department of Computer Science University of British Columbia Lecture Notes 2008/2009, Section 203 CPSC 121: Models of Computation

  2. Menu April 8, 2009 Topics: Example: NFA to DFA Conversion Final Reading List Learning Goals Summary The End! Reminders: On-line Quiz 12 deadline 5:00pm TODAY Teaching evaluation survey now available on-line — deadline 23:00 April 12 Review session (Steve): Thu April 9, 9:00, DMP 310 Review session (Bob): Thu April 16, 14:00, DMP 110 Final exam Friday, April 17, 7:00pm, SRC A READ the WebCT Vista course announcements board CPSC 121: Models of Computation

  3. Recall: Decimal Number NFA 0−9 S S int dot 0 1 0−9 0−9 real 0−9 CPSC 121: Models of Computation

  4. Example 1: Build the DFA. . . Construct the DFA corresponding to the decimal number NFA {s ,s } 0 1 CPSC 121: Models of Computation

  5. Example 1: Build the DFA. . . Construct the DFA corresponding to the decimal number NFA 0−9 {s ,s } { ,int} s 1 0 1 {s } 1 { } CPSC 121: Models of Computation

  6. Example 1: Build the DFA. . . Construct the DFA corresponding to the decimal number NFA 0−9 {s ,s } { ,int} s 1 0 1 0−9 {s } 1 else { } CPSC 121: Models of Computation

  7. Example 1: Build the DFA. . . Construct the DFA corresponding to the decimal number NFA 0−9 0−9 {s ,s } { ,int} s 1 {dot} 0 1 else 0−9 {s } 1 else { } CPSC 121: Models of Computation

  8. Example 1: Build the DFA. . . Construct the DFA corresponding to the decimal number NFA 0−9 0−9 0−9 {s ,s } { ,int} s 1 {dot} {real} 0 1 else else 0−9 {s } 1 else { } CPSC 121: Models of Computation

  9. Example 1: Build the DFA. . . Construct the DFA corresponding to the decimal number NFA 0−9 0−9 0−9 0−9 {s ,s } { ,int} s 1 {dot} {real} 0 1 else else 0−9 else {s } 1 else { } CPSC 121: Models of Computation

  10. Example 1: Build the DFA. . . Construct the DFA corresponding to the decimal number NFA 0−9 0−9 0−9 0−9 {s ,s } { ,int} s 1 {dot} {real} 0 1 else else 0−9 else {s } 1 else { } else CPSC 121: Models of Computation

  11. Final Exam Coverage Section 203 Lectures 1–36 1 — cumulative [slides] and [with notes] versions provided Epp: 2 Chapter 1 Chapter 2 Sections 3.1, 3.6, and 3.7 plus Theorem 3.4.1 and pages 159–163 Section 4.1 (purely as background reading) Sections 4.2–4.4 Sections 5.1–5.3 Section 7.1 and Section 7.2 (excluding “Application: Hash Functions” and “Properties of Exponential and Logarithmic Functions”) Section 12.1–12.2 Labs 0–8 3 CPSC 121: Models of Computation

  12. Final Exam Aides The final exam is open book You may bring and access during the exam: any (reasonable) number of textbooks one binder or folder of notes The binder or folder may contain any notes you like (e.g., handwritten notes, printouts of practice finals, midterms, recipes for chocolate cake, etc.) We recommend carefully organizing and thinking through the material beforehand In a timed situation, you’ll likely want to access your notes and books as infrequently as possible Finally, you may not have any other aides during the exam. (In particular, you may not use any electronic device such as a calculator) CPSC 121: Models of Computation

  13. Learning Goals Evaluate the truth of simple propositional logic statements 1 using truth tables Translate back and forth between simple natural language 2 statements and propositional logic Translate back and forth between propositional logic 3 statements and combinational circuits built using standard logic gates (NOT, AND, OR, XOR, NAND, NOR) Design combinational circuits based on propositional logic 4 expressions and their equivalent logic circuits to solve real problems (e.g., a 7 segment LED numerical display) Evaluate propositional logic as a model of computation for 5 combinational circuits, identifying at least one explicit shortfall (e.g., timing based on gate delays, fan-out, wire length, instabilities, shared sub-circuits, etc.) CPSC 121: Models of Computation

  14. Learning Goals (cont’d) Translate back and forth between simple natural language 6 statements and propositional logic, including conditionals and biconditionals Evaluate the truth of simple propositional logic statements 7 using truth tables, including conditionals and biconditionals Given a propositional logic statement and a logical 8 equivalence rule, apply the rule to create the equivalent statement Transform propositional logic statements by application of 9 logical equivalence rules in order to: — simplify complex statements — prove the logical equivalence of two statements — represent statements in a standard canonical form CPSC 121: Models of Computation

  15. Learning Goals (cont’d) 10 Convert integers from octal or hexadecimal to binary and back 11 Convert positive integers from decimal to binary — by “repeated division” (octal/hex as intermediary) 12 Convert positive integers from binary to decimal 13 Take the 2’s complement of a fixed width binary number 14 Convert signed (either positive or negative) integers to binary and back 15 Add and subtract fixed width, 2’s complement (signed) binary integers 16 Convert decimal fractions (in positional notation) to binary fractions (in positional notation) — by “repeated multiplication” (octal/hex as intermediary) CPSC 121: Models of Computation

  16. Learning Goals (cont’d) 17 Critique different number representations describing their strengths and weaknesses (finite representation, overflow, etc.). Representations include: positional notation (binary, octal, decimal, hexadecimal); binary coded decimal (BCD); fixed-width, 2’s complement (signed) binary; IEEE 754 floating point (single and double precision) 18 Use truth tables to establish or refute the validity of a proposed rule of inference 19 Given a rule of inference and propositional logic statements that correspond to the rule’s premises, apply the rule to infer a new statement implied by the original statements 20 Explore the logical consequences of a set of propositional statements by application of both equivalence and inference rules, especially in order to transform statements into a desired canonical form CPSC 121: Models of Computation

  17. Learning Goals Understand the definition of a predicate and its associated 1 domain of discourse Evaluate the truth of predicates applied to particular values 2 Understand what it means for a predicate to be universally 3 quantified or existentially quantified Show predicate logic statements are true by enumerating 4 examples (i.e., all examples in the domain of discourse for a universally quantified statement or at least one example for an existentially quantified statement) Show predicate logic statements are false by enumerating 5 counterexamples (i.e., one counterexample for a universally quantified statement or all for an existentially quantified statement) CPSC 121: Models of Computation

  18. Learning Goals (cont’d) Translate between statements in formal predicate logic 6 notation and equivalent statements in closely matching informal language (i.e., informal statements with clear and explicitly stated quantifiers) Construct predicate logic statements to capture the 7 relationships between properties of various objects both real-world like and computing related Determine the negation of any quantified statement, 8 including multiply quantified statements, using generalized De Morgan Given a quantified statement and a logical equivalence 9 rule, apply the rule to create an equivalent statement CPSC 121: Models of Computation

  19. Learning Goals (cont’d) 10 Apply additional rules of inference for quantified statements including universal instantiation, universal generalizarion, existential instantiation, existential generalization, universal modus ponens, universal modus tollens, and universal transitivity 11 Prove (or disprove) conjectures involving quantified statements using basic proof techniques, both direct and indirect, including proof by contradiction and proof by contrapositive CPSC 121: Models of Computation

  20. Learning Goals Understand the following basic proof strategies: 1 constructive/nonconstructive proofs of existence (“witness”) disproof by counterexample exhaustive proof generalizing from the generic particular (“WLOG”) direct proof (“antecedent assumption”) proof by contradiction proof by contrapositive proof by cases well enough to identify the strategy when it is encountered in a given proof and well enough to apply it as a strategy in a novel proof CPSC 121: Models of Computation

  21. Learning Goals (cont’d) Devise and attempt multiple different, appropriate proof 2 strategies for a given theorem – including all those listed above – that use definitions, premises, logical equivalences, rules of inference and rules of inference for quantified variables Prove theorems requiring only simple insights beyond 3 choice of proof strategy or for which the necessary insight is given as a hint/suggestion CPSC 121: Models of Computation

Recommend


More recommend