Introduction to the Theory of Computation
AZADEH FARZAN WINTER 2010
Monday, January 11, 2010
PROOFS
Proof by Contradiction Proof by Construction
Jack sees Jill, who has just come in from outdoors Proo
CSC236H: Introduction to the Theory of Computatoin
Homework 1 Solutions
1. Use induction to prove that the following equation holds for all positive integers n:
n
k=1
n 1 = . k (k + 1) n+1
Solution. W
REGULAR EXPRESSIONS
DEFINITION
A regular expression over alphabet is dened inductively by:
DEFINITION
A regular expression over alphabet is dened inductively by: Basis:
DEFINITION
A regular expression
CONTEXT FREE LANGUAGES
CONTEXT-FREE LANGUAGES
CONTEXT-FREE
REGULAR
Context-Free Grammars Push-Down Automata
IDEA
Remember balanced parantheses example from structural induction?
IDEA
Remember balance
THE PUMPING LEMMA
THE PUMPING LEMMA
Theorem. For any regular language L there exists an integer n, such that for all x L with |x| n, there exist u, v, w , such that (1) x = uvw (2) |uv | n (3) |v | 1
LANGUAGES AND AUTOMATA
Tuesday, February 9, 2010
DATA MODEL
: a nite alphabet, e.g. cfw_0, 1, cfw_a, b, c. string or word: a nite sequence of concatenated symbols of .
0110 abbccbcac
empty string: len
Introduction to the Theory of Computation
AZADEH FARZAN SPRING 2010
Tuesday, February 2, 2010
STRUCTURAL INDUCTION
Tuesday, February 2, 2010
DEFINING SETS RECURSIVELY
Dene a set of objects: (i) dene t
Introduction to the Theory of Computation
AZADEH FARZAN SPRING 2010
Tuesday, January 26, 2010
FUNCTIONS DEFINED BY INDUCTION
Tuesday, January 26, 2010
RECURSIVELY DEFINED FUNCTIONS
76
CHAPTER 3. FUNCT
Introduction to the Theory of Computation
AZADEH FARZAN SPRING 2010
Wednesday, January 20, 2010
CORRECTNESS OF SIMPLE RECURSIVE PROGRAMS
Wednesday, January 20, 2010
MERGE SORT
Merge sort takes an arra
Introduction to the Theory of Computation
AZADEH FARZAN SPRING 2009
Wednesday, January 13, 2010
CORRECTNESS OF SIMPLE ITERATIVE PROGRAMS
Wednesday, January 13, 2010
BASIC DEFINITIONS
Program Correctne
UNIVERSITY OF TORONTO
® Faculty of Arts and Science (0
6&9 ‘y
AUGUST 2015 EXAMINATIONS %
CSC 236 HIY
Q Instructor: S. Cohen
Duration — 3 hours
Examination Aid: One sheet of paper, handwritten on both
DECEMBER 2014 FINAL EXAM CSC236H5F
Last Name: . First Name:
Student #: . a r g Signature:
UNIVERSITY OF TORONTO MISSISSAUGA
DECEMBER 2014 FINAL EXAMINATION
CSCZ36H5F
Theory of Computation
Daniel Zinga
0
(<0 UNIVERSITY OF TORONTO \$
‘7 Faculty of Arts and Science
Final Exam
ago
, December 2014 ‘8
¢ CSC 236H1F
Duration — 3 hours
No Aids Allowed.
Student Number: I
Last Name:
First Name:
Do not turn th
(
6% UNIVERSITY OF TORONTO O
6‘ Faculty of Arts and Science $
6‘ ‘2‘?
6’4 Final Exam Q,
¢ . 9
0 April 2015 @V‘
I4, CSC 236HlS QV
Duration — 3 hours
NO A‘AS AllowacL
Student Numb er: I
Last Name:
Fir
CSC236H: Introduction to the Theory of Computatoin
Homework 2
Due on Tuesday Feb 9, 2010 (in class)
1. Consider an array A[1.N ] each of whose elements is red or blue. The following algorithm rearrang
Homework 2 Solutions
February 21, 2010 Problem 1a (3 points)
Precondition: N > 1 is a natural number. A is an array of N elements. Each element is either red or blue. Postcondition: A contains the sam
CSC236H: Introduction to the Theory of Computation
Homework 3
Due on Thursday March 4, 2010 (in class)
1. Early members of the Pythagorean Society dened gurate numbers to be the number of dots in cert
CSC236H: Introduction to the Theory of Computatoin
Homework 1
Due on Tuesday January 26, 2010 1. Use induction to prove that the following equation holds for all positive integers n:
n
k=1
1 n = . k (
CSC236H: Introduction to the Theory of Computation
Bonus Homework
Due on Tuesday April 6, 2010 (in review session, see announcements)
Note that this assignment is for extra credit. If you do not want
CSC236H: Introduction to the Theory of Computation
Homework 5 Solutions
1. Give a context-free grammar for each of the following languages. (a) L1 = cfw_0n 1m 0m 1n | n, m 0. Solution. S 0S 1 | C C 1C
CSC236H: Introduction to the Theory of Computation
Homework 5
Due on Tuesday April 6, 2010 (in review session, see announcements)
1. Give a context-free grammar for each of the following languages. (a
CSC236: Homework 4
March 17, 2010
Question 1
Part (a)
The automaton accepts words over cfw_a, b where the number of as is congurent to the number of bs modulo 3.
Part (b)
A B C
Part (c)
Prove by induc