Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Juggling Patterns and Programs

miner
December 05, 2016

Juggling Patterns and Programs

The art of juggling has fascinated people since the days of ancient Egypt. In this talk, we posit that juggling theory can inform software development. We start with the mathematical insights of Claude Shannon, renowned as the father of Information Theory. After introducing “siteswap” notation, we use Clojure to visualize juggling patterns. Finally, we review some interesing results in neuroscience regarding juggling.

Presented at Clojure/conj 2016.
video: https://www.youtube.com/watch?v=TqG176T69VM

miner

December 05, 2016
Tweet

More Decks by miner

Other Decks in Programming

Transcript

  1. Juggling Patterns and Programs
    Steve Miner
    @miner

    View full-size slide

  2. Anthony Gatto
    Cirque du Soleil

    View full-size slide

  3. Simple Made Easy
    Rich Hickey
    Strange Loop 2011

    View full-size slide

  4. Metaphor Alert
    RH ~ incidental complexity
    Me ~ essential complexity
    https://schani.wordpress.com/tag/juggling/

    View full-size slide

  5. Scientific Aspects of Juggling
    Claude Shannon (1916 - 2001)
    written in1980s

    View full-size slide

  6. Egyptian Wall Painting
    circa 2040 B.C.

    View full-size slide

  7. Uniform Juggle
    • one throw at a time
    • alternating hands
    • constant rhythm

    View full-size slide

  8. 3 Ball Cascade
    • Odd numbers: cascade
    • Even numbers: fountain

    View full-size slide

  9. 4 Ball Fountain
    • Odd numbers: cascade
    • Even numbers: fountain

    View full-size slide

  10. Shannon’s Juggling Theorem
    • Flight time
    • Dwell time
    • Vacant time
    • number of Balls
    • number of Hands

    View full-size slide

  11. Complex Made Hard
    • B ≈ F
    • F ≈ (sqrt height)
    • small errors compound

    View full-size slide

  12. Flying Karamazov Brothers
    scaling H

    View full-size slide

  13. Shannon’s Juggling Theorem
    • Flight time
    • Dwell time
    • Vacant time
    • number of Balls
    • number of Hands

    View full-size slide

  14. Lessons from Shannon
    • historical analysis
    • domain understanding
    • choosing right abstraction
    • exploring trade-offs

    View full-size slide

  15. Science of Juggling
    • Peter J. Beek and Arthur Lewbel
    • Scientific American, November, 1995, Volume 273,
    Number 5, pages 92-97
    • www.juggling.org/papers/science-1/

    View full-size slide

  16. Siteswap Notation
    • sequence of integers
    • e.g. 531 = [5, 3, 1] …, 5, 3, 1, 5, 3, 1, …
    • 3 = standard three-ball cascade
    • odd for cascade, even for fountain
    • empty 0, switch1, hold 2

    View full-size slide

  17. Inventors
    • Paul Klimek - UC Santa Cruz 1981
    • Bruce Tiemann and Bengt Magnusson - Caltech
    1985
    • Michael Day, Colin Wright and Adam Chalcraft -
    Cambridge 1985

    View full-size slide

  18. Number of Balls
    • average of throws, must be an integer
    • 531 (/ (+ 5 3 1) 3) 㱺 3
    • 71 (/ (+ 7 1) 2) 㱺 4
    • 97531 (/ (+ 9 7 5 3 1) 5) 㱺 5

    View full-size slide

  19. Validate Pattern
    (defn siteswap? [pattern]
    (let [cnt (count pattern)]
    (or (zero? cnt)
    (apply distinct?
    (map #(mod % cnt)
    (map-indexed + pattern))))))

    View full-size slide

  20. Spec
    (s/def ::siteswap
    (s/and (s/coll-of (s/int-in 0 10) :kind vector?)
    siteswap?))

    View full-size slide

  21. Orbits
    • Decompose pattern into orbits (sub-patterns)
    • 531 = 501 & 030
    • 4413 = 4000 & 0400 & 0013
    • 97531 = 90001 & 07030 & 00500
    • Practice separately

    View full-size slide

  22. Quil
    • Clojure library for graphics and animations
    • quil.info
    • Rastelli - Clojure juggling library

    View full-size slide

  23. 453
    3 balls in 450
    1 ball in 003

    View full-size slide

  24. 97531
    2 balls in 90001
    2 balls in 07030
    1 ball in 00500

    View full-size slide

  25. Isomorphic Patterns
    • repeat: 3 㱺 333
    • rotate: 531 㱺 315 㱺 135

    View full-size slide

  26. New Patterns
    • add period to element: 33 㱺 53
    • swap sites i & j
    • add distance earlier, subtract distance later
    • guarantees same landing schedule
    • 333 㱺 531 531 㱺 441

    View full-size slide

  27. State Diagram
    https://plus.maths.org/content/juggling-maths-and-beautiful-mind

    View full-size slide

  28. Siteswap Features
    • simple data representation
    • flexible interpretation
    • sharing
    • composition
    • verification
    • generation

    View full-size slide

  29. Additional Resources
    • juggling.org
    • thewjf.com
    • wikipedia.com
    • siteswap.net/JsJuggle.html
    • jugglinglab.sourceforge.net

    View full-size slide

  30. The Mathematics of Juggling
    • Book by Burkard Polster, Monash University
    • Survey article based on his book
    • www.qedcat.com/articles/juggling_survey.pdf
    • YouTube videos on juggling

    View full-size slide

  31. – Burkard Polster
    The way that I feel when I look at a
    nice equation is the same way I feel
    when I look at a nice juggling pattern.

    View full-size slide

  32. Allen Knutson
    • Math professor at Cornell
    • Siteswap FAQ on rec.juggling
    • YouTube video on
    mathematics of juggling

    View full-size slide

  33. Neuroscience
    • Plasticity In The Adult Brain: Why We Care About
    Taxi Drivers & Jugglers
    • Marc W. Haut, PhD
    • youtube.com/watch?v=JVsZVW2HRYQ
    • nature.com/nature/journal/v427/n6972/full/
    427311a.html

    View full-size slide

  34. Jennifer Slaw: Juggling Life
    • TEDxPrincetonlibrary talk
    • motivational speaker, teaches
    juggling
    • improves memory,
    concentration, flexibility,
    patience, balance
    • youtube.com/watch?v=S-
    Rohq5649A

    View full-size slide

  35. – Michael Moschen
    What you learn is how to feel with your eyes
    and see with your hands.

    View full-size slide

  36. Recap
    • Juggling inspires mathematicians
    • Siteswap notation is a juggling DSL
    • Rastelli juggles with Clojure

    View full-size slide

  37. ClassicProgrammerPaintings.com

    View full-size slide

  38. photo by Lisa J. Miner

    View full-size slide