recurrences part 3
play

Recurrences, Part 3 Troy Vasiga Centre for Education in Mathematics - PowerPoint PPT Presentation

Recurrences, Part 3 Troy Vasiga Centre for Education in Mathematics and Computing Faculty of Mathematics, University of Waterloo cemc.uwaterloo.ca WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING Outline


  1. Recurrences, Part 3 Troy Vasiga Centre for Education in Mathematics and Computing Faculty of Mathematics, University of Waterloo cemc.uwaterloo.ca WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  2. Outline • Selected solutions to problems from last week • L-systems • Examples of L-systems • Prouhet-Thue-Morse sequence • Other definitions of PTM • Morphisms • Squares, cubes and overlaps • Summary WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  3. Solution to Problem 5 Use the Master Theorem to find the asymptotic running time for the recurrence T ( n ) = 4 T ( n / 2) + n . Solution: We have a = 4, b = 2 and f ( n ) = n . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  4. Solution to Problem 5 Use the Master Theorem to find the asymptotic running time for the recurrence T ( n ) = 4 T ( n / 2) + n . Solution: We have a = 4, b = 2 and f ( n ) = n . We calculate n log b a = n log 2 4 = n 2 . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  5. Solution to Problem 5 Use the Master Theorem to find the asymptotic running time for the recurrence T ( n ) = 4 T ( n / 2) + n . Solution: We have a = 4, b = 2 and f ( n ) = n . We calculate n log b a = n log 2 4 = n 2 . Then, f ( n ) = n ∈ O ( n 2 − ǫ for ǫ = 0 . 9 (for instance). WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  6. Solution to Problem 5 Use the Master Theorem to find the asymptotic running time for the recurrence T ( n ) = 4 T ( n / 2) + n . Solution: We have a = 4, b = 2 and f ( n ) = n . We calculate n log b a = n log 2 4 = n 2 . Then, f ( n ) = n ∈ O ( n 2 − ǫ for ǫ = 0 . 9 (for instance). Thus, we are in case 1 of the Master Theorem, and thus T ( n ) = Θ( n log b a ) = Θ( n 2 ). WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  7. Solution to Problem 7 Use the Master Theorem to find the asymptotic running time for the recurrence T ( n ) = 4 T ( n / 2) + n 3 . Solution: We have a = 4, b = 2 and f ( n ) = n 3 . We calculate n log b a = n log 2 4 = n 2 . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  8. Solution to Problem 7 Use the Master Theorem to find the asymptotic running time for the recurrence T ( n ) = 4 T ( n / 2) + n 3 . Solution: We have a = 4, b = 2 and f ( n ) = n 3 . We calculate n log b a = n log 2 4 = n 2 . Then, f ( n ) = n 3 ∈ Ω( n 3 − ǫ ) for ǫ = 1, for instance. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  9. Solution to Problem 7 Use the Master Theorem to find the asymptotic running time for the recurrence T ( n ) = 4 T ( n / 2) + n 3 . Solution: We have a = 4, b = 2 and f ( n ) = n 3 . We calculate n log b a = n log 2 4 = n 2 . Then, f ( n ) = n 3 ∈ Ω( n 3 − ǫ ) for ǫ = 1, for instance. Thus, we are in case 3 of the Master Theorem. We just need to verify that the second condition holds: that is, we need to show that � n � af ≤ cf ( n ) b for some fixed c for all n sufficiently large. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  10. Solution to Problem 7 (continued) Plugging in our constants and f ( n ) = n 3 , we have to show: � n � 3 ≤ cn 3 . 4 2 WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  11. Solution to Problem 7 (continued) Plugging in our constants and f ( n ) = n 3 , we have to show: � n � 3 ≤ cn 3 . 4 2 Pick c = 1 and then for n > 1, we have: n 3 2 ≤ cn 3 . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  12. Solution to Problem 7 (continued) Plugging in our constants and f ( n ) = n 3 , we have to show: � n � 3 ≤ cn 3 . 4 2 Pick c = 1 and then for n > 1, we have: n 3 2 ≤ cn 3 . Thus, by case 3 of the Master Theorem, T ( n ) = Θ( n 3 ). WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  13. Definition of an L-system An L-system or Lindenmayer system is a parallel rewriting system. By parallel, we mean we each step involves replacing every possible occurrence at the same time. We also need to specify the starting condition/symbol. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  14. Rewriting Rules We use the rule X → Y to mean “replace every occurrence of X with Y .” For example, if we have the rule X → ABX and we have the current word: ABXBAX then the next word will be WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  15. Rewriting Rules We use the rule X → Y to mean “replace every occurrence of X with Y .” For example, if we have the rule X → ABX and we have the current word: ABXBAX then the next word will be ABABXBAABX WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  16. What does this sequence do? 1. A → AB 2. B → ǫ (Here ǫ means “this disappears.”) Start with A WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  17. Not much This just generates AB at the first step, which becomes AB after the second step, and so on. So, this is just the word AB . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  18. Not much This just generates AB at the first step, which becomes AB after the second step, and so on. So, this is just the word AB . This indicates that AB is a fixed point of this recurrence. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  19. Not much This just generates AB at the first step, which becomes AB after the second step, and so on. So, this is just the word AB . This indicates that AB is a fixed point of this recurrence. Definition: A fixed point of a function f is a value t such that f ( t ) = t . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  20. Not much This just generates AB at the first step, which becomes AB after the second step, and so on. So, this is just the word AB . This indicates that AB is a fixed point of this recurrence. Definition: A fixed point of a function f is a value t such that f ( t ) = t . Notice: if f ( t ) = t , then f ( f ( t )) WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  21. Not much This just generates AB at the first step, which becomes AB after the second step, and so on. So, this is just the word AB . This indicates that AB is a fixed point of this recurrence. Definition: A fixed point of a function f is a value t such that f ( t ) = t . Notice: if f ( t ) = t , then f ( f ( t )) = f ( t ) = WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  22. Not much This just generates AB at the first step, which becomes AB after the second step, and so on. So, this is just the word AB . This indicates that AB is a fixed point of this recurrence. Definition: A fixed point of a function f is a value t such that f ( t ) = t . Notice: if f ( t ) = t , then f ( f ( t )) = f ( t ) = t , WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  23. Not much This just generates AB at the first step, which becomes AB after the second step, and so on. So, this is just the word AB . This indicates that AB is a fixed point of this recurrence. Definition: A fixed point of a function f is a value t such that f ( t ) = t . Notice: if f ( t ) = t , then f ( f ( t )) = f ( t ) = t , which means f n ( t ) = f ( f ( · · · f ( t )) · · · ) = t . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  24. What does this sequence do? 1. A → AB 2. B → B Start with A WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  25. Infinitely more WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  26. Infinitely more After n iterations of the rewriting rules, we have the word AB n = ABB · · · B . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  27. What does this sequence do? 1. A → B 2. B → AB Start with A . Hint: write out the first few terms and look at them. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  28. Fibonacci Notice the length. Notice the ratio | A | | B | WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  29. What does this sequence do? 1. A → ABA 2. B → BBB Start with A . Hint: draw a straight line. WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  30. Cantor Dust How much of the line is removed? What about the number 1 4 for instance? WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  31. What does this sequence do? 1. X → X + YF 2. Y → FX − Y Start with FX . WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  32. Dragon Curve Do the following things: • F means move forward • + means turn clockwise 90 o • − means turn counterclockwise 90 o WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  33. Dragon Curve Here are some steps: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  34. Dragon Curve Here are some steps: WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

  35. Dragon Curve WWW.CEMC.UWATERLOO.CA | The CENTRE for EDUCATION in MATHEMATICS and COMPUTING

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