CSci 423 Homework 7
Due: 9:30 am, Thursday, 10/29
Stephen Yuan
1. (20 points) Problem 2.30 (a) and (d) on page 157 (131).
(a) L = cfw_0n 1n 0n 1n |n 0
Proof by contradiction:
Assume that L is context free and the pumping lemma for CFL applies.
Therefore,
CSci 423 Homework 6
Due: 9:30 am, Thursday, 10/22
Stephen Yuan
1. (6 points) Give an informal description of a pushdown automaton that recognizes the language
A. Give the state diagram of your PDA.
A = cfw_ai b j ck | i = j or j = k where i, j, k 0
The pu
CSci 423 Homework 3
Due: 9:30 am, Thursday, 9/24
Stephen Yuan
1. (10 points) Exercise 1.12 on page 85.
DFA:
a
b
a
a
b
b
b
a
a, b
Regular Expression: b(bb)*(aa)*
Collaborators: Finite State Machine Designer, http:/madebyevan.com/fsm/
2. (10 points) Exercis
CSci 423 Homework 4
Due: 9:30 am, Thursday, 10/15
Stephen Yuan
1. (8 points) Prove by the pumping lemma that the language A of strings of 0s and 1s whose length is a
power of two is not regular.
Proof by Contradiction:
Assume A is a regular language. Then
CSci 423 Homework 5
Due: 9:30 am, Thursday, 10/15
Stephen Yuan
1. (10 points) Problem 1.49 (a) and (b) on page 90.
(a) Let B = cfw_1k y|y cfw_0, 1 and y contains at least k 1s, for k 1.
Show that B is a regular language
By denition, B is a regular languag
CSci 423 Homework 1
Due: 9:30 am, Thursday, 9/10
Stephen Yuan
1. (10 points) Prove by induction that n i3 = (n i)2 .
i=1
i=1
Proof: To start, we will represent the right side of the equation differently.
n i = 1 + 2 + . + n
i=1
2 n i = 2(1 + 2 + . + n)
i=
CSci 423 Homework 2
Due: 9:30 am, Thursday, 9/17
Stephen Yuan
1. (10 points) Exercise 1.7 (c) on page 84 and then additionally convert the NFA to an equivalent DFA
using the subset construction method. Make sure you show the subsets in all nodes in the DF
What is this course about?
CS312: Programming Languages
This course is about programming languages
We will study dierent ways of specifying programs
Lecture 1: Introduction and Lambda Calculus I
We will learn how to give (precise) meaning to programs
Thom
Announcements
PA1 is due 2/12
CS312: Programming Languages
WA2 is also due now
Lecture 6: Parsing Algorithms
The rst midterm is 2/12
Midterm information:
Thomas Dillig
In-class midterm: 12:35pm-1:50 pm
Closed everything (no handouts, laptops, etc) but all
Announcements
CS312: Programming Languages
Lecture 7: Operational Semantics I
PA2 out today
WA3 due 2/21
Thomas Dillig
Thomas Dillig,
CS312: Programming Languages
Lecture 7: Operational Semantics I
Thomas Dillig,
1/37
Outline
CS312: Programming Languages
Announcements
CS312: Programming Languages
WA2 is due Tuesday
Lecture 5: Introduction to Parsing
WA3 out today, to give you more time for the midterm.
Thomas Dillig
Thomas Dillig,
CS312: Programming Languages
Lecture 5: Introduction to Parsing
The rst mid
Announcements
CS312: Programming Languages
WA1 and PA0 are due Thursday
Lecture 4: Implementation of Lexical Analysis
If you are not very busy right now, get started now
Thomas Dillig
Thomas Dillig,
CS312: Programming Languages
Lecture 4: Implementation o
Administrativa
CS312: Programming Languages
Forgot to mention last time: No Textbook
Lecture 2: Lambda Calculus II
and Introduction to L
Today two handouts: L Reference Manual and Written
Assignment 1
Blackboard course site is set up with discussion forum
Syntactic Analysis
Main Question: How to give structure to strings
CS312: Programming Languages
Analogy: Understanding an English sentence
First, we separate a string into words
Lecture 3: Lexical Analysis
Second, we understand sentence structure by diagr
Historical Perspective
Second oldest programming language after Fortran
CS312: Programming Languages
Developed in late 1950s at MIT by John McCarthy
Lecture 9: LISP
Original purpose: to facilitate research in articial intelligence
In research, one may not
Outline
CS312: Programming Languages
Lecture 8: Operational Semantics II
We will discuss semantics of remining (interesting) L
expressions
Thomas Dillig
Thomas Dillig,
CS312: Programming Languages
Lecture 8: Operational Semantics II
Will look at one more
CS312 Midterm 1
Spring 2012/2013
Please read all instructions (including these) carefully.
There are 5 questions on the exam, all with multiple parts. You have 75 minutes to work on
the exam.
The exam is closed book, closed notes, closed computers, pho
CS312 Midterm 2
Spring 2011/2012
Please read all instructions (including these) carefully.
There are 4 questions on the exam, all with multiple parts. You have 75 minutes to work on
the exam.
The exam is closed book, closed notes, closed computers, pho
Outline
CS312: Programming Languages
Lecture 11: Polymorphism
Type system for let language augmented with lambda
abstraction and application
Thomas Dillig
Thomas Dillig,
CS312: Programming Languages
Polymorphic types
Lecture 11: Polymorphism
1/38
Thomas D
Announcements
CS312: Programming Languages
Tom is away until next Thursday
Lecture 10: Basic Type Checking
Midterm 2 postponed to April 4
Thomas Dillig
Thomas Dillig,
CS312: Programming Languages
Written assignment 2 is out due April 2
Lecture 10: Basic T
Outline
CS312: Programming Languages
We will talk about types
Lecture 10: Principles of Typing
What types compute
Why types are useful
Thomas Dillig
Brief survey of types in the real world
Thomas Dillig,
CS312: Programming Languages
Lecture 10: Principles
Outline
CS312: Programming Languages
We will write type systems for multiple languages
Lecture 11: Basic Type Checking
We will formally see how to dene soundness
Thomas Dillig
Thomas Dillig,
CS312: Programming Languages
We will learn how to prove soundnes
1.
CS 131 - Answers to Homework 1 - Chapters 1 & 2 - Spring 2012 - D. Noonan
What do the following acronyms stand for?
a.
b.
c.
d.
e.
f.
g.
h.
i.
j.
k.
l.
m.
n.
o.
p.
SCSI - Small Computer System Interface
PILPOF - Plug in Last, Pull out First
ROM - Read
CS 131 - Answers to Homework 5 - Chapter 7 - Spring 2012
D. Noonan
1. Multiple Choice:
a) The first step in debugging is to:
A. check for obvious errors B. try to reproduce the problem
C. isolate the problem
D. find exactly what the problem is
2. B - try
CS 131 - Answers to Homework 4 - Chapter 5 - Spring 2012
D. Noonan
1. Multiple Choice:
a. Information created in _ is likely to be digitized.
A. 1956 B. 1976
C. 1996 D. all the above
b. C - 1996
c. A hierarchy resembles a:
A. subway map
B. tree
C. spoked
CS 131 - Answers to Homework 3 - Chapter 4 - Spring 2012
D. Noonan
1. Multiple Choice:
a. HTML commands are called:
A. hops B. brackets
C. tags
D. tokens
b. C - tags
c. Which of the following would put "Kelly Clarkson - In Concert" in the
title bar of a W
CS 131 - Answers to Homework 2 - Chapter 3 - Spring 2012
D. Noonan
1. Acronyms - what do each of the following stand for?
a. DARPA - Defense Advanced Research Projects Agency
b. DNS - Domain Name System
c. TLD - Top Level Domain
d. URL - Uniform Resource
CS 131 - Answers to Homework 6 - Chapter 8 - Spring 2012
D. Noonan
1. Multiple choice
a. A good example of a collating sequence that you learned in school is
A. PandA B. i before e
C. ABCs
D. all of the above
b. C - ABCs
c. Which of these is not digital?
CS 131 - Answers to Homework 7 - Chapter 9 - Spring 2012
D. Noonan
1. Acronyms
a. RAM - Random Access Memory
b. ALU - Arithmetic Logic Unit
c. ENIAC - Electronic Numerical Integrator and Calculator
d. ABC - Atanasoff-Berry Computer
e. I/O - Input/Output
f
CS 131 - Answers to Homework 11 - Chapter 11 Spring 2012
D. Noonan
1. Acronyms
a. ADC - Analog-to-Digital converter
b. DAC - Digital-to-Analog converter
c. GIF - Graphics Interchange Format
d. JPEG - Joint Photographic Experts Group
e. ISO - International