# CSE20

## Discrete Mathematics for Computer Science

Top

The BIG questions

How do we decide (and prove) what's true?
About algorithms and games and strategies / databases / cryptographic systems / compilers / operating systems / circuits...
How do we exploit these properties to build new systems?
Use integer representations to build ALU, use strings to build error-correcting codes, use logic to optimize database queries...
What's impossible? And what can we say about it?
Logical paradoxes, different sizes of infinity

Top

### Schedule

NOTE: This schedule is subject to change.

 Date Day Subject Reference Due Dates 1/10/17 Tues Algorithms: pseudocode and tracing Rosen 3.1 + Appendix 3 Slides Recommended practice problems: Rosen 3.1 # 53, 55, 57 1/11/17 Wed Discussion Section 1/12/17 Thur Number systems: representations and algorithms Rosen 4.2 (+ 4.1) Slides Recommended practice problems: Rosen 4.1 # 9, 21, 23 and Rosen 4.2 # 1, 3, 5, 7, 9, 21 1/15 Sun HW 1 due Sunday at noon PDF tex style file 1/17/17 Tues Number systems: conversions and logical operations Rosen 4.2 + 1.1 Slides Recommended practice problems: Rosen 4.2 # 11, 13, 15, 17, 19, 23 1/18/17 Wed Discussion Section 1/19/17 Thur Propositional Logic: the connectives Rosen 1.1 + 12.3 Slides Recommended practice problems: Rosen 1.1 #7, 27, 29, 31, 41; 1.2 # 9; 12.3 #1,3,5 1/22/17 Sun HW 2 due Sunday at noon PDF tex style file 1/24/17 Tues Propositional logic: equivalences Rosen 1.2,1.3,12.1,12.2 Slides Recommended practice problems: Rosen 1.2 # 17, 25, 27, 29, 31, 41, 43; 1.3 #1-6, 16-30 1/25/17 Wed Discussion Section. 1/26/17 Thur Review Slides 1/29/17 Sun HW 3 due Sunday at noon PDF tex style file 1/31/17 Tues First exam Exam today. 2/1/17 Wed Discussion Section 2/2/17 Thur Predicates and quantifiers Rosen 1.4,1.5 Slides Recommended practice problems: Rosen 1.4 # 13, 17, 19, 29, 31, 37, 39; 1.5 #9, 13, 25, 31 2/7/17 Tues Proof strategies Rosen 1.6,1.7,1.8 Slides Recommended practice problems: Rosen 1.6 # 15, 17; 1.7 #1, 5, 15, 35; 1.8 #3, 13, 14, 15 2/8/17 Wed Discussion Section 2/9/17 Thur Sets Rosen 2.1,2.2 JS 2.1 Slides Recommended practice problems: Rosen 2.1 # 7, 11 2/12/17 Sun HW 4 due Sunday at noon PDF tex style file Note: files slightly modified 2/10 to fix example in question 4 part c. 2/14/17 Tues Sets Rosen 2.1,2.2 Slides Recommended practice problems: Rosen 2.1 # 25, 27, 31; 2.2 #29, 31, 45, 47 2/15/17 Wed Discussion Section 2/16/17 Thur Induction, inequalities and constructions Rosen 5.1 Slides Recommended practice problems: Rosen 5.1 # 3, 5, 7, 11, 19, 21, 51, 55; 2.1 # 23, 31; 2.2 # 3, 31, 45 2/19/17 Sun HW 5 due Sunday at noon PDF tex style file 2/21/17 Tues Recursive definitions and structural induction Rosen 5.3 Slides Recommended practice problems: Rosen 5.3 # 23, 25, 27, 33, 37, 39; 2.2 # 47, 49 2/22/17 Wed Discussion Section 2/23/17 Thur Structural and strong induction Rosen 2.3 Slides Recommended practice problems: Rosen 5.2 # 7, 11, 25, 29; 5.3 # 1, 3, 13 2/26/17 Sun HW 6 due Sunday at noon PDF tex style file 2/28/17 Tues Second exam Exam today. 3/1/17 Wed Discussion Section 3/2/17 Thur Functions and cardinality of sets Rosen 2.3, 2.5 Slides Recommended practice problems: Rosen 2.3 # 21, 2.5 # 1, 3, 11, 17, 19, 33 3/7/17 Tues Cardinality of sets and relations Rosen 2.5, 9.1 Slides Recommended practice problems: (see previous week) 3/8/17 Wed Discussion Section 3/9/17 Thur Relations: properties of binary relations, equivalence relations Rosen 9.1, 9.5 Slides Recommended practice problems: 9.1 # 49, 9.5 # 1, 11, 13, 27, 29, 43 3/12/17 Sun HW 7 due Sunday at noon PDF tex style file 3/14/16 Tues Modular arithmetic Rosen 4.1, 9.5 Slides 3/15/17 Wed Discussion Section 3/16/17 Thur Review day Slides HW 8 due Thursday at 11pm. PDF tex style file 3/18/17 Saturday Final exam Final exam today 8:00am-10:59am in location on Triton Link (see Piazza for details).

