did it with buckets number theory 3 gal 5 gal die hard 3
play

Diditwithbuckets: NumberTheory: 3gal.&5gal. DieHard - PowerPoint PPT Presentation

GeneralizedDieHard MathematicsforComputerScience MIT 6.042J/18.062J Diditwithbuckets: NumberTheory: 3gal.&5gal. DieHard 3gal.&9gal. Uniquefactorization Nowagal.&bgal.? AlbertRMeyer March5,2012


  1. Generalized Die Hard Mathematics for Computer Science MIT 6.042J/18.062J Did it with buckets: Number Theory: 3 gal. & 5 gal. Die Hard 3 gal. & 9 gal. Unique factorization Now a gal. & b gal.? Albert R Meyer March 5, 2012 lec 5M. 1 Albert R Meyer March 5, 2012 lec 5M. 2 Generalized Die Hard Generalized Die Hard Under Die Hard rules, Under Die Hard rules, gal.’s in each bucket are gal.’s in each bucket are linear combinations multiples of gcd(a,b) of a and b of a and b Albert R Meyer March 5, 2012 lec 5M. 3 Albert R Meyer March 5, 2012 lec 5M. 4 1

  2. Generalized Die Hard Generalized Die Hard Claim: Can get any multiple of Claim: Can get any linear gcd(a, b) into a bucket combination of a, b into a bucket (if there’s room for it). (if there’s room for it). Namely, say 0 ≤ sa +tb < b. Get sa +tb into the b gal. bucket as follows: Albert R Meyer March 5, 2012 lec 5M. 5 Albert R Meyer March 5, 2012 lec 5M. 6 Generalized Die Hard Generalized Die Hard assume s > 0. do s times: In fact, no need to count: fill bucket a, pour into b — if b fills, empty it. fill bucket a , pour into b total fills = sa if b fills, empty it — 0 ≤ amount left < b — until desired gal.’s in b ! # b emptyings must be -t Albert R Meyer March 5, 2012 lec 5M. 7 Albert R Meyer March 5, 2012 lec 5M. 8 2

  3. MIT OpenCourseWare http://ocw.mit.edu 6.042J / 18.062J Mathematics for Computer Science Spring 20 15 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend