Skip to main content

Introduction to Theory of Computation(Automata)

Summary
Introduction to the course title, Formal and In-formal languages, Alphabets, Strings, Null string, Words, Validand In-valid alphabets, length of a string, Reverse of a string, Defining languages, Descriptive definition of languages, EQUAL, EVEN-EVEN, INTEGER, EVEN, { a n b n }, { a n b n a n }, factorial, FACTORIAL, DOUBLEFACTORIAL, SQUARE, DOUBLESQUARE, PRIME, PALINDROME.

What does automata mean?
Definition : It is the plural of automaton, and it means “something that works automatically”
Introduction to languages
There are two types of languages
                    1) Formal Languages (Syntactic languages)                    2) Informal Languages (Semantic languages)

Alphabets
Definition : A finite non-empty set of symbols (called letters), is called an alphabet. It is denoted by Σ ( Greek letter sigma).
Example
Σ = {a,b}
Σ = {0,1} (important as this is the language which the computer understands.)
Σ = {i,j,k}
Note
Certain version of language ALGOL has 113 letters.
Σ (alphabet) includes letters, digits and a variety of operators including sequential operators such as GOTO and IF

Strings
Definition : Concatenation of finite number of letters from the alphabet is called a string.
Example
If Σ = {a,b} then
a, abab, aaabb, ababababababababab
Note

Empty string or null string
Sometimes a string with no symbol at all is used, denoted by (Small Greek letter Lambda) λ or (Capital Greek letter Lambda) Λ, is called an empty string or null string.
The capital lambda will mostly be used to denote the empty string, in further discussion.

Words
Definition : Words are strings belonging to some language.
Example
If Σ= {x} then a language L can be defined as
L={x n : n=1,2,3,.....} or L={x,xx,xxx,....}
Here x,xx,... are the words of L
Note
All words are strings, but not all strings are words.

Valid/In-valid alphabets
While defining an alphabet, an alphabet may contain letters consisting of group of symbols for example Σ 1 = {B,aB, bab, d}.
Now consider an alphabet
Σ 2 = {B, Ba, bab, d} and a string BababB.

This string can be tokenized in two different ways
(Ba), (bab), (B)
(B), (abab), (B)
Which shows that the second group cannot be identified as a string, defined over
Σ = {a, b}.
As when this string is scanned by the compiler (Lexical Analyzer), first symbol B is identified as a letter belonging to Σ, while for the second letter the lexical analyzer would not be able to identify, so while defining an alphabet it should be kept in mind that ambiguity should not be created.

Remarks
While defining an alphabet of letters consisting of more than one symbols, no letter should be started with the
letter of the same alphabet i.e. one letter should not be the prefix of another. However, a letter may be ended in a
letter of same alphabet.

Conclusion
Σ 1 = {B, aB, bab, d}
Σ 2 = {B, Ba, bab, d}
Σ 1 is a valid alphabet while Σ 2 is an in-valid alphabet.

Length of Strings
Definition
: The length of string s, denoted by |s|, is the number of letters in the string.
Example
Σ={a,b}
s=ababa
|s|=5
Example
Σ= {B, aB, bab, d}
s=BaBbabBd
Tokenizing=(B), (aB), (bab), (B), (d)
|s|=5

Comments

Popular posts from this blog

important question on Entity Relationship Model(ER Model)

5)A university registrar’s office maintains data about the following entities: (a) courses, including number, title, credits, syllabus, and prerequisites; (b) course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom; (c) students, including student-id, name, and program; and (d) instructors, including identification number, name, department, and title. Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled for must be appropriately modeled. Construct an E-R diagram for the registrar’s office. Document all assumptions that you make about the mapping constraints. Answer:   In the answer given here, the main entity sets are student, course, course-offering, and instructor. The entity set course-offering is a weak entity set dependent on course. The assumptions made are : a class meets only at one particular place and time. This E - R diagram cannot model a class meet

how to Install Numpy, Pandas and matplotlib on ubuntu 18.04 and Linux Mint

Install Python, NumPy,Matplotlib for Python 3 on Ubuntu 18.04, Linux Mint, Debian Linux. This is a short article about installing Numpy, Pandas , Matplotlib, Python3 on the latest Ubuntu 18.04 LTS, Linux Mint, Debian Linux which comes with Python 3.6.5. Let’s start by making sure we have an updated system: 1 sudo apt update 2 sudo apt upgrade Now, let’s install NumPy, Pandas,Matplotlib : sudo apt-get install python-pip sudo pip install numpy sudo pip install pandas sudo pip install matplotlib Test numpy : Open up a Terminal in Your Linux Operating System by running the following: python3 At the Terminal, type the following: >>> import numpy as np >>> np.__version__ '1.13.3'   Test Pandas : Open up a Terminal in Your Linux Operating System by running the following: python3 At the Terminal, type the following: >>> import pandas as pd >>> pd.__version__ '0.22.0'   Test Matpl

Library Management System DataFlow Diagram

Library Management System DataFlow Diagram 1) Zero Level DFD 2) 1st level DFD and 2nd level DFD