Top

### Instructional team

 Name Role Prof. Mia Minnes Instructor Srinivas Avireddy Teaching Assistant Priyanka Dighe Teaching Assistant Justin Lazarow Teaching Assistant Shaida Masoumi Teaching Assistant Michael Walter Teaching Assistant Kevin Yin Teaching Assistant Janice Huang Tutor Rachel Keirouz Tutor Julia Len Tutor Ken Lin Tutor RT Lin Tutor David Luu Tutor Yalin Shi Tutor Clara Woods Tutor JoJo Zhou Tutor

Announcements and Q&A are through Piazza (sign up link: piazza.com/ucsd/winter2017/cse20): use public posts to ask questions that might interest other students in the class and private posts (visible to the instructional team) for questions specific to you. Our office hours and locations can be found in the calendar above.

Top

### Welcome Message

Welcome to CSE20! If you ever wondered "What sort of mathematics do I need for computer science?", this course will provide some of the answers. In particular, you will have the opportunity to learn basic concepts about algorithms, computer arithmetic, number systems, Boolean algebras, logic, proofs, program correctness, loop invariants, modular arithmetic, linear and partial orders, recurrences, and induction, among other things. These are some of the essential ingredients in the toolkit of every computer scientist.

#### Learning Goals:

In answering the three BIG questions above about truth, provability, and possibility, CSE 20 will teach you the basic tools for representing, analyzing, solving, and reasoning about computational problems. Specifically, on successful completion of this course, you will be able to:
• Describe and trace simple algorithms using English and pseudocode.
• Identify and prove (or informally justify) termination and correctness of some algorithms.
• Define and use classical algorithms and algorithmic paradigms e.g. Euclidean algorithm, greedy optimization.
• Use multiple representations of numbers to illustrate properties of the numbers and develop algorithms.
• Understand the logical structure and meaning of a sentence expressing a property, fact, or specification.
• Reason about the truth or falsity of complicated statements using Boolean connectives, quantifiers, and basic definitions.
• Relate boolean operations to applications, e.g. logic puzzles, set operations, combinatorial circuits.
• Prove propositional equivalences.
• Apply proof techniques, including direct proofs and proofs by contradiction.
• Distinguish valid from invalid arguments.
• Prove program correctness using loop invariants and pre-conditions /post-conditions.
• Use mathematical induction to prove statements about mathematical identities and inequalities.
• Apply structural induction to prove statements about recursively defined objects.
• Identify and be able to prove basic properties of sets, functions, and relations.
• Distinguish between finite, countable, and uncountable sets.

Course grades will be computed using the following weights.

 Grading Exams 65% Homework 30% Participation 5%

Exams: There will be two midterm exams and one final exam. The midterms will be given during the usual lecture time and place and you must attend the lecture for which you are registered. No makeup tests will be given. The exams will test all material covered up to the day of the exam. In particular, the final exam will be cumulative and will cover all material from the whole term. You may not use calculators on any exams but you may use a double-sided sheet of handwritten notes on a standard sized index card. The weighting of the exam scores will be

MAX ( (Final 35%, First Exam 15%, Second Exam 15%), (Final 50%, Best Exam 15%)).

You must have a passing score on the final exam (50%) in order to pass the course.

Homework: There will be eight homework assignments. Working through them will be crucial to helping you gain mastery of the techniques we will study. When computing the homework portion of the course grade, the two lowest of your eight homework scores will be dropped and the average computed using the remaining six assignments.

Homework should be done in groups of one to three people. Group members may be in any of the sections of CSE 20. You are free to change group members at any time throughout the quarter. Problems should be solved together, not divided up between partners.

For homework help, consult your textbook, class notes and podcast, lecture slides, instructors, TAs, and tutors. It is considered a violation of the policy on academic integrity to:

