CHAPTER 3 Language Theory and Mathematical Preliminaries SETS
- Slides: 84
CHAPTER 3 Language Theory and Mathematical Preliminaries
SETS A set is a collection of elements We write C = { a, b, c, d, e, f, g, h, i, j, k } C = { a, b, …, k } finite set S = { 2, 4, 6, … } infinite set S = { j : j > 0, and j = 2 k for some k>0 } S = { j : j is nonnegative and even } 1 -2
SETS U A 6 7 10 1 2 3 4 5 8 9 A = { 1, 2, 3, 4, 5 } Universal Set: all possible elements U = { 1 , … , 10 }
SETS B A 2 3 1 4 5
SETS • Complement Universal set = {1, …, 7} A = { 1, 2, 3 } 4 A 1 A = { 4, 5, 6, 7} A 2 5 6 3 7 A=A
SETS Empty Set: A = { 1, 2, 3} B = { 1, 2, 3, 4, 5 } Disjoint Sets: Set Cardinality |A| = 3
SETS A powerset is a set of sets S = { a, b, c } Powerset of S is the set of all the subsets of S 2 S = {∅ , {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c} } | 2 S | = 2|S| ( 8 = 23 )
THREE BASIC CONCEPTS • Languages • Grammars • Automata
Language A language is a set of strings. String: A sequence of letters defined over an alphabet: Examples: “cat”, “dog”, “house”, …
Language String Concatenation Reverse Length
Language Empty String : A string with no letters • Substring of string: – a subsequence of consecutive characters
Prefix and Suffix Prefixes Suffixes prefix suffix
Language Repeat Operation The * Operation: the set of all possible strings from alphabet
Language The + Operation: Costas Busch - RPI 14
Languages A language is any subset of Languages:
Another Example An infinite language
Operations on Languages • The usual set operations • Complement: Costas Busch - RPI 17
Reverse & Concatation Costas Busch - RPI 18
Repeat Operation
Star-Closure (Kleene *) Example: Costas Busch - RPI 20
Positive Closure
Grammars A grammar for the English language tells us whether a particular sentence is well formed or not. <sentence> → <noun phrase> <predicate> <noun phrase> → <article><noun>, <predicate> → <verb> If we associate the actual words “a” and “the” with <article>, “boy” and “dog” with <noun>, and “runs” and “walks” with <verb>, then the grammar tells us that the sentences “a boy runs” and “the dog walks” are properly formed. Copyright © 2015 Pearson. All rights reserved. 1 -22
Grammars A Grammar G is defined as a quadruple G = (V, T, S, P), where V is a finite set of objects called variables, T is a finite set of objects called terminal symbols, S ∈ V is a special symbol called the start variable, P is a finite set of productions. The production rules are the heart of a grammar; they specify how the grammar transforms one string into another: x → y,
Grammars x→y
Grammars
Grammars
Grammars
Grammars For Find The Language of the following Grammer.
Grammars Consider the grammar G 1 = ({A, S}, {a, b}, S, P), with P consisting of the productions S → a. Ab|λ, A → a. Ab|λ. Find The Language of the following Grammer.
Automata An automaton is an abstract model of a digital computer. It has a mechanism for reading input. Input is a string over a given alphabet. The automaton can produce output of some form. It may have a temporary storage device, consisting of an unlimited number of cells, each capable of holding a single symbol from alphabet. Finally, the automaton has a control unit, which can be in any of a internal states, and can change state in some defined manner.
Automata
Automata The internal state of the control unit at the next time step is determined by the next-state or transition function. Deterministic Automata : each move is uniquely determined by the current configuration. • If we know the internal state, the input, and the contents of the temporary storage, we can predict the future behavior of the automaton exactly. Nondeterministic Automaton: At each point, may have several possible moves, so we can only predict a set of possible actions.
Automata An automaton whose output response is limited to a simple “yes” or “no” is called an accepter. Presented with an input string, an accepter either accepts the string or rejects it. A more general automaton, capable of producing strings of symbols as output, is called a transducer.
Transition Graph initial state transition state final state “accept”
Initial Configuration Input String Costas Busch - RPI 35
Reading the Input
Reading the Input
Reading the Input • Costas Busch - RPI 38
Reading the Input • Costas Busch - RPI 39
Reading the Input finished Output: “accept”
Rejection
Reading the Input Costas Busch - RPI 42
Reading the Input Costas Busch - RPI 43
Reading the Input
Reading the Input finished Output: “reject”
Another Rejection
Another Example
Reading the Input
Reading the Input
Reading the Input
Reading the Input finished Output: “accept”
Rejection
Reading the Input
Reading the Input
Reading the Input
Reading the Input finished Output: “reject”
Formalities Deterministic Finite Accepter (DFA) : set of states : input alphabet : transition function : initial state : set of final states
Input Alphabet
Set of States
Initial State
Set of Final States
Transition Function
Transition Function
Transition Function
Transition Function
Transition Function
Extended Transition Function
Extended Transition Function
Extended Transition Function
Extended Transition Function
Extended Transition Function
Recursive Definition
Recursive Definition
Languages Accepted by DFAs – The language contains – all input strings accepted by = { strings that drive to a final state}
Example accept
Another Example accept
Formally For a DFA Language accepted by :
Observation • Language rejected by :
More Examples accept trap state
More Examples = { all strings with prefix } accept
More Examples = { all strings without 001 substring}
Regular Languages • A language is regular if there is • a DFA such that • All regular languages form a language family –
Another Example The language is regular:
Regular Languages There exist languages which are not Regular: Example: There is no DFA that accepts such a language
- Chapter 1 mathematical preliminaries
- Mathematical preliminaries in numerical computing
- Apa itu preliminaries
- Parts of preliminaries
- Apa itu preliminaries
- Constant synoynm
- Non mathematical economics
- Fuzzy sets and fuzzy logic theory and applications
- Information sets in game theory
- Almost essential
- Information sets in game theory
- Information sets in game theory
- Information sets in game theory
- Speaking mathematically the language of sets
- Introduction and mathematical concepts
- The language of mathematics is precise example
- Language of mathematics
- Explain the use of the square paddle brush in braiding
- Sets and propositions in discrete mathematics
- Onto function definition
- Chromosome sets (=n) in mitosis and meiosis
- Anaphase meaning
- Sequences and sets
- Recursive and recursively enumerable sets
- The main text of the book
- Maps
- Maps and sets support bidirectional iterators.
- Subspaces and spanning sets
- Discrete mathematics
- Unordered subsets
- A pilot sets out from an airport and heads in the direction
- Well-defined set example
- 4 sided shape
- Lexical sets
- Weak entity set example
- @gin lingo
- Which ics functional area arranges for resources
- Lexical sets
- Even numbers symbol
- Lexical sets
- Predefined sets of different shapes group
- Binary relation in sets
- Correspondence between two sets of elements
- Lexical sets
- Angles of a convex polygon
- A novice pilot sets a plane's controls
- Module 5 financial services
- Lesson 12-4 slopes of parallel and perpendicular lines
- Oklahoma city gangs
- Sets per muscle group
- Difference of sets
- Examples of uncountable sets
- Folk gang signs
- Proving set identities
- De morgans law
- Removing redundant attributes in entity sets
- What is symmetric difference between two sets
- Countable and uncountable nouns apple
- Concave sets
- Cartesian product of fuzzy sets
- Mutually disjoint sets example
- Concepts of set
- Concepts of sets
- Infinite set example
- Az vm repair create
- Mutually disjoint sets example
- Although it was raining maria went for a jog at the park
- Base station test sets
- Linked list representation of disjoint sets
- Manipulating large data sets
- Spark: cluster computing with working sets
- Venn digram
- Disjoint sets
- 6-6 practice systems of linear inequalities
- Principle of recursive definition
- What are the two sets of reactions for photosynthesis
- How many different sets of
- A repeated musical figure
- 3-5 practice working with sets form g answer key
- Loop graph
- Disjoint set in java
- Cs246 stanford
- Disjoint set definition
- Cartesian product
- Scale of inquiry affects truth