You are on page 1of 27

Welcome to CSE21 (online edition)!

CSE21 Winter 2020, Day 1

Miles Jones

https://sites.google.com/a/eng.ucsd.edu/cse-21-s2020/
Online version of the course

Lectures:
• Lectures will be given via Zoom. The link/ID will be posted on the website.
• Lecture slides will be posted on the website.
• Video of lectures will be posted on Canvas.
• Although lectures are not mandatory, it is encouraged that you attend during
the scheduled lecture times.
• There will be a review quiz following every lecture.
• You have unlimited attempts.
• It will be open from 2pm to 10am the next day.
Online version of the course

Exams:
• There will be 2 midterms and one final
• The midterms will each be 50 minutes long with a 20 hour window from
10am until 6am the next day.
• The duration of the final is TBD. It will have a 20 hour window starting from
the posted time of the final exam (Saturday 6/6 at 11:30am.)
About the content of this course

Why is math part of the CS curriculum?


Proofs: key to convincing arguments, but also key part of
software engineering

Vocabulary: basic language of Computer


Science

Quantitative Analysis: are our solutions / programs /


algorithms good enough? How many computational
resources (time, memory, power) does our solution use?
Trees in CS (an example of math)

Game tree
Search tree data structure evaluation

Evolutionary tree in comp bio


Introductions
Textbook

Textbook: Rosen 7th Edition, available through TritonEd

You don’t need a new copy; old editions fine.

Can get pdf through bookstore, or used ebay copy for $10
Evaluation
Option 1:
Review Quizzes (drop 5 lowest): 15%, best 6 of 7 other homeworks: 50%,
10% for each midterm, Final Exam: 15%

Option 1:
Review Quizzes (drop 5 lowest): 15%, best 6 of 7 other homeworks: 50%,
10% for best midterm, Final Exam: 25%

* Exams: 2 midterms, Wednesday weeks 4 and 8;


combined final the first Saturday of finals week
* HW: 7 assignments (drop the lowest)
* Review Quizzes: One review quiz for every lecture. (drop the lowest 5)
Resources
Class Website:
Homework assignments, syllabus, calendar, announcements, study guides,
office hour info, lecture slides.
Gradescope:
Homework submission and exam return.
Piazza:
Announcements and Q&A. Contact instructors here! No HW questions online!
Office hours:
Instructors, TAs and tutors. Discuss HW questions here!
Canvas:
Exams, grades, quizzes
Piazza rules
TAs + Tutors

• Best way to get in touch is via Piazza


• Public post: question about class policy, notes, etc.
• Private post: question about your HW submission, grading, special circumstances.
How to Excel

• Prepare ahead of class


• Read assigned textbook sections
• Engage in class
• Discuss questions, look for (counter)examples
• Go over wrong choices too!
• Reinforce after class
• Briefly summarize what you learned
• Start on homework right away
• Seek help and seek to help others, with integrity
About this class: Academic integrity
It's an integrity violation to…
• Ask others to give you specific HW or quiz or test answers
• Share your answers on HW or quiz or test
• Work on HW with anyone else than your HW partner
• Search the internet or other resources not provided for this quarter's class for HW
solutions or hints
• Share answers or notes during an exam window
• Taking an exam for someone else or having somebody take the exam for you

This not a complete list … you are responsible for knowing and following the
guidelines Academic integrity violations will be taken seriously and reported to the UCSD
Academic Integrity Office.
Goals of the course

Learn concepts and vocabulary which computer science relies upon:


● Counting
● Recurrence relations
● Enumeration and data representation
● Algorithms (iterative and recursive)
● Asymptotic notation
● Graphs
● Probability

Develop problem solving skills.


Learn to present ideas clearly and rigorously.
Goal 1: Counting

Counting: How many objects are there with a certain format or property?

● Exhaustive search: how many candidate solutions are there, if we


are trying to find the best one?
● Algorithm analysis: how many steps might this algorithm go
through before it terminates?
● Data representation: how many bits do I need to describe this type
of object?
Product rule
Rosen p. 386

For any sets, A and B: |A x B| = |A| |B|

More generally:

To count the number of pairs of objects:


* Count the number of choices for selecting the first object.
* Count the number of choices for selecting the second object.
* Multiply these two counts.
CAUTION: this will only work
if the number of choices for the
second object doesn't depend
on which first object we choose.
Sum rule
Rosen p. 389

