MIT6_042JS10_lec07_prob

# MIT6_042JS10_lec07_prob - Massachusetts Institute of...

This preview shows pages 1–2. Sign up to view the full content.

Massachusetts Institute of Technology 6.042J/18.062J, Spring ’10 : Mathematics for Computer Science February 19 Prof. Albert R. Meyer revised February 19, 2010, 1407 minutes In-Class Problems Week 3, Fri. Problem 1. Let’s refer to a programming procedure (written in your favorite programming language —C++, or Java, or Python, . . . ) as a string procedure when it is applicable to data of type string and only returns values of type boolean . When a string procedure, P , applied to a string , s , returns True , we’ll say that P recognizes s . If R is the set of strings that P recognizes, we’ll call P a recognizer for R . (a) Describe how a recognizer would work for the set of strings containing only lower case Ro- man letter — a,b,...,z —such that each letter occurs twice in a row. For example, aaccaabbzz , is such a string, but abb , 00bb , AAbb , and a are not. (Even better, actually write a recognizer pro- cedure in your favorite programming language). A set of string s is called recognizable if there is a recognizer procedure for it. When you actually program a procedure, you have to type the program text into a computer system. This means that every procedure is described by some string of typed characters. If a string , s

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern