# CS 330 Formal Methods and Models

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 CS 0 Forml Methods nd Models Dn Richrds, George Mson University, Fll 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Septemer 8 1. Prove q (q p) p q p () (4pts) with truth tle. p q p q p (q p) p q q (q p) p q p T T F F T F T T T F F F T T T T F T T T T F T T F F T F F T F F () (4pts) lgericlly. q (q p) p q ((q p) p) q ((q p) p) (q (q p)) p q p Conditionl lw Lw of negtion Associtivity Susumption 2. (2pts) Prove (α β) γ ((α γ) (β γ)). (α β) γ γ (α β) (γ α) (γ β) (α γ) (β γ) Commuttivity Distriutivity Commuttivity This result cn lso e shown using truth tle. 1

2 Quiz 2, Rules of Inference Dte: Septemer (4pts) Prove (( p q) q) p. 1 [( p q) q] Assumption 2 p q elimintion 1 q elimintion 1 4 p Modus tollens 2, 5 p Doule negtion 4 6 (( p q) q) p introduction 1,5 2. (6pts) Prove ((p q) r) (p (q r)). 1 [(p q) r] Assumption 2 [p] Assumption [q] Assumption 4 p q introduction 2, 5 r Modus ponens 1,4 6 q r introduction,5 7 p (q r) introduction 2,6 8 ((p q) r) (p (q r)) introduction 1,7 9 [p (q r)] Assumption 10 [p q] Assumption 11 p elimintion q elimintion 10 1 q r Modus ponens 9,11 14 r Modus ponens 1,12 15 (p q) r introduction 10,14 16 (p (q r)) ((p q) r) introduction 9,15 17 ((p q) r) (p (q r)) introduction 8,16 2

3 Quiz, Predicte Logic Dte: Septemer (4pts) Evlute i I + : j I i : j 2 = i. True. If i = 1, then I i = {1}, so j must e 1 s well. Since (1) 2 = 1, nd it is sufficient to find single vlue of i which stisfies the expression, the expression evlutes to true. 2. (6pts) Given ODD(i) nd P RIM E(i) ssert every even integer greter thn two is the sum of two primes. To express tht x is even nd greter thn 2 : ODD(x) (x > 2) To express tht x is the sum of two primes : y I + : z I + : PRIME(y) PRIME(z) (x = y +z) Altogether ( if ny x is n even integer greter thn 2, then it is the sum of two primes ): x I + : ( ODD(x) (x > 2)) ( y I + : z I + : PRIME(y) PRIME(z) (x = y +z)) Note: the ssertion given here is lso known s Goldch s conjecture. The conjecture hs no known proof s of yet, ut it hs een numericlly verified to e true for s fr s it hs een computtionlly fesile.

4 Quiz 4, Mthemticl Induction Dte: Septemer (6pts) Prove y induction n i=0 i(i+1) = n(n+1)(n+2) for n 0 When n = 0, we hve 0 i=0 i(i+1) = 0(0+1) = 0 = 0(0+1)(0+2) = 0 Assume tht for some k 0, k i(i+1) = i=0 k(k +1)(k +2) We would like to prove the k +1 cse, k+1 i(i+1) = i=0 (k +1)((k +1)+1)((k +1)+2) = (k +1)(k +2)(k +) To do this, we egin with the left hnd side, nd sustitute the inductive hypothesis, k+1 i(i+1) = (k +1)((k +1)+1)+ i=0 = (k +1)((k +1)+1)+ = (k +1)(k +2) = + k i(i+1) i=0 k(k +1)(k +2) k(k +1)(k +2) (k +1)(k +2)(k +) This proves the inductive conclusion, thus y mthemticl induction, the theorem is proved. 4

5 2. (4pts) Give forml outline of the proof of x N : p(x). 1 p(0) Bse cse 2 [k N] Assumption [p(k)] Assumption 4 p(k +1) proof of IC 5 p(k) p(k +1) introduction,4 6 x N : p(x) p(x+1) introduction 2,5 7 x N : p(x) Mthemticl induction 1,6 5

