Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Bottles of waterwhy?Slide 18Slide 19New bottles of water puzzleSlide 21InvariantSlide 23Generalized bottles of waterSlide 25To come later in the courseHow to use this?And if you can measure out 1…What if gcd(P,Q) ≠ 1?Exemplification: Try out a problem or solution on small examples. Look for the patterns.Slide 31Slide 32Slide 33Get The Problem Right!Slide 35Intuitive, But FalseVocabulary Self-ProofingKeep track of what you actually know – remember what you merely suspectSlide 39Slide 40Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46Slide 47Slide 48Slide 49Slide 50Slide 51Slide 52Slide 53Words To The WiseSlide 55The future belongs to the computer scientist who hasRepresentation: Understand the relationship between different representations of the same information or ideaAbstraction: Abstract away the inessential features of a problemSlide 59Slide 60Induction has many guises. Master their interrelationship.Modularity: Decompose a complex problem into simpler sub-problemsImprovement: The best solution comes from a process of repeatedly refining and improving solutions and proofs.Bracketing: What are the best lower and upper bounds that I can prove?Slide 65Slide 66Slide 67Slide 68Slide 69Slide 70Slide 71Slide 72Gratuitous Induction ProofSlide 74Slide 75Slide 76Slide 77Slide 78Slide 79Slide 80Slide 81Switcharoo ExampleSlide 83Slide 84Slide 85“Assuming the Result” ExampleSlide 87“Not Covering All Cases” ExampleSlide 89Slide 90Slide 9115-251Great Theoretical Ideas in Computer ScienceBits of Wisdom on Solving Problems, Writing Proofs, and Enjoying the Pain: How to Succeed in This Class Lecture 4 (September 4, 2008)What did our brains evolve to do?What were our brainsdesigned to do?Our brains probably did not evolve to do math!Over the last 30,000 years, our brains have essentially stayed the same!The human mind was designed by evolution to deal with foraging in small bands on the African Savannah . . . faulting our minds for succumbing to games of chance is like complaining that our wrists are poorly designed for getting out of handcuffsSteven Pinker“How the Mind Works”Our brains can perform simple, concrete tasks very wellAnd that’s how math is best approached!Draw simple picturesTry out small examples of the problem: What happens for n=1? n=2?Substitute concrete values for the variables: x=0, x=100, …Terry Tao (Fields Medalist, considered to be the best problem solver in the world)“I don’t have any magical ability…I look at the problem, and it looks like one I’ve already done. When nothing’s working out, then I think of a small trick that makes it a little better. I play with the problem, and after a while, I figure out what’s going on.”ExpertNoviceThe better the problem solver, the less brain activity is evident. The real masters show almost no brain activity!Simple and to the pointUse a lot of paper, or a board!!!Quick Test...Count the green squares(you will have three seconds)How many were there?Bottles of waterYou have a 5 gallon bottle, a 3 gallon bottle, and lots of water.How can you measure outexactly 4 gallons?why?New bottles of water puzzleYou have a 6 gallon bottle, a 3 gallon bottle, and lots of water.How can you measure outexactly 4 gallons?InvariantSuppose stage of system is given by (L,S)(L gallons in larger one, S in smaller)Invariant: L,S are both multiples of 3.Set of valid moves1.empty out either bottle2.pour bottle into other until first one empty3.pour bottle into other until second one fullGeneralized bottles of waterYou have a P gallon bottle, a Q gallon bottle, and lots of water.When can you measure outexactly 1 gallon?To come later in the courseif P and Q have gcd(P, Q) = 1(that is, they are relatively prime)then you can find integers a and b so thata*P + b*Q = 1How to use this?And if you can measure out 1…What if gcd(P,Q) ≠ 1?Exemplification:Try out a problem or solution on small examples. Look for the patterns.A volunteer, pleaseRelaxI am just going to ask you a Microsoft interview questionFour guys want to cross a bridge that can only hold two people at one time. It is pitch dark and they only have one flashlight, so people must cross either alone or in pairs (bringing the flashlight). Their walking speeds allow them to cross in 1, 2, 5, and 10 minutes, respectively. Is it possible for them to all cross in 17 minutes?Get The Problem Right!Given any context you should double check that you read/heard it correctly!You should be able to repeat the problem back to the source and have them agree that you understand the issueFour guys want to cross a bridge that can only hold two people at one time. It is pitch dark and they only have one flashlight, so people must cross either alone or in pairs (bringing the flashlight). Their walking speeds allow them to cross in 1, 2, 5, and 10 minutes, respectively. Is it possible for them to all cross in 17 minutes?Intuitive, But False“10 + 1 + 5 + 1+ 2 = 19, so the four guys just can’t cross in 17 minutes”“Even if the fastest guy is the one to shuttle the others back and forth – you use at least 10 + 1 + 5 + 1 + 2 > 17 minutes”Vocabulary Self-ProofingAs you talk to yourself, make sure to tag assertions with phrases that denote degrees of convictionKeep track of what you actually know – remember what you merely suspect“10 + 1 + 5 + 1 + 2 = 19, so it would be weird if the four guys could cross in 17 minutes”“even if we use the fastest guy to shuttle the others, they take too long.”If it is possible, there must be more than one guy doing the return trips: it must be that someone gets deposited on one side and comes back for the return trip later!Suppose we leave 1 for a return trip later We start with 1 and X and then X returns Total time:Thus, we start with 1,2 go over and 2 comes back….2X1 2 5 101 2 5 101 2 5 10 5 102 11 2 5 10 5 102 11 2 5 10 5 102 5 102 111 2 5 10 5 102 5 102 111 2 5 10 5 102 5 1022 111 5 101 2 5 10 5 102 5 1022 111 5 101 2 5 10 5 102 5 1021 22 111 5 105 101 2 5 10 5 102 5 1021 22 111 5 105 101 2 5 10 5 102 5 1021 22 111 5 105 101 2 5 105 and 10“Load Balancing”:Handle our hardest work loads in parallel! Work backwards by assuming 5 and 10 walk together1 2 5 10 5 102 5 1021 22 111 5 10 5 101 2 5 10Words To The Wise•Keep It Simple•Don’t Fool YourselfThat really was a Microsoft questionWhy do you think that they ask such
View Full Document