Problem Session 1 CS 302. Topics LaTeX Questions from Class Extra problems.

Slides:



Advertisements
Similar presentations
CS 3240: Languages and Computation
Advertisements

CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
8/27/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 2 Theory of Computation Finite Automata Operations on languages Nondeterminism L2.1.
January 7, 2015CS21 Lecture 21 CS21 Decidability and Tractability Lecture 2 January 7, 2015.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
CFG => PDA Sipser 2 (pages ).
CFG => PDA Sipser 2 (pages ). CS 311 Fall Formally… A pushdown automaton is a sextuple M = (Q, Σ, Γ, δ, q 0, F), where – Q is a finite set.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
Finite Automata and Non Determinism
CS5371 Theory of Computation
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections:1.1 page 44 September 8, 2006.
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Topics Automata Theory Grammars and Languages Complexities
CSC 361Finite Automata1. CSC 361Finite Automata2 Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers.
1.Defs. a)Finite Automaton: A Finite Automaton ( FA ) has finite set of ‘states’ ( Q={q 0, q 1, q 2, ….. ) and its ‘control’ moves from state to state.
CS 173 Fall Introduction to LaTeX David and Lucas CS 173 Fall 2009 Written with significant references to Oetiker et al. “The Not So Short Introduction.
Lexical Analysis Part 2 Professor Yihjia Tsai Tamkang University.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
For AMS 200, 2009 Dept. of Applied Math & Statistics School of Engineering University of California Santa Cruz, CA A Very Short Introduction to LaTeX.
Rosen 5th ed., ch. 11 Ref: Wikipedia
Lexical Analysis — Part II: Constructing a Scanner from Regular Expressions Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
Lexical Analysis — Part II: Constructing a Scanner from Regular Expressions.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
Pushdown Automata (PDAs)
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Spring
Athasit Surarerks THEORY OF COMPUTATION 07 NON-DETERMINISTIC FINITE AUTOMATA 1.
Lexical Analysis Constructing a Scanner from Regular Expressions.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: 
LATEX B. R. Chandavarkar, Wireless Information Networking Group (WiNG), CSE Dept., NITK, Surathkal.
CSE 311 Foundations of Computing I Lecture 27 FSM Limits, Pattern Matching Autumn 2012 CSE
Deterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.2)
NFA defined. NFA A Non-deterministic Finite-state Automata (NFA) is a language recognizing system similar to a DFA. It supports a level of non-determinism.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CS 203: Introduction to Formal Languages and Automata
The decidability of Presburger Arithmetic By Guillermo Guillen 04/13/05 Dr. Smith COT 6421 FIU Spring 2005.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
CSCI 3130: Formal languages and automata theory Tutorial 1 Lee Chin Ho.
CSE 311 Foundations of Computing I Lecture 24 FSM Limits, Pattern Matching Autumn 2011 CSE 3111.
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
 2004 SDU Lecture4 Regular Expressions.  2004 SDU 2 Regular expressions A third way to view regular languages. Say that R is a regular expression if.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
1 Lexical Analysis Uses formalism of Regular Languages Uses formalism of Regular Languages Regular Expressions Regular Expressions Deterministic Finite.
1 Finite Automata. 2 Introductory Example An automaton that accepts all legal Pascal identifiers: Letter Digit Letter or Digit "yes" "no" 2.
Nondeterminism Subset Construction ε -Transitions.
Theory of Computation Automata Theory Dr. Ayman Srour.
Nondeterminism The Chinese University of Hong Kong Fall 2011
CIS Automata and Formal Languages – Pei Wang
Finite-State Machines (FSMs)
Finite-State Machines (FSMs)
Chapter 2 Finite Automata
Nondeterministic Finite Automata
Chapter 2 FINITE AUTOMATA.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Lecture3 DFA vs. NFA, properties of RL
COSC 3340: Introduction to Theory of Computation
A Very Short Introduction to LaTeX
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 1 Regular Language
Presentation transcript:

Problem Session 1 CS 302

Topics LaTeX Questions from Class Extra problems

LaTeX Typesetting software for math Used by scientific community Why should you learn it?

How to get LaTeX (windows) Download MikTeX ( Download TeXnicCenter (or other IDE) (

Starting a document \documentclass[12pt]{article} \pagestyle{plain} \usepackage{anysize} \marginsize{2.5cm}{2.5cm}{1.5cm}{1.5cm} \begin{document} … \end{document}

Math Mode $ - begins math mode ^ - superscript _ - subscript \mbox – enter text in math mode \ - begins a command or escapes a character

Using the Preamble LaTeX allows you to create your own environments \begin{proof} Blah blah blah \end{proof} There are lots provided in the preamble

Lists \begin{enumerate}, \begin{itemize} \item creates a new item \begin{enumerate*} omits numbering

Formatting \newpage \vspace{10mm}, \hspace{10mm} newlines

Including Images \usepackage{graphicx} \begin{figure}[!htbp] \includegraphics[scale=.75]{hw1-9a.jpg} \end{figure} It probably won’t put things where you want. Supports jpg, ps, but not gif

Tutorials Links on course webpage Lots of links on wikipedia Search for what you want!

Questions From Class?

Example of Conceptual Power of Non-determinism Let L be regular Let ½(L)={x :  y |x|=|y| and xy  L}  i.e., ½(L) = first halves of strings in L Is ½(L) regular?

½(L) is regular Let M be a DFA for L Construct M’ for ½(L) M’ uses the “finger method”  Place left finger on q 0 in M  Middle finger on q j, nondeterministic guess as to where x will lead  Right finger on q j

Transition Function As characters of x are read  M’ moves left finger along transitions dictated by characters read  And simultaneously moves right finger along a non-deterministically chosen edge which may be labeled with any character, not necessarily the one of x being read

Acceptance M’ accepts x iff at the end  Left finger is on q j  Right finger is on accept state Thus, M’ accepts x iff q0q0 qjqj |x||y|

Formal Implementation Given M=(Q, , ,q 0,F) Construct M’=(Q’, ,  ’,q 0 ’,F) Q’ = Q x Q x Q  {s}  Q x Q x Q = (left,middle,right)  s = new start state

Formal Implementation Guess the state q j that input x will lead to   ’(s,  ) = { : q j in Q}   ’(, a) = { :  ’(q i,a)=q l and there is b in  such that  (q k,b)=q m }  Note that the middle finger does not change after initial guess. F’={ : q j in Q, q k in F}.

Extra Problems True or false: if T is countable, then the set {S|S a subset of T, S is finite} is also countable.

True Use the Subset Sum technique T = { a 1, a 2, a 3,…} Add up the subscripts of each set of S Order by sum of subscripts, then lexicographically (i.e. a set with a 1 comes before a set with a 2 )

Extra Problems Is there a bijection between the interval (0,1) on the real line and all the real numbers?

Yes Tan(x-½ π)/π/2 Project (0,1) to semi circle centered at (½, ½). Draw the ray passing through (½, ½) and intersecting the x-axis.

Extra Problems Show that if we add a single 32-bit register to a DFA and that each state can store some value in it then every language this machine accepts can be accepted by a regular DFA.

The register adds a finite number of states to each state Add states to the machine representing all the possible values the register could have at that state

Extra Problems Create a DFA the recognizes the set of strings in which the number of 0s is divisible by 2 and the number of 1s is divisible by 3.