6 Quiz 5, Progrm Verifiction Dte: Octoer 6 1. Assume n 0. i 0 s 1 while i < n do s 2 s i i+1 s s 6 () (pts) Give the loop invrint. (i n) (s = 4 i ) After initiliztion, i = 0 nd s = 1, so (0 n) (1 = 4 0 ). () (5pts) Prove the loop invrint. (i n) (s = 4 i ) (i < n) {s 2 s} (i n) (s = 2 4i ) (i < n) (i n) (s = 2 4i ) (i < n) {i i+1} (i n) (s = 2 4i 1 ) (i n) (s = 2 4i 1 ) {s s 6} (i n) (s = 2 4i 1 6 = 4 4 i 1 = 4 i ) (i n) (s = 4 i ) (i < n) {s 2 s;i i+1;s s 6} (i n) (s = 4i ) (c) (2pts) Apply the loop invrint. (i n) (s = 4 i ) (i < n) {s 2 s;i i+1;s s 6} (i n) (s = 4i ) (i n) (s = 4 i ){whilei < ndos 2 s;i i+1;s s 6}(i n) (s = 4i ) (i < n) 6

7 Quiz 6, Regulr Expressions Dte: Octoer (5pts) Give regulr expression for Σ = {,}, L = {x x does not contin }. If string does not contin, nd there re s in the string, then they must either e preceded y n, or they must e prt of sustring of s t the eginning of the string. If (+) is the set of ll strings, then (+) is the set of strings in which every is preceded y n, nd the finl nswer is: (+) 2. (5pts) Give regulr expression for L = {x x contins n efore every }. ex. L, L There re two cses to consider, one in which there re no s nd one in which there re s. If there re no s, then the resulting string cn e expressed s. If there re s, then the string cn e constructed s follows. There is first, with t lest two s efore it, nd nything fter it. Thus, ( )(+). Altogether, the solution is: +( )(+) 7

8 Quiz 7, Regulr Grmmrs Dte: Novemer 1. (10pts) Convert this regulr expression into regulr grmmr with unit productions: +c c 2 1 P 1 = {S 1 A 1,A 1 Λ} P 2 = {S 2 Λ,S 2 S 1,S 1 A 1,A 1 S 2 } P = {S A,A Λ} P 4 = {S 4 S 2,S 2 S,S 2 S 1,S 1 A 1,A 1 S 2, S A,A Λ} P 5 = {S 5 ca 5,A 5 Λ} P 6 = {S 6 S 4,S 6 S 5,S 5 ca 5,A 5 Λ, S 4 S 2,S 2 S,S 2 S 1,S 1 A 1,A 1 S 2,S A,A Λ} Using P 6, the strt symol is S 6. 8

9 Quiz 8, Regulr Grmmr Conversion Dte: Novemer (6pts) P = {S A,S B,A A,B S,A Λ}, convert to regulr expression, removing S then A then B. First, dd S, H, nd missing loopcks. S S S A S B S S A A A H B S B B H Λ Remove S. S S / S S / S A : S A S S / S S / S B : S B B S / S S / S A : B A B S / S S / S B : B B After removing S, the remining productions re: S A S B A A A H B A B (Λ+)B H Λ Remove A. S A / A A / A H : S H B A / A A / A H : B H After removing A, the remining productions re: S B S H B H B (Λ+)B H Λ 9

10 Remove B. S B / B (Λ+)B / B H : S () H After removing B, the remining productions re: S +() H H Λ Regulr expression: +() 2. (4pts) P = {S A,S B,B S,B A,A S}, convert to regulr grmmr without unit productions. Solution: S A S B B S B A A S B A S S B B B S 10

11 Quiz 9, Finite Automt Dte: Novemer (5pts) Write DFA for L, Σ = {,,c}, L = {x if x hs n nd then x hs c}, c L, c L. Solution: q 0 - no s, s, or cs q - s ut no s or cs q - s ut no s or cs q - s nd s ut no cs q c - t lest one c q c strt q 0 c q c,,c c q, c q 11

12 2. (5pts) Write n NFA for L, Σ = {,}, L = {x the rd chrcter is the sme s the rd from the end}, L. Solution:,, strt,,,,,,, 12

