Introduction to CS Theory Lecture 1 – Introduction Piotr Faliszewski

Slides:



Advertisements
Similar presentations
Chapter 2 Revision of Mathematical Notations and Techniques
Advertisements

Lecture 24 MAS 714 Hartmut Klauck
1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
More Set Definitions and Proofs 1.6, 1.7. Ordered n-tuple The ordered n-tuple (a1,a2,…an) is the ordered collection that has a1 as its first element,
Introduction to CS Theory Lecture 2 – Discrete Math Revision Piotr Faliszewski
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
CS 310 – Fall 2006 Pacific University CS310 Strings, String Operators, and Languages Sections: August 30, 2006.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
1 Languages and Finite Automata or how to talk to machines...
1 Lecture 5 Topics –Closure Properties for REC Proofs –2 examples Applications.
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
CSE115/ENGR160 Discrete Mathematics 03/31/11
1 Module 31 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union, concatenation.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Normal forms for Context-Free Grammars
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Theoretical Computer Science COMP 335 Fall 2004
Lecture 1 String and Language. String string is a finite sequence of symbols. For example, string ( s, t, r, i, n, g) CS4384 ( C, S, 4, 3, 8) (1,
 2004 SDU Introduction to the Theory of Computation My name: 冯好娣 My office: 计算中心 430
Introduction Chapter 0. Three Central Areas 1.Automata 2.Computability 3.Complexity.
Welcome to Honors Intro to CS Theory Introduction to CS Theory (Honors & Traditional): - formalization of computation - various models of computation (increasing.
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
1 Chapter 1 Automata: the Methods & the Madness Angkor Wat, Cambodia.
1 Strings and Languages. 2 Review Sets and sequences Functions and relations Graphs Boolean logic:      Proof techniques: – Construction, Contradiction,
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
1 Chapter 1 Introduction to the Theory of Computation.
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
CSCI 2670 Introduction to Theory of Computing Instructor: Shelby Funk.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Welcome to Honors Intro to CS Theory Introduction to CS Theory (Honors & Traditional): - formalization of computation - various models of computation (increasing.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
1 Exercise: Prove that the set S = { π : π is a permutation of {1, 2, 3, …, n} for some integer n ≥ 1 } is countable.
Theory of Computation, Feodor F. Dragan, Kent State University 1 TheoryofComputation Spring, 2015 (Feodor F. Dragan) Department of Computer Science Kent.
1 Lecture 3.3: Recursion CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
CS355 - Theory of Computation Regular Expressions.
CS 203: Introduction to Formal Languages and Automata
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Introduction Why do we study Theory of Computation ?
Introduction Why do we study Theory of Computation ?
6/12/2016 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(2) Mathematical Induction & Recursion Dr.Saad Alabbad Department of.
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
Introduction Why do we study Theory of Computation ?
CIS 262 Automata, Computability, and Complexity Fall Instructor: Aaron Roth
Introduction Chapter 0.
BCS2143 – Theory of Computer Science
Introduction to the Theory of Computation
Languages.
Why do we study Theory of Computation ?
Lecture 1 Theory of Automata
CIS Automata and Formal Languages – Pei Wang
Assume that p, q, and r are in
Why do we study Theory of Computation ?
Introduction Chapter 0.
Instructor: Aaron Roth
Instructor: Aaron Roth
Chapter 1 Introduction to the Theory of Computation
Languages Fall 2018.
Presentation transcript:

Introduction to CS Theory Lecture 1 – Introduction Piotr Faliszewski

Introduction  Instructor Piotr Faliszewski Office:  Course website:  Office hours Monday through Thursday 2pm—4pm

Logistics  Look at the courses website!  Important highlights Cooperation on homeworks  Teams of two allowed  Both people get the same grade—you cannot complain about your teammate not working Quizzes! Disputing your grade  At most a week after you received the grade  Discrete math quiz Next Monday

Introduction  This is a course in mathematics! Basic discrete math  Dealing with sets, functions, sequences etc.  Logic  Inductive proofs (!!!)  Goals of the course Understand the nature of computation Develop problem solving skills Increase mathematical sophistication You should already be familiar with those, but we will review a bit as well

Computer Science Needs Precision! From a letter of Charles Babbage to Alfred Tennyson in response to his poem "The Vision of Sin“: "In your otherwise beautiful poem, one verse reads, Every moment dies a man, Every moment one is born.... If this were true, the population of the world would be at a standstill. In truth, the rate of birth is slightly in excess of that of death. I would suggest: Every moment dies a man, Every moment 1 1/16 is born. Strictly speaking, the actual figure is so long I cannot get it into a line, but I believe the figure 1 1/16 will be sufficiently accurate for poetry."

What is this course about?  Two fundamental questions about computation What can and cannot be computed? What can and cannot be computed efficiently?  But, before we can answer these… What IS computation? What PROBLEMS do we want to solve?  What is computation? Many different models of a computer  Finite automata  Push-down automata  Turing machines  Decision problems and languages

Languages and Decision Problems  Decision problem Name Input  the mathematical entities about whose properties we ask Question  A well-defined yes/no question  Language A set of strings Languages encode decision problems  Example Name: Connectivity Input: Graph G, vertices s and t Question: Are vertices s and t connected in G

Languages and Decision Problems  Our two fundamental questions What decision problems can and cannot be solved? What decision problem can and cannot be solved efficiently  We focus on languages  Chomsky Hierarchy  Models of computation Regular languages / finite automata Context-free languages / push-down automata Turing machines

Hierarchy of Languages Finite languages Context-free languages Recursive languages All languages

Effectively Decidable Languages P NP Regular languages Context-free languages Recursive languages

And now…  Let’s get some real work done! Your responsibility: Part I of the book But, I will cover:  Languages  Mathematical induction

1.5 Languages  Language A set of strings over some alphabet  Alphabet A finite set of indivisible objects, usually denoted as Σ Examples  {0, 1, 2, …, 9}  {0, 1}  {a, b, c, …, z}  {1}  String A string over Σ is a finite, possibly empty, sequence of elements of Σ Some strings over {0,1}:  ε  empty string  0, 1, 001, Examples of nonstrings (for alphabet {0,1})   11111… Length of a string x  |x|  Examples?

Defining Languages  Set of all strings Σ * -- set of all strings over Σ {0,1} * {a} *  We can define languages via set operations Intersection, union Difference Complement operation  L = Σ * - L  Examples of languages L 1 = { x  {0,1} * | x contains at least as many 0s as 1s} L 2 = { x  {0,1} * | x contains at least as many 1s as 0s} L 3 = {ε} L 4 = { x  {0,1} * | x viewed as an integer is a prime} L 5 = L 1  L 2 L 6 = L 1

Operations on Strings Let x, y  Σ * Some operations on strings xy – concatenation x i – concatenation of x i times with itself x is a substring of y if there are strings w and z such that y=wxz x is a prefix of y if there is a string z such that y=xz x is a suffix of y if there is a string z such that y=zx  Examples x = ab y = aabb xy = abaabb xε = x = εx x 3 = xxx = ababab x 0 = ??? x is a substring of y z = bb z is a suffix of y x is a prefix of x

Operations on Languages  Let L, L 1, L 2 be languages over the same alphabet Σ L 1 L 2 = {xy | x in L 1 and y in L 2 } – the concatenation of two languages L i – concatenation of i L’s  What is L 0 ? L * = L 0  L 1  L 2  L 3  …  Kleene’s star L + = LL * = L * L  Exercises Is there a language L such that L * is finite? Let L 1, L 2 be two finite languages. What is the cardinality of L 1 L 2 Is there a language such that L = L * ?

Mathematical Induction  Mathematical induction Technique to prove facts about finite entities E.g., properties of integers  Inductive proof: Base case Inductive step  Intuition … a little like a for loop in a program: we construct the proof in iterations. Theorem. Let A be a finite set with n elements. There are 2 n distinct subsets of A. Proof. Base: A =  Inductive step: Assume that the theorem holds for all natural numbers up to k. Let A be a set with k+1 elements and B an arbitrary subset of k elements of A. Let x be such that: A = B  {x} By the inductive assumption, B has 2 k subsets. Thus A has 2 k+1 subsets. (Why?)

Mathematical Induction – Examples  Let us prove the following: Σ = {0,1}, each string x such that x = 0y1, where y Σ *, contains 01 as a substring For every natural number n, n ≥ 2, n either is a prime or a product of two or more primes  How about the following theorem: For every natural number n it holds that n! > 2 n And I can prove by induction that all horses are of the same color!

Recursive Definitions  Recursive definition Define a small set of basic entities Show how to obtain larger ones from those already constructed A bit like induction! Examples Factorial 0! = 1 For each natural n, (n+1)! = (n+1)*n! Recursive definition of Σ * : 1.ε  Σ * 2.If x  Σ * and a  Σ then xa  Σ * 3.Nothing is in Σ * unless it is obtained by the two previous rules.

Recursive Definitions – Examples  Two exercises Give a recursive definition of the length of a string. Give a recursive definition of a reverse of a string.  Palindromes A string is a palindrome if it reads the same backward and forward Let’s define a language of palindromes!  Language L of palindromes, Σ = {a, b}. 1.ε  L 2.If x  L then both axa and bxb belong to L. 3.Nothing belongs to L unless it is obtained by rules 1 and 2. Hmm… This looks wrong to me!

Recursive Definitions – Examples  Language L of all strings with as many 0s as 1s. (Σ = {0,1}) 1.ε  L 2.For any x in L it holds that each of: 0x1 1x0 01x 10x x01 x10 belongs to L. Is this definition correct?  Exercise Prove that for each string x over alphabet Σ it holds that |x| = |x r | x r is the reverse of x Structural induction!