Welcome! []•Required: [R] Discrete Mathematics and its Applications, 7th Edition, 2011. Kenneth H. Rosen. ... •Discrete mathematics is the part of mathematics devoted to the study

Post on 10-Mar-2020

12 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

Welcome! L01

Today’s Menu

•Administrativia

• Two Problems •Cutting a Pizza •Lighting Rooms

Administrativia

•Course page: https://www.cs.duke.edu/courses/spring13/compsci230/

• Who we are: •Instructor: Chittaranjan Tripathy (please call me Chittu) •TA: Branka Lakic •UTAs: Nicholas Gordon Alessio Santoro

• schedule •Lectures Physics 130, Tue.Thu 10:05AM-11:20AM •Recitations Soc Psy 126, Fri 11:45AM-1:00PM •Office Hours Chittu: LSRC D301, Tue.Wed 4:00PM-5:00PM (tentative) Branka: N002 North Bldg, Tue.Wed 5:00PM-6:00PM (tentative)

•Textbooks: •Required: [R] Discrete Mathematics and its Applications, 7th Edition, 2011.

Kenneth H. Rosen. •Optional (free PDF! Nice book!): [LLM] Mathematics for Computer

Science, 2012. Eric Lehman, F. Thomson Leighton, Albert R. Meyer.

•Grading •Class Interaction. [5 points] •Weekly Homework Assignments. [30 points] •First In-class Closed-book Midterm Exam. [15 points] •Second In-class Closed-book Midterm Exam. [15 points] •In-class Closed-book Final Exam. [35 points]

Late Homework Policy No credits for late submissions.

Administrativia

Please check the course page regularly for more administrative stuffs and updates and ask us if you have any questions

•Collaborations on Homework Problems • Collaborations and team work is highly encouraged • Anything submitted for grading must be your own write-up • If you collaborated, then please clearly mention the name of your

collaborators in your write-up • Please type or clearly hand-write solutions. Clearly written, to-

the-point solutions often receive more credits • You may not consult solutions on the internet or any other

electronic sources • Duke honor code applies strictly

Administrativia

What is Discrete Mathematics?

• Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous) objects.

• Calculus deals with continuous objects and is not part of discrete mathematics.

• Examples of discrete objects: – Integers – #steps taken by computer program – #airline routes (paths) from RDU to Mumbai – Picking up winning set of numbers in a lottery

Discrete Mathematics is Used to Solve

• Shortest paths between two cities • Shortest tour of a number of cities (e.g. buying

multiple destinations flight tickets) • Representing a program in computer • Proving a theorem or an impossibility! • Showing that your sorting algorithm is better than

mine! In theory! And in practice? • Proving that an algorithm always terminates and gives

correct answer on all valid inputs • And many problems we study in this course and

beyond!

Goals of COMPSCI 230

• Mathematical Reasoning: Ability to read, understand, and construct mathematical arguments and proofs

• Combinatorial Analysis: Techniques for counting objects of different kinds

• Discrete Structures: Abstract mathematical structures that represent objects and the relationships between them, e.g. – sets, permutations, relations, graphs, trees, and finite

state machines.

Goals of COMPSCI 230

• Thinking Algorithmically – Design of Algorithms – Proving that they are correct – Analyzing their performance: time, space (= memory, or

other resources)

• Applications and Modeling – Networking – AI – Systems, eg. Compilers – Biology – Chemistry – Physics – Economics – …

Gateway Course for other Courses • Computer Science: Computer Architecture, Data

Structures, Algorithms, Programming Languages, Compilers, Computer Security, Databases, Artificial Intelligence, Networking, Graphics, Game Design, Theory of Computation, …

• Mathematics: Logic, Set Theory, Probability, Number Theory, Abstract Algebra, Combinatorics, Graph Theory, Game Theory, Network Optimization, … • The concepts learned will also be helpful in continuous

areas of mathematics.

• Other Disciplines: Biology, philosophy, economics, linguistics, ...

Two Problems •Cutting a Pizza •Lighting Rooms

Cutting a Pizza

Given: a convex (e.g. circular or rectangular shapes) pizza, and a knife Goal: You are asked to make n straight vertical cuts of the pizza so that the number of slices is maximized

Cutting a Pizza Let’s try to guess a solution for the number of regions (slices) Rn

Seems correct! But, how to prove that our guess is correct?

R0 = 1, Rn = Rn-1 + n, for n > 0

First, How did I guess?

• Rn-1 slices after n-1 cuts • How do I make the nth cut that maximizes the #slices? • Observe: If nth cut splits k old slices then #slices increase

by k. Easy! • Possible if and only if nth cut (line) intersects previous k-1

cuts (lines) in k-1 different points • But I have n-1 cuts (lines) previously! So I get n-1

intersection points, that is, n more new slices. • Therefore, Rn ≤ Rn-1 + n for n > 0. Can we show Rn ≥ Rn-1 + n?

• Observe: I can make nth cut (line) such that • It is NOT parallel to any of the previous cuts (lines) • It intersects them all in different points (no intersection

point reused!) • Therefore, Rn ≥ Rn-1 + n

R0 = 1, Rn = Rn-1 + n, for n > 0

First, How did I guess?

What does such a formula mean? How to solve such a formula?

Solving R0 = 1 Rn = Rn-1 + n for n > 0

One Method we learned in High School: Unfold the repetitive pattern and express using smaller (and simpler) terms

Rn = Rn-1 + n = Rn-2 + n-1 + n = Rn-3 + n-2 + n-1 + n = …= R0 + 1 + 2 + …+ n = 1 + (1 + … + n) = 1 + (n(n+1)/2)

∴ Rn = 1 + (n(n+1)/2)

Solving R0 = 1, Rn = Rn-1 + n, for n > 0

Second Method: Guess the solution and verify that it is correct

Guess: c2 n2 + c1 n + c0.

Find out the constants from R0, R1 and R2. Exercise!

But how to prove that your guess is correct for all n?

We need more tools to express our ideas formally. Tools = Proof Techniques!

http://www.play-hookey.com/digital/combinational/decoder_demux_four.html

Switches

Input Line

Lighting the Rooms

How can we implement the deciding unit (Demux)? Logic and Boolean Gates! More on logic in the next lecture!

top related