13 Quiz 10, Finite Automt nd Regulr Lnguges Dte: Novemer (pts)provel = {x xhsthesmenumerofsss}isnotregulr. Solution: Let S = { i i 0}. Let x = i nd y = j e ny pir of distinct elements in S (thus, i j). If z = i, then x nd y re distinguishle, ecuse xz L ut yz / L. Since there is n infinite numer of elements in S, ll of which re mutully distinguishle, then it is impossile to express L s regulr lnguge. 2. (4pts) Convert this into the corresponding regulr grmmr. strt S A B C Solution: S A A A A B B S B B B C B Λ C A. (pts) Prove A B = {x x A or x B, ut not oth} is closed for regulr lnguges. Solution: Let s first rewrite A B in more workle form. The set of x which reonlyinautnotb is(a B), whilethesetofxwhichreonlyinb ut not A is (B A). Altogether, this mkes A B = (A B) (B A). Since A nd B re oth regulr, nd since union, intersection, nd set complement re ll closed under regulr lnguges, then the result of n expression using only those opertions must lso e regulr. 1

14 Quiz 11, Context Free Grmmrs Dte: Decemer 1 1. (5pts) Give CFG for L = { i j c k j > i+k +}. If j > i+k +, then j = i+k +(l+4), for some l 0. Thus, i j c k cn e rewritten s i i+k+l+4 c k, which equls ( i i )( l )( 4 )( k c k ). ( i i ) cn e generted y A A Λ. ( l ) cn e generted y B B Λ. 4 is simply. ( k c k ) cn e generted y C Cc Λ. Altogether, this gives: S ABC A A Λ B B Λ C Cc Λ 2. (5pts) Give CFG for the set of fully prenthesized propositions using,, nd vriles,, e.g. (( ( )) ). Two different solution types would get credit. The set of fully prenthesized propositions: S ( S) (S S) (S S) The set of prenthesized expressions (which is not the sme s fully prenthesized propositions, ut still receives credit) is: S S S S S S (S) 14