• look or ask for answers to homework problems in other texts or sources, including the internet, or to
• discuss the homework problems with anyone outside your group (unless you are in office hours with someone from the instructional team).
Only post about graded homework questions on Piazza if you suspect a typo in the assignment, or if you don't understand what the question is asking you to do. Other questions are best addressed in office hours.

Participation: The 5% of the grade that may be earned through participation will consist of the higher score between the following two options:

• Discussion section quizzes: Each week, short quizzes will be given in discussion section. These short quizzes will be based on the readings in the textbook sections for the week and will help you start out on the homework. To receive credit, you should take the quiz at the beginning of section, take notes on your quiz during section, and show your quiz to your TA at the end of section. You will get 100% on the quiz by doing these things. We will drop your lowest quiz score (one week excused absence), then compute the average score of the remaining quizzes.
• When you enrolled in the class, you signed up for a specific discussion section. If you would like to switch section during the quarter, please post a private note on Piazza with your name, PID, current Discussion Section, and requested new section. Also let us know if you'd like this to be a permanent switch for the rest of the quarter. Please wait for confirmation from us before attending your new section, since we will need to make sure that there is enough space.

After your weighted average is calculated, letter grades will be assigned based on the following curved grading scale:

 A+, A, A- B+, B, B- C+, C, C- D, F 100-90 89.9-80 79.9-65 Below 65

The boundaries for +/- designations within each letter grades will be determined based on the grade distribution of the class. In addition, you must pass the final exam with at least a 50% in order to pass the course.

#### Standards for evaluation:

Please be prompt (less than three days) in reporting any errors in the grading of your work, or in the recording of your grade. All grades become permanent one week after they are recorded. All regrade requests must be made in person in Prof. Minnes' office hours (see calendar for times; CSE 4206).

The Jacobs School of Engineering code of Academic Integrity is here. You should make yourself aware of what is and is not acceptable by reading this document. Academic integrity violations will be taken seriously and reported immediately. Ignorance of the rules will not excuse you from any violations. Key facts about academic integrity related to CSE20:
• Do not discuss homework problems with people besides your homework group members and the instructional staff.
• Do not share written solutions or partial solutions with other groups.
• Prepare your final written solution without consulting any written material except class notes and the class text.
• Do not use any external resources (other than the allowed index card of notes) during the in-class exams.
• Before taking an exam, do not attempt to obtain information about the contents of the exam from students who have already taken in. After taking an exam, do not discuss its contents with anyone in the class who has not yet taken it.

#### Accommodations:

Students requesting accommodations for this course due to a disability must provide a current Authorization for Accommodation (AFA) letter issued by the Office for Students with Disabilities (OSD) which is located in University Center 202 behind Center Hall. Students are required to present their AFA letters to Faculty (please make arrangements to contact me privately) and to the OSD Liaison in the department in advance (by the end of week 2, if possible) so that accommodations may be arranged. For more information, see here.

Top

### Textbook

The required textbook for this course is

Discrete Mathematics and its Applications, Kenneth Rosen, McGraw Hill, 7th edition.

This book is on reserve in the library and is also available in hardcopy at the UCSD Bookstore or many online retailers. You are also able to purchase an online copy of the book through McGraw Hill Connect. There are not many differences between the 7th edition and other recent editions, so you may be able to save some money by purchasing an older edition of the textbook. All posted reading assignments will refer to the chapter and section numbers of the 7th edition, but we have put together this guide so that you can easily find the corresponding sections in the 5th and 6th editions. Please be aware that while this textbook does not vary too much from edition to edition, the content of the older books might not be exactly the same as the 7th edition.

You may also wish to look at the following textbook as a supplementary resource.

Fundamentals of Discrete Math for Computer Science: A Problem-Solving Primer, Jenkyns and Stephenson

Top

### Important Websites

In addition to this course website, we will be using these external websites for various purposes throughout the quarter:

• Use Gradescope to view grades and submit homework assignments. You should already be enrolled in this class with your @ucsd.edu email address. If you have trouble accessing the Gradescope site, post a private Piazza message to the instructors with your name, PID, UCSD email, and lecture section in this class (A00 or C00).
• Use Piazza to get important announcements and post questions and answers.
• Register your clicker at the beginning of the quarter here. Once this is done, you will not need to access this website again this quarter.
• Visit podcast.ucsd.edu for a video podcast of the lectures. The video feed in Mandeville has been nonfunctional for several months. I will still record audio podcasts for Lec B, but you may want to consult the video in Lec A or look at the posted annotated slides.

Top