Solution Prove by induction the following statement:

Slides:



Advertisements
Similar presentations
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Advertisements

Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
YES-NO machines Finite State Automata as language recognizers.
Bina Nusantara Finite Automata II (FA) Pertemuan 24: Mata kuliah:K0144/ Matematika Diskrit Tahun:2008.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Chapter Section Section Summary Set of Strings Finite-State Automata Language Recognition by Finite-State Machines Designing Finite-State.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
CS5371 Theory of Computation
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
1 Languages and Finite Automata or how to talk to machines...
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections: September 1, 2006.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
CSC 361Finite Automata1. CSC 361Finite Automata2 Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers.
1.Defs. a)Finite Automaton: A Finite Automaton ( FA ) has finite set of ‘states’ ( Q={q 0, q 1, q 2, ….. ) and its ‘control’ moves from state to state.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
Finite-State Machines with No Output
Theory of Languages and Automata
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
Modeling Computation: Finite State Machines without Output
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
Nondeterministic Finite Automata (NFAs). Reminder: Deterministic Finite Automata (DFA) q For every state q in Q and every character  in , one and only.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Finite Automata A simple model of computation. 2 Finite Automata2 Outline Deterministic finite automata (DFA) –How a DFA works.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State Automata.
1 Chapter 2 Finite Automata (part a) Hokkaido, Japan.
  An alphabet is any finite set of symbols.  Examples: ASCII, Unicode, {0,1} ( binary alphabet ), {a,b,c}. Alphabets.
Theory of Computation Automata Theory Dr. Ayman Srour.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
Fall 2004COMP 3351 Finite Automata. Fall 2004COMP 3352 Finite Automaton Input String Output String Finite Automaton.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
CIS 262 Automata, Computability, and Complexity Fall Instructor: Aaron Roth
Deterministic Finite Automata (DFAs). Reminder: Functions vs Relations Let P = {p: p is a person} M = {m: m is a male} S 1 = {(m,p): m is in M, p is in.
Lecture Three: Finite Automata Finite Automata, Lecture 3, slide 1 Amjad Ali.
Languages.
Lecture2 Regular Language
CSE 105 theory of computation
Nondeterministic Finite Automata
Jaya Krishna, M.Tech, Assistant Professor
Chapter 2 FINITE AUTOMATA.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
THEORY OF COMPUTATION Lecture One: Automata Theory Automata Theory.
Chapter Two: Finite Automata
Principles of Computing – UFCFA3-30-1
NFA vs DFA DFA: For every state q in S and every character  in , one and only one transition of the following form occurs:  q q’ NFA: For every state.
Introduction to Finite Automata
Finite Automata.
Chapter Five: Nondeterministic Finite Automata
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Deterministic Finite Automaton (DFA)
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 1 Regular Language
CSCI 2670 Introduction to Theory of Computing
Chapter # 5 by Cohen (Cont…)
CSE 105 theory of computation
What is it? The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled.
CSE 105 theory of computation
Presentation transcript:

Solution Prove by induction the following statement: If there is an edge connecting every pair of nodes in a graph G and n is the number of nodes in G, then the number of edges in G is n(n-1)/2

Finite Automata (Deterministic) (Chapter 1) Note: once again you are strongly advised to read the covered chapters from the book carefully. Particularly the examples!

Reminder: Functions vs Relations Let P = {p: p is a person} M = {m: m is a male} S1 = {(m,p): m is in M, p is in P and m is the father of p} S2 = {(m,p): m is in M, p is in P and m is an ancestor of p} students have trouble with the notation (x,f(x)) to denote functions (they are used to y = f(x)). Answers: 1 (yes), 2(yes), 3(both), 4 (S1 only) True or false: S1  M  P True or false: S2  M  P Is either S1 or S2 a relation in M  P? Is either S1 or S2 a function f:M  P?

You have seen Finite Automata before! Write a program that indicates if a given input text contains the string “Britney Spears” (or “Justin Timberlake”) Check this video:

NPC’s Behavior is Modeled through Finite State Machines (I) State: an activity performed by an avatar Event: something that happens in the game world that makes state change Enemy on sight Attack Patrol

NPC’s Behavior is Modeled through Finite State Machines (II) States Attack Chase Spawn Wander Events E: see an enemy S: hear a sound D: die Attack ~E ~S Chase E S D D E Wander E ~E Spawn D

Deterministic Automata (Informal) Key questions: if a automaton is confronted with a certain state where a choice must be made, 1. are all the alternatives transitions known?, and 2. given some input data, is it known which transition the machine will make? “current state” “new state” If the answer to both of these questions is “yes”, the automaton is said to be deterministic “transition”

Nondeterministic Automata (Informal) If the answer to any of these questions is “no”, the automaton is said to be nondeterministic That is, either some transitions are unknown, or given some input data, the machine can make more than one transition

Deterministic Automata (Informal) of the computation We are going to define automata indicating for a state s and some input data d, which is the state that will be reached Transition: ((s,d), s’) s d s’ Let Q be the set of all states and  be the set of all input data. Then, the set of transitions is a subset of (Q  )  Q

Determinism, Nondeterminism, Relations and Functions The set of transitions defining an automaton is a subset of (Q  )  Q If the automaton is deterministic, should the set of transitions be a relation or a function? Deterministic automata: Since for each pair (s,d) there should be one and only one s’, the set of transitions must be a function Nondeterministic automata: Since for each pair (s,d) there might not be any s’ or there might be more than one s’, the set of transitions must be a relation This is a crucial issue: understanding that the mathematical definition of determinism uses functions and nondeterminism uses relations

Finite Automata Problem 1: Design a computer program that given a sequence of numbers a1, a2, …, an returns their sum a1 + a2 +… + an Problem 2: Design a computer program that given a sequence of numbers a1, a2, …, an returns the list in the inverted order: an, …, a2, a1 How many memory units are needed for a program to execute: problem 1: Problem 2: Finite automata use a constant amount of memory Later in the course we will be able to prove formally that there is no finite automata that can solve problem 2. 1 n

Deterministic Finite Automaton (finite automaton) A deterministic finite automaton (DFA) or finite automaton is a 5-tuple (Q,,,s,F) where: Q is a finite set of elements called states  is a finite input alphabet  is a transition function, (Q × ) × Q (or : (Q × )  Q) s  Q called the start state F  Q called the favorable states As in yes! (or no!) The input word is (not) in the language recognized by the automaton Constant! no! (or yes!) Given an input the automaton answers “yes” if its computation ends in a favorable state. Otherwise the automaton answers “no” a1 a2 … The fact that  is a function makes the automaton deterministic

Finite State Diagram A finite state diagram is a graphic representation for a finite automaton A finite state diagram is a directed graph, where nodes represent elements in Q (i.e., states) and arrows are characters in  such that: q q’ a Indicates: ((q,a),q’) is a transition in  The start state is marked with: > The favorable states are marked with:

Example # 1 a,b b b b a a r r s q q > a a Formally, this automaton (Q,,,s,F) is defined as: : 6 transitions: ((s,b), s) ((s,a), q) ((q,a), r) ((q,b), s) ((r,a), r) ((r,b), r) Answer: yes, for every pair (state,symbol) there is one and only one transition Q = {s,q,r} Is this automaton deterministic?  = {a,b} s: start state F = {r}

Kleene Star Given a set B of characters, B* denote the set of all strings made of elements in B. Typically we take * for all words that can be given as input for a DFA (Q,,,s,F) If  = {0,1}, what is *? If  = {a,b}, what is *? If  = {a,b,c, …, z}, what is *? the empty word, e, is always in *

Formal Definition of Computation Given an finite automaton M= (Q,,,s,F), and let w = w1w2 …wn, where each wi is in  (i.e., w in *) M accepts w if there is a sequence of states r0 , r1, r2 , … rn in Q such that: r0 is the start state of M (ri , wi+1) = ri+1 rn in F Language recognized by M: {w in * : M accepts w} Given a language A, with A  *, the language A is regular if a finite automata exists recognizing A “such that”

Example a b b b a a r r s q q > a a b Is abb accepted by this automaton? Is abba accepted by this automaton? What is the language recognized by this automaton?

Example # 2 a b b b a a r r s q q > a a b Language accepted is the set of all words except those containing two consecutive a’s What is the language recognized by this automaton?

Homework Friday Sept. 7 1.6: a, f, j 1.31 1.36

Sample Problems 1.6: b Let  = {0,1}, Show that the following language over  is regular: {w : w contains at least three 1’s} 1.31 Let A be a regular language. Show that: AR = {wR | w is in A} is also regular