This is the home page for CMPSCI 250. CMPSCI 250 is the undergraduate core course in discrete mathematics and will deal with logic, elementary number theory, proof by induction, combinatorics, graphs, finite automata, regular languages, and a brief introduction to Turing machines.

The course is primarily intended for undergraduates in computer science and related majors such as mathematics or computer engineering. CMPSCI 187 (programming with data structures) and MATH 132 (Calculus II) are corequisites and in fact most students in the course have already taken one or both.

The course will meet for three lecture meetings a week, MWF 10:10-11:00. The Monday and Friday meetings will be in Marston 132. The Wednesday lectures, starting with the lecture of 6 October, will be in Chenoweth 227. Thanks to the registrar's office for getting us out of our original inferior classroom.

There are two discussion sections, one meeting Monday 11:15-12:05 and the other Wednesday 12:20-1:10, both in LGRC A203. These will consist of students solving specific problems alone or in groups and handing answers in, so that missing these classes will incur a grade penalty.

There is also an honors section for the course called CMPSCI H11,
a one-credit seminar
intended for undergraduates in Commonwealth College (but open to non-CC
students as well if there is room). In this we will read
Hofstadter's *Godel, Escher, Bach* and discuss how it relates to the
topic of the main course. The seminar meets Fridays 2:30-3:20 in room 140
of the Computer Science building.

**Important Course Material:**

