Welcome to CSCA67 Discrete Mathematics for Computer Scientists

Slides:



Advertisements
Similar presentations
Chapter 1: Introduction
Advertisements

Advanced Piloting Cruise Plot.
Analysis of Computer Algorithms
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Cognitive Radio Communications and Networks: Principles and Practice By A. M. Wyglinski, M. Nekovee, Y. T. Hou (Elsevier, December 2009) 1 Chapter 12 Cross-Layer.
© 2001 by Charles E. Leiserson Introduction to AlgorithmsDay 17 L9.1 Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 9 Prof. Charles E. Leiserson.
Writing Pseudocode And Making a Flow Chart A Number Guessing Game
We need a common denominator to add these fractions.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
Measurements and Their Uncertainty 3.1
Multiplying binomials You will have 20 seconds to answer each of the following multiplication problems. If you get hung up, go to the next problem when.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
1 Outline relationship among topics secrets LP with upper bounds by Simplex method basic feasible solution (BFS) by Simplex method for bounded variables.
1) Read 2) Plan 3) Solve 4) Check Camels live in many places around the world. There are two kinds of camels. The Bactrian camel has two humps, while.
§1 Greedy Algorithms ALGORITHM DESIGN TECHNIQUES
Randomized Algorithms Randomized Algorithms CS648 1.
ABC Technology Project
The Weighted Proportional Resource Allocation Milan Vojnović Microsoft Research Joint work with Thành Nguyen Microsoft Research Asia, Beijing, April, 2011.
3 Logic The Study of What’s True or False or Somewhere in Between.
5-1 Chapter 5 Theory & Problems of Probability & Statistics Murray R. Spiegel Sampling Theory.
Outline Minimum Spanning Tree Maximal Flow Algorithm LP formulation 1.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
1 Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
VOORBLAD.
1. 2 No lecture on Wed February 8th Thursday 9 th Feb 14: :00 Thursday 9 th Feb 14: :00.
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
0 Teams: Roles of Group Members. 1 What is a team? Two or more people ……….
Success with ModelSmart3D Pre-Engineering Software Corporation Written by: Robert A. Wolf III, P.E. Copyright 2001, Pre-Engineering Software Corporation,
Constant, Linear and Non-Linear Constant, Linear and Non-Linear
BIOLOGY AUGUST 2013 OPENING ASSIGNMENTS. AUGUST 7, 2013  Question goes here!
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Do you have the Maths Factor?. Maths Can you beat this term’s Maths Challenge?
Computer Science at Oxford
CMPT 275 Software Engineering
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Science as a Process Chapter 1 Section 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Chapter 5 Test Review Sections 5-1 through 5-4.
Your 30 second introduction This PowerPoint presentation will guide you thru your 30 second introduction. To move to the next slide, click the enter key,
IG Pro & CMS.
25 seconds left…...
Stream 1 Dr Deborah King Room G42 Richard Berry Building
Slippery Slope
H to shape fully developed personality to shape fully developed personality for successful application in life for successful.
Januar MDMDFSSMDMDFSSS
Week 1.
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
Computer Science 20 Discrete Mathematics for Computer Science All the Math you need for your Computer Science courses that you won’t learn in your Math.
Insertion Sort Introduction to Algorithms Insertion Sort CSE 680 Prof. Roger Crawfis.
By Rasmussen College. 1. What majors or programs do you offer? 2. What is the average length of your programs? 3. What percentage of your students graduate?
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
About the Course Lecture 0: Sep 2 AB C. Plan  Course Information and Arrangement  Course Requirement  Topics and objectives of this course.
Welcome to CSCA67 Discrete Mathematics for Computer Scientists
An Introduction to Computer Programming Anna Bretscher
Teaching Teaching Discrete Mathematics and Algorithms & Data Structures Online G.MirkowskaPJIIT.
CS 103 Discrete Structures Lecture 01 Introduction to the Course
CIT 592 Discrete Math Lecture 1. By way of introduction … Arvind Bhusnurmath There are no bonus points for pronouncing my last name correctly Please call.
1 COMP2121 Discrete Mathematics Introduction Hubert Chan [O1 Abstract Concepts] [O2 Proof Techniques] [O3 Basic Analysis Techniques]
Presentation transcript:

