Turing Machines
What do we mean by
Computation?
Turing Machines
The first third of the 20th century resulted in our, finally, obtaining a
useful formal idea of what is meant by computation. We also
ob
Turing Machines
Our most powerful model of a computer is
the Turing Machine. This is an FA with
an infinite tape for storage.
A Turing Machine
A Turing Machine (TM) has three components:
An infinite
Theory of Computer Science and Compiler Design
Assignment
Deadline of submission: Before 8th May 2017 by 5:00 p.m.
Q1. Design a Turing machine to perform multiplication for two numbers m and n.
Hint:
Jaypee Institute of Information and Technology University, Noida (U.P)
Theory of Computation and Compiler Design
Assignment-10 and 11
1. Check whether the grammar is suitable for top down parsing? If
Jaypee Institute of Information Technology University, Noida
Theory of Computation and Compiler Design (15B11CI611)
Assignment- 7, 8 and 9
1. Let G be the grammar
S 0B| 1A,
A 0|0S|1AA,
B 1|1S|0BB
For
Jaypee Institute of Information Technology University, Noida
Theory of Computation and Compiler Design (15B11CI611)
Assignment- Lex Tool
1) Write a Lex program to accept a string and remove leading, t
Jaypee Institute of Information and Technology University, Noida (U.P)
Theory of Computation and Compiler Design
(Turing Machine)
Assignment-12 and 13
1) Design a Turing machine which changes all as t
Jaypee Institute of Information and Technology University, Noida (U.P)
Theory of Computation and Compiler Design
Assignment-14 and 15
(SDT, Type Checking, Intermediate Code Generation)
1. Perform the
Jaypee Institute of Information Technology University, Noida
Theory of Computation and Compiler Design (15B11CI611)
Assignment-6
1. You are going to write a lexical analyzer for a toy programming lang
Jaypee Institute of Information Technology University, Noida
Theory of Computation and Compiler Design (15B11CI611)
Assignment-5
1. A man, a wolf, a goat, and a cabbage are all on one bank of a wide r
Introduction to Information Retrieval
Information Retrieval Systems
Information
Retrieval
What is information?
What do we mean by retrieval?
What are different types information needs?
Systems
How do
Information
Retrieval &
Semantic Web
1
Outline
Syllabus
Book
What is the IR problem?
Indexing
Retrieval
Data Mining
Applications of IR and DM
2
Syllabus
Introduction to Information Retrieval
Boolean R
Deterministic Finite Automata
Controllers (such as elevator, dishwashers,
automatic door) are common examples of
deterministic finite automata (DFAs).
DFAs are an example of machines to describe
a rel
Theory of Computation
and Compiler Design
(15B11CI611)
Shelly Sachdeva,JIITU
Introduction
Theoretical computer science treats any computational subject for which a
good model can be created.
Research
Theory of Computation
and Compiler Design
(15B11CI611)
Shelly Sachdeva,JIITU
Introduction
Theoretical computer science treats any computational subject for which a
good model can be created.
Research
Regular Expressions
Definition of regular languages
The simplest possible regular languages are
the empty set and languages consisting of a
single string that is either the empty string or
has length
Compiler Design
Preliminaries Required
Basic knowledge of programming languages.
Basic knowledge of FSA and CFG.
Knowledge of a high programming language for the
programming assignments.
Textbook:
LEXICAL
ANALYSIS
Why a Separate Lexical Analysis Phase?
Programs could be made from characters, and
parse trees would go down to the character
level
Lexical analysis is firewall between program
repr
NFA with -Transitions (NFA)
There exist -transitions that allow
state changes without consuming
any input symbol.
Similar to NFA, an input is
accepted if there is a path leading
from the start state t
Jaypee Institute of Information Technology University, Noida
Theory of Computation and Compiler Design (15B11CI611)
Assignment-4
(Regular Expression)
1) Suppose that for security reasons you require a
Tool
Lex
LEX:
Tool for constructing lexical analyzers from special purpose
notations based on regular expressions.
Tool widely used to specify lexical analyzers for a variety of
languages.
Lex is a p
Regular Expressions
DFA, NFA, -NFA and RE
DFA, NFA, -NFA and RE are all equivalent.
DFA
NFA
-NFA
RE
A language that can be described by them is called a
Regular Language
Draw DFA and give RE
Soln
n,
Jaypee Institute of Information Technology University, Noida
Theory of Computation and Compiler Design (15B11CI611)
Assignment-1
1) Show a deterministic finite automaton that can be used to look for o
Jaypee Institute of Information Technology University, Noida
Theory of Computation and Compiler Design (15B11CI611)
Assignment-2 and 3
1) Consider the language over cfw_1, 2, 3 in which no string uses
Lab Exercise -10
1. Write a menu driven program showing following operations in a
binary tree
- Insertion
- Deletion
Inorder, preorder and Postorder Traversal
2. Write a menu driven program showing f
SINGLE-SOURCE SHORTEST PATH
PROBLEM
Single-Source Shortest Path Problem - The problem of
finding shortest paths from a source vertex v to all other
vertices in the graph.
DIJKSTRA'S ALGORITHM
Dijkstra
Polynomial Representation
typedef struct nodeType cfw_
int coeff;
int power;
struct nodetype *next;
node;
node *poly;
Coeff
of the
term
Power of Link
x
to
next
node
A=3x14+2x8+1
A
3
14
2
8
1
0
NULL
-3
Outline
Graph Adjacency Representation
Topological Sort
Minimum Spanning Tree
Kruskals Algorithm
Prims Algorithm
1
Graph - adjacency representation
Adjacency matrix
A B C D E
B
A 0 0 1 0 1
C
D
B
Graphs
1
Definition of Graphs and
Related Concepts
Representation of Graphs
Graph Traversal
Definition of Graphs
2
A graph is a finite set of nodes with
edges between nodes
Formally, a graph G is a