Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Finite Automata: Understanding Input Processing as a Mathematical Model - Prof. Gary Lockl, Study notes of Computer Science

An introduction to finite automata (fa), a mathematical model of hardware used to process inputs and determine if they belong to a specific language. Fa abstracts the internal functions of a 'black box' system, focusing on input-output relationships. The mathematical definition of fa, its state transition diagrams, and the concept of regular expressions (re) to represent the accepted language.

Typology: Study notes

Pre 2010

Uploaded on 07/23/2009

koofers-user-vh3
koofers-user-vh3 🇺🇸

2

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
9 October, Day 13
Chapter 2 – Finite Automata (FA)
A FA is a model of computation. A FA is a mathematical model of H/W.
A FA is an abstraction of H/W.
Consider his “black box” analogy.
Input -> “Black Box” -> Output
Inside functions of black box are hidden
Ex: a TV, we don’t know how it works inside, we give it input (channel
30) and it gives us output
Mathematical definition of FA
Q is a set of “states” (this is hidden in the black box)
Sigma is a set of “input” symbols
delta is a function for “moving” from a state given an input (this is the
hidden portion of the black box)
Q includes an initial state and a final state
An automaton accepts “words” in its language
example for English:
problem: is this string a word?
“NOT” [black box: FA] black box: FA] yes / accept
“OTN” [black box: FA] black box: FA] no
Language we CS people care about is binary form
Thus, words are sequences of 1s / 0s
Job of a FA is to determine if input string is a word in the FA’s
language; if yes then “accept”
example use of an FA – compiler checking syntax
input strings of 1s and 0s – is this input a syntactically valid “word” in
the language C?
He is trying to uncover a pattern for the words that are accepted by
the FA
Pattern that was found was – 01(001)*01
(001)* is shorthand for any number of repetitions of the sequence 001
note that “any number” can also mean 0, thus valid words following
the pattern
01(001)*01 are
01 01
CSC 490 Course Notes and Outline, © Dr. Gary Locklair, Fall 2006
pf3

Partial preview of the text

Download Finite Automata: Understanding Input Processing as a Mathematical Model - Prof. Gary Lockl and more Study notes Computer Science in PDF only on Docsity!

9 October , Day 13 Chapter 2 – Finite Automata (FA) A FA is a model of computation. A FA is a mathematical model of H/W. A FA is an abstraction of H/W. Consider his “black box” analogy. Input -> “Black Box” -> Output Inside functions of black box are hidden Ex: a TV, we don’t know how it works inside, we give it input (channel

  1. and it gives us output Mathematical definition of FA Q is a set of “states” (this is hidden in the black box) Sigma is a set of “input” symbols delta is a function for “moving” from a state given an input (this is the hidden portion of the black box) Q includes an initial state and a final state An automaton accepts “words” in its language example for English: problem: is this string a word? “NOT”  [black box: FA] black box: FA]  yes / accept “OTN”  [black box: FA] black box: FA]  no Language we CS people care about is binary form Thus, words are sequences of 1s / 0s Job of a FA is to determine if input string is a word in the FA’s language; if yes then “accept” example use of an FA – compiler checking syntax input strings of 1s and 0s – is this input a syntactically valid “word” in the language C? He is trying to uncover a pattern for the words that are accepted by the FA Pattern that was found was – 01(001)* (001)* is shorthand for any number of repetitions of the sequence 001 note that “any number” can also mean 0, thus valid words following the pattern 01(001)*01 are 01 01

etc A state transition diagram is a convention used to represent FA How? Input strings (potential words) are ‘read’ one symbol (letter) at a time. The FA “moves” between states given its current state and the input symbol (0 or 1) read. If the input string is a real “word” in the language, the FA will finish (no more input) in an accepting state. Thus, the goal of a FA is to finish in an accepting or final state. It may not be possible to know exactly what is inside the black box (since it is really hidden from view), but we can know the sequences of 1s and 0s (strings or words) accepted by the black box. ex; we know that 0101 is accepted by 0110 is not. The language accepted by a finite automaton … [black box: FA] by language we mean the “good” words, or the accepted strings] … can be written as a Regular Expression (RE) RE is a formal way of writing an accepted language RE is “shorthand” don’t have to list all of the accepted strings in a language ex: how many strings are there? answer: infinite! (hard to list :-) RE is a “pattern” for the accepted language 01(001)* analogy – its an algorithm for creating accepted strings

  • it shows the form of good strings Rules for RE – 0 and 1 are RE concatenation 01 is RE “sum” 0+1 [black box: FA] better term is “or”] is RE iteration * is RE Ex: 0 1 0 (note, can just write it as 010) can also just “ignore” other transitions and assume they go to “trap” or “bad” states Note: if FA is in a final or accepting state when the input string is completely read, then the string is in the language