Welcome to CSCA67 Discrete Mathematics for Computer Scientists Anna Bretscher and Richard Pancer SY110 Bretscher Fridays 10:10-12pm SY110 Pancer Fridays 13:10-14pm

Evaluation Assignments 4 each worth 10% Late assignments will be accepted up to 24 hrs late with a penalty of 25% You are encouraged to discuss the problems with other students however, the actual write up must be an individual effort You must be able to reproduce any solution that you submit. The penalty for cheating ranges from a zero on the assignment to suspension from the university

Evaluation Term Test Week 7 or 8 worth 20% Final Exam Worth 40%

Resources Course Slides Posted each week. Print them and bring to class. Website http://www.utsc.utoronto.ca/bretscher/a67/f13 Check the announcements daily. Textbook Stein, Drysdale and Bogart, Discrete Mathematics for Computer Scientists Office Hours Tutorials

Course Expectations Expectations of the lecturer Give clear, organized lectures Assign fair, challenging assignments that ensure that you, the student, understand the material Be available for help in office hours Help every student achieve their goals in the course (this requires your help!)

Course Expectations Expectations of the student Attend lectures and participate Bring course notes to class Review lecture notes after each class, not just before the exam Complete homework fully, neatly and independently Have respect for your classmates and lecturers

Course Expectations What does neatly mean? Staple sheets Write legibly (if you are incapable of this skill, please type) Your work should be of a quality that you would feel comfortable giving to your boss in a work environment.

Discrete Mathematics Who needs it? Anyone in computer science or a mathematical science Why? In CS we need to be able to speak precisely without ambiguity analyze problems and formulate solutions apply the concepts associated with probability, graph theory and counting theory.

CS is Applied Mathematics! Specifically, we will work on: Thinking abstractly Expressing ourselves precisely Arguing logically – i.e., inferring conclusions that necessarily result from assumptions Writing rigorous solutions Learning how mathematics and computer science work together

Where Does Mathematics Appear in Computer Science? Computer Graphics Multivariable calculus, physics-based modelling Digital Signal Processing Multivariable calculus, (eg., speech understanding) Numerical Analysis Multivariable calculus, linear algebra Cryptography Number theory Networking Algorithms Graph theory, statistics, combinatorics, probability, set theory

Where Does Mathematics Appear in Computer Science? Databases Set theory, logic Artificial Intelligence Programming Languages Formal Methods Set theory, logic for the specification and verification of hardware and software; (e.g., nuclear, aviation – NASA!)

Course Outline Proofs 3 weeks Graph Theory Counting Probability

How Do I Become Good At This Stuff? Same way that you become a good hockey player, calculus student, violinist… practice, practice, practice...

Weighted Job Scheduling Problem Given a set of jobs where each job has a value or weight jobs have a start time and duration Schedule the jobs so that the total value is maximized scheduled jobs do not overlap Q. What are some examples of this type of problem? A. printer queue, airplanes on runway, server use, scheduling surgeries…

Some Examples 10 5 16 3 Time

Some Examples 10 19 3 25 Time

Finding an Algorithm Q. What is an algorithm? A. A step-by-step procedure for solving a problem or accomplishing some end especially by a computer.* Let’s list some potential algorithms to try: Earliest start time. Time 10 5 16 3 * Merrian-Webster

Potential Algorithms Largest weight first. Other ideas? Time 25 10 16 3 Time

Potential Algorithms Create all possible orders by largest weight first. Eg. Option 1: Pick 25. Option 2: Pick 16. Pick 10. Pick 3. Total = 29. Time 10 25 16 3 11 Q. Does this work? A. Now Option 2 is Pick 16. Pick 11. Total = 27.