15 Quiz 12, Pushdown Automt Dte: Decemer 8 1. (10pts) Give stte trnsition digrm for PDA for L = {x x is lnced for [,],{,}}. Solution: For every strting [, push B for squre rcket, nd for every strting {, push C for curly rce. If closing rcket or rce is encountered, pop the corresponding symol from the stck. If there re multiple consecutive sets of lnced rckets nd rces, we do not wnt the stck to ecome empty fter the first set, so when dding new opening rcket or rce, one option will e to preseve the strt symol. The solution cn e implemented in single stte. We use PDA model which does not include ccept sttes, so solutions which use ccept sttes will not receive full credit. strt [,S/B [,S/BS [,B/BB [,C/BC ],B/Λ {,S/C {,S/CS {,B/CB {,C/CC },C/Λ 15

### CS 330 Formal Methods and Models

CS 330 Forml Methods nd Models Dn Richrds, section 003, George Mson University, Fll 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Septemer 7 1. Prove (p q) (p q), () (5pts) using truth tles. p q

### Homework 3 Solutions

CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

### Harvard University Computer Science 121 Midterm October 23, 2012

Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is

### Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)

### CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

CS 311 Homework 3 due 16:30, Thursdy, 14 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [15 pts.; 5 pts. ech] Drw stte digrms for NFAs recognizing the following lnguges:. L = {w

### Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

### CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)

### CHAPTER 1 Regular Languages. Contents

Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

### CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

### Formal languages, automata, and theory of computation

Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

### Normal Forms for Context-free Grammars

Norml Forms for Context-free Grmmrs 1 Linz 6th, Section 6.2 wo Importnt Norml Forms, pges 171--178 2 Chomsky Norml Form All productions hve form: A BC nd A vrile vrile terminl 3 Exmples: S AS S AS S S

### Name Ima Sample ASU ID

Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to

### a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother

### Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

### 1 From NFA to regular expression

Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

### CS375: Logic and Theory of Computing

CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tle of Contents: Week 1: Preliminries (set lger, reltions, functions) (red Chpters 1-4) Weeks

### Context-Free Grammars and Languages

Context-Free Grmmrs nd Lnguges (Bsed on Hopcroft, Motwni nd Ullmn (2007) & Cohen (1997)) Introduction Consider n exmple sentence: A smll ct ets the fish English grmmr hs rules for constructing sentences;

### 5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

CSC4510 AUTOMATA 5.1 Definitions nd Exmples 5.2 Deterministic Pushdown Automt Definitions nd Exmples A lnguge cn be generted by CFG if nd only if it cn be ccepted by pushdown utomton. A pushdown utomton

### Chapter 2 Finite Automata

Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

### 3 Regular expressions

3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

### Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Regulr Expressions (RE) Regulr Expressions (RE) Empty set F A RE denotes the empty set Opertion Nottion Lnguge UNIX Empty string A RE denotes the set {} Alterntion R +r L(r ) L(r ) r r Symol Alterntion

### Lexical Analysis Finite Automate

Lexicl Anlysis Finite Automte CMPSC 470 Lecture 04 Topics: Deterministic Finite Automt (DFA) Nondeterministic Finite Automt (NFA) Regulr Expression NFA DFA A. Finite Automt (FA) FA re grph, like trnsition

### State Minimization for DFAs

Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid

### Automata and Languages

Automt nd Lnguges Prof. Mohmed Hmd Softwre Engineering Lb. The University of Aizu Jpn Grmmr Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Regulr Lnguges Context Free Lnguges Context Sensitive

### 1.3 Regular Expressions

56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,

### 1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

### Boolean Algebra. Boolean Algebra

Boolen Alger Boolen Alger A Boolen lger is set B of vlues together with: - two inry opertions, commonly denoted y + nd, - unry opertion, usully denoted y ˉ or ~ or, - two elements usully clled zero nd

### Non-deterministic Finite Automata

Non-deterministic Finite Automt From Regulr Expressions to NFA- Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion

### Homework Solution - Set 5 Due: Friday 10/03/08

CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.

### USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

1/1/21. Fill in the circles in the picture t right with the digits 1-8, one digit in ech circle with no digit repeted, so tht no two circles tht re connected by line segment contin consecutive digits.

### Chapter 4 Regular Grammar and Regular Sets. (Solutions / Hints)

C K Ngpl Forml Lnguges nd utomt Theory Chpter 4 Regulr Grmmr nd Regulr ets (olutions / Hints) ol. (),,,,,,,,,,,,,,,,,,,,,,,,,, (),, (c) c c, c c, c, c, c c, c, c, c, c, c, c, c c,c, c, c, c, c, c, c, c,

### Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

### Reasoning and programming. Lecture 5: Invariants and Logic. Boolean expressions. Reasoning. Examples

Chir of Softwre Engineering Resoning nd progrmming Einführung in die Progrmmierung Introduction to Progrmming Prof. Dr. Bertrnd Meyer Octoer 2006 Ferury 2007 Lecture 5: Invrints nd Logic Logic is the sis

### Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

U.U.D.M. Project Report 07:4 Frey Frctions Rickrd Fernström Exmensrete i mtemtik, 5 hp Hledre: Andres Strömergsson Exmintor: Jörgen Östensson Juni 07 Deprtment of Mthemtics Uppsl University Frey Frctions

### Automata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.

Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent

### Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch.

Overview H9 Vertlerouw H 9: Prsing: op-down & LL(1) do 3 mei 2001 56 heo Ruys h. 8 - Prsing 8.1 ontext-free Grmmrs 8.2 op-down Prsing 8.3 LL(1) Grmmrs See lso [ho, Sethi & Ullmn 1986] for more thorough

### CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS 267: Automted Verifiction Lecture 8: Automt Theoretic Model Checking Instructor: Tevfik Bultn LTL Properties Büchi utomt [Vrdi nd Wolper LICS 86] Büchi utomt: Finite stte utomt tht ccept infinite strings

### The University of Nottingham

The University of Nottinghm SCHOOL OF COMPUTR SCINC AND INFORMATION TCHNOLOGY A LVL 1 MODUL, SPRING SMSTR 2004-2005 MACHINS AND THIR LANGUAGS Time llowed TWO hours Cndidtes must NOT strt writing their

### Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

Nondeterminism Nondeterministic Finite Automt Nondeterminism Subset Construction A nondeterministic finite utomton hs the bility to be in severl sttes t once. Trnsitions from stte on n input symbol cn

### This lecture covers Chapter 8 of HMU: Properties of CFLs

This lecture covers Chpter 8 of HMU: Properties of CFLs Turing Mchine Extensions of Turing Mchines Restrictions of Turing Mchines Additionl Reding: Chpter 8 of HMU. Turing Mchine: Informl Definition B

### Lecture 2 : Propositions DRAFT

CS/Mth 240: Introduction to Discrete Mthemtics 1/20/2010 Lecture 2 : Propositions Instructor: Dieter vn Melkeeek Scrie: Dlior Zelený DRAFT Lst time we nlyzed vrious mze solving lgorithms in order to illustrte

### Lecture 9: LTL and Büchi Automata

Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled

### CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

CS411-2015S-12 Turing Mchine Modifictions 1 12-0: Extending Turing Mchines When we dded stck to NFA to get PDA, we incresed computtionl power Cn we do the sme thing for Turing Mchines? Tht is, cn we dd

### Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

Chpter 1, Prt 1 Regulr Lnguges CSC527, Chpter 1, Prt 1 c 2012 Mitsunori Ogihr 1 Finite Automt A finite utomton is system for processing ny finite sequence of symols, where the symols re chosen from finite

### 12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

CS125 Lecture 12 Fll 2016 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

### MATH 573 FINAL EXAM. May 30, 2007

MATH 573 FINAL EXAM My 30, 007 NAME: Solutions 1. This exm is due Wednesdy, June 6 efore the 1:30 pm. After 1:30 pm I will NOT ccept the exm.. This exm hs 1 pges including this cover. There re 10 prolems.

### CS12N: The Coming Revolution in Computer Architecture Laboratory 2 Preparation

CS2N: The Coming Revolution in Computer Architecture Lortory 2 Preprtion Ojectives:. Understnd the principle of sttic CMOS gte circuits 2. Build simple logic gtes from MOS trnsistors 3. Evlute these gtes

### Software Engineering using Formal Methods

Softwre Engineering using Forml Methods Propositionl nd (Liner) Temporl Logic Wolfgng Ahrendt 13th Septemer 2016 SEFM: Liner Temporl Logic /GU 160913 1 / 60 Recpitultion: FormlistionFormlistion: Syntx,

### Introduction to Electrical & Electronic Engineering ENGG1203

Introduction to Electricl & Electronic Engineering ENGG23 2 nd Semester, 27-8 Dr. Hden Kwok-H So Deprtment of Electricl nd Electronic Engineering Astrction DIGITAL LOGIC 2 Digitl Astrction n Astrct ll

### Formal Methods in Software Engineering

Forml Methods in Softwre Engineering Lecture 09 orgniztionl issues Prof. Dr. Joel Greenyer Decemer 9, 2014 Written Exm The written exm will tke plce on Mrch 4 th, 2015 The exm will tke 60 minutes nd strt

QUADRATIC EQUATIONS OBJECTIVE PROBLEMS +. The solution of the eqution will e (), () 0,, 5, 5. The roots of the given eqution ( p q) ( q r) ( r p) 0 + + re p q r p (), r p p q, q r p q (), (d), q r p q.

### input tape head moves current state

CPS 140 - Mthemticl Foundtions of CS Dr. Susn Rodger Section: Finite Automt (Ch. 2) (lecture notes) Things to do in clss tody (Jn. 13, 2004): ffl questions on homework 1 ffl finish chpter 1 ffl Red Chpter

### Formal Languages and Automata Theory. D. Goswami and K. V. Krishna

Forml Lnguges nd Automt Theory D. Goswmi nd K. V. Krishn Novemer 5, 2010 Contents 1 Mthemticl Preliminries 3 2 Forml Lnguges 4 2.1 Strings............................... 5 2.2 Lnguges.............................

### NON-DETERMINISTIC FSA

Tw o types of non-determinism: NON-DETERMINISTIC FS () Multiple strt-sttes; strt-sttes S Q. The lnguge L(M) ={x:x tkes M from some strt-stte to some finl-stte nd ll of x is proessed}. The string x = is

### How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

XII. LINEAR ALGEBRA: SOLVING SYSTEMS OF EQUATIONS Tody we re going to tlk out solving systems of liner equtions. These re prolems tht give couple of equtions with couple of unknowns, like: 6= x + x 7=

### REVIEW Chapter 1 The Real Number System

Mth 7 REVIEW Chpter The Rel Number System In clss work: Solve ll exercises. (Sections. &. Definition A set is collection of objects (elements. The Set of Nturl Numbers N N = {,,,, 5, } The Set of Whole

### Learning Goals. Relational Query Languages. Formal Relational Query Languages. Formal Query Languages: Relational Algebra and Relational Calculus

Forml Query Lnguges: Reltionl Alger nd Reltionl Clculus Chpter 4 Lerning Gols Given dtse ( set of tles ) you will e le to express dtse query in Reltionl Alger (RA), involving the sic opertors (selection,

### Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Eugene Weinstein Google, NYU Cournt Institute eugenew@cs.nyu.edu Slide Credit: Mehryr Mohri Preliminries Finite lphet, empty string.

### Solutions Problem Set 2. Problem (a) Let M denote the DFA constructed by swapping the accept and non-accepting state in M.

Solution Prolem Set 2 Prolem.4 () Let M denote the DFA contructed y wpping the ccept nd non-ccepting tte in M. For ny tring w B, w will e ccepted y M, tht i, fter conuming the tring w, M will e in n ccepting

### CSCI FOUNDATIONS OF COMPUTER SCIENCE

1 CSCI- 2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2015 My 7, 2015 2 Announcements Homework 9 is due now. Some finl exm review problems will be posted on the web site tody. These re prcqce problems not

### 8. Complex Numbers. We can combine the real numbers with this new imaginary number to form the complex numbers.

8. Complex Numers The rel numer system is dequte for solving mny mthemticl prolems. But it is necessry to extend the rel numer system to solve numer of importnt prolems. Complex numers do not chnge the

### 8 Automata and formal languages. 8.1 Formal languages

8 Automt nd forml lnguges This exposition ws developed y Clemens Gröpl nd Knut Reinert. It is sed on the following references, ll of which re recommended reding: 1. Uwe Schöning: Theoretische Informtik

### Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

Section: Other Models of Turing Mchines Definition: Two utomt re equivlent if they ccept the sme lnguge. Turing Mchines with Sty Option Modify δ, Theorem Clss of stndrd TM s is equivlent to clss of TM

### The Trapezoidal Rule

_.qd // : PM Pge 9 SECTION. Numericl Integrtion 9 f Section. The re of the region cn e pproimted using four trpezoids. Figure. = f( ) f( ) n The re of the first trpezoid is f f n. Figure. = Numericl Integrtion

### Where did dynamic programming come from?

Where did dynmic progrmming come from? String lgorithms Dvid Kuchk cs302 Spring 2012 Richrd ellmn On the irth of Dynmic Progrmming Sturt Dreyfus http://www.eng.tu.c.il/~mi/cd/ or50/1526-5463-2002-50-01-0048.pdf

### SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics

SCHOOL OF ENGINEERING & BUIL ENVIRONMEN Mthemtics An Introduction to Mtrices Definition of Mtri Size of Mtri Rows nd Columns of Mtri Mtri Addition Sclr Multipliction of Mtri Mtri Multipliction 7 rnspose

### Prefix-Free Regular-Expression Matching

Prefix-Free Regulr-Expression Mthing Yo-Su Hn, Yjun Wng nd Derik Wood Deprtment of Computer Siene HKUST Prefix-Free Regulr-Expression Mthing p.1/15 Pttern Mthing Given pttern P nd text T, find ll sustrings

### STRUCTURE OF CONCURRENCY Ryszard Janicki. Department of Computing and Software McMaster University Hamilton, ON, L8S 4K1 Canada

STRUCTURE OF CONCURRENCY Ryszrd Jnicki Deprtment of Computing nd Softwre McMster University Hmilton, ON, L8S 4K1 Cnd jnicki@mcmster.c 1 Introduction Wht is concurrency? How it cn e modelled? Wht re the

### = state, a = reading and q j

4 Finite Automt CHAPTER 2 Finite Automt (FA) (i) Derterministi Finite Automt (DFA) A DFA, M Q, q,, F, Where, Q = set of sttes (finite) q Q = the strt/initil stte = input lphet (finite) (use only those

### MTH 505: Number Theory Spring 2017

MTH 505: Numer Theory Spring 207 Homework 2 Drew Armstrong The Froenius Coin Prolem. Consider the eqution x ` y c where,, c, x, y re nturl numers. We cn think of \$ nd \$ s two denomintions of coins nd \$c

### Chapter 7. Kleene s Theorem. 7.1 Kleene s Theorem. The following theorem is the most important and fundamental result in the theory of FA s:

Chpte 7 Kleene s Theoem 7.1 Kleene s Theoem The following theoem is the most impotnt nd fundmentl esult in the theoy of FA s: Theoem 6 Any lnguge tht cn e defined y eithe egul expession, o finite utomt,

### Continuous Random Variables Class 5, Jeremy Orloff and Jonathan Bloom

Lerning Gols Continuous Rndom Vriles Clss 5, 8.05 Jeremy Orloff nd Jonthn Bloom. Know the definition of continuous rndom vrile. 2. Know the definition of the proility density function (pdf) nd cumultive

### SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 014 Mrk Scheme: Ech prt of Question 1 is worth four mrks which re wrded solely for the correct nswer.

### Project 6: Minigoals Towards Simplifying and Rewriting Expressions

MAT 51 Wldis Projet 6: Minigols Towrds Simplifying nd Rewriting Expressions The distriutive property nd like terms You hve proly lerned in previous lsses out dding like terms ut one prolem with the wy

### along the vector 5 a) Find the plane s coordinate after 1 hour. b) Find the plane s coordinate after 2 hours. c) Find the plane s coordinate

L8 VECTOR EQUATIONS OF LINES HL Mth - Sntowski Vector eqution of line 1 A plne strts journey t the point (4,1) moves ech hour long the vector. ) Find the plne s coordinte fter 1 hour. b) Find the plne

### approaches as n becomes larger and larger. Since e > 1, the graph of the natural exponential function is as below

. Eponentil nd rithmic functions.1 Eponentil Functions A function of the form f() =, > 0, 1 is clled n eponentil function. Its domin is the set of ll rel f ( 1) numbers. For n eponentil function f we hve.

### 2 b. , a. area is S= 2π xds. Again, understand where these formulas came from (pages ).

AP Clculus BC Review Chpter 8 Prt nd Chpter 9 Things to Know nd Be Ale to Do Know everything from the first prt of Chpter 8 Given n integrnd figure out how to ntidifferentite it using ny of the following

### Agenda. Agenda. Regular Expressions. Examples of Regular Expressions. Regular Expressions (crash course) Computational Linguistics 1

Agend CMSC/LING 723, LBSC 744 Kristy Hollingshed Seitz Institute for Advnced Computer Studies University of Mrylnd HW0 questions? Due Thursdy before clss! When in doubt, keep it simple... Lecture 2: 6

### Recursively Enumerable and Recursive. Languages

Recursively Enumerble nd Recursive nguges 1 Recll Definition (clss 19.pdf) Definition 10.4, inz, 6 th, pge 279 et S be set of strings. An enumertion procedure for Turing Mchine tht genertes ll strings

### Prefix-Free Subsets of Regular Languages and Descriptional Complexity

Prefix-Free Susets of Regulr Lnguges nd Descriptionl Complexity Jozef Jirásek Jurj Šeej DCFS 2015 Prefix-Free Susets of Regulr Lnguges nd Descriptionl Complexity Jozef Jirásek, Jurj Šeej 1/22 Outline Mximl

### 10. AREAS BETWEEN CURVES

. AREAS BETWEEN CURVES.. Ares etween curves So res ove the x-xis re positive nd res elow re negtive, right? Wrong! We lied! Well, when you first lern out integrtion it s convenient fiction tht s true in

### Shape and measurement

C H A P T E R 5 Shpe nd mesurement Wht is Pythgors theorem? How do we use Pythgors theorem? How do we find the perimeter of shpe? How do we find the re of shpe? How do we find the volume of shpe? How do

### Math 259 Winter Solutions to Homework #9

Mth 59 Winter 9 Solutions to Homework #9 Prolems from Pges 658-659 (Section.8). Given f(, y, z) = + y + z nd the constrint g(, y, z) = + y + z =, the three equtions tht we get y setting up the Lgrnge multiplier

### EE273 Lecture 15 Asynchronous Design November 16, Today s Assignment

EE273 Lecture 15 Asynchronous Design Novemer 16, 199 Willim J. Dlly Computer Systems Lortory Stnford University illd@csl.stnford.edu 1 Tody s Assignment Term Project see project updte hndout on we checkpoint

### Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

Improper Integrls The First Fundmentl Theorem of Clculus, s we ve discussed in clss, goes s follows: If f is continuous on the intervl [, ] nd F is function for which F t = ft, then ftdt = F F. An integrl

### Improper Integrals. Introduction. Type 1: Improper Integrals on Infinite Intervals. When we defined the definite integral.

Improper Integrls Introduction When we defined the definite integrl f d we ssumed tht f ws continuous on [, ] where [, ] ws finite, closed intervl There re t lest two wys this definition cn fil to e stisfied:

### Nondeterministic Finite Automata

Nondeterministi Finite utomt The Power of Guessing Tuesdy, Otoer 4, 2 Reding: Sipser.2 (first prt); Stoughton 3.3 3.5 S235 Lnguges nd utomt eprtment of omputer Siene Wellesley ollege Finite utomton (F)

### 7 Automata and formal languages. 7.1 Formal languages

7 Automt nd forml lnguges This exposition ws developed by Clemens Gröpl nd Knut Reinert. It is bsed on the following references, ll of which re recommended reding: 1. Uwe Schöning: Theoretische Informtik

### Operations with Matrices

Section. Equlit of Mtrices Opertions with Mtrices There re three ws to represent mtri.. A mtri cn be denoted b n uppercse letter, such s A, B, or C.. A mtri cn be denoted b representtive element enclosed

### On Determinisation of History-Deterministic Automata.

On Deterministion of History-Deterministic Automt. Denis Kupererg Mich l Skrzypczk University of Wrsw YR-ICALP 2014 Copenhgen Introduction Deterministic utomt re centrl tool in utomt theory: Polynomil

### ECON 331 Lecture Notes: Ch 4 and Ch 5

Mtrix Algebr ECON 33 Lecture Notes: Ch 4 nd Ch 5. Gives us shorthnd wy of writing lrge system of equtions.. Allows us to test for the existnce of solutions to simultneous systems. 3. Allows us to solve

### Worksheet A EXPONENTIALS AND LOGARITHMS PMT. 1 Express each of the following in the form log a b = c. a 10 3 = 1000 b 3 4 = 81 c 256 = 2 8 d 7 0 = 1

C Worksheet A Epress ech of the following in the form log = c. 0 = 000 4 = 8 c 56 = 8 d 7 0 = e = f 5 = g 7 9 = 9 h 6 = 6 Epress ech of the following using inde nottion. log 5 5 = log 6 = 4 c 5 = log 0

3//0 INF383 -ncos de Ddos Prof. Sérgio Lifschitz DI PUC-Rio Eng. Computção, Sistems de Informção e Ciênci d Computção LGER RELCIONL lguns slides sedos ou modificdos dos originis em Elmsri nd Nvthe, Fundmentls

Qudrtic recirocity Frncisc Bozgn Los Angeles Mth Circle Octoer 8, 01 1 Qudrtic Recirocity nd Legendre Symol In the eginning of this lecture, we recll some sic knowledge out modulr rithmetic: Definition

### Section 6.1 Definite Integral

Section 6.1 Definite Integrl Suppose we wnt to find the re of region tht is not so nicely shped. For exmple, consider the function shown elow. The re elow the curve nd ove the x xis cnnot e determined

### 4 VECTORS. 4.0 Introduction. Objectives. Activity 1

4 VECTRS Chpter 4 Vectors jectives fter studying this chpter you should understnd the difference etween vectors nd sclrs; e le to find the mgnitude nd direction of vector; e le to dd vectors, nd multiply

### Nondeterministic Biautomata and Their Descriptional Complexity

Nondeterministic Biutomt nd Their Descriptionl Complexity Mrkus Holzer nd Sestin Jkoi Institut für Informtik Justus-Lieig-Universität Arndtstr. 2, 35392 Gießen, Germny 23. Theorietg Automten und Formle

### DATABASTEKNIK - 1DL116

DATABASTEKNIK - DL6 Spring 004 An introductury course on dtse systems http://user.it.uu.se/~udl/dt-vt004/ Kjell Orsorn Uppsl Dtse Lortory Deprtment of Informtion Technology, Uppsl University, Uppsl, Sweden