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: TA: UTAs: Chittaranjan Tripathy (please call me Chittu) Branka Lakic Nicholas Gordon Alessio Santoro schedule Lectures Recitations Office Hours Chittu: Branka: Physics 130, Tue.Thu 10:05AM-11:20AM Soc Psy 126, Fri 11:45AM-1:00PM LSRC D301, Tue.Wed 4:00PM-5:00PM (tentative) N002 North Bldg, Tue.Wed 5:00PM-6:00PM (tentative)
Administrativia 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. Please check the course page regularly for more administrative stuffs and updates and ask us if you have any questions
Administrativia 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, tothe-point solutions often receive more credits You may not consult solutions on the internet or any other electronic sources Duke honor code applies strictly
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) R n R 0 = 1, R n = R n-1 + n, for n > 0 Seems correct! But, how to prove that our guess is correct?
First, How did I guess? R n-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, R n R n-1 + n for n > 0. Can we show R n R n-1 + n?
First, How did I guess? 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, R n R n-1 + n R 0 = 1, R n = R n-1 + n, for n > 0 What does such a formula mean? How to solve such a formula?
Solving R 0 = 1 R n = R n-1 + n for n > 0 One Method we learned in High School: Unfold the repetitive pattern and express using smaller (and simpler) terms R n = R n-1 + n = R n-2 + n-1 + n = R n-3 + n-2 + n-1 + n = = R 0 + 1 + 2 + + n = 1 + (1 + + n) = 1 + (n(n+1)/2) R n = 1 + (n(n+1)/2)
Solving R 0 = 1, R n = R n-1 + n, for n > 0 Second Method: Guess the solution and verify that it is correct Guess: c 2 n 2 + c 1 n + c 0. Find out the constants from R 0, R 1 and R 2. 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!
Lighting the Rooms Switches Input Line http://www.playhookey.com/digital/combination al/decoder_demux_four.html How can we implement the deciding unit (Demux)? Logic and Boolean Gates! More on logic in the next lecture!