csc236h lecture 1 - mcs.utm.utoronto.ca236/sadia/1/lecture1.pdf · having 9am class with sadia i d....
TRANSCRIPT
Welcome to CSC236
I This course is much more “CS” than CSC108 (and maybeeven CSC148)
I We’re going to studyI Program correctnessI Program e�ciencyI How to design e�cient algorithms
Evaluation
I Pre-lecture reading quizzes (5%)
I Class participation (5%)
I Two tests (better one worth 18%, other worth 12%)
I Final exam (45%)
I Five problem sets (15%)
Huh? I Can’t Sleep in Class?
Please don’t.
I Class participation is worth 5%
I But that’s not the most important reason
I Most important reason: learning is enhanced when we areactively engaged in and questioning the material
I You will have opportunities to solve and discuss solutions toproblems rather than watching me solve problems for you
How Lectures Work
I We are using a technique called Peer Instruction (PI)
I I present a short summary of a key topic and then ask aquestion
I You think about it for a minute or two, on your own (notalking just yet, please)
I You anonymously report your answers using your clicker
I Then, you discuss that same question with a small group ofyour neighbors, trying to convince them of your reasoning andreach consensus
I You report your revised answers, and we discuss as a class
How Lectures Work...
I On occasion we will extend this patternI e.g. I might ask you a follow-up question but with no group
discussionI e.g. I might make up new questions on the spot if I notice
di�culties
I I’ll clearly indicate what we are doing for each question
What’s the Point?
I Helps you assess your own understandingI Did you answer correctly? Why did you choose your answer?
Why are the other answers incorrect?
I Helps you think through the ideas of other studentsI Explanations of other students (correct or incorrect) can help
you gain a better understanding of the topic
I Lets me know where di�culties are arising, and how toaddress them
Where’s the Evidence?I A team of researchers, has researched PI in CS since 2010I That’s eight years of researchI We have studied student learning, retention of knowledge,
attitudes, comparisons to traditional lecture-based courses,benefits of individual thinking, benefits of group discussion . . .you name it
I PI simply works better than traditional lecture
How we will use Clickers
I Please purchase an i>clicker remote for this course (can buyfrom bookstore)
I Please register it on Quercus. How-to available on course website.
I I’ll ask questions on the screen during lecture, to which youcan respond with your clicker
I After discussion, I’ll display a graph with the class results onthe screen
I We’ll discuss the questions and answers
I You get points for participating
How to Vote
I Make sure that the clicker is powered on
I A blue “Power” light will appear at the top of the remote
I When I ask a question in class (and start the timer), select A,B, C, D, or E as your vote
I Green light: your vote was sent AND received
I Red light: error! Vote again!
I You can always change your vote while the timer is going —your last vote is the one that counts
Clicker Tips
I If you bought a used clicker, replace all AAA batteries
I Don’t use Duracell as they are TOO short for the casing
I Don’t use rechargeable batteries. They harm the clicker
I Register your clicker before our next class
I Before using a new clicker for the first time, pull the plastictab out of the battery compartment
I Bring your clicker to every class. Make sure it is on beforevoting!
Sample Clicker Question
What makes you the happiest?
I A. Cat videos
I B. Free food
I C. Having 9am class with Sadia
I D. Board games
I E. Expanding my knowledge about the theory of computation,e.g. learning how to prove my algorithms are correct, learninghow to calculate the runtime e�ciency of recursivealgorithms, and other such amazing stu↵
Reading Quizzes
I Before each lecture, you’ll complete a short reading quiz onlineI Why?
I You have to be prepared for class for our discussions to beproductive
I I can then focus on di�cult parts of the material and newexamples
I I will not teach you the course notes in class (you know how toread!)
Participation and Reading Quiz Grading
I You are graded on the quality of your participation in class,not on the correctness of your answers
I You are graded on reasonable completion of readingquizzes, not on the correctness of your answers
I In this course, we use an absolute grading scale (nobell-curve)
I I want you to feel comfortable discussing and understandingideas with other students
Problem Sets
I Problem sets are due approximately every two weeks
I You can work individually or in a group of at most 3 students
I Problem sets contain an unmarked “preliminary” exercise.Please do that early!
Submission Policy
I LaTeX is a system for typesetting documents
I Many computer scientists, mathematicians, physicists, etc.use LaTeX
I I am requiring you to submit all problem sets using LaTeXI You must submit both your .tex source and resulting .pdf
file
I Please check the course website for useful introductoryresources
Academic Integrity tips
I You all know what I expect by now
I Do not discuss problem sets outside of your group
I Please don’t “help” others by helping them solve the problemsets!
I Please don’t put others in awkward positions by asking themfor help on a problem set
I What you can do to helpI Discuss examples from lecture and the course materialsI Discuss “preliminary” questions
Tutorials
I Tutorial attendance is not required for marks
I But it is a great way to practice course material with thesupport of a TA and other students!
I TAs can help you understand course material and workthrough examples and previous problem sets
I Feel free to bring questions!
Course Materials
ICSC236 Lecture Notes is our core text for the course,available for free from the course web site. We will follow itclosely
I Additional readings as indicated on the course web site.
Course Decisions
We will refer back to these! In this course:
I If not specified, our proofs are on the natural numbers0, 1, . . . , n
I log n means “log base 2 of n”. The default base is 2!
I Use of limits for proving bounds is not allowed
I Regular expressions must use only syntax introduced in thiscourse
ConcepTest
Which of the following is not a predicate?
I A. P1(n) :Pn
i=0 i =n(n+1)
2
I B. P2(n) : n is prime or is equal to the product of two or moreprimes
I C. P3(n) : n is a perfect square
I D. These are all predicates
Mathematical Induction
I Mathematical induction is a proof technique that can be usedto prove that a certain statement is true for all naturalnumbers (or all natural numbers starting from number b)
I Symbolically: it lets us prove claims of the form 8n 2 N,P(n)
I We’ll start with Simple (or Weak) induction . . .
Let’s visualize it.
IP(n) : “n-th domino falls backwards”
I Note P(n) makes sense for n > 0.
I We are given “P(1) falls’ backwards” is true.
I If P(K ) falls, then P(k + 1) will fall.
I We conclude all dominos fall backwards.
ConcepTest
We want to prove that P(n) is true for all integers n � b. Which isnot a valid proof?
I A. (1) Prove P(b); (2) prove, for all n � b, P(n) ) P(n + 1)
I B. (1) Prove P(b); (2) prove, for all n > b, P(n � 1) ) P(n)
I C. (1) Prove P(b); (2) prove, for all n � b + 3,P(n) ) P(n + 1)
I D. (1) Prove P(b); (2) prove, for all n � b + 3,P(n � 3) ) P(n � 2)
I E. More than one of the above is invalid
Base Case and Inductive Step
Most often, we use the P(n) ) P(n + 1) form of induction.For some predicate P :
I (1) When we show that P(b) is true for some b, we areproving the base case
I (2) When we show that P(n) ) P(n + 1) for all n � b, weare proving the inductive case
I To help us prove the inductive case, we assume and use theInductive Hypothesis (I.H.) that P(n) is true
Mathematical Induction Proof Recipe
We are given a problem that depends on a natural number, wantto use proof by induction. Here is what we need to do:
1. Identify and write down the predicate that depends on anatural number. Let b be the smallest number the predicate isdefined.
2. Prove the base case P(b).
3. Let n be a generic natural number � b.
4. Assume P(n) holds. Derive P(n + 1).
5. Conclude the property speicifed by the given problem holds.
Q: If at least one the steps (above) fails, can we conclude thespecified property does not hold?