For any disjoint sets, A and B: |A U B| = |A| + |B|

Counting by case analysis:

Divide up into mutually exclusive cases

Count each case seperately

Add counts together

Each possibility must fall in exactly one case.


2 by n domino tilings

Domino,
Domino, 1 by 2
2 by 1

How many ways to arrange dominos into a 2 by n grid?


(Treat dominos as identical, don’t rotate or flip grid)
2 by n domino tilings

Here are two different ways to fill in


a 2 × 5.
Counting sequences of sets

Often times, we will have a sequence of sets and we want to know how many
objects are in each set as a closed form.

For example,
• count the number of length 𝑛 binary strings for 𝑛 = 1,2,3, …
• Count the number of 𝑛-letter words for 𝑛 = 1,2,3, …
• Count the number of subsets of a set of size 𝑛 for 𝑛 = 1,2,3, …
• Count the number of different domino tilings of a 2 by 𝑛 grid for 𝑛 = 1,2, …
In examples like this it is useful to name the sizes of the sets based on 𝑛

For the domino tiling, we will say:


Let 𝐷𝑇(𝑛) be the number of different domino tilings of a 2 by 𝑛 grid.
Counting sequences of sets

For the domino tiling, we will say that:


Let 𝐷𝑇(𝑛) be the number of different domino tilings of a 2 by 𝑛 grid.

It is very useful to set up the problem this way. This is also a general
technique that can help you in many other classes.

Now, another useful technique in these situations is to start small.


Start to fill in the following table:
Fill in the table

For the domino tiling, we will say that:


Let 𝐷𝑇(𝑛) be the number of different domino tilings of a 2 by 𝑛 grid.

Now, another useful technique in these situations is to start small.


Start to fill in the following table:

DT(1) DT(2) DT(3) DT(4) DT(5) DT(6) DT(7) DT(8)


2 by n domino tilings, n=1

What is 𝐷𝑇 1 ?
What is the number of different domino tilings of a 2 by 1 grid?

Domino 1 by 2 Domino
2 by 1

DT(1) DT(2) DT(3) DT(4) DT(5) DT(6) DT(7) DT(8)

1
2 by n domino tilings, n=2

What is 𝐷𝑇 2 ?
What is the number of different domino tilings of a 2 by 2 grid?

Domino, 1 by 2
Domino,
2 by 1

DT(1) DT(2) DT(3) DT(4) DT(5) DT(6) DT(7) DT(8)

1 2
2 by n domino tilings, n=3

What is 𝐷𝑇 3 ?
What is the number of different domino tilings of a 2 by 3 grid?

Domino, 2 by 1

Activity: compute 𝐷𝑇 3 . Try to find a pattern and then test it to see


if it is consistent.
2 by n domino tilings, n=3

Domino, 2 by 1 Domino, 2 by 1
Domino, 2 Domino, Domino, Domino, Domino,
by 1 2 by 1 2 by 1 2 by 1 2 by 1
Domino, 2 by 1 Domino, 2 by 1

How many ways to arrange dominos into a 2 by 3 grid? 3

DT(1) DT(2) DT(3) DT(4) DT(5) DT(6) DT(7) DT(8)

1 2 3
2 by n domino tilings, n=4 and up

How many ways to arrange dominos into a 2 by 4 grid?

DT(1) DT(2) DT(3) DT(4) DT(5) DT(6) DT(7) DT(8)

1 2 3 ?????
CSE majors Other engineering majors

http://ersp.ucsd.edu/ http://jacobsschool.ucsd.edu/idea/gear/
Are you…
• An engineering* major who is curious about research and don't know where to start?
• Passionate about building and joining a diverse and inclusive CSE community?
• In your first year at UC San Diego and not yet taking upper division courses*?

Apply to ERSP or GEAR!


Learn more at the ERSP/GEAR Virtual Info sessions:
Wednesday, April 8th, 12p-1p, https://ucsd.zoom.us/j/892024842
Thursday, April 16th, 4p-5p, https://ucsd.zoom.us/j/115793825

Application DEADLINE APRIL 19, 2020

See the program websites (above) for the application and more
* exceptions are possible. See websites for details.information

You might also like