So...What’s the Answer? Use a mathematical tool called Dynamic Programming. You can read about it in a text such as Algorithm Design by Kleinberg and Tardos. Or visit this link: http://www.cs.princeton.edu/~wayne/kleinberg-tardos/06dynamic- programming-2x2.pdf Or take CSCC73.

A Simpler Problem Interval Scheduling Problem Given a set of jobs where jobs have a start time and finish time Schedule the jobs so that the number of jobs scheduled is maximized jobs do not overlap Notation J: The set of jobs ji: The ith job si: The start time of the ith job fi: The finish time of the ith job

Scheduling The Jobs Challenge What is our algorithm? Example Let students work for a few minutes. Ask them to get their neighbour to try and find a counterexample. Remind them what a counterexample is. Explain what is meant by “general” - ie, works for more than just the given example, works for all cases. Challenge First person to come up with a correct algorithm wins chocolate.

Scheduling The Jobs What is our algorithm? Example Ordering Schedule Sort the jobs by increasing start time. Schedule each job if there are no conflicts. Example j1 j2 j3 j4 j5 j6 j7 Some students may suggest trying the job with earliest start time. Ordering j1, j3, j6, j4, j7, j2, j5 Schedule j1, j7, j5

Scheduling The Jobs What is our algorithm? Sort the jobs by increasing start time. Schedule each job if there are no conflicts. Does this algorithm always find the best solution? j2 j1 j3 j4 j5 j6 j7 Now show that this doesn’t always give the optimal answer. Ordering j1, j3, j6, j4, j7, j2, j5 Schedule j1

Scheduling The Jobs Other ideas? Does this algorithm always find the best solution? Some students may say by shortest duration - show that this doesn’t always work as well. simple example is two long jobs consecutively and one short one that overlaps a little with each of the other two. If they say something else, get the class to decide if there is a counter example. Ordering Schedule

Scheduling The Jobs What is our algorithm? Example Ordering Schedule Sort the jobs by increasing finish time. Schedule each job if there are no conflicts. Example j1 j2 j3 j4 j5 j6 j7 Now show an algorithm that does always find the optimal. Ordering j3, j6, j1, j7, j4, j2, j5 Schedule j3, j7, j5

Is It Correct? Q. How do we know our algorithm is correct? A. Prove it! One common proof technique is “Proof by Contradiction” Idea Play Devil’s Advocate Assume our solution is not the best This means there is a better solution B Show that our algorithm’s solution is as good as B by making B equivalent to our solution. Point out that in previous cases we were able to disprove algorithms by giving a counter example. How do we know that a counter example doesn’t exist? perhaps we just haven’t thought of a good one yet...this is why we need to prove that our solution is the best possible.

The Proof Let S be the schedule our algorithm creates. S = (s1, s2, s3, ... , sn) Let B be a better solution. B = (b1, b2, b3, ... , bm) Q. What do we know about m and n? A. m >= n Q. What do we know about b1 and s1? A. The finish time for s1 is less than or equal to the finish time for b1. in order of non-decreasing finish time

The Proof S = (s1, s2, s3, ... , sn) B = (b1, b2, b3, ... , bm) Q. If the finish time for s1 is less then or equal to the finish time for b1, what can we say about B* = (s1, b2, b3, ... , bm)? A. |B*| = |B|. So B* is as good a solution as B but is more similar to S. Q. How should the proof finish? A. Repeat the argument with S’ = (s2, s3,…, sn) and B’ = (b2, b3,…, bm). Q. Why does this work? A. Induction - more on this later.

Challenge Another Scheduling Problem Given a set of employees, want to set up a meeting that everyone can attend. Each person has a calendar which says whether they are available for any given time slot during the day. Give an efficient algorithm to schedule the meeting so that everyone can attend (if possible).