- Course Requirements and Grading
- Homework Assignment Directory (with HW#8)
- Discussion Assignment Directory (with Disc #5 and solutions through Disc #11)
- Exam Directory (complete, with real final exam and solution)
- Questions and Answers on Homework (with some on HW#7)
- Syllabus

**Announcements (23 December 2004):**

- (23 Dec) Ok, the finals are graded and I can email grades to
students (I may do this as a batch job before I leave town tomorrow
morning. I may or may not have access to my email when I'm away.)
Final exam distribution:

- A (102+) nine, top was 117
- A- (95-101) four
- B+ (89-94) three
- B (82-88) six
- B- (75-81) six
- C+ (69-74) three
- C (62-68) eight
- C- (55-61) three
- D+ (49-54) four
- D (42-48) zero
- D- (35-41) six
- F (0-34) one (a 34)

Overall course grades were: A (6), A- (4), B+ (7), B (5), B- (4), C+ (7), C (8), C- (4), D+ (3), D (4), D- (1). I had some hard decisions at the C-/D+ line but I am satisfied that those I didn't pass should repeat the course before going on.

- (21 Dec) I've posted the final exam and its solution. Grading proceeds. I've graded Discussions #9 and #11 and will put these in the pickup box. I'm not returning Discussion #10 because I want a record of your comments.
- (20 Dec) Harish and Russell have graded HW#8, and the papers are available to be picked up in the main office. The scale for HW#8 is A = 84, C = 48. There are a few papers without names on them -- if you pick up your paper with no name please email Harish to get proper credit.
- (20 Dec) I hope to have all the grading finished by Thursday. I will put a note here when I am ready to return final exams and give out grades. I should be able to answer email requests at that point, but please don't email me until then just to ask you you're doing...
- (17 Dec) I have posted solutions to the practice final. I found two errors in the practice final, which have now been corrected.
- (16 Dec) I have posted the third midterm and its solution.
- (15 Dec) Ok, the practice final is now posted. I have been asked to post solutions to the third midterm -- I will probably not get to this until Friday. I'll also post solutions to the practice final on Friday.
- (15 Dec) HW#7 has been graded and is in the pickup box in the CMPSCI main office. These were better than the last few (average 67) -- the ten-point bonus wasn't the entire difference. Scale will be A=90, C=54.
- (15 Dec) Sorry the practice exam and HW#8 solutions have been delayed. The latter are probably going up tonight. I will see whether I can get the practice exam up by midday tomorrow.
- (15 Dec) A student suggests two web sites with tools for working with regular expressions and finite automata. These might be particularly useful for checking results of practice problems. (E.g., write down a DFA at random, convert it to a regular expression by hand, and check the result against a tool...) The sites are: http://www.cs.duke.edu/~rodger/tools/jflap and http://www.weitz.de/regex-coach. Disclaimers: I haven't tried either of these, and note that they may not be using the same notation as we are.
- (8 Dec) I have just posted solutions for the last two discussions, available from the discussion index page. I will grade these as soon as I can get to them, which will complete the discussion partion of the course.
- (8 Dec) The review-and-coming-attractions session on Tuesday 14 December (the first reading day) will be from 1-3 p.m. in room 142 of the CMPSCI building (the large classroom).
- (3 Dec) As we decided today in lecture, the deadline for HW#7 is extended until Monday in class, but students who elected to turn theirs in today will get ten extra points. I have just posted the HW#8 assignment, which will be due to the CMPSCI main office by 4:00 p.m. on Monday 13 Dec, the last day of classes.
- (3 Dec) Remember that their will be no lecture on Monday 13 Dec. Instead I will have a review session 1:00-3:00 p.m. on Tuesday 14 Dec, the reading day, in a room to be determined. Also bear in mind that I will be away for 11-13 Dec, and may not be able to answer email.
- (3 Dec) I put the new Q&A in 6.html instead of 7.html, so the link below was bad until I fixed it a few minutes ago. Thanks to the two students who spotted this, and apologies that I wasn't on-line last night to fix it then.
- (2 Dec) Sorry for the gap in announcements. I've just posted several questions and answers on HW#7.
- (23 Nov) I've just found out that the student evaluation forms are
available, so I'm going to
*switch*the discussions for 29 Nov/1 Dec and 6/8 December. The Monday and Wednesday after the break, we'll do course evaluations -- both the university's multiple-choice form (anonymous) and a form I'll give out which will have your name on it. The latter will count as a discussion writing, with a check for any serious response. Then on 6/8 December we'll do Excursion 9.8 from the book, which will be good practice for the final. - (23 Nov) The HW#7 assignment has been posted. It is due 3 December, a week from Friday. The last assignment, HW#8, will be due on the last day of classes by 4:00 p.m. to the main office.
- (23 Nov) I recognize that some of you are going to have to miss the lecture tomorrow, and that some of you missed the lecture Friday. If you did, it's important that you take a good look at Sections 9.1-9.3 of the book, so that you will know what is going on next Monday.
- (22 Nov) I've graded the exams -- I am going home soon but you
can pick them up tomorrow (I'll be in for office hours and some other
times at random) or in class on Wednesday. On page 2 of each exam I've
written the letter grade for this exam and the average letter grade for the
three midterms. This latter grade is 45% of your course grade (or 30% if it
is better for you to count your final as 50%).
Distribution of third midterm grades:

- High 100 (two of them), first quartile 84, median 69, third quartile 49, low 17
- Scale was A=90 and C=60 as announced.
- A-, A and A+ (83-100): 17
- B-, B and B+ (68-82): 11
- C-, C and C+ (53-67): 8
- D-, D and D+ (38-52): 11
- F (17-37): 6

Remember that if your midterm average is D or D+ you still have some chance of getting a C- or better if you have been to all the discussions and are doing better on the homework.

I will probably post the exam and its solution sometime tomorrow.

- (18 Nov) Some students have pointed out a potentially confusing error on page 8-9 of the text. The top graph in Figure 8-7 should have an additional edge from vertex 1 to vertex 3.
- (17 Nov) A reminder -- this week's lectures, on sections 8.1-8.3, are fair game for the test. If you didn't make it to today's lecture, in particular, you'll want to look at those sections of the textbook.
- (17 Nov) I handed back about half of the graded HW#5's in class today. The rest are not lost and will be handed back soon. I will also try to have some graded discussions to return on Friday. Harish has posted a partial HW#5 solution on his site and will have complete solutions up later today.
- (16 Nov) I've found out that I'm going to be in Montreal on Mon 13 Dec, which is scheduled to be a "review and coming attractions" lecture. I will cancel this class and instead hold a review session sometime on Tue 14 Dec, a reading day.
- (16 Nov) I've posted solutions to practice
midterm #3. I also found a mistake in Question 3(c), which has been corrected on
the posted exam. Remember that the real third midterm
will be Thursday 6-8 in
*two different places*. People in the Monday discussion section should go to Flint 201 and people from the Wednesday section should go to Goessman 51. Harish will be in one room and I will be in the other. - (14 Nov) Ok, Practice Exam #3 has been posted.
- (14 Nov) Good news and bad news: The good news is that Chapters 8-10, the last course packet, is now available at Collective Copies. It costs $15.75 and is course packet #90. The bad news is that I don't have the practice test ready yet (striking the sets from my show today took longer than I expected). I will try to get it posted later tonight, but it might slip until tomorrow. More good news, though, Harish has HW#6 solutions almost ready and they will probably be out tomorrow.
- (10 Nov) Graded HW#4's were returned in lecture today. Scale was A = 80, C = 50. HW#5 solutions are available (password-protected) on Harish's site. I have also made up solutions, though not notes, for Discussions #6, #7, and #8. These are available from the discussion index page.
- (10 Nov) I hope to finish Chapters 8-10 and get them to the copy shop tomorrow. I will post here when they are available. After that I will get a practice third midterm up as soon as possible.
- (9 Nov) There are now some questions and answers on HW#6, including a rather bad typo on page 6-37.
- (5 Nov) I have posted the HW#6 assignment, due on Friday 12 November.
- (4 Nov) There are now some questions and answers on HW#5.
- (4 Nov) A diligent student has found another error in HW#5, specifically in the last sentence of the statement of Problem 6.4.1, where the final "j-k falling" should instead read "k-j falling". (We have never defined what a negative falling power might mean.) This correction has also now been made on the HW#5 assignment.
- (1 Nov) There is an error in the statement of Problem 5.4.2 on HW#5, which has now been corrected on the HW#5 assignment page.
- (1 Nov) I've graded the tests and will hand them back in class tomorrow. I gave a generous scale of A = 84 and C = 48, but they were still not very good: A range (81-100) had 8, B range (57-80) had 16, C range (39-56) had 16, D range (21-38) had 10, and F range (0-20) had 5. Some of the problems were my fault but not enough people for my liking had a good grasp of induction -- many understood the form of an induction proof but not the content, or vice versa.
- (29 Oct) HW#5 assignment is up, due a week from today. Exam solutions will be up sometime today or tonight. I will try to get the exams graded over the weekend but I may or may not make it.
- (29 Oct) The yellow volume containing chapters 6 and 7 of the textbook is now available at Collective Copies -- it is course packet number 89 and costs $9.00.
- (27 Oct) I am hoping to get the master copies for the next section of the textbook to the copy shop tomorrow, which means that they might be available on Monday. I'll keep you updated here on the progress. This section (yellow) will be chapters 6 and 7, and the last one (red) will be chapters 8, 9, and 10.
- (27 Oct) I won't have a chance to write up notes for Discussion #6 until
after I've graded the exam, so here is the answer. The simplest expression I
know for the language EEP is aa + bb + (ab + ba)(aa + bb)
^{*}(ab + ba), and the language EE is the star of EEP. Many other more complicated expressions are also correct. - (27 Oct) I handed back HW#3 in class today. This is the one on which I messed up a couple of the problems, so the scale is more generous: 80 is an A and 40 is a C. Solutions (as with HW#4 ) are available on Harish' site. (This site is password-protected, and the username and password to use were given in lecture.)
- (26 Oct) Practice exam solutions are up.
- (26 Oct) I have corrected a typo in Question 5a of the practice exam. I will post solutions to this exam tonight.
- (23 Oct) The practice exam for the second midterm is now posted.
- (21 Oct) I have posted the notes and
solution to Discussion #5.
I still owe you a practice test. I will
*try*to write this tonight and post it tomorrow morning, but more realistically it will be up later on Friday. - (21 Oct) A few more questions and answers on HW#4 are up.
- (16 Oct) Some wise people have started HW#4 by now, so I have some questions and answers. There is a mistake on problem 4.10.3 (a), which has been corrected.
- (13 Oct) I have graded the Discussion #4's and put them in the pickup box in the main office. I'll bring them to class Friday. Remember that there is no discussion today, and no Honors meeting tomorrow. I was generally pleased with the answers to Question 1, so much so that I will be sure to put a similar problem on the second midterm. Some of you still need to be more careful about the order of steps when proving a statement with multiple quantifiers.
- (13 Oct) The HW#4 assignment is posted. It would be good for many of you to get an earlier start on this one, so that you can take advantage of the opportunity to ask questions and read responses to other's questions.
- (12 Oct) The university undergraduate advising offices have asked
me to remind you that the W-drop date is Monday 25 October, two weeks from
yesterday. If you drop before that time, you get a "W" which has no effect
on your GPA and is "nearly always preferable to an F". If dropping a course
takes you below 12 total credits for the term, however, this may have various
adverse consequences -- check with your academic dean.
We won't have another midterm before that date, but as I said after the first midterm I am very unlikely to give an F to someone who fully participates in the course. Still, you may want to consider W-dropping if the effort it would take to get the most out of this course would adversely affect your other courses. I'm happy to discuss individuals' situations in office hours, by appointment, or by email.

- (12 Oct) I'll be in my office 4-5 today (Tuesday) and can take questions about HW#3 then. I'll also be reading email late tonight assuming my home internet connection works.
- (12 Oct) I've just posted the first question and
answer on HW#3. Be sure to read it, because it explains that what I
asked you to prove on 2.9.3 is
**false**, so you should prove its negation! - (8 Oct) I returned graded HW#2 and Discussion #3 in class today. Papers not picked up are in the box in the CMPSCI main office. The scale for HW#2 was again A=90, B=72, C=54, D=36, F=18.
- (8 Oct) Next Monday, 11 October, is a holiday and there will be no lecture or discussion. Wednesday 13 October will be on a Monday schedule, so lecture will be in Marston rather than Chenoweth. There will be no discussion on Wednesday either. However, I will have my normal Wednesday office hours on that day. I believe Harish will keep his Monday hours and I will confirm this when he gets back to me.
- (8 Oct) Harish is changing his office hours to Monday 1-2:30 and Wednesday 3:30-5:00, still in LGRT 220.
- (6 Oct) I've posted the notes from this week's Discussion #4, and the solution to that discussion. Don't forget that there is no discussion next week.
- (5 Oct) Don't forget that tomorrow's lecture, and all future Wednesday lectures, are in Chenoweth 227 rather than in the trailer!
- (5 Oct) The HW#3 assignment has been posted, due a week from tomorrow in class.
- (4 Oct) The exams have been graded and were returned in lecture today.
If you didn't get yours yet, you must pick it up from me in class or in my office.
(I don't want to put exams in the pickup box to be pawed over by strangers.)
I was disappointed in the performance. I changed the scale to 90=A, 60=C (so these numbers are the center of those ranges, thus 85=A-, 80=B+, etc.) but there were still a lot of D's and F's. (The high score was 100, a quarter of them were 69 or better, the median was 58, three quarters were 48 or better, and the low was 21.)

When an exam goes so badly it is the fault of both teacher and students. I think of lot of you simply didn't study enough or well enough -- it should have been clear from the practice exam, for example, that memorizing details of the definitions of concepts like "function", "onto functions", and "partial order" was going to be important. As I said in lecture this morning, I think I erred in not stressing the roles of variables in quantifier proofs. Statements in a proof can be premise statements or conclusion statements, and variables can have values chose by you or chosen arbitrarily. The four proof rules are very strict about which quantifier must be in which end of the proof to use them, and whether the variables involved are chosen by the prover or are arbitrary. We'll get a lot more practice with this.

Some of you who did very badly may be considering dropping the course. I'll point out a few things:

- I am very generous with D's, though not with C's. It is unlikely that anyone who continues the course to the end in good faith (e.g., attends all discussions and hands in all work) will get an F.
- Is is possible to get a "passing for CMPSCI" grade of C- or better while getting D's or D+'s on the exams, because discussions and hw's tend to raise the average of the lower performing students.
- The final exam will count 50% of your grade rather than 25% if this is to your advantage. Thus if you messed up this exam but later put things together you can improve your current grade considerably.
- Any kind of D grade (D-, D, D+) can be repeated with the new grade replacing the old. Of course, if you didn't like me this term you are still stuck with me next term.
- Thus there aren't very good grade-related reasons to drop the course. But if you decide that putting in the effory you will require to do as well as you want will take too much away from your other courses, for example, this might be a good reason to drop. I'm happy to discuss this individually in office hours or by email.

- (1 Oct) The first midterm and its solution are posted.
- (1 Oct) The next section of the textbook, Chapters 4 and 5, has been given to Collective Copies and should be ready by Monday. (Next Wednesday's lecture will be about section 4.1.) It will be course packet #86 and cost $11.00. There will probably be two more sections, one with Chapters 6 and 7 and one with Chapters 8-10.
- (29 Sept) I have posted notes and a a solution for Discussion #3. On the paper handout and in the book I incorrectly factor 17256 by getting 619 rather than 719, the correct factoring is in the notes.
- (29 Sept) Scheduling has found us a better classroom for Wednesday, in Chenoweth 227. (Chenowith is the Food Science building, just west of Stockbridge Hall.) Wednesday lectures will be in that room starting next Wednesday, 6 October. As per a class vote this morning, we will remain in Marston for Monday and Friday lectures.
- (29 Sept) Graded HW#1's were handed back in class today. The scale will be about A=90, B=72, C=54, D=36, F=18. There were only a couple in the 90's but a lot in the 70's. Papers not picked up in class will be in the pickup box in the CMPSCI main office.
- (28 Sept) Solutions to the practice exam (as corrected) are now posted.
- (28 Sept) There was a mistake on Questions 5 and 6 of the practice exam, which has now been corrected. As originally written, Question 5 was easier than it should have been but Question 6 was impossible.
- (28 Sept) Harish will hold an extra office hour to help people review for the exam, 5-6 p.m. on Wednesday (tomorrow) in LGRT 220.
- (27 Sept) Evening exam locations have now been assigned and are posted on the exam directory page. The exam this coming Thursday, 30 September, will be 6-8 p.m. in ECSC 119. ECSC is the new engineering building just south of the computer science building.
- (27 Sept) Graded discussion #2' s were handed out in lecture today. Those not picked up are now in a box in the Computer Science main office. (Graded HW and discussions will go there -- graded exams must be picked up in lecture or from me.) Solutions to HW#1 and HW#2 are avaiable from this password-protected site. The login and password were given in lecture.
- (27 Sept) I will post solutions to the practice midterm sometime tomorrow.
- (27 Sept) There is a seminar of general interest next Monday, 4 October, at 4:00 in room 151, Computer Science Building. Clay Shields of Georgetown University will speak on "Catching Hackers: Holding Computer Attackers Responsible for their Actions". The stepson of a CIA agent and an Army veteran, Shields does research on locating the sources of network attacks as well as on other topics in computer networking. This talk is part of a series on "Information Assurance", an area in which our department has been named a Center of Excellence.
- (23 Sept) The practice midterm is now up. I'll post solutions early next week. This is roughly the same length and difficulty as the real midterm will be, though the latter might not have quite as many quantifier proofs.
- (23 Sept) Discussion #2 and its its solution are posted.
- (22 Sept) There are now more questions and
answers on HW#2 posted. In particular, question #5 identifies a
**typo**in the book for Problem 2.6.2 -- my symbolic translation of the second of the six premises is wrong and should be corrected for the proof to work. (It should be "∀x:B(x)→¬WWD(x)".) - (21 Sept) If you are planning to add the course and have not been able to do so on SPIRE, it is important that you go to the CMPSCI main office today as this is the last day of add/drop. At some point (they often give you an extra day) you will start to need an approval from your academic dean as well as from me to add. If I have orally told you that you are ok to add the class, the CMPSCI main office staff will process your add.
- (21 Sept) I've posted the first questions and answers on HW#2. Also, remember that lecture tomorrow is in Totman MB9 rather than in Marston.
- (18 Sept) I made a few errors in the homework assignment, which will be reflected in the solutions (which I hope to be able to hand out on paper Monday or Wednesday). The murder mystery I gave you had three possible solutions, not one, because I said "did not use both the bat and candlestick" in clue II when I meant "did not use either the bat or the candlestick". Also in 1.8.1 (b) I referred to "indirect proof", which is another name for "proof by contrapositive" that I neglected to mention in the text. Finally, 1.5.4 (b) and 1.5.5 (b) were problems inviting speculation and should be thought of as extra credit. (Though 1.5.4 (b) would have been a good specific problem if I had phrased it better...)
- (16 Sept) I encourage everyone eligible to register and vote in the November elections. In particular, the total turnout of students and Amherst residents influences how seriously politicians take students, Amherst, UMass, and their particular issues. There is a large voter registration event on Saturday 18 September, 1-4 pm, on the Haigis Mall on campus.
- (16 Sept) The HW#2 assignment, due Fri 24 September, is now posted.
- (15 Sept) The text and solutions for Discussion #1 are now available.
- (13 Sept) I have now posted some questions and answers on HW#1.
- (13 Sept) Office hours for our TA, Harish Venkataramani, are 1-2:30 on Monday and Tuesday, in LGRT 220. Office hours for me (Dave) are Tuesday 11-12, Wednesday 9-10, and Wednesday 11:15-12 in my office, 210 CMPSCI building.
- (13 Sept) I have gotten some good email questions on the HW and will try to get them posted tonight.
- (9 Sept) The HW#1 assignment has now been posted, due a week from tomorrow.
- (8 Sept) A reminder for students affected by SPIRE's problems: classroom locations and meeting times are available in PDF format from the registrar's website: Choose "Registration and Schedules" and item #5 is the PDF schedule.
- (8 Sept) I now know of six people who want to be in the course and are not on my roster, and two who are on my roster but haven't confirmed their intentions by a form or email. (All these people have been emailed individually.) I have room in the main section for all the applicants, but I have a problem with the Monday discussion -- it has 38 students and 38 seats in the classroom. So adding the Wednesday section is fine. If you are now registered for the Monday section and would just as soon switch, please do so.
- (8 Sept) I will have a brief meeting immediately after class Friday (10 Sept) with anyone registered for or interested in the honors section. I would like to schedule the honors section for Fridays 11:15-12:05 but I think that is a conflict for someone who is registered. We will see what we can work out.
- (7 Sept) Collective Copies has the first volume of the textbook available now for $14.25 -- the later volumes will follow as soon as I can get them ready.
- (7 Sept) Please note the
**location change**for the first lecture and all**Wednesday**lectures until further notice. On Wednesdays we will be in Totman MB9, on Monday and Friday we will still be in Marston 132. - (2 Sept) Chapters 1-3 of the textbook will be available starting Tuesday 7 September at Collective Copies, 71 South Pleasant Street, downtown Amherst. The syllabus has now been posted. Note that there is no discussion on the first day of classes, Wednesday 8 September.
- (12 July) I'm just establishing a stub web site for the course.
The textbook will be the latest draft of my own
book,
*A Mathematical Foundation for Computer Science*. Since I'm making extensive revisions over the summer, copies of the text will not be available until shortly before the start of term. If you would like to look at another book that covers roughly the same material, I can recommend K. H. Rosen,*Discrete Mathematics and its Applications*(McGraw-Hill), which has often been used for this course. We will cover most of the material in Rosen, except for much of Chapter 7 on graphs and all of Chapter 8 on trees.

Last modified 23 December 2004